-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Conversation
🦋 Changeset detectedLatest commit: 5cdc41d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this 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?
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 |
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; |
|
Oh I didn't understand that. I didn't realize that eslint-plugin-svelte had already changed the types and released them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
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]>
This type has been deprecated in eslint, see https://github.com/eslint/eslint/blob/71f37c5bf04afb704232d312cc6c72c957d1c14e/lib/types/index.d.ts#L1306