ember-cli-eslint icon indicating copy to clipboard operation
ember-cli-eslint copied to clipboard

Wrong configuration is being used

Open alexlafroscia opened this issue 9 years ago • 9 comments

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.

alexlafroscia avatar Jul 11 '16 21:07 alexlafroscia

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?

Turbo87 avatar Jul 12 '16 09:07 Turbo87

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?

alexlafroscia avatar Jul 12 '16 16:07 alexlafroscia

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 :(

cafreeman avatar Jul 29 '16 22:07 cafreeman

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.

alexlafroscia avatar Jul 29 '16 23:07 alexlafroscia

Having the issue too

bartocc avatar Aug 10 '16 09:08 bartocc

@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 avatar Aug 10 '16 16:08 alexlafroscia

@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

bartocc avatar Aug 12 '16 07:08 bartocc

actually, I still get the error, but only when running tests on /tests. eslint /path/to/my/file.js does not complain

bartocc avatar Aug 12 '16 07:08 bartocc

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.

alexlafroscia avatar Aug 12 '16 18:08 alexlafroscia