-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[typescript] continue to use the default config in development #21966
[typescript] continue to use the default config in development #21966
Conversation
In elastic#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 elastic#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.
@@ -5,7 +5,10 @@ | |||
"module": "esnext", | |||
}, | |||
"include": [ | |||
"src/**/public/**/*" | |||
// in the build we populate this to include **/public/**/* but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the config loader okay with comments in json? i don't think this will lint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, typescript config can have comments, checkout tsconfig.json
. It has a bunch of them and always has.
await write(browserProject.tsConfigPath, JSON.stringify({ | ||
...browserProject.config, | ||
include: [ | ||
...browserProject.config.exclude, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include config.exclude?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, copy paste fumble
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested both browser and server code in VS Code, LGTM. I'll let CI handle the build testing.
retest |
💚 Build Succeeded |
…ic#21966) * [typescript] continue to use the default config in development In elastic#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 elastic#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
💔 Build Failed |
… (#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
6.x/6.5: ad3e193 |
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.