Skip to content

[Bug]: @babel/eslint-parser@7.23.9 breaks linting with legacy decorators #16239

@andreyfel

Description

@andreyfel

💻

  • Would you like to work on a fix?

How are you using Babel?

@babel/eslint-parser

Input code

import { tracked } from '@glimmer/tracking';

class State {
  @tracked depth = 0;
}

Configuration file name

No response

Configuration

module.exports = {
  root: true,
  parser: '@babel/eslint-parser',
  parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module',
    requireConfigFile: false,
    babelOptions: {
      plugins: [
        ['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
      ],
    },
  },
}

Current and expected behavior

Expected eslint to run without issues.
Actual: error 'tracked' is defined but never used no-unused-vars

Reverting @babel/eslint-parser to 7.23.3 fixes the issue.

Here is a reference repository (pretty small ember addon) retailnext/ember-bem-helpers#195 https://github.com/retailnext/ember-bem-helpers/actions/runs/7668263539/job/20899739663

Environment

babel@7.23.9, Node@18

Possible solution

No response

Additional context

No response

Metadata

Metadata

Labels

i: needs triagei: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions