by austin-cheney · 3y ago · 0 comments
In my tsconfig.json I use
{
"compilerOptions": {
"alwaysStrict": true,
"module": "ES2020",
"moduleResolution": "node",
"outDir": "./js/lib",
"noEmit": true,
"noImplicitAny": true,
"pretty": false,
"strictFunctionTypes": true,
"target": "ES2020",
"types": ["node"],
"typeRoots": ["./node_modules/@types"]
},
"exclude": [
"js",
"lib/terminal/test/storageTest/temp",
"**/node_modules",
"**/.*/"
],
"include": [
"**/*.ts"
]
}
Internally in your apps never never use relative file system paths."alwaysStrict", which adds "use strict", is different than TypeScript "strict" mode, which constrains the language.
Setting "strict" to "true" enables "alwaysStrict", but not the other way around. I'd remove "alwaysStrict" and go with "strict" as it covers more things.