Skip to content

getASTFromProject reports error when linting new files using a long running instance of eslint #959

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

Closed
raix opened this issue Sep 7, 2019 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists package: parser Issues related to @typescript-eslint/parser

Comments

@raix
Copy link

raix commented Sep 7, 2019

What code were you trying to parse?

The file is empty and just created in vs code - the eslint extension is working on a newly created file.

// ... in vscode-eslint/server/src/eslintServer.ts
let report: ESLintReport = cli.executeOnText(content, file);
// ...

What did you expect to happen?
There should be no errors (like if setting the parser option "createDefaultProgram": true)

What actually happened?
The VSCode extension returns:

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: /Users/raix/dev/test-eslint/src/test8.tsx.
The file must be included in at least one of the projects provided.eslint

(Running eslint from the terminal works as expected - it might be a caching issue)

Versions

package version
@typescript-eslint/parser 2.1.0
TypeScript 3.5.3
ESLint 6.3.0
node 10.16.3
npm 6.9.0
yarn 1.7.3
.eslintrc.json

```json { "parser": "@typescript-eslint/parser", "plugins": [ "react", "@typescript-eslint" ], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking" ], "parserOptions": { "project": "tsconfig.json", "ecmaFeatures": { "jsx": true }, "ecmaVersion": 2018, "sourceType": "module" }, "env": { "browser": true, "es6": true }, "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" }, "rules": { "indent": [ "error", "tab" ], "linebreak-style": [ "error", "unix" ], "quotes": [ "error", "double" ], "semi": [ "error", "always" ] } } ```

tsconfig.json

```json { "compilerOptions": { "target": "es5", "module": "esnext", "jsx": "preserve", "outDir": "./dist", "strict": true, "esModuleInterop": true, "allowJs": true, "lib": [ "dom", "dom.iterable", "esnext" ], "skipLibCheck": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true }, "include": [ "src" ] } ```

References:

Possible related to:

If needed I can investigate further and make a pull request solving the issue - but I would like to get a direction on where to best solve the issue.

@raix raix added package: parser Issues related to @typescript-eslint/parser triage Waiting for team members to take a look labels Sep 7, 2019
@bradzacher bradzacher added duplicate This issue or pull request already exists bug Something isn't working and removed triage Waiting for team members to take a look labels Sep 7, 2019
@bradzacher
Copy link
Member

Thanks for the report! This is a duplicate of #864.
It's on our radar to look into this.

We currently don't recalculate the program when we encounter a new file. This is on purpose, but the problem is that we don't have handling for encountering new files that should be included within the project.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working duplicate This issue or pull request already exists package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

No branches or pull requests

2 participants