Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix end positions for at-rule-*-list #6032

Merged
merged 2 commits into from Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/rules/at-rule-allowed-list/__tests__/index.js
Expand Up @@ -70,6 +70,8 @@ testRule({
`,
line: 2,
column: 7,
endLine: 2,
endColumn: 13,
message: messages.rejected('mixin'),
description: '@rule not from an allowed list; independent rule.',
},
Expand Down Expand Up @@ -128,20 +130,26 @@ testRule({
message: messages.rejected('mixin'),
line: 2,
column: 7,
endLine: 2,
endColumn: 13,
description: '@rule not from an allowed list.',
},
{
code: "@import 'path/to/file.css';",
message: messages.rejected('import'),
line: 1,
column: 1,
endLine: 1,
endColumn: 8,
description: '@rule not from an allowed list.',
},
{
code: '@media screen and (max-witdh: 1000px) {}',
message: messages.rejected('media'),
line: 1,
column: 1,
endLine: 1,
endColumn: 7,
description: '@rule not from an allowed list.',
},
],
Expand Down
1 change: 1 addition & 0 deletions lib/rules/at-rule-allowed-list/index.js
Expand Up @@ -47,6 +47,7 @@ const rule = (primary) => {
node: atRule,
result,
ruleName,
word: `@${atRule.name}`,
mattxwang marked this conversation as resolved.
Show resolved Hide resolved
});
});
};
Expand Down
7 changes: 7 additions & 0 deletions lib/rules/at-rule-disallowed-list/__tests__/index.js
Expand Up @@ -24,6 +24,8 @@ testRule({
message: messages.rejected('extend'),
line: 1,
column: 5,
endLine: 1,
endColumn: 12,
description: '@rule from a disallowed list, is a Sass directive.',
},
{
Expand All @@ -36,6 +38,8 @@ testRule({
message: messages.rejected('extend'),
line: 3,
column: 9,
endLine: 3,
endColumn: 16,
description: '@rule from a disallowed list; newline after its name.',
},
{
Expand All @@ -47,6 +51,9 @@ testRule({
`,
message: messages.rejected('keyframes'),
line: 2,
column: 7,
endLine: 2,
endColumn: 17,
description: '@rule from a disallowed list; independent rule.',
},
{
Expand Down
1 change: 1 addition & 0 deletions lib/rules/at-rule-disallowed-list/index.js
Expand Up @@ -47,6 +47,7 @@ const rule = (primary) => {
node: atRule,
result,
ruleName,
word: `@${atRule.name}`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this also can be simplified: 😅

Suggested change
word: `@${atRule.name}`,
word: `@${name}`,

});
});
};
Expand Down