2

how to set up eslint for different eslintrc and tsconfig in typescript I have following structure and test command for compile eslint. Whenever I run tsc, it generated all error from file using path alias under test but from editor (webstorm/vscode) path are correct without error. How can I configure so when I run compilt command it can read different tsconfig.json not just from root/tsconfig.json.

- root
    |_tsconfig.json
    |_.eslintrc.json
    |_test
        |_tsconfig.json
        |_.eslintrc.json
        |_abc



# root/tsconfig.json
{
  "extends": [
    "plugin:@typescript-eslint/recommended",
    "plugin:jest/recommended",
    "@uc/eslint-config-react",
    "prettier",
    "prettier/react",
    "prettier/@typescript-eslint"
  ],
  "plugins": ["react-hooks", "@typescript-eslint"],
  "parser": "@typescript-eslint/parser",
}

# root/test/tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "target": "es6",
    "module": "commonjs",
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "types": ["cypress", "chai"],
    "baseUrl": ".",
    "paths": {
      "@abc/*": ["./abc/*"],
    }
  }
}

jacobcan118
  • 7,797
  • 12
  • 50
  • 95
  • Maybe take a look at this question: https://stackoverflow.com/questions/57044697/how-to-use-different-tsconfig-file-for-test-files-in-vscode – vhbazan Jun 19 '20 at 23:45

0 Answers0