azat-io / eslint-plugin-perfectionist

🦄 ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
https://eslint-plugin-perfectionist.azat.io
MIT License
1.62k stars 28 forks source link

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

Open motss opened 2 weeks ago

motss commented 2 weeks ago

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

azat-io commented 2 weeks ago

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