From 04804ee9f5ff0076ddbf2183dd7e5c08097b7f21 Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Tue, 28 Mar 2023 19:44:55 +1100 Subject: [PATCH] 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 --- README.md | 11 +++++++++++ docs/user-guide.md | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/README.md b/README.md index 0e9843df2..ac94a1a7f 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,17 @@ module.exports = { See also . +::: warning ❗ Attention + +The TypeScript parser uses a singleton internally and it will only use the +options given to it when it was first initialized. If trying to change the +options for a different file or override, the parser will simply ignore the new +options (which may result in an error). See +[typescript-eslint/typescript-eslint#6778](https://github.com/typescript-eslint/typescript-eslint/issues/6778) +for some context. + +::: + #### settings.svelte You can change the behavior of this plugin with some settings. diff --git a/docs/user-guide.md b/docs/user-guide.md index 3f83cb32e..36c3215af 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -137,6 +137,17 @@ module.exports = { See also . +::: warning ❗ Attention + +The TypeScript parser uses a singleton internally and it will only use the +options given to it when it was first initialized. If trying to change the +options for a different file or override, the parser will simply ignore the new +options (which may result in an error). See +[typescript-eslint/typescript-eslint#6778](https://github.com/typescript-eslint/typescript-eslint/issues/6778) +for some context. + +::: + #### settings.svelte You can change the behavior of this plugin with some settings.