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

Linting files outside tsconfig rootDir #37

Open
bno1 opened this issue Jun 25, 2020 · 0 comments
Open

Linting files outside tsconfig rootDir #37

bno1 opened this issue Jun 25, 2020 · 0 comments

Comments

@bno1
Copy link

bno1 commented Jun 25, 2020

I have rootDir: src/ in tsconfig.json and test files in a separate directory named spec/. Everything works as expected when editing files in src/, but I don't get lint messages from typescript-eslint-language-service when editing files in spec/. I do get typescript errors though. eslint src/ spec/ --ext '.ts' works fine.

Project directory structure:

$ tree
.
├── .eslintignore
├── .eslintrc.js
├── .git
├── .gitignore
├── jakefile.js
├── lib
│   ├── <build outputs>
├── node_modules
├── package.json
├── .prettierrc.js
├── spec
│   ├── <tests>
├── src
│   ├── <sources>
├── tsconfig.json

tsconfig.json

{
  "include": [
    "src/**/*"
  ],
  "compilerOptions": {
    "declaration": true,
    "declarationMap": true,
    "outDir": "lib/",
    "rootDir": "src/",
    "composite": true,
    "plugins": [
      {
        "name": "typescript-eslint-language-service"
      }
    ]
  }
}

.eslintrc

module.exports = {
  root: true,
  parser: '@typescript-eslint/parser',
  plugins: [
    '@typescript-eslint',
  ],
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/eslint-recommended',
    'plugin:@typescript-eslint/recommended',
    'prettier/@typescript-eslint',
    'plugin:prettier/recommended',
  ],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant