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

TypeError: Cannot read property 'type' of undefined (no-single-element-style-arrays) #284

Open
mehmetnyarar opened this issue May 1, 2021 · 2 comments

Comments

@mehmetnyarar
Copy link

I'm getting the following error:

ESLint: 7.25.0

TypeError: Cannot read property 'type' of undefined
Occurred while linting root/packages/mobile/src/screens/main/index.tsx:22
at JSXAttribute (root/node_modules/eslint-plugin-react-native/lib/rules/no-single-element-style-arrays.js:40:35)
at root/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (root/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (root/node_modules/eslint/lib/linter/node-event-generator.js:256:26)
at NodeEventGenerator.applySelectors (root/node_modules/eslint/lib/linter/node-event-generator.js:285:22)
at NodeEventGenerator.enterNode (root/node_modules/eslint/lib/linter/node-event-generator.js:299:14)
at CodePathAnalyzer.enterNode (root/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:711:23)
at root/node_modules/eslint/lib/linter/linter.js:954:32
at Array.forEach ()
error Command failed with exit code 2.

main/index.tsx:22 -> <View style={styles.container}>

.eslintrc.json:

{
  "plugins": ["react-native"],
  "extends": ["../../.eslintrc.js", "plugin:react-native/all"],
  "rules": {
    "react/forbid-component-props": "off",
    "react/style-prop-object": "off",
    "react-native/no-single-element-style-arrays": "off", // ErrorGoesAwayWhenITurnOffTheRule
    "react-native/sort-styles": "off"
  },
  "env": {
    "react-native/react-native": true
  },
  "globals": {
    "__DEV__": true
  }
}

"eslint-plugin-react-native": "^3.10.0",

@AlanSl
Copy link

AlanSl commented May 19, 2021

See #278

@Intellicode
Copy link
Owner

Should be fixed as discussed in #278

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

3 participants