Skip to content

Commit 9fd0884

Browse files
committed
wip
1 parent 8d75802 commit 9fd0884

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

README.md

Lines changed: 6 additions & 7 deletions
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 only Svelte 5. The default value is `true`.
290+
// If `false`, ESLint will not recognize rune symbols.
291+
// If not configured, it will try to read `compilerOptions.runes` from `svelte.config.js`.
292+
// However, note that if `parserOptions.svelteConfig` is not specified and the file cannot be parsed by static analysis, it will behave as `true` if Svelte version is 5. Otherwise `false`.
292293
runes: false,
293294
/* -- Experimental Svelte Features -- */
294295
/* It may be changed or removed in minor versions without notice. */
@@ -329,7 +330,8 @@ For example in `.eslintrc.*`:
329330

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

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.
333+
If you install Svelte v5 the parser will be able to parse runes, and will also be able to parse `*.js` and `*.ts` files.
334+
If you don't want to use Runes, you may need to configure. Please read [parserOptions.svelteFeatures](#parseroptionssveltefeatures) for more details.
333335

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

@@ -383,15 +385,13 @@ For example in `.eslintrc.*`:
383385
"parser": "svelte-eslint-parser",
384386
"parserOptions": {
385387
"parser": "...",
386-
"svelteFeatures": { "runes": true },
387388
/* ... */
388389
},
389390
},
390391
{
391392
"files": ["*.svelte.js"],
392393
"parser": "svelte-eslint-parser",
393394
"parserOptions": {
394-
"svelteFeatures": { "runes": true },
395395
/* ... */
396396
},
397397
},
@@ -400,7 +400,6 @@ For example in `.eslintrc.*`:
400400
"parser": "svelte-eslint-parser",
401401
"parserOptions": {
402402
"parser": "...(ts parser)...",
403-
"svelteFeatures": { "runes": true },
404403
/* ... */
405404
},
406405
},

src/parser/svelte-parse-context.ts

Lines changed: 1 addition & 1 deletion
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)