Skip to content

Commit d4303f5

Browse files
authored
fix: update svelte-eslint-parser (#696)
1 parent 410897e commit d4303f5

File tree

6 files changed

+17
-10
lines changed

6 files changed

+17
-10
lines changed

.changeset/lovely-papayas-cough.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-svelte": patch
3+
---
4+
5+
fix: update svelte-eslint-parser

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"postcss-safe-parser": "^6.0.0",
7979
"postcss-selector-parser": "^6.0.15",
8080
"semver": "^7.6.0",
81-
"svelte-eslint-parser": ">=0.34.0-next.10 <1.0.0"
81+
"svelte-eslint-parser": ">=0.34.0-next.11 <1.0.0"
8282
},
8383
"devDependencies": {
8484
"@1stg/browserslist-config": "^2.0.0",
@@ -90,7 +90,7 @@
9090
"@changesets/changelog-github": "^0.5.0",
9191
"@changesets/cli": "^2.27.1",
9292
"@changesets/get-release-plan": "^4.0.0",
93-
"@fontsource/fira-mono": "^5.0.8",
93+
"@fontsource/fira-mono": "^5.0.12",
9494
"@ota-meshi/eslint-plugin": "^0.15.2",
9595
"@sindresorhus/slugify": "^2.2.1",
9696
"@sveltejs/adapter-static": "^3.0.1",
@@ -110,7 +110,7 @@
110110
"@types/markdown-it-container": "^2.0.9",
111111
"@types/markdown-it-emoji": "^2.0.4",
112112
"@types/mocha": "^10.0.6",
113-
"@types/node": "^20.11.22",
113+
"@types/node": "^20.11.24",
114114
"@types/postcss-safe-parser": "^5.0.4",
115115
"@types/prismjs": "^1.26.3",
116116
"@types/semver": "^7.5.8",
@@ -146,7 +146,7 @@
146146
"estree-walker": "^3.0.3",
147147
"less": "^4.2.0",
148148
"locate-character": "^3.0.0",
149-
"magic-string": "^0.30.7",
149+
"magic-string": "^0.30.8",
150150
"markdown-it-anchor": "^8.6.7",
151151
"markdown-it-container": "^4.0.0",
152152
"markdown-it-emoji": "^3.0.0",
@@ -166,7 +166,7 @@
166166
"stylelint": "^16.2.1",
167167
"stylelint-config-standard": "^36.0.0",
168168
"stylus": "^0.62.0",
169-
"svelte": "^5.0.0-next.69",
169+
"svelte": "^5.0.0-next.70",
170170
"svelte-adapter-ghpages": "0.2.2",
171171
"svelte-i18n": "^4.0.0",
172172
"tslib": "^2.6.2",

src/rules/no-unused-class-name.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {
33
SourceLocation,
44
SvelteAttribute,
55
SvelteDirective,
6+
SvelteGenericsDirective,
67
SvelteShorthandAttribute,
78
SvelteSpecialDirective,
89
SvelteSpreadAttribute,
@@ -85,6 +86,7 @@ function findClassesInAttribute(
8586
| SvelteDirective
8687
| SvelteStyleDirective
8788
| SvelteSpecialDirective
89+
| SvelteGenericsDirective
8890
): string[] {
8991
if (attribute.type === 'SvelteAttribute' && attribute.key.name === 'class') {
9092
return attribute.value.flatMap((value) =>

src/types-for-node.ts

+2
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ export type ASTNodeListener = {
237237
SvelteDirective?: (node: AST.SvelteDirective & ASTNodeWithParent) => void;
238238
SvelteStyleDirective?: (node: AST.SvelteStyleDirective & ASTNodeWithParent) => void;
239239
SvelteSpecialDirective?: (node: AST.SvelteSpecialDirective & ASTNodeWithParent) => void;
240+
SvelteGenericsDirective?: (node: AST.SvelteGenericsDirective & ASTNodeWithParent) => void;
240241
SvelteDirectiveKey?: (node: AST.SvelteDirectiveKey & ASTNodeWithParent) => void;
241242
SvelteSpecialDirectiveKey?: (node: AST.SvelteSpecialDirectiveKey & ASTNodeWithParent) => void;
242243
SvelteText?: (node: AST.SvelteText & ASTNodeWithParent) => void;
@@ -457,6 +458,7 @@ export type SvelteNodeListener = {
457458
SvelteDirective?: (node: AST.SvelteDirective & ASTNodeWithParent) => void;
458459
SvelteStyleDirective?: (node: AST.SvelteStyleDirective & ASTNodeWithParent) => void;
459460
SvelteSpecialDirective?: (node: AST.SvelteSpecialDirective & ASTNodeWithParent) => void;
461+
SvelteGenericsDirective?: (node: AST.SvelteGenericsDirective & ASTNodeWithParent) => void;
460462
SvelteDirectiveKey?: (node: AST.SvelteDirectiveKey & ASTNodeWithParent) => void;
461463
SvelteSpecialDirectiveKey?: (node: AST.SvelteSpecialDirectiveKey & ASTNodeWithParent) => void;
462464
SvelteText?: (node: AST.SvelteText & ASTNodeWithParent) => void;

src/utils/ast-utils.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,14 @@ export function getAttributeKeyText(
462462
| SvAST.SvelteShorthandAttribute
463463
| SvAST.SvelteStyleDirective
464464
| SvAST.SvelteDirective
465-
| SvAST.SvelteSpecialDirective,
465+
| SvAST.SvelteSpecialDirective
466+
| SvAST.SvelteGenericsDirective,
466467
context: RuleContext
467468
): string {
468469
switch (node.type) {
469470
case 'SvelteAttribute':
470471
case 'SvelteShorthandAttribute':
472+
case 'SvelteGenericsDirective':
471473
return node.key.name;
472474
case 'SvelteStyleDirective':
473475
return `style:${node.key.name.name}`;

tests/fixtures/rules/indent/invalid/const-tag01-requirements.json

-4
This file was deleted.

0 commit comments

Comments
 (0)