at-rule-no-unknown errors
See original GitHub issueI get at-rule-no-unknown errors for things like @extend, @mixin etc. with this plugin installed. I could be mistaken, but I assumed this plugin would cover those cases, but right now I have to use a custom ignore rule:
{
"extends": [
"stylelint-config-standard",
"stylelint-config-css-modules"
],
"plugins": [
"stylelint-scss"
],
"rules": {
"at-rule-no-unknown": [ true, {
ignoreAtRules: ['extend', 'at-root', 'debug', 'warn', 'error', 'if', 'else', 'for', 'each', 'while', 'mixin', 'include', 'content', 'return', 'function']
}]
}
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:9
Top Results From Across the Web
at-rule-no-unknown - Stylelint
Disallow unknown at-rules. ... This rule considers at-rules defined in the CSS Specifications, up to and including Editor's Drafts, to be known. Options....
Read more >Prevent `at-rule-no-unknown` from warning against Sass ...
A feature request to not warn against Sass directives like @import , @function , and @if when using Sass or SCSS syntax. Which...
Read more >css - Unexpected unknown at-rule "@tailwind" scss/at-rule-no ...
And when I run stylelint "**/*.{scss,css,sass,svelte}" , I get the following error: yarn run v1.22.17 ...
Read more >stylus/at-rule-no-unknown | stylelint-plugin-stylus
The at-rule-no-unknown (opens new window) rule incorrectly report errors in Stylus. This problem is that the core rules do not understand at- ...
Read more >@tailwind unknown at rule | The AI Search Engine You Control
Whenever i try to use any tailwind directive except @apply it throws me an error: "Unexpected unknown at-rule "@screen" at-rule-no-unknown", nor screen, nor ......
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 Free
Top 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
Another possibility would be to write a new rule for
stylelint-scss
that wrapsat-rule-no-unknown
but automatically ignores Sass’s special at-rules. Something like this:This solution means your rule is easy to maintain, without duplicating code and at-rule lists in stylelint.
This ability to manually invoke stylelint rules within plugin rules opens a lot of doors!
@neverfox I’m in the same boat, but what I realized is that because
stylelint-scss
is a stylelintplugin
, it doesn’t automatically enable any rule for you because that’s how plugins work.What we really need to make the linter “scss aware” is a scss lint config that we can tell stylelint to
extend
instead, the same way you’re extendingstylelint-config-css-modules
above.I did a quick search online for “stylelint scss config” but it isn’t turning up anything, perhaps this is a perfect moment for me to attempt to write one myself!