stricter rules
This commit is contained in:
parent
4f58a6603e
commit
b4156074eb
104
.eslintrc.json
104
.eslintrc.json
@ -1,36 +1,25 @@
|
||||
{
|
||||
"root": true,
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true
|
||||
"browser": true
|
||||
},
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.ts"],
|
||||
"files": ["*.ts"],
|
||||
"extends": ["plugin:@typescript-eslint/recommended"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"rules": {
|
||||
"@angular-eslint/directive-selector": [
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@typescript-eslint/explicit-member-accessibility": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "iqser",
|
||||
"style": "camelCase"
|
||||
"accessibility": "no-public"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "iqser",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/prefer-on-push-component-change-detection": "error",
|
||||
"@angular-eslint/use-lifecycle-interface": "error",
|
||||
"@angular-eslint/no-input-prefix": "error",
|
||||
"@angular-eslint/no-input-rename": "error",
|
||||
"@angular-eslint/no-output-on-prefix": "error",
|
||||
"@angular-eslint/no-output-rename": "error",
|
||||
"@angular-eslint/prefer-output-readonly": "error",
|
||||
"@typescript-eslint/unbound-method": "error",
|
||||
"@typescript-eslint/no-floating-promises": "off",
|
||||
"@typescript-eslint/naming-convention": [
|
||||
@ -54,14 +43,79 @@
|
||||
"leadingUnderscore": "allow"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
"@typescript-eslint/lines-between-class-members": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@angular-eslint/recommended",
|
||||
"plugin:@angular-eslint/recommended--extra",
|
||||
"plugin:@angular-eslint/template/process-inline-templates",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:rxjs/recommended"
|
||||
],
|
||||
"rules": {
|
||||
"rxjs/no-ignored-subscription": "error",
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "iqser",
|
||||
"style": "camelCase"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "iqser",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/prefer-on-push-component-change-detection": "error",
|
||||
"@angular-eslint/use-lifecycle-interface": "error",
|
||||
"@angular-eslint/no-input-prefix": "error",
|
||||
"@angular-eslint/no-input-rename": "error",
|
||||
"@angular-eslint/no-output-on-prefix": "error",
|
||||
"@angular-eslint/no-output-rename": "error",
|
||||
"@angular-eslint/prefer-output-readonly": "error",
|
||||
"no-underscore-dangle": "off",
|
||||
"no-param-reassign": "error",
|
||||
"no-dupe-class-members": "off",
|
||||
"no-redeclare": "off",
|
||||
"no-unused-vars": "off",
|
||||
"consistent-return": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
"@typescript-eslint/lines-between-class-members": "off"
|
||||
"consistent-return": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@angular-eslint/template/recommended"]
|
||||
},
|
||||
{
|
||||
// https://github.com/angular-eslint/angular-eslint#notes-for-eslint-plugin-prettier-users
|
||||
"files": ["*.html"],
|
||||
"excludedFiles": ["*inline-template-*.component.html"],
|
||||
"extends": ["plugin:prettier/recommended"],
|
||||
"rules": {
|
||||
"prettier/prettier": [
|
||||
"error",
|
||||
{
|
||||
"parser": "angular"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["**/*.spec.ts"],
|
||||
"env": {
|
||||
"node": true,
|
||||
"jest": true
|
||||
},
|
||||
"rules": {
|
||||
"@angular-eslint/prefer-on-push-component-change-detection": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import { ChangeDetectionStrategy, Component, Input, Optional } from '@angular/core';
|
||||
import { SortingOrders, SortingService } from '../../sorting';
|
||||
import { KeysOf, Required } from '../../utils';
|
||||
import { KeysOf } from '../../utils';
|
||||
import { Id, IListable } from '../models';
|
||||
|
||||
const ifHasRightIcon = <T extends IListable>(thisArg: TableColumnNameComponent<T>) => !!thisArg.rightIcon;
|
||||
|
||||
@Component({
|
||||
selector: 'iqser-table-column-name [label]',
|
||||
templateUrl: './table-column-name.component.html',
|
||||
@ -19,7 +17,7 @@ export class TableColumnNameComponent<T extends IListable<PrimaryKey>, PrimaryKe
|
||||
@Input() class?: string;
|
||||
@Input() leftIcon?: string;
|
||||
@Input() rightIcon?: string;
|
||||
@Input() @Required(ifHasRightIcon) rightIconTooltip?: string;
|
||||
@Input() rightIconTooltip?: string;
|
||||
|
||||
constructor(@Optional() readonly sortingService: SortingService<T>) {}
|
||||
}
|
||||
|
||||
@ -415,7 +415,7 @@ describe('Permission directive with different async functions in permissions via
|
||||
permissionsService.add({
|
||||
ADMIN: (name, store) => {
|
||||
expect(name).toBeTruthy();
|
||||
expect(store[name!].name).toBeTruthy();
|
||||
expect(store[name].name).toBeTruthy();
|
||||
return name === ADMIN;
|
||||
},
|
||||
});
|
||||
@ -483,7 +483,7 @@ describe('Permission directive testing different async functions in permissions
|
||||
permissionsService.add({
|
||||
ADMIN: (name, store) => {
|
||||
expect(name).toBeTruthy();
|
||||
expect(store[name!].name).toBeTruthy();
|
||||
expect(store[name].name).toBeTruthy();
|
||||
return name === ADMIN;
|
||||
},
|
||||
});
|
||||
|
||||
@ -386,7 +386,7 @@ describe('Permission directive with different async functions in permissions via
|
||||
permissionsService.add({
|
||||
ADMIN: (name, store) => {
|
||||
expect(name).toBeTruthy();
|
||||
expect(store[name!].name).toBeTruthy();
|
||||
expect(store[name].name).toBeTruthy();
|
||||
return name === ADMIN;
|
||||
},
|
||||
});
|
||||
@ -468,7 +468,7 @@ describe('Permission directive testing different async functions in permissions
|
||||
permissionsService.add({
|
||||
ADMIN: (name, store) => {
|
||||
expect(name).toBeTruthy();
|
||||
expect(store[name!].name).toBeTruthy();
|
||||
expect(store[name].name).toBeTruthy();
|
||||
return name === ADMIN;
|
||||
},
|
||||
});
|
||||
|
||||
@ -121,7 +121,7 @@ export class IqserPermissionsGuard implements CanActivate, CanMatch, CanActivate
|
||||
return redirectHandle.then(() => false);
|
||||
}
|
||||
|
||||
if (!!failedPermission) {
|
||||
if (failedPermission) {
|
||||
const redirectHandle = this.#handleRedirectOfFailedPermission(permissions, failedPermission, route, state);
|
||||
return redirectHandle.then(() => !pass);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user