Skip to content

Commit 04804ee

Browse files
committed
docs: warn about the typescript parser being a singleton
The TypeScript parser uses a singleton internally, which means that repeated `parserOptions` will be ignored, using only the first one. This can lead to unexpected behaviour if there are multiple possible configurations. This closes #422. Ref: #422 Signed-off-by: JP-Ellis <[email protected]>
1 parent e8bec77 commit 04804ee

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Diff for: README.md

+11
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,17 @@ module.exports = {
184184

185185
See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.
186186

187+
::: warning ❗ Attention
188+
189+
The TypeScript parser uses a singleton internally and it will only use the
190+
options given to it when it was first initialized. If trying to change the
191+
options for a different file or override, the parser will simply ignore the new
192+
options (which may result in an error). See
193+
[typescript-eslint/typescript-eslint#6778](https://github.com/typescript-eslint/typescript-eslint/issues/6778)
194+
for some context.
195+
196+
:::
197+
187198
#### settings.svelte
188199

189200
You can change the behavior of this plugin with some settings.

Diff for: docs/user-guide.md

+11
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ module.exports = {
137137

138138
See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.
139139

140+
::: warning ❗ Attention
141+
142+
The TypeScript parser uses a singleton internally and it will only use the
143+
options given to it when it was first initialized. If trying to change the
144+
options for a different file or override, the parser will simply ignore the new
145+
options (which may result in an error). See
146+
[typescript-eslint/typescript-eslint#6778](https://github.com/typescript-eslint/typescript-eslint/issues/6778)
147+
for some context.
148+
149+
:::
150+
140151
#### settings.svelte
141152

142153
You can change the behavior of this plugin with some settings.

0 commit comments

Comments
 (0)