diff --git a/.changeset/orange-laws-tie.md b/.changeset/orange-laws-tie.md new file mode 100644 index 00000000..810419f2 --- /dev/null +++ b/.changeset/orange-laws-tie.md @@ -0,0 +1,5 @@ +--- +"svelte-eslint-parser": minor +--- + +feat: stabilized generics diff --git a/README.md b/README.md index 628930aa..17310844 100644 --- a/README.md +++ b/README.md @@ -291,11 +291,6 @@ export default [ // If not configured this option, The parser will try to read the option from `compilerOptions.runes` from `svelte.config.js`. // If `parserOptions.svelteConfig` is not specified and the file cannot be parsed by static analysis, it will behave as `true`. runes: true, - /* -- Experimental Svelte Features -- */ - /* It may be changed or removed in minor versions without notice. */ - // Whether to parse the `generics` attribute. - // See https://github.com/sveltejs/rfcs/pull/38 - experimentalGenerics: false, }, }, }, @@ -317,11 +312,6 @@ For example in `.eslintrc.*`: // If not configured this option, The parser will try to read the option from `compilerOptions.runes` from `svelte.config.js`. // If `parserOptions.svelteConfig` is not specified and the file cannot be parsed by static analysis, it will behave as `true`. "runes": true, - /* -- Experimental Svelte Features -- */ - /* It may be changed or removed in minor versions without notice. */ - // Whether to parse the `generics` attribute. - // See https://github.com/sveltejs/rfcs/pull/38 - "experimentalGenerics": false, }, }, } diff --git a/src/parser/converts/root.ts b/src/parser/converts/root.ts index aa713bd8..54cbe964 100644 --- a/src/parser/converts/root.ts +++ b/src/parser/converts/root.ts @@ -173,8 +173,7 @@ export function convertSvelteRoot( body.push(style); } body.push(...convertChildren({ nodes: snippetChildren }, ast, ctx)); - if (script && ctx.parserOptions.svelteFeatures?.experimentalGenerics) - convertGenericsAttribute(script, ctx); + if (script) convertGenericsAttribute(script, ctx); // Set the scope of the Program node. ctx.scriptLet.addProgramRestore( diff --git a/src/parser/parser-options.ts b/src/parser/parser-options.ts index b8f15d1a..f8052939 100644 --- a/src/parser/parser-options.ts +++ b/src/parser/parser-options.ts @@ -26,9 +26,6 @@ export type NormalizedParserOptions = { // If not configured this option, The parser will try to read the option from `compilerOptions.runes` from `svelte.config.js`. // If `parserOptions.svelteConfig` is not specified and the file cannot be parsed by static analysis, it will behave as `true`. runes?: boolean; - // Whether to parse the `generics` attribute. - // See https://github.com/sveltejs/rfcs/pull/38 - experimentalGenerics?: boolean; }; loc: boolean; range: boolean; diff --git a/tests/src/parser/test-utils.ts b/tests/src/parser/test-utils.ts index ec68fec6..8d98c0e6 100644 --- a/tests/src/parser/test-utils.ts +++ b/tests/src/parser/test-utils.ts @@ -21,9 +21,6 @@ const BASIC_PARSER_OPTIONS: Linter.ParserOptions = { }, project: require.resolve("../../fixtures/tsconfig.test.json"), extraFileExtensions: [".svelte"], - svelteFeatures: { - experimentalGenerics: true, - }, }; const SVELTE5_SCOPE_VARIABLES_BASE = [
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: