I am converting my tslint to eslint using below
Reference : https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin-tslint#usage
This is my tslint.json
file:
https://github.com/kumaresan-subramani/ESlint-tester/blob/main/tslint.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
}
While giving below command i a facing an error
yarn run 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.
You are using typescript-eslint which is a :
ESLint plugin [that] wraps a TSLint configuration and lints the whole source using TSLint.
But the error message:
Could not find implementations for the following rules specified in the configuration:
comes from TSLint itself. The reason is that the rules in your tslint.json
are not compatible with your TSLint version.
You have to either change the TSLint version or adapt the rules by reviewing the TSLint ChangeLog. Note that typescript-eslint need a 5.x or 6.x TSLint version (See its package.json).
You can also check this SO question: Update TSLint Errors : Could not find implementations for the following rules specified in the configuration