kibana/tsconfig.json
Spencer ad3e193a8a
[typescript] continue to use the default config in development (#21966) (#21973)
* [typescript] continue to use the default config in development

In #21865 we tried to make a separate config file that would be used for
browser TS files by excluding them from the default config file and
adding a second that included them. This works fine in the build, but
IDE integrations rely on being able to automatically discover a
`tsconfig.json` file in a parent directory of the file being edited,
which doesn't work when the tsconfig.json file is found, but excludes
the file being edited. In this situation IDE integrations silently
fallback to the default TSConfig settings, which don't show the types of
compiler errors that will become issues in CI, like implicit any
warnings.

This implements the original strategy we tried in #21865 of mutating the
tsconfig.json file before we run the tsc in the build so that the config
files select the right files at build time.

* [tslint] remove browser config from default projects list since it is empty

* [build/ts] fix typo
2018-08-15 16:22:35 -07:00

59 lines
2 KiB
JSON

{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"ui/*": ["src/ui/public/*"]
},
// Support .tsx files and transform JSX into calls to React.createElement
"jsx": "react",
// Enables all strict type checking options.
"strict": true,
// enables "core language features"
"lib": [
// ESNext auto includes previous versions all the way back to es5
"esnext",
// includes support for browser APIs
"dom"
],
// Node 8 should support everything output by esnext, we override this
// in webpack with loader-level compiler options
"target": "esnext",
// Use commonjs for node, overridden in webpack to keep import statements
// to maintain support for things like `await import()`
"module": "commonjs",
// Allows default imports from modules with no default export. This does not affect code emit, just type checking.
// We have to enable this option explicitly since `esModuleInterop` doesn't enable it automatically when ES2015 or
// ESNext module format is used.
"allowSyntheticDefaultImports": true,
// Emits __importStar and __importDefault helpers for runtime babel ecosystem compatibility.
"esModuleInterop": true,
// Resolve modules in the same way as Node.js. Aka make `require` works the
// same in TypeScript as it does in Node.js.
"moduleResolution": "node",
// Disallow inconsistently-cased references to the same file.
"forceConsistentCasingInFileNames": true,
// Disable the breaking keyof behaviour introduced in TS 2.9.2 until EUI is updated to support that too
"keyofStringsOnly": true
},
"include": [
"src/**/*"
],
"exclude": [
"src/**/__fixtures__/**/*",
// In the build we actually exclude **/public/**/* from this config so that
// we can run the TSC on both this and the .browser version of this config
// file, but if we did it during development IDEs would not be able to find
// the tsconfig.json file for public files correctly.
// "src/**/public/**/*"
]
}