簡體   English   中英

找不到配置中指定的以下規則的實現

[英]Could not find implementations for the following rules specified in the configuration

我正在使用下面將我的 tslint 轉換為 eslint

參考: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin-tslint#usage

這是我的tslint.json文件:

https://github.com/kumaresan-subramani/ESlint-tester/blob/main/tslint.json

我的 eslint.json 文件

 { "env": { "browser": true, "es2021": true }, "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended" ], "parser": "@typescript-eslint/parser", "plugins": [ "@typescript-eslint", "@typescript-eslint/tslint" ], "parserOptions": { "project": "tsconfig.json" }, "rules": { "@typescript-eslint/tslint/config": ["warn", { "lintFile": "./tslint.json", // path to tslint.json of your project "rules": {}, "rulesDirectory": [ "node_modules/tslint-eslint-rules/dist/rules" ] }] }, "reportUnusedDisableDirectives": true }

在給出以下命令時 ia 面臨錯誤

紗線運行 eslint src

錯誤

 D:\today\ESlint-tester>yarn run eslint src yarn run v1.21.1 $ D:\today\ESlint-tester\node_modules\.bin\eslint src Could not find implementations for the following rules specified in the configuration: chai-vague-errors no-redundant-jsdoc missing-optional-annotation no-backbone-get-set-outside-model no-banned-terms no-cookies no-delete-expression no-document-write no-document-domain no-disable-auto-sanitization no-duplicate-parameter-names no-empty-interfaces no-exec-script no-function-constructor-with-string-args no-function-expression no-for-in no-multiline-string no-multiple-var-decl no-unnecessary-bind no-unnecessary-semicolons no-octal-literal no-sparse-arrays no-string-based-set-immediate no-string-based-set-interval no-unused-imports no-with-statement prefer-array-literal promise-must-complete react-no-dangerous-html use-named-parameter max-func-body-length no-empty-line-after-opening-brace Try upgrading TSLint and/or ensuring that you have all necessary custom rules installed. If TSLint was recently upgraded, you may have old rules configured which need to be cleaned up.

您正在使用typescript-eslint這是一個:

ESLint 插件 [that] 包裝了 TSLint 配置並使用 TSLint 對整個源代碼進行 lints。

但錯誤信息:

Could not find implementations for the following rules specified in the configuration:

來自 TSLint 本身。 原因是您的tslint.json中的規則與您的 TSLint 版本不兼容。

您必須更改 TSLint 版本或通過查看TSLint ChangeLog來調整規則。 請注意,typescript-eslint 需要 5.x 或 6.x TSLint 版本(參見其package.json )。

您還可以檢查這個 SO 問題: 更新 TSLint 錯誤:找不到配置中指定的以下規則的實現

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM