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

no-unused-vars is not right. #12554

Closed
PolanZ opened this issue Nov 11, 2019 · 2 comments
Closed

no-unused-vars is not right. #12554

PolanZ opened this issue Nov 11, 2019 · 2 comments
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly

Comments

@PolanZ
Copy link

PolanZ commented Nov 11, 2019

Tell us about your environment

  • ESLint Version: v6.2.1
  • Node Version: v10.16.0
  • npm Version: 6.9.0

What parser (default, Babel-ESLint, etc.) are you using?
Babel-ESLint

Please show your full configuration:

module.exports = {
  root: true,
  env: {
    node: true
  },
  'extends': [
    'plugin:vue/essential',
    // '@smart/standard'
  ],
  // required to lint *.vue files
  plugins: [
    'vue'
  ],
  rules: {
    // allow async-await
    'max-len': [2, { 'code': 200 }],
    'space-before-function-paren': ['error', {
      'anonymous': 'always',
      'named': 'never',
      'asyncArrow': 'always'
    }],
    'no-multi-spaces': ['error', {
      'ignoreEOLComments': true
    }],
    'no-trailing-spaces': 'off',
    'no-unused-vars': [1, { 'args': 'none' }],
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
  },
  parserOptions: {
    parser: 'babel-eslint'
  }
};
Configuration

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
lint

for (const key in sortType) {
  if (sortType[key].status === this.sortTypeStatus) {
    return sortType[key].name;
  }
}

What did you expect to happen?

'key' is defined but never used.eslint(no-unused-vars)

image
image

but! use in function rule is right. see
image
image

not output warning

@PolanZ PolanZ added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Nov 11, 2019
@aladdin-add
Copy link
Member

Duplicate of #12117

@aladdin-add aladdin-add marked this as a duplicate of #12117 Nov 11, 2019
@aladdin-add
Copy link
Member

please upgrade babel-eslint to resolve the issue.

@platinumazure platinumazure added 3rd party plugin This is an issue related to a 3rd party plugin, config, or parser and removed triage An ESLint team member will look at this issue soon labels Nov 11, 2019
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators May 11, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly
Projects
None yet
Development

No branches or pull requests

3 participants