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

False positive indent error for comment line before line started from semicolon #12232

Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly indent Relates to the `indent` rule

Comments

@Alexsey
Copy link

Alexsey commented Sep 6, 2019

Tell us about your environment

  • ESLint Version: 6.3.0
  • Node Version: 12.9.1
  • npm Version: 6.11.3

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

Please show your full configuration:

Configuration
module.exports = {
  plugins: [
    'node',
    'lodash',
    'array-func',
    'import',
    'jest',
  ],
  extends: [
    'standard',
    'plugin:node/recommended',
  ],
  env: {
    node: true,
    es6: true,
    'jest/globals': true,
  },
  parserOptions: {
    'ecmaVersion': 9,
    'sourceType': 'script',
  },
  rules: {
    'comma-dangle': ['error', 'always-multiline'],
    'max-len': ['error', {'code': 120}],
    'no-tabs': 'error',

    'node/no-unpublished-require': 'off',
    'node/exports-style': ['error', 'module.exports'],

    'lodash/callback-binding': 'error',
    'lodash/collection-method-value': 'off',
    'lodash/collection-return': 'off',
    'lodash/no-double-unwrap': 'error',
    'lodash/no-extra-args': 'error',
    'lodash/no-unbound-this': 'error',
    'lodash/unwrap': 'error',
    'lodash/chain-style': ['error', 'as-needed'],
    'lodash/chaining': 'off',
    'lodash/consistent-compose': 'off',
    'lodash/identity-shorthand': ['error', 'always'],
    'lodash/import-scope': 'off',
    'lodash/matches-prop-shorthand': ['error', 'always'],
    'lodash/matches-shorthand': ['error', 'always'],
    'lodash/no-commit': 'off',
    'lodash/path-style': ['error', 'as-needed'],
    'lodash/prefer-compact': 'off',
    'lodash/prefer-filter': 'error',
    'lodash/prefer-find': 'error',
    'lodash/prefer-flat-map': 'error',
    'lodash/prefer-immutable-method': 'off',
    'lodash/prefer-invoke-map': 'error',
    'lodash/prefer-map': 'error',
    'lodash/prefer-reject': 'error',
    'lodash/prefer-thru': 'error',
    'lodash/prefer-wrapper-method': 'error',
    'lodash/preferred-alias': 'error',
    'lodash/prop-shorthand': ['error', 'always'],
    'lodash/prefer-constant': 'off',
    'lodash/prefer-get': 'error',
    'lodash/prefer-includes': 'error',
    'lodash/prefer-is-nil': 'error',
    'lodash/prefer-lodash-chain': 'off',
    'lodash/prefer-lodash-method': 'off',
    'lodash/prefer-matches': 'error',
    'lodash/prefer-noop': 'off',
    'lodash/prefer-over-quantifier': 'error',
    'lodash/prefer-some': 'error',
    'lodash/prefer-startswith': 'error',
    'lodash/prefer-times': 'error',

    'array-func/from-map': 'error',
    'array-func/no-unnecessary-this-arg': 'error',
    'array-func/prefer-array-from': 'off',
    'array-func/avoid-reverse': 'error',
    'array-func/prefer-flat-map': 'error',
    'array-func/prefer-flat': 'error',

    'import/order': ['error', {"newlines-between": "always"}],
  },
}

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

const {log} = console

// comment <- error on this line

;(async () => {
  log('stuff')
})()

Autorun by IntelliJ IDE

What did you expect to happen?
No error

What actually happened? Please include the actual, raw output from ESLint.
ESLint: expected indentation of 2 spaces but found 0.(indent)

Are you willing to submit a pull request to fix this bug?
Probably no

@Alexsey Alexsey added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Sep 6, 2019
@kaicataldo
Copy link
Member

Verified using our demo.

@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion indent Relates to the `indent` rule and removed triage An ESLint team member will look at this issue soon labels Sep 8, 2019
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 13, 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 Mar 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.