Skip to content

Commit

Permalink
fix: update svelte-eslint-parser (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi authored Mar 4, 2024
1 parent 410897e commit d4303f5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-papayas-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-svelte": patch
---

fix: update svelte-eslint-parser
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"postcss-safe-parser": "^6.0.0",
"postcss-selector-parser": "^6.0.15",
"semver": "^7.6.0",
"svelte-eslint-parser": ">=0.34.0-next.10 <1.0.0"
"svelte-eslint-parser": ">=0.34.0-next.11 <1.0.0"
},
"devDependencies": {
"@1stg/browserslist-config": "^2.0.0",
Expand All @@ -90,7 +90,7 @@
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@changesets/get-release-plan": "^4.0.0",
"@fontsource/fira-mono": "^5.0.8",
"@fontsource/fira-mono": "^5.0.12",
"@ota-meshi/eslint-plugin": "^0.15.2",
"@sindresorhus/slugify": "^2.2.1",
"@sveltejs/adapter-static": "^3.0.1",
Expand All @@ -110,7 +110,7 @@
"@types/markdown-it-container": "^2.0.9",
"@types/markdown-it-emoji": "^2.0.4",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.22",
"@types/node": "^20.11.24",
"@types/postcss-safe-parser": "^5.0.4",
"@types/prismjs": "^1.26.3",
"@types/semver": "^7.5.8",
Expand Down Expand Up @@ -146,7 +146,7 @@
"estree-walker": "^3.0.3",
"less": "^4.2.0",
"locate-character": "^3.0.0",
"magic-string": "^0.30.7",
"magic-string": "^0.30.8",
"markdown-it-anchor": "^8.6.7",
"markdown-it-container": "^4.0.0",
"markdown-it-emoji": "^3.0.0",
Expand All @@ -166,7 +166,7 @@
"stylelint": "^16.2.1",
"stylelint-config-standard": "^36.0.0",
"stylus": "^0.62.0",
"svelte": "^5.0.0-next.69",
"svelte": "^5.0.0-next.70",
"svelte-adapter-ghpages": "0.2.2",
"svelte-i18n": "^4.0.0",
"tslib": "^2.6.2",
Expand Down
2 changes: 2 additions & 0 deletions src/rules/no-unused-class-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
SourceLocation,
SvelteAttribute,
SvelteDirective,
SvelteGenericsDirective,
SvelteShorthandAttribute,
SvelteSpecialDirective,
SvelteSpreadAttribute,
Expand Down Expand Up @@ -85,6 +86,7 @@ function findClassesInAttribute(
| SvelteDirective
| SvelteStyleDirective
| SvelteSpecialDirective
| SvelteGenericsDirective
): string[] {
if (attribute.type === 'SvelteAttribute' && attribute.key.name === 'class') {
return attribute.value.flatMap((value) =>
Expand Down
2 changes: 2 additions & 0 deletions src/types-for-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export type ASTNodeListener = {
SvelteDirective?: (node: AST.SvelteDirective & ASTNodeWithParent) => void;
SvelteStyleDirective?: (node: AST.SvelteStyleDirective & ASTNodeWithParent) => void;
SvelteSpecialDirective?: (node: AST.SvelteSpecialDirective & ASTNodeWithParent) => void;
SvelteGenericsDirective?: (node: AST.SvelteGenericsDirective & ASTNodeWithParent) => void;
SvelteDirectiveKey?: (node: AST.SvelteDirectiveKey & ASTNodeWithParent) => void;
SvelteSpecialDirectiveKey?: (node: AST.SvelteSpecialDirectiveKey & ASTNodeWithParent) => void;
SvelteText?: (node: AST.SvelteText & ASTNodeWithParent) => void;
Expand Down Expand Up @@ -457,6 +458,7 @@ export type SvelteNodeListener = {
SvelteDirective?: (node: AST.SvelteDirective & ASTNodeWithParent) => void;
SvelteStyleDirective?: (node: AST.SvelteStyleDirective & ASTNodeWithParent) => void;
SvelteSpecialDirective?: (node: AST.SvelteSpecialDirective & ASTNodeWithParent) => void;
SvelteGenericsDirective?: (node: AST.SvelteGenericsDirective & ASTNodeWithParent) => void;
SvelteDirectiveKey?: (node: AST.SvelteDirectiveKey & ASTNodeWithParent) => void;
SvelteSpecialDirectiveKey?: (node: AST.SvelteSpecialDirectiveKey & ASTNodeWithParent) => void;
SvelteText?: (node: AST.SvelteText & ASTNodeWithParent) => void;
Expand Down
4 changes: 3 additions & 1 deletion src/utils/ast-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,14 @@ export function getAttributeKeyText(
| SvAST.SvelteShorthandAttribute
| SvAST.SvelteStyleDirective
| SvAST.SvelteDirective
| SvAST.SvelteSpecialDirective,
| SvAST.SvelteSpecialDirective
| SvAST.SvelteGenericsDirective,
context: RuleContext
): string {
switch (node.type) {
case 'SvelteAttribute':
case 'SvelteShorthandAttribute':
case 'SvelteGenericsDirective':
return node.key.name;
case 'SvelteStyleDirective':
return `style:${node.key.name.name}`;
Expand Down

This file was deleted.

0 comments on commit d4303f5

Please sign in to comment.