小编Kar*_*ind的帖子

无法加载在“.eslintrc.cjs”中声明的插件“@typescript-eslint”:意外的标记“。”

我\xe2\x80\x99m 使用 TypeScript 和 ESLint 开发 React 项目。我有以下版本的eslinttypescript-eslint我的 package.json 文件中

\n
"@typescript-eslint/eslint-plugin": "^6.3.0",\n"@typescript-eslint/parser": "^6.0.0",\n"eslint": "^8.45.0",\n
Run Code Online (Sandbox Code Playgroud)\n

我也有以下.eslintrc.cjs文件:

\n
/* eslint-env node */\n\nmodule.exports = {\n  root: true,\n  env: { browser: true, es2020: true },\n  extends: [\n    \'eslint:recommended\',\n    \'plugin:@typescript-eslint/recommended\',\n    \'plugin:@typescript-eslint/recommended-requiring-type-checking\',\n    \'plugin:react-hooks/recommended\',\n  ],\n  parser: \'@typescript-eslint/parser\',\n  parserOptions: {\n    ecmaVersion: \'latest\',\n    sourceType: \'module\',\n    project: true,\n    tsconfigRootDir: __dirname,\n  },\n  plugins: [\'react-refresh\'],\n  rules: {\n    \'react-refresh/only-export-components\': [\n      \'warn\',\n      { allowConstantExport: true },\n    ],\n    \'@typescript-eslint/no-non-null-assertion\': \'off\',\n    "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],\n  },\n}\n …
Run Code Online (Sandbox Code Playgroud)

webstorm typescript-eslint

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

标签 统计

typescript-eslint ×1

webstorm ×1