Skip to content

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

Closed
@Alexsey

Description

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

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyindentRelates to the `indent` rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions