8000 GitHub Β· Where software is built
[go: up one dir, main page]

Skip to content
Bug: parserService allowDefaultProject just isn't workingΒ #9739
Closed
@samesfahani-tuplehealth

Description

@samesfahani-tuplehealth

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.

Repro link

https://stackblitz.com/edit/vitejs-vite-rv1ac6?file=eslint.config.js

Relevant Package

parser

I am in the process of upgrading to ESLint 9 from 8, but running into issues with this package complaining about files that are not source code (they are config files, script files, etc)

ESLint Config

import baseConfig from './eslint.config.mjs';

export default [
  ...baseConfig,
  {
    languageOptions: {
      parserOptions: {
        projectService: {
          allowDefaultProject: ['*.js', '*.mjs'],
        },
        tsconfigRootDir: import.meta.dirname,
      },
    },
  },
  {
    rules: {
      '@typescript-eslint/await-thenable': 'warn',
      '@typescript-eslint/no-floating-promises': 'warn',
      '@typescript-eslint/require-await': 'warn',
      'no-return-await': 'warn',
    },
  },
];

tsconfig

{
  "files": [],
  "references": [{ "path": "./packages/package1" }, { "path": "./packages/package2" }],
  "compilerOptions": {
    "resolveJsonModule": true,
    "esModuleInterop": true
  }
}

Expected Result

I expect no errors as previously was the case on ESLint 8.57.

Actual Result

A bunch of errors similar to:

/Users/sam/repo/prettier.config.mjs
  0:0  error  Parsing error: /Users/sam/repo/prettier.config.mjs was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject

Additional Info

No response

Versions

package version
@typescript-eslint/eslint-plugin 8.0.1
@typescript-eslint/parser 8.0.1
@typescript-eslint/rule-tester X.Y.Z
@typescript-eslint/scope-manager X.Y.Z
@typescript-eslint/typescript-estree X.Y.Z
@typescript-eslint/type-utils X.Y.Z
@typescript-eslint/utils X.Y.Z
TypeScript 5.5.4
ESLint 9.8.0
node 20.12.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.triageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0