Skip to content

Commit e043530

Browse files
committed
wip
1 parent 8d75802 commit e043530

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Diff for: README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,10 @@ export default [
286286
svelteFeatures: {
287287
/* -- Experimental Svelte Features -- */
288288
/* It may be changed or removed in minor versions without notice. */
289-
// If true, it will analyze Runes.
290-
// By default, it will try to read `compilerOptions.runes` from `svelte.config.js`.
291-
// However, note that if `parserOptions.svelteConfig` is not specified and the file cannot be parsed by static analysis, it will behave as `false`.
289+
// This option is for Svelte 5. The default value is `true`.
290+
// If `false`, ESLint will not recognize rune symbols.
291+
// If not configured this option, The parser will try to read the option from `compilerOptions.runes` from `svelte.config.js`.
292+
// If `parserOptions.svelteConfig` is not specified and the file cannot be parsed by static analysis, it will behave as `true`.
292293
runes: false,
293294
/* -- Experimental Svelte Features -- */
294295
/* It may be changed or removed in minor versions without notice. */
@@ -311,9 +312,10 @@ For example in `.eslintrc.*`:
311312
"svelteFeatures": {
312313
/* -- Experimental Svelte Features -- */
313314
/* It may be changed or removed in minor versions without notice. */
314-
// If true, it will analyze Runes.
315-
// By default, it will try to read `compilerOptions.runes` from `svelte.config.js`.
316-
// However, note that if the file cannot be parsed by static analysis, it will behave as false.
315+
// This option is for Svelte 5. The default value is `true`.
316+
// If `false`, ESLint will not recognize rune symbols.
317+
// If not configured this option, The parser will try to read the option from `compilerOptions.runes` from `svelte.config.js`.
318+
// If `parserOptions.svelteConfig` is not specified and the file cannot be parsed by static analysis, it will behave as `true`.
317319
"runes": false,
318320
/* -- Experimental Svelte Features -- */
319321
/* It may be changed or removed in minor versions without notice. */
@@ -329,7 +331,8 @@ For example in `.eslintrc.*`:
329331

330332
**_This is an experimental feature. It may be changed or removed in minor versions without notice._**
331333

332-
If you install Svelte v5 and turn on runes (`compilerOptions.runes` in `svelte.config.js` or `parserOptions.svelteFeatures.runes` in ESLint config is `true`), the parser will be able to parse runes, and will also be able to parse `*.js` and `*.ts` files.
334+
If you install Svelte v5 the parser will be able to parse runes, and will also be able to parse `*.js` and `*.ts` files.
335+
If you don't want to use Runes, you may need to configure. Please read [parserOptions.svelteFeatures](#parseroptionssveltefeatures) for more details.
333336

334337
When using this mode in an ESLint configuration, it is recommended to set it per file pattern as below.
335338

@@ -383,15 +386,13 @@ For example in `.eslintrc.*`:
383386
"parser": "svelte-eslint-parser",
384387
"parserOptions": {
385388
"parser": "...",
386-
"svelteFeatures": { "runes": true },
387389
/* ... */
388390
},
389391
},
390392
{
391393
"files": ["*.svelte.js"],
392394
"parser": "svelte-eslint-parser",
393395
"parserOptions": {
394-
"svelteFeatures": { "runes": true },
395396
/* ... */
396397
},
397398
},
@@ -400,7 +401,6 @@ For example in `.eslintrc.*`:
400401
"parser": "svelte-eslint-parser",
401402
"parserOptions": {
402403
"parser": "...(ts parser)...",
403-
"svelteFeatures": { "runes": true },
404404
/* ... */
405405
},
406406
},

Diff for: src/parser/svelte-parse-context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function isEnableRunes(
2828
} else if (svelteConfig?.compilerOptions?.runes != null) {
2929
return Boolean(svelteConfig.compilerOptions.runes);
3030
}
31-
return false;
31+
return true;
3232
}
3333

3434
export function resolveSvelteParseContextForSvelte(

0 commit comments

Comments
 (0)