Replies: 1 comment
-
TLDR is essentially: Don't use That in turn can cause:
Other defaults that can cause issues:
Worth noting:
Options that the default doesn't set and which you should set:
For more suggestions, see my base config, which also links to other base configs: https://github.com/voxpelli/tsconfig My base config is set up purely for a types in JS workflow (backed up by occasional manual |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The only documentation of what additional rules
jsconfig.json
sets that I can find are the one in the VSCode docs, and it says (emphasis mine):But, turns out that it hasn't been true for 7.5 years. Here's a list of all additions on top of
allowJs: true
that has happened:maxNodeModuleJsDepth
was changed to0
as default for TS as a whole, it was kept as2
forjsconfig.json
(without updating the docs it seems) microsoft/TypeScript@c0309fa / Fix crash when checking module exports for export= microsoft/TypeScript#10538allowSyntheticDefaultImports: true
was added in microsoft/TypeScript@12578a5 / set allowSyntheticDefaultImports to true by default for jsconfig.json microsoft/TypeScript#11070skipLibCheck: true
was added in microsoft/TypeScript@460de66 / Turn on skipLibCheck for js-only inferred project and external project microsoft/TypeScript#11399noEmit: true
was added in microsoft/TypeScript@4af47f1 / Set noEmit = true on jsconfig.json file microsoft/TypeScript#21505And that's where we remain today with
jsconfig.json
implying:It seems that the VSCode docs are long overdue for an update: https://github.com/microsoft/vscode-docs/blame/91835d57149c4352073c22300487a18baeefe13c/docs/languages/jsconfig.md#L18 (Which I will do following this post)
And likewise the documentation of
maxNodeModuleJsDepth
also needs to be updated:0 is not the default for
jsconfig.json
files, it defaults to 2.And since
maxNodeModuleJsDepth
is only usable whenallowJs
istrue
it is quite likely that someone looking at that rule is also thinking aboutjsconfig.json
.Based on a realization in eslint/eslint#18100 (comment), initially posted as a comment in #2 (reply in thread)
Beta Was this translation helpful? Give feedback.
All reactions