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

strange beeslint glob option does not seem to work properly #6256

Closed
qjnz opened this issue May 25, 2016 · 4 comments
Closed

strange beeslint glob option does not seem to work properly #6256

qjnz opened this issue May 25, 2016 · 4 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon

Comments

@qjnz
Copy link

qjnz commented May 25, 2016

What version of ESLint are you using?
2.2.0

What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint

Please show your full configuration:

{
  "parser": "babel-eslint",
  "env": {
    "browser": true,
    "es6": true,
    "node": true,
    "amd": true
  },
  "globals": {
    "angular": false,
    "system": false
  },
  "ecmaFeatures": {
    "modules": true,
    "classes": true,
    "blockBindings": true
  },
  "plugins": ["chai-expect"],
  "rules": {
    "arrow-parens": [2, "as-needed"],
    "block-spacing": [2, "always"],
    "curly": [2, "all"],
    "eqeqeq": [2, "smart"],
    "no-eval": 2,
    "no-extend-native": 2,
    "no-extra-bind": 2,
    "no-implied-eval": 2,
    "no-iterator": 2,
    "no-multi-spaces": 2,
    "no-multi-str": 2,
    "no-redeclare": 2,
    "no-sequences": 2,
    "no-with": 2,
    "radix": 2,
    "strict": 0,
    "no-delete-var": 2,
    "no-shadow-restricted-names": 2,
    "no-trailing-spaces": 2,
    "no-undef": 0,
    "no-unused-vars": 1,
    "no-use-before-define": [2, "nofunc"],
    "indent": 0,
    "brace-style": [2, "1tbs", { "allowSingleLine": true } ],
    "camelcase": 2,
    "comma-spacing": [2, { "before": false, "after": true } ],
    "eol-last": 1,
    "func-style": 0,
    "key-spacing": [2, { "beforeColon": false, "afterColon": true } ],
    "new-cap": [2, { "newIsCap": true, "capIsNew": false } ],
    "no-mixed-spaces-and-tabs": [2, "smart-tabs"],
    "no-nested-ternary": 2,
    "no-new-object": 2,
    "no-spaced-func": 0,
    "no-underscore-dangle": 0,
    "object-curly-spacing": [2, "always"],
    "quotes": [2, "single", "avoid-escape"],
    "semi": [2, "always"],
    "space-before-function-paren": [2, "always"],
    "keyword-spacing": 2,
    "space-before-blocks": [2, "always"],
    "space-in-parens": [2, "never"],
    "space-infix-ops": 2,
    "space-unary-ops": [1, { "words": true, "nonwords": false } ],
    "no-var": 1,
    "generator-star-spacing": [2, "before"],
    "chai-expect/missing-assertion": 2,
    "chai-expect/terminating-properties": 1,
    "chai-expect/no-inner-compare": 1
  }
}

What did you do? Please include the actual source code causing the issue.
Run eslint test/e2e/**/* which should by default lint all .js files but the output shows me that it lints other non-js files such as .json files and .sh files too.

If I run eslint test/e2e/**/*.js, the output does not contain all files that have linting issues. I compare the output with gulp-eslint result that use the same eslint config file above.

What did you expect to happen?
eslint test/e2e/**/* should lint all .js files in all folders under test/e2e.
eslint test/e2e/**/*.js should lint all .js files in all folders under test/e2e.

What actually happened? Please include the actual, raw output from ESLint.
eslint test/e2e/**/* lints other non-js files, such as json files and .sh files, even html file.
eslint test/e2e/**/*.js only lints certain files in first level under test/e2e/

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label May 25, 2016
@qjnz
Copy link
Author

qjnz commented May 26, 2016

I used bash and iTerm2 on OS X 10.10.5, both produced the same results above.

@IanVS
Copy link
Member

IanVS commented May 26, 2016

eslint test/e2e/*/ should lint all .js files in all folders under test/e2e.

This is not correct. As the docs mention, if you pass a glob, the glob is respected verbatim. Meaning, we do not change the glob to only look at .js files. Some shells expand the glob for you, and ESLint receives a list of all files matching the glob, so that is the same as explicitly passing them to ESLint.

If you pass a directory, that is when we limit linting to .js or whatever you specify by --ext.

Could you try echo test/e2e/**/*.js, and see what is returned by your terminal?

@qjnz
Copy link
Author

qjnz commented May 26, 2016

Thanks @IanVS, it is not eslint issue, it is bash issue that does not handle the glob like I would expect. zsh output all files in all sub dir properly.

As your suggestion, using eslint "test/e2e/**/*.js" with double quotes works perfectly now in bash.

@IanVS
Copy link
Member

IanVS commented May 26, 2016

Great, glad it works for you.

@IanVS IanVS closed this as completed May 26, 2016
ilyavolodin added a commit that referenced this issue Nov 28, 2016
ilyavolodin added a commit that referenced this issue Dec 9, 2016
* New: Additional APIs (fixes #6256)

* Fix unit test
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

3 participants