Skip to content

eslint: @typescript-eslint error when add some rules #123

@troy351

Description

@troy351
  • Create vue 2 project using following config
    QQ截图20220715152725

  • npm install

  • add rules inside .eslintrc.cjs

    rules: {
        "@typescript-eslint/prefer-optional-chain": "error"
    }
  • npm run lint

  • terminal error

    Error: Error while loading rule '@typescript-eslint/prefer-optional-chain': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.

FYI.
Adding parserOptions: { project: ["tsconfig.json"] } to .eslintrc.cjs won't help.
Maybe caused by eslint-plugin-vue or @typescript-eslint

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions