epicweb-dev / epic-stack

This is a Full Stack app starter with the foundational things setup and configured for you to hit the ground running on your next EPIC idea.
https://www.epicweb.dev/epic-stack
MIT License
4.32k stars 355 forks source link

ESLint: Too many files #804

Open braginteractive opened 1 month ago

braginteractive commented 1 month ago

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

kentcdodds commented 1 month ago

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.

andrecasal commented 1 month ago

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.

MoSattler commented 1 month ago

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?

braginteractive commented 1 month ago

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,
]