Skip to content

Argument of type ExampleTypedLintingRuleDocs is not assignable to parameter of type 'unknown' #14

@baruchiro

Description

@baruchiro

Hi,

I just cloned and ran the eslint-plugin-example-typed-linting:

$ npm install
$ npm run lint
$ npm run tsc
src/rules/no-loop-over-enum.test.ts:26:37 - error TS2345: Argument of type 'RuleModule<"loopOverEnum", [], ExampleTypedLintingRuleDocs, RuleListener>' is not assignable to parameter of type 'RuleModule<"loopOverEnum", [], unknown, RuleListener>'.
  Types of property 'create' are incompatible.
    Type '(context: Readonly<import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule").RuleContext<"loopOverEnum", []>>) => import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule").R...' is not assignable to type '(context: Readonly<import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/typescript-eslint/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule").RuleContext<"loopOverEnum", []>>) => import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/typescript-eslint...'.
      Types of parameters 'context' and 'context' are incompatible.
        Type 'Readonly<import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/typescript-eslint/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule").RuleContext<"loopOverEnum", []>>' is not assignable to type 'Readonly<import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule").RuleContext<"loopOverEnum", []>>'.
          The types of 'languageOptions.globals' are incompatible between these types.
            Type 'import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/typescript-eslint/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").SharedConfig.GlobalsConfig | undefined' is not assignable to type 'import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").SharedConfig.GlobalsConfig | undefined'.
              Type 'import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/typescript-eslint/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").SharedConfig.GlobalsConfig' is not assignable to type 'import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").SharedConfig.GlobalsConfig'.
                'string' index signatures are incompatible.
                  Type 'import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/typescript-eslint/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").SharedConfig.GlobalVariableOption' is not assignable to type 'import("/Users/baruch/source/with/eslint-plugin-example-typed-linting/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").SharedConfig.GlobalVariableOption'.
                    Type '"readable"' is not assignable to type 'GlobalVariableOption'.

26 ruleTester.run("no-loop-over-enum", rule, {
                                       ~~~~


Found 1 error in src/rules/no-loop-over-enum.test.ts:26

That's happened because the ruleTester.run expects the RuleModule generic Docs type to be unknown, but it isn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: accepting prsPlease, send a pull request to resolve this! 🙏type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions