1

I have created the Getting Started "AwesomeProject" react-native application as shown in the Docs section of the React-Native website.

I have it running in both Xcode Simulator and Android Studio emulators.

When I open the project in WebStorm to begin editing the JS code I am prompted with an error:

ESLint: Error: ESLint configuration in .eslintrc.js » @react-native-community/eslint-config is invalid:

.eslintrc.js:

module.exports = { root: true, extends: '@react-native-community', };

Error Details :

Error: ESLint configuration in .eslintrc.js » @react-native-community/eslint-config is invalid:
    - Property "overrides" is the wrong type (expected array but got '{"files":["*/__tests__/*/*.js","* */*.spec.js","*/*.test.js"],"env":{"jest":true,"jest/globals":true}}').

Referenced from: /Users/admin/AwesomeProject/.eslintrc.js

Error: ESLint configuration in .eslintrc.js » @react-native-community/eslint-config is invalid:
    - Property "overrides" is the wrong type (expected array but got '{"files":["*/__tests__/*/*.js","*/*.spec.js","*/*.test.js"],"env":{"jest":true,"jest/globals":true}}').

Referenced from: /Users/admin/AwesomeProject/.eslintrc.js
    at validateConfigSchema (/Users/admin/AwesomeProject/node_modules/eslint/lib/shared/config-validator.js:286:15)
    at ConfigArrayFactory._normalizeConfigData (/Users/admin/AwesomeProject/node_modules/eslint/lib/cli-engine/config-array-factory.js:469:9)
    at ConfigArrayFactory._loadConfigData (/Users/admin/AwesomeProject/node_modules/eslint/lib/cli-engine/config-array-factory.js:414:21)
    at ConfigArrayFactory._loadExtendedShareableConfig (/Users/admin/AwesomeProject/node_modules/eslint/lib/cli-engine/config-array-factory.js:716:21)
    at ConfigArrayFactory._loadExtends (/Users/admin/AwesomeProject/node_modules/eslint/lib/cli-engine/config-array-factory.js:615:25)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/admin/AwesomeProject/node_modules/eslint/lib/cli-engine/config-array-factory.js:546:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/Users/admin/AwesomeProject/node_modules/eslint/lib/cli-engine/config-array-factory.js:491:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at createConfigArray (/Users/admin/AwesomeProject/node_modules/eslint/lib/cli-engine/config-array-factory.js:307:25)
Process finished with exit code -1

I would appreciate ESLinting to be functioning at least for syntax and general code error trapping, so I don't want to just try and turn it all off. Hopefully, this can quickly and easily be solved so that I can continue using WebStorm for my react-native project.

Thank you in advance for any help this community can contribute.

Leland

DINA TAKLIT
  • 7,074
  • 10
  • 69
  • 74
Leland Long
  • 11
  • 1
  • 2

1 Answers1

1

Not a WebStorm issue. You will face the same error when running npm lint or eslint . in terminal. Please see https://github.com/facebook/create-react-app/issues/7218 for explanation. I'd suggest reporting the issue to https://github.com/facebook/react-native/issues so they can fix @react-native-community/eslint-config to work with ESLint 6.*

lena
  • 90,154
  • 11
  • 145
  • 150