Rule 'no-empty-source' fails on 'null' and doesn't accept 'false'
See original GitHub issueI want to use stylelint to lint inside Vue files. When adding Vue files to be linted, I get this error:
src/layouts/default.vue
12:24 ✖ Missed semicolon CssSyntaxError
I need to install processor @mapbox/stylelint-processor-arbitrary-tags (because stylelint-preprocessor-html is deprecated). And when using this, their readme says to disable the rule no-empty-source.
I am extending stylelint-config-recommended in my config, and I must overwrite the rule no-empty-source
to turn it off.
When setting 'no-empty-source': null
in the config, stylelint will return no exit code and all linting will succeed (but it should fail when there are lint-errors).
When setting 'no-empty-source': false
in the config, stylelint returns an error: Invalid Option: Unexpected option value "false" for rule "no-empty-source"
.
I expect to use false
if the input is of type Boolean, or using null
to reset to the default. To set to false or null, I can use the processor to use stylelint in style tags in Vue files.
Configuration file:
module.exports = {
processors: ['@mapbox/stylelint-processor-arbitrary-tags'],
extends: ['stylelint-config-standard'],
rules: {
'no-empty-source': null
}
}
Stylelint version: 9.5.0
, is also not working in 9.4.0
CLI: $ ./node_modules/.bin/stylelint --config ./config/stylelint.config.js --syntax scss ./src/{assets/styles/{,*/}*.scss,**/*.vue}
To test this, make sure to let your example code fail when using the ‘stylelint-config-recommended’ rules, then update your configuration to enable the processor and add the rule ‘no-empty-source’.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
I’ve been working on a PR to deemphasize processors and the
--syntax
option in the docs. This will hopefully make it less confusing for other users.stylelint can now automatically:
As such, I’ve deemphasized processors and the
--syntax
option in the docs as their use is more of an edge case than the norm now.@PMK I’m glad you were able to resolve the issue too 😃
@ota-meshi You’re totally right. This was very confusing me… Actually, now if I add the
--syntax scss
again, it gives different results. So to solve it, I need to remove the--syntax scss
and removing processorstylelint-processor-arbitrary-tags
.Thanks for the help all!