Open ThaNarie opened 4 years ago
shouldn't noUnusedParameters
be true for it to complain about unused code?
noImplicitAny
is true if strict
is true. But how about we start from a tsconfig that lists every option and we explicitly set everything ourselves to make it obvious rather than relying on TS defaults and flags that affect other flags?
~related (maybe?), and for VSCode~
~https://code.visualstudio.com/docs/languages/jsconfig~
not needed if theres a tsconfig
https://code.visualstudio.com/docs/nodejs/working-with-javascript#_migrating-to-typescript
To align between all our skeletons, easily setup up other projects, and to align with our other standards, it would be good to define a "default" tscofig.json.
I think we can use use an existing one (from muban or vue-skeleton), and tweak it a bit.
Feel free to add to this list of "musts" or "discussion points":
"strict": true
- Already our default"importsNotUsedAsValues": "error"
- Forces explicit type imports, added in TS 3.8;import type { Foo } from './foo-types';
- This also prevents errors on theno-cycle
, which don't apply to types (or not in normal use cases anyway)."forceConsistentCasingInFileNames": true,
- to align with our eslint rule"noImplicitAny": true,
- If a type is inferred as any, you have to explicitly type it - note that in our lint rules, we also don't allow the use of explicit any."noUnusedLocals": true
- Don't leave unused code"noUnusedParameters": true
- Don't leave unused code