Skip to content

Commit

Permalink
Fix end positions for at-rule-*-list (#6032)
Browse files Browse the repository at this point in the history
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
  • Loading branch information
mattxwang and ybiquitous committed Apr 24, 2022
1 parent 9b82c8f commit 2962bd7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
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: `@${name}`,
});
});
};
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}`,
});
});
};
Expand Down

0 comments on commit 2962bd7

Please sign in to comment.