Fix CssSyntaxError for `.cjs` files
See original GitHub issueClearly describe the bug
As title
Which rule, if any, is the bug related to?
e.g. number-leading-zero
What code is needed to reproduce the bug?
// test.cjs
module.exports = 1
What stylelint configuration is needed to reproduce the bug?
No need
Which version of stylelint are you using?
13.13.1
How are you running stylelint: CLI, PostCSS plugin, Node.js API?
CLI with stylelint test.cjs
Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?
No
What did you expect to happen?
No error
What actually happened (e.g. what warnings or errors did you get)?
test.cjs
1:1 ✖ Unknown word CssSyntaxError
If I rename test.cjs
to test.js
, there will be no error.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Webpack not building because CssSyntaxError - Stack Overflow
js file but for some reason it didn't work. Not sure if that might be cause of your error but it fixed it...
Read more >Changelog - Stylelint 中文文档
Fixed : throwing more informative error when all input files are ignored (#5709). ... Fixed: CssSyntaxError for functions in template literals (#3869).
Read more >0 - Code Grepper
Queries related to “Module build failed (from ./node_modules/css-loader/dist/cjs.js): CssSyntaxError”. module build failed (from ./node_modules/ ...
Read more >Stylelint | WebStorm Documentation - JetBrains
Stylelint wakes up automatically when you edit a CSS file and ... In a stylelint.config.cjs file that exports a JavaScript object.
Read more >sass-loader - npm
sass-loader. Loads a Sass/SCSS file and compiles it to CSS. ... Webpack provides an advanced mechanism to resolve files.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be fixed now. https://github.com/stylelint/vscode-stylelint/issues/160#issuecomment-949249681
OK, then I have to use
.stylelintignore
for now, the other two options seem not good to me.