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

import_all does not recognise unused JSX classes #85

Closed
janpaul123 opened this issue Dec 29, 2015 · 7 comments
Closed

import_all does not recognise unused JSX classes #85

janpaul123 opened this issue Dec 29, 2015 · 7 comments
Labels

Comments

@janpaul123
Copy link
Contributor

I run into this frequently now, since I use Sublime Text which only supports import_all. It would never recognise <Button> as an unused variable.

@trotzig
Copy link
Collaborator

trotzig commented Dec 30, 2015

if you run eslint outside of import-js, does it then pick up the undefined jsx variables? This has been a problem on and off since I added import-all. The eslint call depends on the .eslintrc.js to be in good shape. I think it might have to do with having eslint 2 installed and our config using eslint 1 specific config:

  'ecmaFeatures': {
    'jsx': true
  },

in eslint 2, this is

{
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    }
  }
}

But I'm not actually sure. It doesn't work for me either, and I have eslint 1.10.1 installed.

@janpaul123
Copy link
Contributor Author

Yep, it does catch it when just running eslint outside of import-js. -_-

@lencioni
Copy link
Collaborator

Is it possible that you have two different eslints installed and that a different one is run in import-js vs outside of import-js?

@trotzig
Copy link
Collaborator

trotzig commented Jan 1, 2016

It turns out that we broke this a while ago in de3c9ee.

Look at what eslint outputs for the Ripple not being defined:

   68:22  error  "contextualEventHelper" is not defined  no-undef
  159:8   error  'Ripple' is not defined                 react/jsx-no-undef
  217:11  error  "contextualEventHelper" is not defined  no-undef

The jsx plugin puts the variable in single quotes. I'll fix this and publish a new version soon.

@trotzig trotzig closed this as completed in d08920a Jan 1, 2016
@lencioni
Copy link
Collaborator

lencioni commented Jan 1, 2016

Ah! My bad. I'll look into submitting a PR to the React plugin to make this consistent with ESLint.

@trotzig
Copy link
Collaborator

trotzig commented Jan 1, 2016

Ah, that would be great!

@lencioni
Copy link
Collaborator

lencioni commented Jan 1, 2016

Actually, it seems that most ESLint rules use single quotes. So perhaps I'll submit a PR over there instead.

lencioni added a commit to lencioni/eslint that referenced this issue Jan 1, 2016
While working on a different project that consumes the output of ESLint
and some plugins, we noticed that the quote styles emitted by the
no-undef rule was different than the quote styles emitted by some of the
rules in our other plugins [0]. This inconsistency led to a small bug in
our plugin, so I wanted to smooth things out a bit for future
developers.

To make things more consistent, my first inclination was to change the
plugin to match ESLint's no-undef quote style, but upon investigation it
seems that most of the core ESLint rules use single quotes instead of
double quotes, so I decided to change this one to be more consistent.

There may be other inconsistencies that are worth resolving, but this
commit fixes the main pain point for me.

[0]: Galooshi/import-js#85 (comment)
lencioni added a commit to lencioni/eslint that referenced this issue Jan 2, 2016
While working on a different project that consumes the output of ESLint
and some plugins, we noticed that the quote styles emitted by the
no-undef rule was different than the quote styles emitted by some of the
rules in our other plugins [0]. This inconsistency led to a small bug in
our plugin, so I wanted to smooth things out a bit for future
developers.

To make things more consistent, my first inclination was to change the
plugin to match ESLint's no-undef quote style, but upon investigation it
seems that most of the core ESLint rules use single quotes instead of
double quotes, so I decided to change this one to be more consistent.

There may be other inconsistencies that are worth resolving, but this
commit fixes the main pain point for me.

Fixes eslint#4845

[0]: Galooshi/import-js#85 (comment)
lencioni added a commit to lencioni/eslint that referenced this issue Jan 2, 2016
While working on a different project that consumes the output of ESLint
and some plugins, we noticed that the quote styles emitted by the
no-undef rule was different than the quote styles emitted by some of the
rules in our other plugins [0]. This inconsistency led to a small bug in
our plugin, so I wanted to smooth things out a bit for future
developers.

To make things more consistent, my first inclination was to change the
plugin to match ESLint's no-undef quote style, but upon investigation it
seems that most of the core ESLint rules use single quotes instead of
double quotes, so I decided to change this one to be more consistent.

There may be other inconsistencies that are worth resolving, but this
commit fixes the main pain point for me.

[0]: Galooshi/import-js#85 (comment)

