From f05a9e7482207b177ec965a7ddd56475e2761553 Mon Sep 17 00:00:00 2001 From: baseballyama Date: Sun, 1 Dec 2024 10:46:39 +0900 Subject: [PATCH 1/2] chore: remove experimental for svelteFeatures.runes option parserOptions --- .changeset/lucky-boxes-tell.md | 5 +++++ README.md | 2 -- src/parser/parser-options.ts | 5 ++--- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .changeset/lucky-boxes-tell.md diff --git a/.changeset/lucky-boxes-tell.md b/.changeset/lucky-boxes-tell.md new file mode 100644 index 00000000..2de2dbcd --- /dev/null +++ b/.changeset/lucky-boxes-tell.md @@ -0,0 +1,5 @@ +--- +"svelte-eslint-parser": patch +--- + +chore: remove experimental for svelteFeatures.runes option parserOptions diff --git a/README.md b/README.md index dc1631d7..f9a55fdd 100644 --- a/README.md +++ b/README.md @@ -289,7 +289,6 @@ export default [ parser: svelteParser, parserOptions: { svelteFeatures: { - /* -- Experimental Svelte Features -- */ /* It may be changed or removed in minor versions without notice. */ // This option is for Svelte 5. The default value is `true`. // If `false`, ESLint will not recognize rune symbols. @@ -310,7 +309,6 @@ For example in `.eslintrc.*`: "parser": "svelte-eslint-parser", "parserOptions": { "svelteFeatures": { - /* -- Experimental Svelte Features -- */ /* It may be changed or removed in minor versions without notice. */ // This option is for Svelte 5. The default value is `true`. // If `false`, ESLint will not recognize rune symbols. diff --git a/src/parser/parser-options.ts b/src/parser/parser-options.ts index f8052939..1cf7cd5d 100644 --- a/src/parser/parser-options.ts +++ b/src/parser/parser-options.ts @@ -20,7 +20,6 @@ export type NormalizedParserOptions = { [key: string]: any; }; svelteFeatures?: { - /* -- Experimental Svelte Features -- */ // This option is for Svelte 5. The default value is `true`. // If `false`, ESLint will not recognize rune symbols. // If not configured this option, The parser will try to read the option from `compilerOptions.runes` from `svelte.config.js`. @@ -66,7 +65,7 @@ const TS_PARSER_NAMES = [ export function isTypeScript( parserOptions: NormalizedParserOptions, - lang: string | undefined, + lang: string | undefined ): boolean { if (!lang) { return false; @@ -89,7 +88,7 @@ export function isTypeScript( if (fs.existsSync(pkgPath)) { try { return TS_PARSER_NAMES.includes( - JSON.parse(fs.readFileSync(pkgPath, "utf-8"))?.name, + JSON.parse(fs.readFileSync(pkgPath, "utf-8"))?.name ); } catch { return false; From deb5f6bb03dbe562f4906312072f91cbd89113ad Mon Sep 17 00:00:00 2001 From: baseballyama Date: Sun, 1 Dec 2024 10:49:05 +0900 Subject: [PATCH 2/2] fix lint --- src/parser/parser-options.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/parser-options.ts b/src/parser/parser-options.ts index 1cf7cd5d..c663406c 100644 --- a/src/parser/parser-options.ts +++ b/src/parser/parser-options.ts @@ -65,7 +65,7 @@ const TS_PARSER_NAMES = [ export function isTypeScript( parserOptions: NormalizedParserOptions, - lang: string | undefined + lang: string | undefined, ): boolean { if (!lang) { return false; @@ -88,7 +88,7 @@ export function isTypeScript( if (fs.existsSync(pkgPath)) { try { return TS_PARSER_NAMES.includes( - JSON.parse(fs.readFileSync(pkgPath, "utf-8"))?.name + JSON.parse(fs.readFileSync(pkgPath, "utf-8"))?.name, ); } catch { return false;