Moving to eslint, and fixing all the linting errors it reported.

This commit is contained in:
Dan 2021-08-10 09:58:37 -04:00
parent 1ee62ef57f
commit 735590aa3b
10 changed files with 7670 additions and 12413 deletions

47
.eslintrc.json Normal file
View File

@ -0,0 +1,47 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"prefix": "app",
"style": "kebab-case",
"type": "element"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"prefix": "app",
"style": "camelCase",
"type": "attribute"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}

View File

@ -99,7 +99,7 @@
"builder": "@angular-builders/custom-webpack:dev-server",
"options": {
"port": 5002,
"browserTarget": "cr-connect-bpmn:build",
"browserTarget": "cr-connect-bpmn:build"
},
"configurations": {
"production": {
@ -141,14 +141,11 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
@ -172,11 +169,11 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
"lintFilePatterns": [
"e2e//**/*.ts",
"e2e//**/*.html"
]
}
}
@ -190,6 +187,7 @@
}
},
"cli": {
"analytics": false
"analytics": false,
"defaultCollection": "@angular-eslint/schematics"
}
}

45
e2e/.eslintrc.json Normal file
View File

@ -0,0 +1,45 @@
{
"ignorePatterns": [
"!**/*"
], "overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"prefix": "app",
"style": "kebab-case",
"type": "element"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"prefix": "app",
"style": "camelCase",
"type": "attribute"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}

19799
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@
"camunda-bpmn-moddle": "^4.4.0",
"camunda-dmn-moddle": "^1.0.0",
"diagram-js": "^6.6.1",
"diagram-js-code-editor": "/home/alicia/Connect/development/diagram-js-code-editor",
"diagram-js-code-editor": "^1.1.5",
"diagram-js-minimap": "^2.0.3",
"dmn-js": "^7.5.1",
"dmn-js-properties-panel": "^0.3.5",
@ -56,7 +56,7 @@
"ngx-markdown": "^12.0.1",
"protractor": "~7.0.0",
"rxjs": "^6.5.5",
"sartography-workflow-lib": "/home/alicia/Connect/sartography-libraries/dist/sartography-workflow-lib",
"sartography-workflow-lib": "^0.0.537",
"tslib": "^2.0.0",
"uuid": "^7.0.2",
"zone.js": "~0.11.4"
@ -64,6 +64,11 @@
"devDependencies": {
"@angular-builders/custom-webpack": "^12.1.0",
"@angular-devkit/build-angular": "^12.1.3",
"@angular-eslint/builder": "12.3.1",
"@angular-eslint/eslint-plugin": "12.3.1",
"@angular-eslint/eslint-plugin-template": "12.3.1",
"@angular-eslint/schematics": "12.3.1",
"@angular-eslint/template-parser": "12.3.1",
"@angular/cli": "^12.1.3",
"@angular/compiler-cli": "^12.1.3",
"@angular/language-service": "^12.1.3",
@ -74,8 +79,13 @@
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "^2.0.8",
"@types/node": "^12.12.50",
"@typescript-eslint/eslint-plugin": "4.28.2",
"@typescript-eslint/parser": "4.28.2",
"babel-loader": "^8.2.2",
"codelyzer": "^6.0.0",
"eslint": "^7.26.0",
"eslint-plugin-import": "latest",
"eslint-plugin-jsdoc": "latest",
"eslint-plugin-prefer-arrow": "latest",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.4",
@ -89,7 +99,6 @@
"puppeteer": "^2.1.1",
"sonar-scanner": "^3.1.0",
"ts-node": "~8.6.2",
"tslint": "~6.1.0",
"typescript": "~4.3.5",
"webpack": "^5.48.0",
"webpack-dev-server": "^3.11.0",

View File

@ -6,7 +6,7 @@ import {AppEnvironment} from 'sartography-workflow-lib';
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.scss']
})
export class FooterComponent implements OnInit {
export class FooterComponent {
title: string;
@ -14,7 +14,4 @@ export class FooterComponent implements OnInit {
this.title = environment.title;
}
ngOnInit() {
}
}

View File

@ -1,4 +1,4 @@
import {Component, OnInit} from '@angular/core';
import {Component} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {MatSnackBar} from '@angular/material/snack-bar';
import * as fileSaver from 'file-saver';
@ -11,7 +11,7 @@ import {OpenFileDialogData} from '../_interfaces/dialog-data';
templateUrl: './reference-files.component.html',
styleUrls: ['./reference-files.component.scss']
})
export class ReferenceFilesComponent implements OnInit {
export class ReferenceFilesComponent {
referenceFiles: FileMeta[];
constructor(
@ -22,9 +22,6 @@ export class ReferenceFilesComponent implements OnInit {
this._loadReferenceFiles();
}
ngOnInit(): void {
}
_loadReferenceFiles() {
this.apiService.listReferenceFiles().subscribe(f => this.referenceFiles = f);
}

View File

@ -1,4 +1,4 @@
import {Component, EventEmitter, Input, OnInit, Output, TemplateRef} from '@angular/core';
import {Component, Input, TemplateRef} from '@angular/core';
import {ApiService, WorkflowSpec} from 'sartography-workflow-lib';
@Component({
@ -6,7 +6,7 @@ import {ApiService, WorkflowSpec} from 'sartography-workflow-lib';
templateUrl: './workflow-spec-card.component.html',
styleUrls: ['./workflow-spec-card.component.scss']
})
export class WorkflowSpecCardComponent implements OnInit {
export class WorkflowSpecCardComponent {
@Input() workflowSpec: WorkflowSpec;
@Input() actionButtons: TemplateRef<any>;
@ -14,7 +14,4 @@ export class WorkflowSpecCardComponent implements OnInit {
private api: ApiService
) {
}
ngOnInit(): void {
}
}

View File

@ -47,7 +47,7 @@
</mat-expansion-panel-header>
<mat-list>
<mat-list-item *ngFor="let wfs of cat.workflow_specs" class="workflow-spec" fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start center">
<a [ngClass]="{'spec_menu_item':true, 'spec-selected': wfs.id == selectedSpec.id}" (click)="selectSpec(wfs)">{{wfs.display_name}}</a>
<a [ngClass]="{'spec_menu_item':true, 'spec-selected': wfs.id === selectedSpec.id}" (click)="selectSpec(wfs)">{{wfs.display_name}}</a>
<span class="spec-actions" fxLayout="row" fxLayoutGap="10px" *ngIf="cat.id !== null">
<button
*ngIf="cat && cat.workflow_specs.length > 0 && wfs.display_order !== 0"

View File

@ -1,130 +0,0 @@
{
"rulesDirectory": [
"codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"deprecation": {
"severity": "warn"
},
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"no-output-on-prefix": true,
"no-inputs-metadata-property": true,
"no-outputs-metadata-property": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-output-rename": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
}
}