Wrong configuration is being used
Somehow, I'm seeing some configuration options applied during testing that shouldn't be applied.
I have a bunch of tests failing due to the comma-dangle rule being applied.
not ok 8 PhantomJS 2.1 - ESLint - acceptance/_checkout-test.js should pass ESLint
---
message: >
acceptance/_checkout-test.js should pass ESLint.
162:34 - Unexpected trailing comma. (comma-dangle)
230:36 - Unexpected trailing comma. (comma-dangle)
Log: |
...
However, as far as I can tell from the command line, that rule is "off".
$ eslint --print-config app | grep comma
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": "off",
$ eslint --print-config tests | grep comma
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": "off",
If I run eslint from the command line none of the files fail, nor to they fail from ESLint being run through my editor. That property must be turned on from somewhere, but I just can't tell where.
eslint:recommended includes that rule, which is used by the default config in this project. maybe your local eslint isn't picking up that config?
Yeah, maybe that's what it is. I wonder if eslint outside of Broccoli has issues with the relative path to the configuration that comes with ember-cli-eslint?
FWIW, this seems to still be an issue. I even went so far as to copy/paste the same config in to both the test and app config files and I still see discrepancies between the two.
eslint --print-config app and eslint --print-config tests even return the exact same results :(
Weird, I figured it was something going wrong on my machine. That seems to happy a lot since I often have packages npm linked which causes all kinds of problems.
Having the issue too
@cafreeman @bartocc do you both have
require.resolve('ember-cli-eslint/coding-standard/ember-application')
in your config to load the default settings? Or a relative path to the configuration in the node_modules directory?
@alexlafroscia , yes, I have this line.
2 days ago, I had to add 'comma-dangle': 0 to my rules to make my files ESLint compliant.
I just tried to remove 'comma-dangle': 0 and now no more errors ...
I'll update this conversation if the error comes back
actually, I still get the error, but only when running tests on /tests. eslint /path/to/my/file.js does not complain
Clearly this is still an issue so I'm going to open this again. It might be an upstream problem in broccoli-lint-eslint though, since ember-cli-eslint really just wraps that package.