chore: add eslint-import-resolver-typescript #10895
Merged
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.
SUMMARY
Add eslint-import-resolver-typescript, let ESLint understand tsconfig.json when importing modules, so we can use
compilerOption.paths
to override TS modules.Also disabled a couple of harmless type warning while testing.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
Update
tsconfig.json
to something like:Then TypeScript (including
tsc
andts-loader
in Webpack) will read your custom source files from../../superset-frontend-override
. This PR makes sure the imports are still valid to ESLint when the files do not exist inincubator-superset
.ADDITIONAL INFORMATION