You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
when using vue-eslint-parser + custom parser (with typescript here) in the context of yarn v2 we get the following error:
Parsing error: A package is trying to access another package without the second one being listed as a dependency of the first one
Required package: @typescript-eslint/parser (via "@typescript-eslint/parser")
Required by: vue-eslint-parser
Yarn v2 is now enforcing require to be strict (no extraneous deps). In this case, I think the solution could be to make the parserOptions.parser to be the parser itself instead of a string. This way we can actually outsource the require call in the userland (here eslint-config-typescript: https://github.com/vuejs/eslint-config-typescript/blob/master/index.js#L8). It is up to the consuming library then to define its own dependencies.
This is an open discussion, I'm no expert here, but I'll be willing to PR if we agree on a solution.
yes, I get that, what I mean is: there is probably a solution of passing this custom parser in such way that it is compatible with yarn by supporting to directly forward the parser and not just a string
That parserOptions.parser field is compatible with the top-level parser field, so it's a string. I guess that you can use require.resolve("@typescript-eslint/parser") to give an absolute path for the parser.
Hello,
when using vue-eslint-parser + custom parser (with typescript here) in the context of yarn v2 we get the following error:
This comes from:
https://github.com/mysticatea/vue-eslint-parser/blob/ea156df3872da715d580ea1c9c67a2c6e340b9ee/src/script/index.ts#L570
Yarn v2 is now enforcing require to be strict (no extraneous deps). In this case, I think the solution could be to make the
parserOptions.parser
to be the parser itself instead of a string. This way we can actually outsource the require call in the userland (here eslint-config-typescript: https://github.com/vuejs/eslint-config-typescript/blob/master/index.js#L8). It is up to the consuming library then to define its own dependencies.This is an open discussion, I'm no expert here, but I'll be willing to PR if we agree on a solution.
ref: vuejs/vue-cli#5135
The text was updated successfully, but these errors were encountered: