Skip to content

Commit

Permalink
Fix typo in rules.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouvedia committed May 25, 2024
1 parent 5f366b6 commit 4cdd69f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/user-guide/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Disallow duplicates with these `no-duplicate` rules.
| :-- | :-: | :-: |
| [`declaration-block-no-duplicate-custom-properties`](../../lib/rules/declaration-block-no-duplicate-custom-properties/README.md)<br/>Disallow duplicate custom properties within declaration blocks. || |
| [`declaration-block-no-duplicate-properties`](../../lib/rules/declaration-block-no-duplicate-properties/README.md)<br/>Disallow duplicate properties within declaration blocks. || 🔧 |
| [`font-family-no-duplicate-names`](../../lib/rules/font-family-no-duplicate-names/README.md)<br/>Disallow duplicate names within font families. || 🔧 |
| [`font-family-no-duplicate-names`](../../lib/rules/font-family-no-duplicate-names/README.md)<br/>Disallow duplicate names within font families. || |
| [`keyframe-block-no-duplicate-selectors`](../../lib/rules/keyframe-block-no-duplicate-selectors/README.md)<br/>Disallow duplicate selectors within keyframe blocks. || |
| [`no-duplicate-at-import-rules`](../../lib/rules/no-duplicate-at-import-rules/README.md)<br/>Disallow duplicate `@import` rules. || |
| [`no-duplicate-selectors`](../../lib/rules/no-duplicate-selectors/README.md)<br/>Disallow duplicate selectors. || |
Expand Down
10 changes: 6 additions & 4 deletions lib/rules/__tests__/index.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ describe('all rules', () => {
describe('fixable rules', () => {
test.each(ruleNames)('"%s" should describe fixable in the documents', async (name) => {
const rule = await rules[name];

if (!rule.meta.fixable) return;
const cell = rule.meta.fixable ? '\\s+🔧\\s+' : ' ';
const wrapper = (x) => {
return rule.meta.fixable ? x : x.not;
};

const ruleDoc = await readFile(new URL(`../${name}/README.md`, import.meta.url), 'utf8');

expect(ruleDoc).toMatch('`fix` option');
expect(rulesListDoc).toMatch(new RegExp(`^.+\`${name}\`.+\\|.+\\|\\s+🔧\\s+\\|$`, 'm'));
wrapper(expect(ruleDoc)).toMatch('`fix` option');
expect(rulesListDoc).toMatch(new RegExp(`^.+\`${name}\`.+\\|.+\\|${cell}\\|$`, 'm'));
});
});

Expand Down

0 comments on commit 4cdd69f

Please sign in to comment.