Skip to content

Bug: Cannot use built-in configs #5031

@PabloLION

Description

@PabloLION

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Issue Description

From issue #5030

What's the problem (repeating README in the "Reproduction Repository")

Test

yarn install && yarn lint

Problem

  1. In the first commit on this branch, the yarn lint command works correctly.
  2. In the second commit, the yarn lint command fails.

Reproduction

  1. Run yarn init to create a whatever new repo.

  2. Install packages with yarn following Getting Started - Linting your TypeScript Codebase

      yarn add --dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin
  3. Add this eslintConfig to package.json, then run yarn lint. The command works.

    "eslintConfig": {
        "env": {
          "node": true
        },
        "extends": [
          "eslint:recommended",
          "plugin:@typescript-eslint/recommended"
        ],
        "parser": "@typescript-eslint/parser",
        "plugins": [
          "@typescript-eslint"
        ],
        "root": true
      },
  4. Add these two lines to eslintConfig.extends, then the command fails.

    "plugin:@typescript-eslint/recommended-requiring-type-checking",
    "plugin:@typescript-eslint/strict"

Env

I'm using MacBook Pro (2021, 16'), which has M1 chips.

VSCode

Version: 1.67.1
Commit: da15b6fd3ef856477bf6f4fb29ba1b7af717770d
Date: 2022-05-06T12:37:14.619Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Darwin arm64 21.3.0

TLDR

@JoshuaKGoldberg, thanks for correcting. I misunderstood that the problem was that the doc didn't tell users where to find the plugins.
@bradzacher, sorry to tell you that I feel a little bit unwelcomed because I couldn't react with emoji. This project is great, I hope that we have more contributors who fill the issues.

Reproduction Repository Link

https://github.com/PabloLION/test-repo/tree/node/eslint-typescript/plugins

Repro Steps

REPEATING Issue Description

  1. Run yarn init to create a whatever new repo.

  2. Install packages with yarn following Getting Started - Linting your TypeScript Codebase

      yarn add --dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin
  3. Add this eslintConfig to package.json, then run yarn lint. The command works.

    "eslintConfig": {
        "env": {
          "node": true
        },
        "extends": [
          "eslint:recommended",
          "plugin:@typescript-eslint/recommended"
        ],
        "parser": "@typescript-eslint/parser",
        "plugins": [
          "@typescript-eslint"
        ],
        "root": true
      },
  4. Add these two lines to eslintConfig.extends, then the command fails.

    "plugin:@typescript-eslint/recommended-requiring-type-checking",
    "plugin:@typescript-eslint/strict"
  5. I also tested with .eslintrc.js and .eslintrc.cjs. Both failed with same error.

Versions

package version
@typescript-eslint/eslint-plugin 5.25.0
@typescript-eslint/parser 5.25.0
@typescript-eslint/scope-manager NONE
@typescript-eslint/typescript-estree NONE
@typescript-eslint/type-utils NONE
@typescript-eslint/utils NONE
TypeScript 4.6.4
ESLint 8.16.0
node 18.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting responseIssues waiting for a reply from the OP or another partyunable to reproissues that a maintainer was not able to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions