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

Bug: Can't ignore the paths in .gitignore #129

Open
1 of 7 tasks
Asaf-S opened this issue Nov 4, 2024 · 1 comment
Open
1 of 7 tasks

Bug: Can't ignore the paths in .gitignore #129

Asaf-S opened this issue Nov 4, 2024 · 1 comment
Labels
bug Something isn't working repro:needed This issue should include a reproducible example

Comments

@Asaf-S
Copy link

Asaf-S commented Nov 4, 2024

Which packages are affected?

  • @eslint/compat
  • @eslint/config-array
  • @eslint/core
  • @eslint/migrate-config
  • @eslint/object-schema
  • @eslint/plugin-kit

Environment

Node version:
v18.20.3
npm version:
10.7.0 (pnpm version: 9.0.6)
ESLint version:

    "@eslint/compat": "^1.2.2",
    "@types/eslint__js": "^8.42.3",
    "@types/node": "^20.12.6",
    "@typescript-eslint/eslint-plugin": "^7.6.0",
    "@typescript-eslint/parser": "^6.5.0",
    "cspell": "6.18.1",
    "eslint": "^9.14.0",
    "eslint-plugin-jest": "^28.2.0",
    "husky": "^9.0.11",
    "just-pnpm": "^1.0.2",
    "lint-staged": "^10.5.1",
    "prettier": "^2.1.2",
    "typescript": "^5.4.4",
    "typescript-eslint": "^7.6.0"

Operating System: macOS 15.0.1

What did you do?

// eslint.config.ts
import { includeIgnoreFile } from "@eslint/compat";
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import path from "node:path";

const gitIgnorePath = path.resolve(__dirname, ".gitignore");

module.exports = tseslint.config(
  includeIgnoreFile(gitIgnorePath),
  // ...
}

Run command:

tsc --target esnext --module nodenext eslint.config.ts && eslint . --fix

What did you expect to happen?

Successfully ignoring the paths in .gitignore

What actually happened?

TS say that tseslint.config expects a different return value from includeIgnoreFile(gitIgnorePath):

eslint.config.ts:22:3 - error TS2345: Argument of type 'Config<RulesRecord>' is not assignable to parameter of type 'ConfigWithExtends'.
  The types of 'languageOptions.ecmaVersion' are incompatible between these types.
    Type 'import("/Users/xxx/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/types/index").Linter.EcmaVersion' is not assignable to type 'import("/Users/xxx/project/node_modules/.pnpm/@[email protected]/node_modules/@typescript-eslint/types/dist/parser-options").EcmaVersion'.
      Type '16' is not assignable to type 'EcmaVersion'.

Link to Minimal Reproducible Example

don't have

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@Asaf-S Asaf-S added bug Something isn't working repro:needed This issue should include a reproducible example labels Nov 4, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Nov 4, 2024
@nzakas
Copy link
Member

nzakas commented Nov 4, 2024

We need a reproduction case in order to investigate.

@nzakas nzakas moved this from Needs Triage to Triaging in Triage Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repro:needed This issue should include a reproducible example
Projects
Status: Triaging
Development

No branches or pull requests

2 participants