标签: eslint-plugin-vue

ESLint“文件扩展名 (.vue) 是非标准”错误

eslint --ext \".js,.ts,.vue\" --ignore-path .gitignore .使用 运行脚本时npm run lint,出现以下错误。

/(somethingSomething...)/Test.vue
  0:0  error  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: components/Test.vue.
The extension for the file (.vue) is non-standard. You should add "parserOptions.extraFileExtensions" to your config
Run Code Online (Sandbox Code Playgroud)

我正在使用vue-eslint-parsereslint-plugin-vue作为 devDependency。并.eslintrc.js包含

...
extends: [
...
    'plugin:vue/recommended',
    "eslint:recommended"
  ],
  parser: "vue-eslint-parser",
  parserOptions: {
    parser: "@typescript-eslint/parser",
    project: './tsconfig.eslint.json'
  },
  plugins: [
    'html',
    'vue',
    'jest'
  ],
...
Run Code Online (Sandbox Code Playgroud)

如手册中所述。并且tsconfig.eslint.json …

eslint tsconfig vue.js eslint-plugin-vue

7
推荐指数
0
解决办法
3136
查看次数

Eslint:如何使用全局安装的 eslint-plugin-vue

我想使用 linter elint-plugin-vue作为全局node_modules安装,因为我经常使用 Docker,并且我的存储库根目录下可能没有文件夹。
\n之前,我已经像这样安装了 linter:sudo npm install -g eslint eslint-plugin-vue vue-eslint-parser

\n

然而,当/usr/bin/eslint --ext .vue Footer.vue在没有任何东西的情况下运行时node_modules文件夹的情况下运行时,我得到以下信息:

\n
Oops! Something went wrong! :(\n\nESLint: 7.23.0\n\nESLint couldn't find the plugin "eslint-plugin-vue".\n\n(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "/home/user".)\n\nIt's likely that the plugin isn't installed correctly. Try reinstalling by running the following:\n\n    npm install eslint-plugin-vue@latest --save-dev\n\nThe plugin "eslint-plugin-vue" was referenced from the config file in "PersonalConfig".\n\nIf …
Run Code Online (Sandbox Code Playgroud)

node.js eslint vue.js eslint-plugin-vue

6
推荐指数
1
解决办法
2271
查看次数

vue.js 使用 eslint-plugin-vue 禁用 <template> 中的 max-len

如何在 <template> </template>.vue 文件的标签内全局禁用 max-len 警告?

我想这样做的原因是我不想 <!-- eslint-disable max-len --> 每次都写。

我也不想在整个 vue 文件中全局禁用它,所以我仍然想在脚本标记中收到警告。

vue.js eslint-plugin-vue

1
推荐指数
1
解决办法
1396
查看次数

标签 统计

eslint-plugin-vue ×3

vue.js ×3

eslint ×2

node.js ×1

tsconfig ×1