fix(create-vite): strict checks on vite.config.ts #14270
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
After creating a project using create-vite with React and TypeScript, and adding
plugin:@typescript-eslint/strict-type-checked
according to README.md, rule@typescript-eslint/no-unnecessary-condition
throws an error on vite.config.ts when running lint.Here is a small project to reproduce this error: nekketsuuu/vite-config-js-strict@380208d.
That error is because TS strict mode is not enabled at tsconfig.node.json. So, this patch enables the same linting config at tsconfig.node.json as that of https://github.com/vitejs/vite/blob/cd6bf29ca4b677ff0d6e2bf36416a65b1a6ffa21/packages/create-vite/template-react-ts/tsconfig.json.
Also see: 4ffaeee #12604
Follow-up: 2ad78aa #13749
Additional context
Nothing.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).