question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

stylelint for less - The "syntax" option is no longer available

See original GitHub issue

stylelint --fix “src/**/*.less” --syntax less Error: The “syntax” option is no longer available. You should install an appropriate syntax, e.g. postcss-scss, and use the “customSyntax” option

"lint:style": "stylelint --fix \"src/**/*.less\" --syntax less",

How to use customSyntax to fixed it? Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

25reactions
jeddy3commented, Oct 28, 2021

See the migration guide.

You should install postcss-less:

npm install --save-dev postcss-less

And then either use the --custom-syntax flag:

"lint:style": "stylelint --fix \"src/**/*.less\" --custom-syntax postcss-less"

or use the customSyntax configuration object property:

{
  "customSyntax": "postcss-less",
  "rules": {
    ..
  }
}

You can also raise an issue in the 3rd party stylelint-config-recommended-less shared config to see if they’ll be willing to bundle the postcss-less syntax in the config.

4reactions
meatnordrinkcommented, Dec 7, 2021

For anyone that encounters this later, the solution is

npm i --save-dev postcss@8

https://github.com/stylelint-scss/stylelint-config-standard-scss/issues/5#issuecomment-961709882

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating to 14.0.0 - Stylelint
syntax option and automatic inferral of syntax​. Stylelint no longer includes the syntaxes that: parse CSS-like languages like SCSS, Sass, Less and SugarSS ......
Read more >
Options - Stylelint
Specify a custom syntax to use on your code. There are many styling languages, ranging from CSS language extensions like SCSS to entirely...
Read more >
Getting started | Stylelint
If a shared config isn't available for your preferred language or library, then you can install the appropriate custom syntax yourself and use...
Read more >
Configuration | Stylelint
You can use the --config or configFile option to short-circuit the search. ... No rules are turned on by default and there are...
Read more >
Changelog | Stylelint
Fixed: no-duplicate-selectors false positives with Less syntax (#6111). ... Added: customSyntax option as a property in the configuration object (#5538).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found