epic-stack icon indicating copy to clipboard operation
epic-stack copied to clipboard

ESLint: Too many files

Open braginteractive opened this issue 1 year ago • 4 comments

Have been working with epic stack for a bit now without any custom configs to ESLint.

The following error showed up today:

Parsing error: Too many files (>8) have matched the default project.

Having many files run with the default project is known to cause performance issues and slow down linting.

See https://typescript-eslint.io/troubleshooting/#allowdefaultproject-glob-too-wide

As of now, my workaround has been to add the following to the eslint.config.js file:

parserOptions.projectService.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING

braginteractive avatar Jul 25 '24 16:07 braginteractive

I've seen this in the editor, but not when running the CLI. I'm not sure what is incorrectly configured, but I'd love to find out how to properly handle this.

kentcdodds avatar Jul 28 '24 15:07 kentcdodds

I've been seeing this too and applied the same parserOptions.projectService.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING solution.

Hoping someone can shed some light into this.

andrecasal avatar Jul 29 '24 18:07 andrecasal

I've been seeing this too and applied the same parserOptions.projectService.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING solution.

Hoping someone can shed some light into this.

Where exactly does one have to set this?

MoSattler avatar Aug 05 '24 15:08 MoSattler

Goes in your eslint.config.js file.

Mine looks like the following as of now:

import { default as defaultConfig } from '@epic-web/config/eslint'

/** @type {import("eslint").Linter.Config} */
export default [
	...defaultConfig,
	// add custom config objects here:
	parserOptions.projectService
		.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING,
]

braginteractive avatar Aug 05 '24 16:08 braginteractive

I'm not sure whether we need to do this or not because I don't have this issue regularly at all. So I think we'll just close this for now.

kentcdodds avatar Apr 23 '25 11:04 kentcdodds