(fixes eslint#4845)
lencioni added a commit to lencioni/eslint that referenced this issue Jan 2, 2016
While working on a different project that consumes the output of ESLint
and some plugins, we noticed that the quote styles emitted by the
no-undef rule was different than the quote styles emitted by some of the
rules in our other plugins [0]. This inconsistency led to a small bug in
our plugin, so I wanted to smooth things out a bit for future
developers.

To make things more consistent, my first inclination was to change the
plugin to match ESLint's no-undef quote style, but upon investigation it
seems that most of the core ESLint rules use single quotes instead of
double quotes, so I decided to change this one to be more consistent.

There may be other inconsistencies that are worth resolving, but this
commit fixes the main pain point for me.

[0]: Galooshi/import-js#85 (comment)
lencioni added a commit to lencioni/eslint that referenced this issue Jan 3, 2016
While working on a different project that consumes the output of ESLint
and some plugins, we noticed that the quote styles emitted by the
no-undef rule was different than the quote styles emitted by some of the
rules in our other plugins [0]. This inconsistency led to a small bug in
our plugin, so I wanted to smooth things out a bit for future
developers.

To make things more consistent, my first inclination was to change the
plugin to match ESLint's no-undef quote style, but upon investigation it
seems that most of the core ESLint rules use single quotes instead of
double quotes, so I decided to change this one to be more consistent.

There may be other inconsistencies that are worth resolving, but this
commit fixes the main pain point for me.

[0]: Galooshi/import-js#85 (comment)
lencioni added a commit to lencioni/eslint that referenced this issue Jan 3, 2016
While working on a different project that consumes the output of ESLint
and some plugins, we noticed that the quote styles emitted by the
no-unused-vars rule was different than the quote styles emitted by some
of the rules in our other plugins [0]. This inconsistency led to a small
bug in our plugin, so I wanted to smooth things out a bit for future
developers.

To make things more consistent, my first inclination was to change the
plugin to match ESLint's no-unused-vars quote style, but upon
investigation it seems that most of the core ESLint rules use single
quotes instead of double quotes, so I decided to change this one to be
more consistent.

There may be other inconsistencies that are worth resolving, but this
commit fixes the main pain point for me.

[0]: Galooshi/import-js#85 (comment)
lencioni added a commit to lencioni/eslint that referenced this issue Jan 3, 2016
)

While working on a different project that consumes the output of ESLint
and some plugins, we noticed that the quote styles emitted by the
no-undef and no-unused-vars rule was different than the quote styles
emitted by some of the rules in our other plugins [0]. This
inconsistency led to a small bug in our plugin, so I wanted to smooth
things out a bit for future developers.

To make things more consistent, my first inclination was to change the
plugin to match ESLint's no-undef and no-unused-vars quote style, but
upon investigation it seems that most of the core ESLint rules use
single quotes instead of double quotes, so I decided to change these
rules to be more consistent.

There may be other inconsistencies that are worth resolving, but this
commit fixes the main pain point for me.

[0]: Galooshi/import-js#85 (comment)
lencioni added a commit to lencioni/eslint that referenced this issue Jan 3, 2016
)

While working on a different project that consumes the output of ESLint
and some plugins, we noticed that the quote styles emitted by the
no-undef and no-unused-vars rule was different than the quote styles
emitted by some of the rules in our other plugins [0]. This
inconsistency led to a small bug in our plugin, so I wanted to smooth
things out a bit for future developers.

To make things more consistent, my first inclination was to change the
plugin to match ESLint's no-undef and no-unused-vars quote style, but
upon investigation it seems that most of the core ESLint rules use
single quotes instead of double quotes, so I decided to change these
rules to be more consistent.

There may be other inconsistencies that are worth resolving, but this
commit fixes the main pain point for me.

[0]: Galooshi/import-js#85 (comment)
lencioni added a commit to lencioni/eslint that referenced this issue Jan 5, 2016
While working on a different project that consumes the output of ESLint
and some plugins, we noticed that the quote styles emitted by the
no-undef and no-unused-vars rule were different than the quote styles
emitted by some of the rules in our other plugins [0]. This
inconsistency led to a small bug in our project, so I wanted to smooth
things out a bit for future developers.

To make things more consistent, my first inclination was to change the
plugin to match ESLint's no-undef and no-unused-vars quote style, but
upon investigation it seems there was a fair amount of inconsistency in
ESLint rules: some used double quotes, some used single quotes, and
others used backticks. I decided to convert all of these to single
quotes to be more consistent.

There may be others that I have missed, but this commit should get the
bulk of them.

[0]: Galooshi/import-js#85 (comment)
@lencioni lencioni added the bug label Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants