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 in no-inline-styles rule #109

Closed
randycoulman opened this issue Dec 7, 2016 · 1 comment
Closed

TypeError in no-inline-styles rule #109

randycoulman opened this issue Dec 7, 2016 · 1 comment

Comments

@randycoulman
Copy link

This is similar to #60, but now occurs in the no-inline-styles rule instead of the no-unused-styles rule. It looks like #60 was fixed in 2.2.0, but that has now exposed this new issue.

When I'm working in Atom with the linter-eslint plugin, I often encounter a TypeError that originates in the no-inline-styles rule while I'm typing. I have linter-eslint configured to lint as I type.

I have found that the code that triggers the error contains the fragment <View style>. So, I'm in the process of adding style information, but before I can add the = {}, I get the type error.

I'm using eslint-plugin-react-native 2.2.0.

Here's the stack trace:

TypeError: Cannot read property 'expression' of null
    at Object.collectStyleObjectExpressions (/Users/randy/src/linx/SmartLinx/node_modules/eslint-plugin-react-native/lib/util/stylesheet.js:170:60)
    at EventEmitter.JSXAttribute (/Users/randy/src/linx/SmartLinx/node_modules/eslint-plugin-react-native/lib/rules/no-inline-styles.js:36:35)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
    at NodeEventGenerator.enterNode (/Users/randy/src/linx/SmartLinx/node_modules/eslint/lib/util/node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (/Users/randy/src/linx/SmartLinx/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23)
    at CommentEventGenerator.enterNode (/Users/randy/src/linx/SmartLinx/node_modules/eslint/lib/util/comment-event-generator.js:97:23)
    at Controller.enter (/Users/randy/src/linx/SmartLinx/node_modules/eslint/lib/eslint.js:925:36)
    at Controller.__execute (/Users/randy/src/linx/SmartLinx/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/Users/randy/src/linx/SmartLinx/node_modules/estraverse/estraverse.js:501:28)
@Intellicode
Copy link
Owner

Thanks for the report, I'll look into it!

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