Skip to content
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

chore: add eslint-import-resolver-typescript #10895

Merged
merged 1 commit into from
Sep 15, 2020
Merged

Conversation

ktmud
Copy link
Member

@ktmud ktmud commented Sep 15, 2020

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:

{
  "compilerOptions": {
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "baseUrl": ".",
    "paths": {
      "src/*": [
        "../../superset-frontend-override/src",
        "./src/*",
      ],
    },
  ...

Then TypeScript (including tsc and ts-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 in incubator-superset.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

Let eslint understand tsconfig.json when importing modules, so we
can use `compilerOption.paths` to override where to find ts modules.
@ktmud ktmud requested review from etr2460, kristw and nytai and removed request for etr2460 September 15, 2020 21:52
Copy link
Member

@nytai nytai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@ktmud ktmud merged commit 4eeee4c into apache:master Sep 15, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
Let eslint understand tsconfig.json when importing modules, so we
can use `compilerOption.paths` to override where to find ts modules.
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants