juanca / stylelint-css-modules

Stylelint ruleset for CSS modules
10 stars 1 forks source link

Throws ENOENT errors rather than failing gracefully when composed classname file is not found #10

Closed ghost closed 4 years ago

ghost commented 4 years ago

When a composes: rule pointing to an external file is used and the file is not found, this plugin crashes Stylelint with an ENOENT error rather than failing gracefully.

For example, given a file a.css:

.test {
  composes: whatever from "./non-existent-file.css";

Running stylelint yields:

Error: ENOENT: no such file or directory, open '[path]/non-existent-file.css' (Plus a big stacktrace)

What's worse, when using an editor with Stylelint support, like VS Code with the Stylelint plugin, this causes errors on every single keypress: repor

Expected behaviour: the plugin should report an error normally when a file is not found, rather than crashing stylelint entirely.

juanca commented 4 years ago

Good catch. Sorry for not catching this issue when it was reported. Looks like my notifications was not set up correctly. I'll try to get this fixed and released by EOW.

juanca commented 4 years ago

This will be released in the next published version, I just need to fix a few other issues.

juanca commented 4 years ago

See latest release @ https://github.com/juanca/stylelint-css-modules/releases/tag/1.1.0