-
-
Notifications
You must be signed in to change notification settings - Fork 26
Description
What rule do you want to change?
use-baseline
What change do you want to make?
Generate fewer warnings
How do you think the change should be implemented?
A new option
Example code
.foo {
&:hover {
color: red;
}
}
What does the rule currently do for this code?
Selector 'nesting' is not a widely available baseline feature.
What will the rule do after it's changed?
After the change, if a selector is included in allowSelectors
, it will not report an error even if it's not a baseline feature.
import css from '@eslint/css';
export default {
files: ['**/*.css'],
language: 'css/css',
plugins: { css },
languageOptions: {
tolerant: true,
},
rules: {
'css/use-baseline': [
'error',
{
available: 2021,
allowSelectors: ['nesting'] // ✅ New option
}
],
},
};
Participation
- I am willing to submit a pull request to implement this change.
Additional comments
Our project uses PostCSS to process CSS nesting selector syntax, so the syntax in the Example code is valid for our environment.
We currently cannot set the 'css/use-baseline' rule to 'error' because it would generate numerous false positives in our codebase.
We hope to configure an allowlist of non-baseline selectors in ESLint to prevent errors when using PostCSS features.
I'm uncertain whether similar allow-list options should be supported for other CSS constructs like properties, at-rules, media conditions or types. Currently, I don't know if anyone actually needs these.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status