Skip to content

Commit

Permalink
Fix at-rule-property-required-list message to use "descriptor" for …
Browse files Browse the repository at this point in the history
…accuracy (#8186)

Follow-up PR #8185
See also <#8148 (comment)>

Note that it doesn't rename local variables to minimize code diffs and keep git-blame easy.
  • Loading branch information
ybiquitous authored Dec 13, 2024
1 parent 63ea779 commit 74f3c08
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-carrots-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `at-rule-property-required-list` message to use "descriptor" for accuracy
4 changes: 3 additions & 1 deletion lib/rules/at-rule-property-required-list/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ const ruleMessages = require('../../utils/ruleMessages.cjs');
const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps.cjs');
const validateOptions = require('../../utils/validateOptions.cjs');

// NOTE: We should have named this rule as `at-rule-descriptor-required-list` instead.
// See https://github.com/stylelint/stylelint/pull/8185
const ruleName = 'at-rule-property-required-list';

const messages = ruleMessages(ruleName, {
expected: (atRule, property) => `Expected property "${property}" for at-rule "${atRule}"`,
expected: (atRule, descriptor) => `Expected descriptor "${descriptor}" for at-rule "${atRule}"`,
});

const meta = {
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/at-rule-property-required-list/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import ruleMessages from '../../utils/ruleMessages.mjs';
import validateObjectWithArrayProps from '../../utils/validateObjectWithArrayProps.mjs';
import validateOptions from '../../utils/validateOptions.mjs';

// NOTE: We should have named this rule as `at-rule-descriptor-required-list` instead.
// See https://github.com/stylelint/stylelint/pull/8185
const ruleName = 'at-rule-property-required-list';

const messages = ruleMessages(ruleName, {
expected: (atRule, property) => `Expected property "${property}" for at-rule "${atRule}"`,
expected: (atRule, descriptor) => `Expected descriptor "${descriptor}" for at-rule "${atRule}"`,
});

const meta = {
Expand Down

0 comments on commit 74f3c08

Please sign in to comment.