eslint-plugin-import icon indicating copy to clipboard operation
eslint-plugin-import copied to clipboard

`import/no-extraneous-dependencies` more compatible when user pass not exist paths

Open Edge00 opened this issue 5 years ago • 2 comments

Scenario:

'import/no-extraneous-dependencies': [
  'error',
  {
    packageDir: [
      __dirname,
      'node_modules/module-exist',
      'node_modules/module-not-exist',
    ],
  },
]

If there is a module module-not-exist that's not installed in node_modules. Even if module-exist did add some dependencies. The lint won't apply dependencies in module-exist.

I think this rule can be more compatible. If packageContent have add some dependencies. These dependencies should be applied.

Like our team is maintaining a shared .eslintrc file and some dependencies is not required in particular projects. We hope that users don't need to change the .eslintrc file when they add a new dependency.

Edge00 avatar Dec 03 '20 03:12 Edge00

I'm not sure what you're asking. What do you expect to happen, and what's happening now?

ljharb avatar Dec 08 '20 07:12 ljharb

@ljharb You can view this PR https://github.com/benmosher/eslint-plugin-import/pull/1954

Edge00 avatar Dec 11 '20 05:12 Edge00