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

chore: Avoid using deprecated FlatConfig eslint type #856

Merged
merged 1 commit into from
Sep 29, 2024
Merged

chore: Avoid using deprecated FlatConfig eslint type #856

merged 1 commit into from
Sep 29, 2024

Conversation

KuSh
Copy link
Contributor

@KuSh KuSh commented Sep 15, 2024

Copy link

changeset-bot bot commented Sep 15, 2024

🦋 Changeset detected

Latest commit: 5cdc41d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-svelte Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR!
But our plugin can still be used with ESLint v8. Maybe this change will cause type errors for users who use ESLint v8.
So I'm worried that this should be changed in the next major version of eslint-plugin-svelte. What do you think?

@KuSh
Copy link
Contributor Author

KuSh commented Sep 27, 2024

Maybe this change will cause type errors for users who use ESLint v8. So I'm worried that this should be changed in the next major version of eslint-plugin-svelte. What do you think?

I dont think so or they already have the problem because the latest type is used everywhere exept for that specific config, see https://www.npmjs.com/package/eslint-plugin-svelte?activeTab=code

@ota-meshi
Copy link
Member

Are you saying you don't think using ESLint v8 would cause any problems? Have you tried that?

@KuSh
Copy link
Contributor Author

KuSh commented Sep 29, 2024

Are you saying you don't think using ESLint v8 would cause any problems? Have you tried that?

I'm saying the type Linter.Config is already used in the same file for all flat config entries except the flat/all one so if ESLint v8 would cause problem it already does.

See the generated types for v2.44.1:

import './rule-types';
import type { RuleModule } from './types';
import * as processor from './processor';
declare const _default: {
    meta: typeof processor.meta;
    configs: {
        base: import("eslint").Linter.LegacyConfig<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
        recommended: import("eslint").Linter.LegacyConfig<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
        prettier: import("eslint").Linter.LegacyConfig<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
        all: import("eslint").Linter.LegacyConfig<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
        'flat/base': import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
        'flat/recommended': import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
        'flat/prettier': import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
        'flat/all': import("eslint").Linter.FlatConfig[];
    };
    rules: {
        [key: string]: RuleModule;
    };
    processors: {
        '.svelte': typeof processor;
        svelte: typeof processor;
    };
};
export = _default;

@ota-meshi
Copy link
Member

ota-meshi commented Sep 29, 2024

In @types/eslint v8, Linter.Config was defined as a type representing the old configuration.

@ota-meshi
Copy link
Member

See the generated types for v2.44.1:

Oh I didn't understand that. I didn't realize that eslint-plugin-svelte had already changed the types and released them.
We can assume that if no new issues are being opened then it's fine for users.
Thank you for explaining it to me.

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ota-meshi ota-meshi merged commit cf6c842 into sveltejs:main Sep 29, 2024
13 checks passed
ota-meshi added a commit that referenced this pull request Oct 16, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

-
[`7460836`](7460836)
Thanks [@ota-meshi](https://github.com/ota-meshi)! -
feat(html-closing-bracket-new-line): add `html-closing-bracket-new-line`
rule

- [#868](#868)
[`edf99d3`](edf99d3)
Thanks [@mikededo](https://github.com/mikededo)! - feat(no-inspect): add
`no-inspect` rule

### Patch Changes

- [#856](#856)
[`cf6c842`](cf6c842)
Thanks [@KuSh](https://github.com/KuSh)! - chore: Avoid using deprecated
FlatConfig eslint type

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yosuke Ota <[email protected]>
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