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.

Fix CssSyntaxError for `.cjs` files

See original GitHub issue

Clearly 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:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
JounQincommented, Aug 6, 2021

OK, then I have to use .stylelintignore for now, the other two options seem not good to me.

Read more comments on GitHub >

github_iconTop 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 >

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