Skip to content

Enhancement: Allow adding test directories and files to allowDefaultProject glob #9472

@jgeurts

Description

@jgeurts

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

typescript-estree

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

I have an eslint config where I'm trying to set up some defaults for all consumers of the config. One of those defaults is to add all test files to the project service:

parserOptions: {
  projectService: {
    allowDefaultProject: ['./tests/**/*.{ts,js,cjs,mjs}'],
    defaultProject: 'tsconfig.json',
  },
  tsconfigRootDir: import.meta.dirname,
},

That configure is causing Parsing error: allowDefaultProject glob './tests/**/*.{ts,js,cjs,mjs}' contains a disallowed '**'. errors.

I understand the risks and would still like to use that glob pattern. Is there a config setting or any other path forward to allow the ** glob pattern in this case? In this case, the glob pattern is constrained to all subdirectories of a single path (./tests), maybe the validate function could be a bit looser in that case and allow it?

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestevaluating community engagementwe're looking for community engagement on this issue to show that this problem is widely importantlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions