eslint-config icon indicating copy to clipboard operation
eslint-config copied to clipboard

Breaks when the `tsconfig.json` file has `extends`

Open kevbook opened this issue 7 months ago • 3 comments

Describe the bug

I keep getting the following error when I use a tsconfig.json with extends

  0:0  error  Parsing error: Cannot read properties of undefined (reading 'target')
export default antfu({
  typescript: { 
    tsconfigPath: resolve(process.cwd(), 'tsconfig.json')
   }
});

// Project tsconfig.json

{
  "extends": "./base-tsconfig.json"
}

base-tsconfig.json file contains the company-wide standard config. This is typically another npm package, but for now just a local file.

Let me know if I need to provide any more details. I just started getting this error since the last update.

Reproduction

$ eslint . 

System Info

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M3
  Memory: 70.64 MB / 16.00 GB
  Shell: 3.2.57 - /bin/bash

Binaries:
  Node: 20.15.1 - /usr/local/bin/node
  npm: 10.7.0 - /usr/local/bin/npm
  pnpm: 9.6.0 - ~/Library/pnpm/pnpm

Used Package Manager

pnpm

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

Contributions

  • [X] I am willing to submit a PR to fix this issue
  • [X] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

kevbook avatar Jul 24 '24 16:07 kevbook