fix: parserOptions, rules default values for ESLint 6 #76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When trying to use
jest-runner-eslint
on a project being upgraded to ESLint 6 there are the following errors:Setup
I "use ESLint 6" by forcing the version using the following in my
package.json
Cause
ESLint 6 introduces type checks on the config.
See ~ PR: eslint/eslint#11546 || Commit: eslint/eslint@6ae21a4
Two default values set in
normalizeConfig.js
are not compatible.config.parserOptions
is typed as anobject
sonull
is not valid.https://github.com/eslint/eslint/blob/2e202ca2228846e6226aa8dd99c614d572fb86a8/lib/shared/types.js#L22
config.rules
is typed as aRecord
sonull
is not valid.https://github.com/eslint/eslint/blob/2e202ca2228846e6226aa8dd99c614d572fb86a8/lib/shared/types.js#L41
Fix
Change the default values for these two configurations from
null
to{}
innormalizeConfig.js
.Using this change
jest-runner-eslint
+ ESlint 6 runs normally for my project. I also tested with this change but back on ESLint 5 and that continues to work.This is not intended to fully support ESLint 6 but step in the right direction.