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

Unable to use components without installing dependencies for unused components #47

Closed
jwilliamson-acquia opened this issue Dec 3, 2024 · 0 comments · Fixed by #48
Closed

Comments

@jwilliamson-acquia
Copy link
Contributor

Problem: When using eslint-config-widen on an SDK project, I would like to use only the components (and install dependencies) that are relevant to the project. Currently, if I attempt to use only the base, jest, and typescript components without installing the front-end dependencies, ESLint will give this error:

Oops! Something went wrong! :(

ESLint: 9.15.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-jsx-a11y' imported from /Users/jacob.williamson/Documents/acquia-dam-api-sdk/node_modules/eslint-config-widen/lib/react.js
    at packageResolve (node:internal/modules/esm/resolve:841:9)
    at moduleResolve (node:internal/modules/esm/resolve:914:18)
    at defaultResolve (node:internal/modules/esm/resolve:1119:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:511:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

This error is reproduced for all peer dependencies listed as 'optional'

For reference, my eslint.config.js is:

import { base, jest, typescript } from 'eslint-config-widen'

const config = [
  ...base,
  ...typescript,
  ...[{ ignores: ['dist/**/*', 'doc/**/*'] }, ...jest],
]

export default config
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

Successfully merging a pull request may close this issue.

1 participant