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

Got Configuration for rule "array-element-newline" is invalid error #49

Closed
LitoMore opened this issue Aug 4, 2018 · 3 comments
Closed

Comments

@LitoMore
Copy link

LitoMore commented Aug 4, 2018

Preview

After upgrade eslint-config-xo from 0.22.2 to 0.23.0, I get this error:

> xo
Error: /home/travis/build/fanfoujs/fandou/node_modules/eslint-config-xo/index.js:
	Configuration for rule "array-element-newline" is invalid:
	Value "consistent" should be equal to one of the allowed values.
	Value "consistent" should be object.
	Value "consistent" should match exactly one schema in oneOf.
Referenced from: /home/travis/build/fanfoujs/fandou/node_modules/eslint-config-xo/esnext.js
Referenced from: 
    at validateRuleOptions (/home/travis/build/fanfoujs/fandou/node_modules/eslint/lib/config/config-validator.js:119:19)
    at Object.keys.forEach.id (/home/travis/build/fanfoujs/fandou/node_modules/eslint/lib/config/config-validator.js:162:9)
    at Array.forEach (<anonymous>)
    at validateRules (/home/travis/build/fanfoujs/fandou/node_modules/eslint/lib/config/config-validator.js:161:30)
    at Object.validate (/home/travis/build/fanfoujs/fandou/node_modules/eslint/lib/config/config-validator.js:239:5)
    at loadFromDisk (/home/travis/build/fanfoujs/fandou/node_modules/eslint/lib/config/config-file.js:516:19)
    at load (/home/travis/build/fanfoujs/fandou/node_modules/eslint/lib/config/config-file.js:559:20)
    at configExtends.reduceRight (/home/travis/build/fanfoujs/fandou/node_modules/eslint/lib/config/config-file.js:425:36)
    at Array.reduceRight (<anonymous>)
    at applyExtends (/home/travis/build/fanfoujs/fandou/node_modules/eslint/lib/config/config-file.js:403:26)
npm ERR! Test failed.  See above for more details.

You may check the CI logs here: https://travis-ci.org/fanfoujs/fandou/jobs/412029424.

How to reproduce

$ git clone git@github.com:fanfoujs/fandou.git -b greenkeeper/eslint-config-xo-0.23.0
$ cd fandou
$ npm i
$ npm test

I'm curious that why I got this error. I reviewed the commit history of eslint-config-xo, but there is no notable changes.

@sindresorhus
Copy link
Member

Make sure you're using the latest ESLint version.

@LitoMore
Copy link
Author

LitoMore commented Aug 4, 2018

@sindresorhus It deleted the node_modules and reinstalled, I got the this error stack:

❯ npm test

> fandou@0.1.0 test /Users/jiong.huang/Git/fandou
> xo

Error: /Users/jiong.huang/Git/fandou/node_modules/eslint-config-xo/index.js:
	Configuration for rule "array-element-newline" is invalid:
	Value "consistent" should be equal to one of the allowed values.
	Value "consistent" should be object.
	Value "consistent" should match exactly one schema in oneOf.

Referenced from: /Users/jiong.huang/Git/fandou/node_modules/eslint-config-xo/esnext.js
Referenced from:
    at validateRuleOptions (/Users/jiong.huang/Git/fandou/node_modules/xo/node_modules/eslint/lib/config/config-validator.js:119:19)
    at Object.keys.forEach.id (/Users/jiong.huang/Git/fandou/node_modules/xo/node_modules/eslint/lib/config/config-validator.js:162:9)
    at Array.forEach (<anonymous>)
    at validateRules (/Users/jiong.huang/Git/fandou/node_modules/xo/node_modules/eslint/lib/config/config-validator.js:161:30)
    at Object.validate (/Users/jiong.huang/Git/fandou/node_modules/xo/node_modules/eslint/lib/config/config-validator.js:239:5)
    at loadFromDisk (/Users/jiong.huang/Git/fandou/node_modules/xo/node_modules/eslint/lib/config/config-file.js:516:19)
    at load (/Users/jiong.huang/Git/fandou/node_modules/xo/node_modules/eslint/lib/config/config-file.js:559:20)
    at configExtends.reduceRight (/Users/jiong.huang/Git/fandou/node_modules/xo/node_modules/eslint/lib/config/config-file.js:425:36)
    at Array.reduceRight (<anonymous>)
    at applyExtends (/Users/jiong.huang/Git/fandou/node_modules/xo/node_modules/eslint/lib/config/config-file.js:403:26)
npm ERR! Test failed.  See above for more details.

It seems the eslint-config-xo is using the eslint from the xo. But the eslint version in xo is 4.19.1.

@LitoMore
Copy link
Author

LitoMore commented Sep 3, 2018

Seems it fixed in eslint-config-xo@0.24.1.

Closing.

@LitoMore LitoMore closed this as completed Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants