[vue2/3]<style lang="postcss">
See original GitHub issuewhen the language is explicitly specified, the linter does not want to work, how can I fix it? i am using Vue Single-File Component (SFC)
linter not work all done 😥
vscode.setting
// stylelint
"stylelint.enable": true,
"stylelint.autoFixOnSave": true,
"stylelint.useLocal": true,
"stylelint.validate": ["vue", "postcss", "pcss", "css"],
"stylelint.packageManager": "yarn",
// "stylelint.validate": [
// "css",
// "postcss"
// ],
"stylelint.snippet": ["css", "postcss"],
"stylelint.customSyntax": "postcss-html",
"stylelint.configFile": "stylelint.config.js"
// "volar.style.defaultLanguage": "postcss",
// "tailwindCSS.validate": true
stylelint.config.js
module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-config-prettier',
'stylelint-config-html/vue',
'stylelint-config-html',
'stylelint-config-recommended-vue',
],
overrides: [
{
files: ['**/*.vue'],
customSyntax: 'postcss-html',
},
],
rules: {
'color-function-notation': 'modern',
'at-rule-semicolon-newline-after': null,
'block-closing-brace-empty-line-before': null,
'block-closing-brace-newline-after': 'never-single-line',
'block-no-empty': null,
'comment-empty-line-before': null,
'declaration-block-semicolon-newline-after': null,
'declaration-colon-space-after': 'always-single-line',
'declaration-colon-space-before': 'never',
'function-parentheses-space-inside': null,
indentation: null,
'media-feature-colon-space-after': null,
'media-feature-colon-space-before': null,
'media-feature-range-operator-space-after': 'never',
'media-feature-range-operator-space-before': 'never',
'named-grid-areas-no-invalid': null,
'no-empty-source': null,
'no-eol-whitespace': null,
'rule-empty-line-before': null,
'string-quotes': 'single',
'at-rule-no-unknown': [
true,
{
ignoreAtRules: [
'for',
'if',
'else',
'each',
'mixin',
'custom-media',
'define-mixin',
'include',
'media',
'rgba',
],
},
],
'property-no-unknown': [
true,
{
ignoreProperties: ['user-drag'],
},
],
},
};
.stylelintignore
node_modules
node_modules/
static/
build/
assets/scss/vendors/
assets/scss/templates/
.output/
dist/
bin/
obj/
*.*
!*.vue
!*.html
!*.postcss
!*.pcss
!*.css
Clearly describe the bug
e.g. “There are false positives for two leading zeros when …”
Which rule, if any, is the bug related to?
e.g. number-leading-zero
What code is needed to reproduce the bug?
e.g.
a {
width: 00.1em;
}
What Stylelint configuration is needed to reproduce the bug?
e.g.
{
"rules": {
"number-leading-zero": "always"
}
}
Which version of Stylelint are you using?
e.g. 9.2.0
How are you running stylelint: CLI, PostCSS plugin, Node.js API?
e.g. “CLI with stylelint "**/*.css" --config myconfig.json
”
Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?
e.g. “Yes, it’s related to SCSS nested properties.”
What did you expect to happen?
e.g. “No warnings to be flagged.”
What actually happened (e.g. what warnings or errors did you get)?
e.g. “The following warnings were flagged:”
test.css
2:4 Expected a leading zero (number-leading-zero)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Ah, sorry. I missed it. 😅
where is postcss-html? If I show the screenshot above, the errors are not showing in vscode. everything works in the CLI of the console. then the problem is in stylint