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

jsx-no-undef throws on multiple lowercase sections for object access #469

Closed
Standard8 opened this issue Feb 25, 2016 · 2 comments
Closed

Comments

@Standard8
Copy link

Seems to be a regression from #435.

This warns unexpectedly:

<foo.bar.Component />

This doesn't warn:

<foo.Component />

The only way I can find around this is to alias the component and use the alias in the react code.

@Standard8
Copy link
Author

Here's a diff for test cases against current master:

diff --git a/tests/lib/rules/jsx-no-undef.js b/tests/lib/rules/jsx-no-undef.js
index e1e9c17..355ae41 100644
--- a/tests/lib/rules/jsx-no-undef.js
+++ b/tests/lib/rules/jsx-no-undef.js
@@ -34,6 +34,15 @@ ruleTester.run('jsx-no-undef', rule, {
     code: '/*eslint no-undef:1*/ var React, App; React.render(<App />);',
     parserOptions: parserOptions
   }, {
+    code: '/*eslint no-undef:1*/ var React, app; React.render(<app />);',
+    parserOptions: parserOptions
+  }, {
+    code: '/*eslint no-undef:1*/ var React, app; React.render(<app.Foo />);',
+    parserOptions: parserOptions
+  }, {
+    code: '/*eslint no-undef:1*/ var React, app; React.render(<app.fake.Foo />);',
+    parserOptions: parserOptions
+  }, {
     code: '/*eslint no-undef:1*/ var React; React.render(<img />);',
     parserOptions: parserOptions
   }, {

The app.fake.Foo test fails.

@ljharb
Copy link
Member

ljharb commented Feb 25, 2016

I've seen this with <this.state.Handler /> as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants