You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type '{ files: string[]; languageOptions: { parser: { parseForESLint: typeof plugin.parseForESLint; }; }; rules: { "@graphql-eslint/description-style": string; "@graphql-eslint/known-argument-names": string; "@graphql-eslint/known-directives": string; "@graphql-eslint/known-type-names": string; "@graphql-eslint/lone-schem...' is not assignable to type 'Config'.
Types of property 'rules' are incompatible.
Type '{ '@graphql-eslint/description-style': string; '@graphql-eslint/known-argument-names': string; '@graphql-eslint/known-directives': string; '@graphql-eslint/known-type-names': string; ... 15 more ...; '@graphql-eslint/unique-type-names': string; }' is not assignable to type 'Partial<Record<string, RuleEntry>>'.
Property ''@graphql-eslint/description-style'' is incompatible with index signature.
Type 'string' is not assignable to type 'RuleEntry | undefined'.
FlatConfig.Config is a loose version of ESLint's own Linter.FlatConfig, just in case.
To reproduce
Use this plugin in a type-checked configuration, as above.
The cause is likely the fact that the rules aren't exported with as const (preserving specific string literals and tuples). And satisfies could be more specific here, utilizing Linter.FlatConfig instead of unknown, for example:
Issue workflow progress
Progress of the issue based on the Contributor Workflow
Describe the bug
Our ESLint configuration is written in TypeScript. The following:
Is reported as erroneous by TypeScript:
FlatConfig.Config
is a loose version of ESLint's ownLinter.FlatConfig
, just in case.To reproduce
Use this plugin in a type-checked configuration, as above.
Expected behavior
No errors.
Environment:
@graphql-eslint/eslint-plugin
:4.0.0-alpha.0
Additional context
Workaround:
The cause is likely the fact that the rules aren't exported with
as const
(preserving specific string literals and tuples). Andsatisfies
could be more specific here, utilizingLinter.FlatConfig
instead ofunknown
, for example:graphql-eslint/packages/plugin/src/flat-configs.ts
Line 36 in 5cb2d8f
Let me know if you need more details or a reproduction.
The text was updated successfully, but these errors were encountered: