vuejs/vue-eslint-parser

Missing typings for .vue files when running with typescript-eslint

danieldasilva-smake opened this issue · 2 comments

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I'm using eslint-plugin-vue.
  • I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-vue repo and open the issue in eslint-plugin-vue repo if there is no solution.
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

8.57.0

What version of eslint-plugin-vue and vue-eslint-parser are you using?

  • vue-eslint-parser@9.4.2
  • eslint-plugin-vue@9.25.0

What did you do?

I created a new Vue.js project with TS + ESLint and updated the .eslintrc.cjs to add the @typescript-eslint/no-unsafe-argument rule.

I also set the parserOptions.project and parserOptions.parser options so that typescript-eslint works.

Configuration
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
  root: true,
  extends: [
    "plugin:vue/vue3-essential",
    "eslint:recommended",
    "@vue/eslint-config-typescript",
  ],
  parserOptions: {
    ecmaVersion: "latest",
    project: "./tsconfig*.json",
    parser: {
      js: "@typescript-eslint/parser",
      jsx: "@typescript-eslint/parser",
      cjs: "@typescript-eslint/parser",
      mjs: "@typescript-eslint/parser",
      ts: "@typescript-eslint/parser",
      tsx: "@typescript-eslint/parser",
      cts: "@typescript-eslint/parser",
      mts: "@typescript-eslint/parser",
      "<template>": "espree",
    },
  },
  rules: {
    "@typescript-eslint/no-unsafe-argument": "error",
  },
};

What did you expect to happen?

No errors to be shown when running npm run lint

What actually happened?

I got an @typescript-eslint/no-unsafe-argument error in the src/main.ts because the App.vue file couldn't be typed when passing it to createApp.

Link to Minimal Reproducible Example

https://github.com/danieldasilva-smake/missing-vue-file-typings-eslint

Additional comments

No response

Duplicate of #104 ("[no-unsafe-*] rules" section)?

Duplicate of #104 ("[no-unsafe-*] rules" section)?

Yes, thank you :)