New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

prettier-plugin-blade-stillat

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-blade-stillat

A Prettier plugin to format Laravel Blade tempaltes

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Blade Prettier Plugin

This package provides a Prettier plugin that can parse and format Laravel Blade template files.

Installation

The Blade Prettier Plugin can be installed with npm using the following command:

npm install prettier-plugin-blade-stillat

Configuring the Blade Parser (Optional)

You may optionally configure the Blade parser by creating a file named .blade.format.json at the root of your project. The two options that can be used currently are:

  • customIfs: A list of custom if statements. These provide hints to the parser and teach it how to treat custom ifs it encounters differently. If the parser consistently produces odd results for custom ifs, adding them to this list helps. Most of the time the parser can figure these out on its own, however.
  • ignoreDirectives: A list of directive names the parser should ignore.

Note: Do not add the leading @ when adding directive names to any of the configuration options. When adding custom if statements, you just need to add the first name (add just "disk" instead of adding "disk" and "elsedisk").

{
    "ignoreDirectives": [

    ],
    "customIfs": [

    ]
}

When configuring the ignoreDirectives option whatever values provided will take precedence over the defaults. By default the parser will ignore the following potential directive names that you may want to add back:

ignoreDirectives: [
    'media',
    'charset',
    'import',
    'namespace',
    'supports',
    'document',
    'page',
    'font-face',
    'keyframes',
    'viewport',
    'counter-style',
    'font-feature-values',
    'swash',
    'ornaments',
    'annotation',
    'stylistic',
    'styleset',
    'character-variant',
    'font-variant-alternates',
    'property',
    'color-profile',
    'click',
    'submit', 
    'scroll',
    'keydown',
    'keypress',
    'keyup',
    'blur', 
    'change',
    'contextmenu',
    'copy',
    'cut',
    'paste',
    'dblclick',
    'drag',
    'dragend',
    'dragenter',
    'dragleave',
    'dragover',
    'dragstart',
    'drop',
    'focus',
    'focusin',
    'focusout',
    'input',
    'mousedown',
    'mouseenter',
    'mouseleave',
    'mousemove',
    'mouseover',
    'mouseout',
    'mouseup',
    'mousewheel',
    'resize',
    'select',
    'touchcancel',
    'touchend',
    'touchmove',
    'touchstart',
    'wheel'
]

Prettier Configuration

If you continuously receive errors like "could not resolve module prettier-plugin-blade-stillat", the following updates to a project's .prettierrc have proved successful:

{
    "plugins": [
      "./node_modules/prettier-plugin-blade-stillat/"
    ],
    "overrides": [
      {
        "files": "*.blade.php",
        "vscodeLanguageIds": ["blade"],
        "options": {
          "parser": "blade"
        }
      }
    ]
}

Reporting Issues

If you come across an issue, or have a suggestion to improve the Blade formatter, feel free to create an issue on the project's GitHub repository here:

https://github.com/stillat/blade-parser-typescript

If you are looking to report a security vulnerability, please do not create an issue on the GitHub repository.

To report sensitive issues or a security vulnerability please email security@stillat.com with the relevant details.

Emails requesting information on bounties, etc. will not be responded to.

License

This formatter utility is open-sourced software licensed under the MIT license.

Keywords

FAQs

Package last updated on 17 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc