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

feat: change type from deprecated FlatConfig to Config #674

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

irsooti
Copy link

@irsooti irsooti commented Aug 1, 2024

Hello,

the type FlatConfig has been replaced with Config, according to the deprecation warning.
image

I just changed the type with the suggested one.

Cheers!

Copy link

changeset-bot bot commented Aug 1, 2024

⚠️ No Changeset found

Latest commit: 3451c3e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@MartinX3
Copy link

MartinX3 commented Aug 11, 2024

@irsooti I tried your change but maybe it's because I use the eslint.config.ts since ESLint 9.9.0.

eslint.config.ts:29:3 - error TS2345: Argument of type 'Config<RulesRecord>' is not assignable to parameter of type 'ConfigWithExtends'.
  Types of property 'languageOptions' are incompatible.
    Type 'import("path/node_modules/.pnpm/@types+eslint@9.6.0/node_modules/@types/eslint/index").Linter.LanguageOptions | undefined' is not assignable to type 'import("path/node_modules/.pnpm/@typescript-eslint+utils@8.0.1_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions | undefined'.
      Type 'import("path/node_modules/.pnpm/@types+eslint@9.6.0/node_modules/@types/eslint/index").Linter.LanguageOptions' is not assignable to type 'import("path/node_modules/.pnpm/@typescript-eslint+utils@8.0.1_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions'.
        Types of property 'globals' are incompatible.
          Type 'Globals | undefined' is not assignable to type 'GlobalsConfig | undefined'.
            Type 'Globals' is not assignable to type 'GlobalsConfig'.
              'string' index signatures are incompatible.
                Type 'GlobalConf' is not assignable to type 'GlobalVariableOption'.
                  Type '"readable"' is not assignable to type 'GlobalVariableOption'.

Edit:
It seems to work using Readonly<Linter.RulesRecord> instead of Linter.Config like used here
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/136deed9a5c0adaea7bc7674783bb52608673d05/types/eslint__js/index.d.ts#L5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants