Skip to content

Commit

Permalink
fix endIndex offset
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Jun 13, 2023
1 parent dc3b4a2 commit 85a24c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions lib/rules/media-feature-name-value-no-unknown/__tests__/index.js
Expand Up @@ -172,7 +172,7 @@ testRule({
line: 1,
column: 31,
endLine: 1,
endColumn: 37,
endColumn: 38,
},
{
code: '@media screen and (width <= 1000khz) {}',
Expand All @@ -181,7 +181,7 @@ testRule({
line: 1,
column: 29,
endLine: 1,
endColumn: 35,
endColumn: 36,
},
{
code: '@media screen and (-webkit-width = 1000khz) {}',
Expand All @@ -190,7 +190,7 @@ testRule({
line: 1,
column: 36,
endLine: 1,
endColumn: 42,
endColumn: 43,
},
{
code: '@media (-webkit-hover: -webkit-pointer) {}',
Expand All @@ -199,7 +199,7 @@ testRule({
line: 1,
column: 24,
endLine: 1,
endColumn: 38,
endColumn: 39,
},
{
code: '@media (color: 1.1) {}',
Expand All @@ -208,7 +208,7 @@ testRule({
line: 1,
column: 16,
endLine: 1,
endColumn: 18,
endColumn: 19,
},
{
code: '@media (color: 1 / 1) {}',
Expand All @@ -217,7 +217,7 @@ testRule({
line: 1,
column: 16,
endLine: 1,
endColumn: 20,
endColumn: 21,
},
{
code: '@media (hover: 15) {}',
Expand All @@ -226,7 +226,7 @@ testRule({
line: 1,
column: 16,
endLine: 1,
endColumn: 17,
endColumn: 18,
},
{
code: '@media (hover: /* a comment */15) {}',
Expand All @@ -235,7 +235,7 @@ testRule({
line: 1,
column: 31,
endLine: 1,
endColumn: 32,
endColumn: 33,
},
{
code: '@media (width: 15) {}',
Expand All @@ -244,7 +244,7 @@ testRule({
line: 1,
column: 16,
endLine: 1,
endColumn: 17,
endColumn: 18,
},
{
code: '@media (hover: 10px) {}',
Expand All @@ -253,7 +253,7 @@ testRule({
line: 1,
column: 16,
endLine: 1,
endColumn: 19,
endColumn: 20,
},
{
code: '@media (hover: sin(90deg)) {}',
Expand All @@ -262,7 +262,7 @@ testRule({
line: 1,
column: 16,
endLine: 1,
endColumn: 25,
endColumn: 26,
},
{
code: '@media (grid: 2) or (grid: -1) {}',
Expand All @@ -280,7 +280,7 @@ testRule({
line: 1,
column: 28,
endLine: 1,
endColumn: 29,
endColumn: 30,
},
],
},
Expand All @@ -293,14 +293,14 @@ testRule({
line: 1,
column: 16,
endLine: 1,
endColumn: 21,
endColumn: 22,
},
{
message: messages.rejected('hover', 'pointer'),
line: 1,
column: 36,
endLine: 1,
endColumn: 42,
endColumn: 43,
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/media-feature-name-value-no-unknown/index.js
Expand Up @@ -225,7 +225,7 @@ const rule = (primary) => {
message: messages.rejected,
messageArgs: [state.mediaFeatureNameRaw, valuePart],
index: atRuleParamIndexValue + start,
endIndex: atRuleParamIndexValue + end,
endIndex: atRuleParamIndexValue + end + 1,
node: atRule,
ruleName,
result,
Expand Down

0 comments on commit 85a24c9

Please sign in to comment.