Add eslint ban rule (#7611)

This commit is contained in:
Pablo Martinez Garcia 2022-05-11 11:18:38 +02:00 committed by GitHub
parent e844faff79
commit 0b2e218b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 2 deletions

View File

@ -22,9 +22,20 @@
],
"plugins": [
"eslint-plugin-unicorn",
"eslint-plugin-rxjs"
"eslint-plugin-rxjs",
"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" }
],
"@angular-eslint/component-selector": [
"error",
{

View File

@ -24,7 +24,7 @@ import { CoreTestingModule } from '../../../testing';
import { TranslateModule } from '@ngx-translate/core';
import { filter } from 'rxjs/operators';
fdescribe('WidgetComponent', () => {
describe('WidgetComponent', () => {
let widget: WidgetComponent;
let fixture: ComponentFixture<WidgetComponent>;

9
package-lock.json generated
View File

@ -31249,6 +31249,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

@ -142,6 +142,7 @@
"css-loader": "^5.2.6",
"dotenv": "^8.2.0",
"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.2",