Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3f00ad7
Created a new rule: "no-invalid-position-declaration"
sw1tch3roo Jul 13, 2025
17a8f17
Merge branch 'main' into feature/no-invalid-position-declaration
sw1tch3roo Jul 14, 2025
2c819fc
Create proud-singers-punch.md
jeddy3 Jul 14, 2025
df1cdcb
Apply suggestions from code review
sw1tch3roo Jul 14, 2025
b4ec245
changes after review: fix no-invalid-position-declaration rule to cat…
sw1tch3roo Jul 14, 2025
992908b
Merge branch 'main' into feature/no-invalid-position-declaration
sw1tch3roo Jul 15, 2025
16a805c
Add endLine and endColumn to no-invalid-position-declaration reject t…
sw1tch3roo Jul 15, 2025
69b3aeb
Apply suggestions from code review
sw1tch3roo Jul 15, 2025
4fd9d2a
Add nested at-rule support and refactor 'no-invalid-position-declarat…
sw1tch3roo Jul 15, 2025
d13f890
Apply suggestions from code review
sw1tch3roo Jul 15, 2025
4f436c5
Merge branch 'main' into feature/no-invalid-position-declaration
sw1tch3roo Jul 15, 2025
4858875
add new case to accepted tests, move keywords import to the first line
sw1tch3roo Jul 15, 2025
38bb265
Update lib/rules/no-invalid-position-declaration/index.mjs
jeddy3 Jul 16, 2025
5702c5b
Update lib/rules/no-invalid-position-declaration/index.mjs
sw1tch3roo Jul 16, 2025
4921715
add isStandardSyntaxDeclaration import, sort imports
sw1tch3roo Jul 16, 2025
56eef91
Merge branch 'main' into feature/no-invalid-position-declaration
sw1tch3roo Jul 18, 2025
d609a07
Merge branch 'main' into feature/no-invalid-position-declaration
sw1tch3roo Jul 21, 2025
5adfc6b
use typeGuards utils
sw1tch3roo Jul 25, 2025
81e383b
Merge branch 'main' into feature/no-invalid-position-declaration
sw1tch3roo Jul 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add endLine and endColumn to no-invalid-position-declaration reject t…
…est cases
  • Loading branch information
sw1tch3roo committed Jul 15, 2025
commit 16a805c8295a0754c7f4d5b183b5ecd090a9f0cc
52 changes: 46 additions & 6 deletions lib/rules/no-invalid-position-declaration/__tests__/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ testRule({
message: messages.rejected,
line: 1,
column: 1,
endLine: 1,
endColumn: 12,
description: 'custom property at root level',
},
{
code: 'color: red;',
message: messages.rejected,
line: 1,
column: 1,
endLine: 1,
endColumn: 12,
description: 'regular property at root level',
},
{
Expand All @@ -86,6 +90,8 @@ testRule({
message: messages.rejected,
line: 1,
column: 1,
endLine: 1,
endColumn: 12,
description: 'custom property at root before selector',
},
{
Expand All @@ -96,6 +102,8 @@ testRule({
message: messages.rejected,
line: 1,
column: 1,
endLine: 1,
endColumn: 12,
description: 'regular property at root before selector',
},
{
Expand All @@ -106,6 +114,8 @@ testRule({
message: messages.rejected,
line: 2,
column: 1,
endLine: 2,
endColumn: 12,
description: 'custom property at root after selector',
},
{
Expand All @@ -116,6 +126,8 @@ testRule({
message: messages.rejected,
line: 2,
column: 1,
endLine: 2,
endColumn: 14,
description: 'regular property at root after selector',
},
{
Expand All @@ -124,8 +136,8 @@ testRule({
color: blue;
`,
warnings: [
{ message: messages.rejected, line: 1, column: 1 },
{ message: messages.rejected, line: 2, column: 1 },
{ message: messages.rejected, line: 1, column: 1, endLine: 1, endColumn: 12 },
{ message: messages.rejected, line: 2, column: 1, endLine: 2, endColumn: 13 },
],
description: 'multiple properties at root level',
},
Expand All @@ -138,6 +150,8 @@ testRule({
message: messages.rejected,
line: 2,
column: 1,
endLine: 2,
endColumn: 12,
description: 'custom property at root after import',
},
{
Expand All @@ -149,6 +163,8 @@ testRule({
message: messages.rejected,
line: 2,
column: 1,
endLine: 2,
endColumn: 12,
description: 'regular property at root after import',
},
{
Expand All @@ -162,8 +178,8 @@ testRule({
margin: 10px;
`,
warnings: [
{ message: messages.rejected, line: 1, column: 1 },
{ message: messages.rejected, line: 7, column: 1 },
{ message: messages.rejected, line: 1, column: 1, endLine: 1, endColumn: 12 },
{ message: messages.rejected, line: 7, column: 1, endLine: 7, endColumn: 14 },
],
description: 'properties at root before and after selector',
},
Expand All @@ -176,6 +192,8 @@ testRule({
message: messages.rejected,
line: 2,
column: 1,
endLine: 2,
endColumn: 12,
description: 'custom property at root with comments',
},
{
Expand All @@ -186,55 +204,73 @@ testRule({
message: messages.rejected,
line: 2,
column: 1,
endLine: 2,
endColumn: 12,
description: 'regular property at root after charset',
},
{
code: '@media screen { color: red; }',
message: messages.rejected,
line: 1,
column: 17,
endLine: 1,
endColumn: 28,
},
{
code: '@supports (display: grid) { margin: 10px; }',
message: messages.rejected,
line: 1,
column: 29,
endLine: 1,
endColumn: 42,
},
{
code: '@container (min-width: 768px) { padding: 5px; }',
message: messages.rejected,
line: 1,
column: 33,
endLine: 1,
endColumn: 46,
},
{
code: '@layer base { font-size: 16px; }',
message: messages.rejected,
line: 1,
column: 15,
endLine: 1,
endColumn: 31,
},
{
code: '@apply text-red-500 { color: red; }',
message: messages.rejected,
line: 1,
column: 23,
endLine: 1,
endColumn: 34,
},
{
code: '@scope (main) { margin: 10px; }',
message: messages.rejected,
line: 1,
column: 17,
endLine: 1,
endColumn: 30,
},
{
code: '@starting-style { padding: 5px; }',
message: messages.rejected,
line: 1,
column: 19,
endLine: 1,
endColumn: 32,
},
{
code: '@document url-prefix("https://") { color: red; }',
message: messages.rejected,
line: 1,
column: 36,
endLine: 1,
endColumn: 47,
},
{
code: stripIndent`
Expand All @@ -244,8 +280,8 @@ testRule({
}
`,
warnings: [
{ message: messages.rejected, line: 2, column: 2 },
{ message: messages.rejected, line: 3, column: 2 },
{ message: messages.rejected, line: 2, column: 2, endLine: 2, endColumn: 13 },
{ message: messages.rejected, line: 3, column: 2, endLine: 3, endColumn: 19 },
],
},
{
Expand All @@ -258,6 +294,8 @@ testRule({
message: messages.rejected,
line: 3,
column: 2,
endLine: 3,
endColumn: 15,
},
{
code: stripIndent`
Expand All @@ -270,6 +308,8 @@ testRule({
message: messages.rejected,
line: 3,
column: 3,
endLine: 3,
endColumn: 14,
},
],
});