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

Move @typescript-eslint/types from devDependencies → dependencies #45

Open
acusti opened this issue Feb 4, 2025 · 0 comments
Open

Comments

@acusti
Copy link

acusti commented Feb 4, 2025

some of the rules import directly from @typescript-eslint/types, but the dependency is listed under devDependencies in the package.json. this means that running eslint with this plugin and any of those rules enabled (no-re-export, sort-react-dependencies, no-reassign-imports, no-restricted-imports) when using Yarn PnP causes the following error:

Error: eslint-plugin-canonical tried to access @typescript-eslint/types, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

moving the dependency in package.json from devDependenciesdependencies will fix the issue.

note that i worked around it by adding the following to my .yarnrc.yml:

packageExtensions:
    'eslint-plugin-canonical@*':
        dependencies:
            '@typescript-eslint/types': '*'
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