vuejs / vue-eslint-parser

The ESLint custom parser for `.vue` files.
MIT License
443 stars 74 forks source link

Normal type errors cannot be returned by vue-eslint-parser #154

Closed ldc2726 closed 2 years ago

ldc2726 commented 2 years ago

In line 453 it is clear that 'string' cannot be assigned to 'number', but ESLint did not catch this error

image

module.exports = {
  root: true,
  env: {
    browser: true,
  },
  parser: "vue-eslint-parser",
  extends: [
    'plugin:vue/vue3-essential',
    '@vue/standard',
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:@typescript-eslint/eslint-recommended'
  ],
  parserOptions: {
    parser: {
      ts: '@typescript-eslint/parser',
    },
    project: ['./tsconfig.json'],
    extraFileExtensions: ['.vue'],
    // "parser": "@typescript-eslint/parser",
    // "sourceType": "module",
    // project:{
    //   extends:'./tsconfig.json'
    // }
  },
  plugins: [
    "vue",
    "@typescript-eslint",
    // "@typescript-eslint/eslint-plugin",
  ]
}
ldc2726 commented 2 years ago

sorry,Just learned that ESLint does not recommend printing errors to ESLint, but instead uses vue's 'vue-tsc' for detection