Jim
Jim

Reputation: 1141

eslint array-callback-return is invalid value warn is the wrong type

I created a SPA using create-react-app (https://facebook.github.io/react/blog/2016/07/22/create-apps-with-no-configuration.html) without any problem

I then launched ATOM and start editing code, and found that eslint came up with the error:

Configuration for rule "array-callback-return" is invalid: value "warn" is the wrong type

so I opened eslint.js and located this line

'array-callback-return': 'warn'

which also seems correct to me.

is there any other error that I missed to check? or module that I need to update?

update: here's the error log

Error: /Users/Jim/Project/tomorrow/config/eslint.js:
Configuration for rule "array-callback-return" is invalid:
Value "warn" is the wrong type.
Referenced from: /Users/Jim/Project/tomorrow/package.json
at validateRuleOptions (/Users/Jim/.nvm/versions/node/v4.1.0/lib/node_modules/eslint/lib/config-validator.js:98:15)
at /Users/Jim/.nvm/versions/node/v4.1.0/lib/node_modules/eslint/lib/config-validator.js:144:13
at Array.forEach (native)
at Object.validate (/Users/Jim/.nvm/versions/node/v4.1.0/lib/node_modules/eslint/lib/config-validator.js:143:35)
at loadConfig (/Users/Jim/.nvm/versions/node/v4.1.0/lib/node_modules/eslint/lib/config.js:179:19)
at /Users/Jim/.nvm/versions/node/v4.1.0/lib/node_modules/eslint/lib/config.js:207:46
at Array.reduceRight (native)
at loadConfig (/Users/Jim/.nvm/versions/node/v4.1.0/lib/node_modules/eslint/lib/config.js:191:36)
at getLocalConfig (/Users/Jim/.nvm/versions/node/v4.1.0/lib/node_modules/eslint/lib/config.js:321:23)
at Config.getConfig (/Users/Jim/.nvm/versions/node/v4.1.0/lib/node_modules/eslint/lib/config.js:416:22)

my atom uses linter-eslint packages and I'm suspecting some settings could be the cause

Upvotes: 2

Views: 1552

Answers (1)

btmills
btmills

Reputation: 4542

I see from the comments that you're using ESLint v1.7.3. array-callback-return was added in v2.0.0-alpha-1, and string severity levels ("off"/"warn"/"error") were added in v2.3.0. Upgrading to at least v2.3.0 should fix the issue.

Upvotes: 3

Related Questions