Skip to content

Commit

Permalink
Refactor function-no-unknown to remove exceptions (#7642)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouvedia committed Apr 23, 2024
1 parent 3b1de8f commit bb31205
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -11,7 +11,7 @@
- Fixed: `declaration-block-no-shorthand-property-overrides` false negatives for `border` ([#7585](https://github.com/stylelint/stylelint/pull/7585)) ([@fpetrakov](https://github.com/fpetrakov)).
- Fixed: `declaration-block-no-shorthand-property-overrides` false negatives for `font` and `border` ([#7606](https://github.com/stylelint/stylelint/pull/7606)) ([@Mouvedia](https://github.com/Mouvedia)).
- Fixed: `function-calc-no-unspaced-operator` false negatives for some math functions ([#7619](https://github.com/stylelint/stylelint/pull/7619)) ([@Mouvedia](https://github.com/Mouvedia)).
- Fixed: `function-no-unknown` false positives for `anchor` and `anchor-size` ([#7607](https://github.com/stylelint/stylelint/pull/7607)) ([@Mouvedia](https://github.com/Mouvedia)).
- Fixed: `function-no-unknown` false positives for `anchor`, `anchor-size` and `palette-mix` ([#7607](https://github.com/stylelint/stylelint/pull/7607) & [#7640](https://github.com/stylelint/stylelint/pull/7640)) ([@Mouvedia](https://github.com/Mouvedia)).
- Fixed: `selector-max-attribute` end positions ([#7592](https://github.com/stylelint/stylelint/pull/7592)) ([@romainmenke](https://github.com/romainmenke)).
- Fixed: `selector-max-class` end positions ([#7590](https://github.com/stylelint/stylelint/pull/7590)) ([@romainmenke](https://github.com/romainmenke)).
- Fixed: `selector-max-combinators` end positions ([#7596](https://github.com/stylelint/stylelint/pull/7596)) ([@romainmenke](https://github.com/romainmenke)).
Expand Down
11 changes: 1 addition & 10 deletions lib/rules/function-no-unknown/index.cjs
Expand Up @@ -45,16 +45,7 @@ const rule = (primary, secondaryOptions) => {
return;
}

const functionsList = [
...JSON.parse(fs.readFileSync(functionsListPath.toString(), 'utf8')),
// #5960
'color-stop',
'from',
'to',
// #7566
'anchor',
'anchor-size',
];
const functionsList = JSON.parse(fs.readFileSync(functionsListPath.toString(), 'utf8'));

root.walkDecls((decl) => {
const { value } = decl;
Expand Down
11 changes: 1 addition & 10 deletions lib/rules/function-no-unknown/index.mjs
Expand Up @@ -43,16 +43,7 @@ const rule = (primary, secondaryOptions) => {
return;
}

const functionsList = [
...JSON.parse(fs.readFileSync(functionsListPath.toString(), 'utf8')),
// #5960
'color-stop',
'from',
'to',
// #7566
'anchor',
'anchor-size',
];
const functionsList = JSON.parse(fs.readFileSync(functionsListPath.toString(), 'utf8'));

root.walkDecls((decl) => {
const { value } = decl;
Expand Down

0 comments on commit bb31205

Please sign in to comment.