Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(types): Typing files are missing for tseslint.configs.strictTypeChecked in FlatConfig #139

Open
2 tasks done
motss opened this issue Apr 28, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@motss
Copy link
Contributor

motss commented Apr 28, 2024

Describe the bug

I'm trying to use ESLint's new FlatConfig and typescript-eslint's tseslint.configs.strictTypeChecked enabled for stricter type checking and linting. However, ESLint reports the lint error below for eslint-plugin-perfectionist due to missing types from the package:

  20:3   error  Unsafe argument of type `any` assigned to a parameter of type `ConfigWithExtends`  @typescript-eslint/no-unsafe-argument

I was quite surprised that a project that is entirely written in TypeScript chose to omit type files completely. It'd be great if type files could be added so that ESLint read the typings of the package correctly without the need to add additional rule to turn off some rules in eslint.config.*js for all the users.

Code example

  1. Go to https://stackblitz.com/edit/vitest-dev-vitest-c5wksh?file=eslint.config.mjs
  2. Wait for dependencies to be installed and you will see linting errors
  3. If Step 2 fails, you can manually run pnpm install && pnpm lint

ESLint version

9.1.1

ESLint Plugin Perfectionist version

2.10.0

Additional comments

{
"@eslint/eslintrc": "^3.0.2",
"@eslint/js": "^9.1.1",
"eslint": "^9.1.1",
"eslint-plugin-perfectionist": "^2.10.0",
"typescript-eslint": "^7.7.1"
}

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@motss motss added the bug Something isn't working label Apr 28, 2024
@azat-io
Copy link
Owner

azat-io commented Apr 28, 2024

Thank you for your question! We plan to add type support in the next major version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants