Add eslint ban rule (#2517)

This commit is contained in:
Pablo Martinez Garcia
2022-05-05 14:06:36 +02:00
committed by GitHub
parent 9a2bca0611
commit 1b61687a1d
3 changed files with 22 additions and 1 deletions

View File

@@ -19,9 +19,20 @@
"plugins": [
"eslint-plugin-rxjs",
"eslint-plugin-unicorn",
"prettier"
"prettier",
"ban"
],
"rules": {
"ban/ban": [
"error",
{ "name": "eval", "message": "Calls to eval is not allowed." },
{ "name": "fdescribe", "message": "Calls to fdescribe is not allowed" },
{ "name": "fit", "message": "Calls to fit is not allowed" },
{ "name": "xit", "message": "Calls to xit is not allowed" },
{ "name": "xdescribe", "message": "Calls to xdescribe is not allowed" },
{ "name": ["test", "only"], "message": "Calls to test.only is not allowed" },
{ "name": ["describe", "only"], "message": "Calls to describe.only is not allowed" }
],
"prettier/prettier": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",

9
package-lock.json generated
View File

@@ -8105,6 +8105,15 @@
}
}
},
"eslint-plugin-ban": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-ban/-/eslint-plugin-ban-1.6.0.tgz",
"integrity": "sha512-gZptoV+SFHOHO57/5lmPvizMvSXrjFatP9qlVQf3meL/WHo9TxSoERygrMlESl19CPh95U86asTxohT8OprwDw==",
"dev": true,
"requires": {
"requireindex": "~1.2.0"
}
},
"eslint-plugin-import": {
"version": "2.25.4",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz",

View File

@@ -87,6 +87,7 @@
"dotenv-expand": "^5.1.0",
"envsub": "^4.0.7",
"eslint": "^7.6.0",
"eslint-plugin-ban": "^1.6.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.3",