dangreenisrael / eslint-plugin-jest-formatting

ESLint rules for formatting test suites written for jest.
MIT License
156 stars 13 forks source link

[BUG] Property "overrides" is the wrong type #78

Closed moltar closed 4 years ago

moltar commented 4 years ago

Describe the bug

After upgrading to 1.1.1, getting the following error:

Error: ESLint configuration in .eslintrc.js » plugin:jest-formatting/strict is invalid:
    - Property "overrides" is the wrong type (expected array but got `{"files":["**/*.test.*","**/*_test.*","**/*Test.*","**/*.spec.*","**/*_spec.*","**/*Spec.*","**/__tests__/*"],"rules":{"jest-formatting/padding-around-all":2}}`).

To Reproduce

Use 1.1.1 packaged as described in the docs.

Expected behavior

No errors.

Screenshots

N/A

Desktop (please complete the following information):

macOS

Additional context

N/A

benkimpel commented 4 years ago

Hey @moltar. Thanks for reporting this!

Could you let me know which version of ESLint you're on? I'm guessing from the error that you may be on ESLint 6.

If my guess is correct and if you need/want to get things working as soon as possible you could try running on ESLint 5.16.0 OR if that's not possible you could manually do the configuration that the configs are providing.

In ESLint 6 it looks like the overrides must be an array so for the real fix we'll need to address that in our configs here and here by wrapping those in arrays.

PRs are welcome!

moltar commented 4 years ago
❯ eslint -v
v6.6.0

PRs are welcome!

So you are ok to migrating the config to ESLint 6? I guess it'd make it incompatible with 5 then?

benkimpel commented 4 years ago

I think ESLint 5 can support both array and object versions of overrides, so I believe it's backwards compatible if we were to just switch to arrays. I'm not 100% sure, though. Lemme check release notes on ESLint.

benkimpel commented 4 years ago

Yeah, looks like we can just switch those over to arrays and be fine on ESLint 5, too. Not a problem if you're not looking to do a PR, btw. I'll be available to make the change this evening, but can't do so at the moment.

moltar commented 4 years ago

Thanks, Ben!

benkimpel commented 4 years ago

No problem. We'll still need to get a release out there. I think @dangreenisrael will bump package.json and tag this release in git.

dangreenisrael commented 4 years ago

@moltar @benkimpel The release is out

benkimpel commented 4 years ago

Thanks, @dangreenisrael

benkimpel commented 4 years ago

Checking back in... @moltar did this release (1.2.0) work out for you? How about for you @HosseinAgha and @Dreebo?

KonstantinSavik commented 4 years ago

@benkimpel Thanks! Now everything is working

benkimpel commented 4 years ago

@Dreebo Thanks for checking back in! Glad to hear it's working.