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

Glob in "import/no-extraneous-dependencies" doesn't work as expected #866

Closed
olalonde opened this issue Jun 7, 2017 · 4 comments
Closed

Comments

@olalonde
Copy link

olalonde commented Jun 7, 2017

eslint v3.19.0

My eslintrc looks like:

{
  "extends": "binded",
  "rules": {
    "import/no-extraneous-dependencies": [
      "error", {"devDependencies": ["test/*"]}
    ]
  }
}

This doesn't work as expected (still getting error 'knex' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies in test/index.js). I tried various globs with no success: test/*.js, ./test/*, ./test/**/*, etc.

The only thing that seems to work is:

{
  "extends": "binded",
  "rules": {
    "import/no-extraneous-dependencies": [
      "error", {"devDependencies": true}
    ]
  }
}
@ljharb
Copy link
Member

ljharb commented Jun 7, 2017

Are you getting this on the command line or in an editor? Are you running the command in the project root?

@olalonde
Copy link
Author

olalonde commented Jun 8, 2017

I tested in command line from root project and editor (vim plugin).

@ljharb
Copy link
Member

ljharb commented Jun 8, 2017

I know these settings work: https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/imports.js#L71-L86

Try adding "root": true to your eslint config in the project root, just in case?

@olalonde
Copy link
Author

olalonde commented Jun 8, 2017

"root": true didn't help. I did however upgrade the version of eslint-config-airbnb-base which I was extending and it did seem to fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants