Migrated to ESLint

merge-requests/7/head
Nato Boram 2022-03-10 16:57:15 -05:00
parent 295aef9ac1
commit 4b30fc615c
No known key found for this signature in database
GPG Key ID: 478E3C64BF88AFFA
7 changed files with 853 additions and 693 deletions

51
.eslintrc.json Normal file
View File

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

View File

@ -5,13 +5,12 @@
"recommendations": [ "recommendations": [
"angular.ng-template", "angular.ng-template",
"davidanson.vscode-markdownlint", "davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig", "editorconfig.editorconfig",
"gitlab.gitlab-workflow", "gitlab.gitlab-workflow",
"hookyqr.beautify",
"johnpapa.angular2", "johnpapa.angular2",
"ms-vscode.vscode-typescript-next", "ms-vscode.vscode-typescript-next",
"ms-vscode.vscode-typescript-tslint-plugin", "visualstudioexptteam.vscodeintellicode",
"visualstudioexptteam.vscodeintellicode"
], ],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [ "unwantedRecommendations": [

View File

@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
* Upgraded to Angular 12 * Upgraded to Angular 12
* Upgraded TSLint rules * Upgraded TSLint rules
* Updated `gateways.json` * Updated `gateways.json`
* Upgraded to Angular 13
* Changed to ESLint
### Deprecated ### Deprecated

View File

@ -3,7 +3,8 @@
"version": 1, "version": 1,
"cli": { "cli": {
"packageManager": "yarn", "packageManager": "yarn",
"analytics": "10b848ad-8b81-4346-852f-5eff89573a85" "analytics": "10b848ad-8b81-4346-852f-5eff89573a85",
"defaultCollection": "@angular-eslint/schematics"
}, },
"newProjectRoot": "projects", "newProjectRoot": "projects",
"projects": { "projects": {
@ -165,6 +166,15 @@
"devServerTarget": "public-gateway-cacher:serve:production" "devServerTarget": "public-gateway-cacher:serve:production"
} }
} }
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
} }
} }
} }

View File

@ -56,13 +56,20 @@
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~13.2.6", "@angular-devkit/build-angular": "~13.2.6",
"@angular-eslint/builder": "13.1.0",
"@angular-eslint/eslint-plugin": "13.1.0",
"@angular-eslint/eslint-plugin-template": "13.1.0",
"@angular-eslint/schematics": "13.1.0",
"@angular-eslint/template-parser": "13.1.0",
"@angular/cli": "~13.2.6", "@angular/cli": "~13.2.6",
"@angular/compiler-cli": "~13.2.6", "@angular/compiler-cli": "~13.2.6",
"@angular/language-service": "~13.2.6", "@angular/language-service": "~13.2.6",
"@types/jasmine": "~3.6.0", "@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3", "@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1", "@types/node": "^12.11.1",
"codelyzer": "^6.0.2", "@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"eslint": "^8.2.0",
"jasmine-core": "~3.6.0", "jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0", "jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.17", "karma": "~6.3.17",
@ -71,12 +78,7 @@
"karma-jasmine": "~4.0.0", "karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0", "karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0", "protractor": "~7.0.0",
"rxjs-tslint-rules": "^4.33.3",
"ts-node": "~8.10.2", "ts-node": "~8.10.2",
"tslint": "~6.1.2",
"tslint-consistent-codestyle": "^1.16.0",
"tslint-origin-ordered-imports-rule": "^2.0.0",
"tslint-rxjs-subject-restrictions-rule": "^1.0.4",
"typescript": "~4.5.5" "typescript": "~4.5.5"
}, },
"private": true "private": true

View File

@ -1,324 +0,0 @@
{
"extends": [
"tslint:recommended",
"rxjs-tslint-rules"
],
"linterOptions": {
"exclude": [
"**/*-routing.module.ts",
"src/polyfills.ts",
"src/test.ts",
"**/*.po.ts"
]
},
"rules": {
"align": {
"options": [
"parameters",
"statements"
]
},
"array-type": false,
"arrow-parens": false,
"arrow-return-shorthand": [
true,
"multiline"
],
"ban-types": [
true,
[
"Object",
"Use {} instead."
],
[
"String"
]
],
"callable-types": true,
"component-class-suffix": true,
"component-max-inline-declarations": true,
"component-selector": [
true,
"element",
"app",
"kebab-case"
],
"contextual-decorator": false,
"contextual-lifecycle": true,
"curly": true,
"cyclomatic-complexity": [
true,
20
],
"deprecation": {
"severity": "warning"
},
"directive-class-suffix": true,
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"encoding": true,
"eofline": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-destructuring-spacing": true,
"import-spacing": true,
"increment-decrement": [
true,
"allow-post"
],
"indent": {
"options": [
"spaces"
]
},
"interface-name": false,
"max-classes-per-file": false,
"max-file-line-count": [
true,
400
],
"max-line-length": [
true,
{
"ignore-pattern": "^import |^export {(.*?)}|class [a-zA-Z]+ implements |// ",
"limit": 140
}
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"public-static-field",
"private-static-field",
"public-instance-field",
"private-instance-field",
"public-constructor",
"private-constructor",
"public-instance-method",
"protected-instance-method",
"private-instance-method",
"public-static-method",
"protected-static-method",
"private-static-method"
]
}
],
"newline-before-return": false,
"no-any": [
true,
{
"ignore-rest-args": true
}
],
"no-arg": true,
"no-attribute-decorator": true,
"no-collapsible-if": true,
"no-conflicting-lifecycle": true,
"no-consecutive-blank-lines": [
true,
1
],
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-default-export": true,
"no-default-import": true,
"no-duplicate-imports": true,
"no-duplicate-super": true,
"no-duplicate-switch-case": true,
"no-empty": [
true,
"allow-empty-functions"
],
"no-for-in-array": true,
"no-forward-ref": true,
"no-host-metadata-property": true,
"no-implicit-dependencies": [
false,
"dev"
],
"no-import-side-effect": [
true,
{
"ignore-module": "(hammerjs|core-js|zone.js)"
}
],
"no-inferrable-types": [
true,
"ignore-params"
],
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-invalid-template-strings": true,
"no-invalid-this": [
true,
"check-function-in-method"
],
"no-lifecycle-call": true,
"no-misused-new": true,
"no-non-null-assertion": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-outputs-metadata-property": true,
"no-pipe-impure": true,
"no-queries-metadata-property": true,
"no-redundant-jsdoc": true,
"no-reference": true,
"no-require-imports": true,
"no-return-await": true,
"no-return-undefined": true,
"no-static-this": true,
"no-switch-case-fall-through": true,
"no-tautology-expression": true,
"no-this-assignment": true,
"no-trailing-whitespace": true,
"no-unbound-method": true,
"no-unnecessary-callback-wrapper": true,
"no-unnecessary-class": [
true,
"allow-constructor-only",
"allow-static-only",
"allow-empty-class"
],
"no-unnecessary-initializer": true,
"no-unnecessary-type-assertion": true,
"no-unsafe-finally": true,
"no-unused": true,
"no-unused-css": true,
"no-var-keyword": true,
"no-var-requires": false,
"object-literal-key-quotes": [
true,
"as-needed"
],
"object-literal-sort-keys": false,
"ordered-imports": false,
"origin-ordered-imports": [
true
],
"prefer-const": true,
"prefer-inline-decorator": false,
"prefer-output-readonly": true,
"prefer-readonly": true,
"prefer-template": true,
"quotemark": [
true,
"single"
],
"radix": false,
"restrict-plus-operands": true,
"rx-subject-restrictions": true,
"rxjs-no-compat": true,
"rxjs-no-internal": true,
"semicolon": {
"options": [
"always"
]
},
"space-before-function-paren": [
true,
{
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
],
"space-within-parens": true,
"template-banana-in-box": true,
"template-conditional-complexity": true,
"template-no-call-expression": true,
"template-no-negated-async": true,
"template-use-track-by-function": true,
"trailing-comma": [
true,
{
"esSpecCompliant": true,
"multiline": {
"arrays": "ignore",
"functions": "never",
"objects": "ignore",
"typeLiterals": "ignore"
}
}
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef": [
true,
"call-signature",
"property-declaration",
"object-destructuring",
"arrow-call-signature"
],
"typedef-whitespace": {
"options": [
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
]
},
"unnecessary-else": [
true,
{
"allow-else-if": true
}
],
"use-component-view-encapsulation": true,
"use-isnan": true,
"use-lifecycle-interface": true,
"use-pipe-decorator": true,
"use-pipe-transform-interface": true,
"variable-name": {
"options": [
"ban-keywords",
"check-format",
"allow-leading-underscore",
"allow-pascal-case"
]
},
"whitespace": {
"options": [
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
}
},
"rulesDirectory": [
"codelyzer",
"node_modules/tslint-origin-ordered-imports-rule/dist",
"node_modules/tslint-rxjs-subject-restrictions-rule/dist",
"node_modules/tslint-consistent-codestyle/rules"
]
}

1136
yarn.lock

File diff suppressed because it is too large Load Diff