-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
parserOptions.project
doesnt handle project references well
#856
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
Comments
Hmm, I'm not sure what the typescript compiler actually does to handle project references. I haven't actually used them yet (I've been meaning to migrate this monorepo to them, but I keep forgetting). Perhaps @uniqueiniquity has more of an idea than I do. @milesj - could you please try using the array form of {
"parserOptions": {
"project": [
"tsconfig.json",
"packages/config-danger/tsconfig.json"
]
}
} |
I can confirm that the array of projects work but it's really making its hard to maintain: project: [
path.resolve(__dirname, "./tsconfig.json"),
path.resolve(__dirname, "./packages/core/tsconfig.json"),
path.resolve(__dirname, "./packages/core/tests/tsconfig.json"),
path.resolve(__dirname, "./packages/class-validator/tsconfig.json"),
path.resolve(__dirname, "./packages/class-validator/tests/tsconfig.json"),
], I suffer from this issue since v2.0 and its breaking change:
|
They are consumed by a different mechanism - in particular, the goal of project references is that when project |
@19majkel94 - there is #806 which will make this easier by allowing you to supply a glob matcher for tsconfig files.
Interesting. That's good to know, thanks. We should probably document this clearly so people don't assume they only need to provide one of the tsconfigs in the project. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Can confirm using an array of const pkg = getPackage();
const project = [fromRoot('tsconfig.json')];
if (pkg.workspaces) {
project.push(
...glob.sync(pkg.workspaces.map(ws => path.join(ws, 'tsconfig.json')), {
absolute: true,
onlyFiles: true,
}),
);
} |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
FYI #806 (glob selectors for |
👏 |
I'm having the same issue. I have
Then I get the error:
I guess this is false and the pattern for some reason isn't matching (while in TS it does). |
Please follow the steps in #890. Locking this issue to direct all further conversation to that issue |
What code were you trying to parse?
Not parsing code exactly, but I'm attempting to upgrade to v2, which hard fails if
project
doesn't include files correctly. This doesn't seem to handle project references correctly.Given this root
tsconfig.json
:And this
config-danger/tsconfig.json
:What did you expect to happen?
Files within a project reference
include
worked correctly.What actually happened?
The parser/plugin fails with a ton of the following errors:
Versions
@typescript-eslint/parser
2.0.0
TypeScript
3.5.2
ESLint
6.1.0
node
12.8.0
npm
6.1.0.3
The text was updated successfully, but these errors were encountered: