mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
WebApp CI: Converting tslint to eslint
This commit is contained in:
parent
b7050c3a01
commit
efa94f47dc
75
front/.eslintrc.json
Normal file
75
front/.eslintrc.json
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"ignorePatterns": [
|
||||||
|
"projects/**/*"
|
||||||
|
],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.ts"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"project": [
|
||||||
|
"tsconfig.json"
|
||||||
|
],
|
||||||
|
"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": {}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"indent": [
|
||||||
|
"error",
|
||||||
|
"tab",
|
||||||
|
{
|
||||||
|
"SwitchCase": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"linebreak-style": [
|
||||||
|
"error",
|
||||||
|
"unix"
|
||||||
|
],
|
||||||
|
"quotes": [
|
||||||
|
"error",
|
||||||
|
"double"
|
||||||
|
],
|
||||||
|
"semi": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"brace-style": [
|
||||||
|
"error",
|
||||||
|
"allman"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,8 @@
|
|||||||
"version": 1,
|
"version": 1,
|
||||||
"cli": {
|
"cli": {
|
||||||
"packageManager": "yarn",
|
"packageManager": "yarn",
|
||||||
"analytics": false
|
"analytics": false,
|
||||||
|
"defaultCollection": "@angular-eslint/schematics"
|
||||||
},
|
},
|
||||||
"newProjectRoot": "projects",
|
"newProjectRoot": "projects",
|
||||||
"projects": {
|
"projects": {
|
||||||
@ -44,7 +45,9 @@
|
|||||||
"./node_modules/hls.js/dist/hls.js"
|
"./node_modules/hls.js/dist/hls.js"
|
||||||
],
|
],
|
||||||
"stylePreprocessorOptions": {
|
"stylePreprocessorOptions": {
|
||||||
"includePaths": ["src"]
|
"includePaths": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
@ -105,12 +108,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
"builder": "@angular-eslint/builder:lint",
|
||||||
"options": {
|
"options": {
|
||||||
"tsConfig": "tsconfig.json",
|
"lintFilePatterns": [
|
||||||
"exclude": [
|
"projects/host/**/*.ts",
|
||||||
"**/node_modules/**",
|
"projects/host/**/*.html"
|
||||||
"dist"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,11 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "^13.0.3",
|
"@angular-devkit/build-angular": "^13.0.3",
|
||||||
|
"@angular-eslint/builder": "13.0.1",
|
||||||
|
"@angular-eslint/eslint-plugin": "13.0.1",
|
||||||
|
"@angular-eslint/eslint-plugin-template": "13.0.1",
|
||||||
|
"@angular-eslint/schematics": "13.0.1",
|
||||||
|
"@angular-eslint/template-parser": "13.0.1",
|
||||||
"@angular/cli": "^13.0.3",
|
"@angular/cli": "^13.0.3",
|
||||||
"@angular/compiler-cli": "^13.0.2",
|
"@angular/compiler-cli": "^13.0.2",
|
||||||
"@angular/language-service": "^13.0.2",
|
"@angular/language-service": "^13.0.2",
|
||||||
@ -46,9 +51,10 @@
|
|||||||
"@types/jquery": "^3.5.8",
|
"@types/jquery": "^3.5.8",
|
||||||
"@types/node": "^16.11.9",
|
"@types/node": "^16.11.9",
|
||||||
"@types/video.js": "^7.3.27",
|
"@types/video.js": "^7.3.27",
|
||||||
"codelyzer": "^6.0.2",
|
"@typescript-eslint/eslint-plugin": "5.3.0",
|
||||||
|
"@typescript-eslint/parser": "5.3.0",
|
||||||
|
"eslint": "^8.2.0",
|
||||||
"ts-node": "~10.4.0",
|
"ts-node": "~10.4.0",
|
||||||
"tslint": "^6.1.3",
|
|
||||||
"typescript": "4.4.4"
|
"typescript": "4.4.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
43
front/projects/host/.eslintrc.json
Normal file
43
front/projects/host/.eslintrc.json
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../.eslintrc.json",
|
||||||
|
"ignorePatterns": [
|
||||||
|
"!**/*"
|
||||||
|
],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.ts"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"project": [
|
||||||
|
"tsconfig.json"
|
||||||
|
],
|
||||||
|
"createDefaultProgram": true
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -29,16 +29,21 @@ export class AppComponent
|
|||||||
isLoading: boolean = false;
|
isLoading: boolean = false;
|
||||||
|
|
||||||
|
|
||||||
constructor(private libraryService: LibraryService,
|
constructor(
|
||||||
private router: Router,
|
private libraryService: LibraryService,
|
||||||
private location: Location,
|
private router: Router,
|
||||||
public authManager: AuthService,
|
private location: Location,
|
||||||
public dialog: MatDialog)
|
public authManager: AuthService,
|
||||||
|
public dialog: MatDialog
|
||||||
|
)
|
||||||
{
|
{
|
||||||
libraryService.getAll().subscribe(result =>
|
libraryService.getAll().subscribe({
|
||||||
{
|
next: result =>
|
||||||
this.libraries = result.items;
|
{
|
||||||
}, error => console.error(error));
|
this.libraries = result.items;
|
||||||
|
},
|
||||||
|
error: error => console.error(error)
|
||||||
|
});
|
||||||
|
|
||||||
this.router.events.subscribe((event: Event) =>
|
this.router.events.subscribe((event: Event) =>
|
||||||
{
|
{
|
||||||
@ -85,8 +90,7 @@ export class AppComponent
|
|||||||
this.router.navigate(["/search", query], {
|
this.router.navigate(["/search", query], {
|
||||||
replaceUrl: this.router.url.startsWith("/search")
|
replaceUrl: this.router.url.startsWith("/search")
|
||||||
});
|
});
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
event.target.classList.remove("searching");
|
event.target.classList.remove("searching");
|
||||||
this.location.back();
|
this.location.back();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Directive, ElementRef, HostListener, Input, Pipe, PipeTransform } from "@angular/core";
|
import { Directive, ElementRef, HostListener, Input, Pipe, PipeTransform } from "@angular/core";
|
||||||
|
|
||||||
/* tslint:disable:directive-selector */
|
/* eslint-disable @angular-eslint/directive-selector */
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: "img[fallback]"
|
selector: "img[fallback]"
|
||||||
})
|
})
|
||||||
|
@ -1,145 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "tslint:recommended",
|
|
||||||
"rulesDirectory": [
|
|
||||||
"codelyzer"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"align": {
|
|
||||||
"options": [
|
|
||||||
"parameters",
|
|
||||||
"statements"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"array-type": false,
|
|
||||||
"arrow-return-shorthand": true,
|
|
||||||
"deprecation": {
|
|
||||||
"severity": "warning"
|
|
||||||
},
|
|
||||||
"eofline": true,
|
|
||||||
"import-spacing": true,
|
|
||||||
"max-classes-per-file": false,
|
|
||||||
"max-line-length": [
|
|
||||||
true,
|
|
||||||
120
|
|
||||||
],
|
|
||||||
"member-ordering": [
|
|
||||||
true,
|
|
||||||
{
|
|
||||||
"order": [
|
|
||||||
"static-field",
|
|
||||||
"instance-field",
|
|
||||||
"static-method",
|
|
||||||
"instance-method"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-console": [
|
|
||||||
true,
|
|
||||||
"debug",
|
|
||||||
"info",
|
|
||||||
"time",
|
|
||||||
"timeEnd",
|
|
||||||
"trace"
|
|
||||||
],
|
|
||||||
"no-empty": false,
|
|
||||||
"no-inferrable-types": false,
|
|
||||||
"no-non-null-assertion": true,
|
|
||||||
"no-redundant-jsdoc": true,
|
|
||||||
"jsdoc-format": false,
|
|
||||||
"no-switch-case-fall-through": true,
|
|
||||||
"no-var-requires": true,
|
|
||||||
"object-literal-key-quotes": [
|
|
||||||
true,
|
|
||||||
"as-needed"
|
|
||||||
],
|
|
||||||
"quotemark": [
|
|
||||||
true,
|
|
||||||
"double"
|
|
||||||
],
|
|
||||||
"semicolon": {
|
|
||||||
"options": [
|
|
||||||
"always"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"space-before-function-paren": {
|
|
||||||
"options": {
|
|
||||||
"anonymous": "never",
|
|
||||||
"asyncArrow": "always",
|
|
||||||
"constructor": "never",
|
|
||||||
"method": "never",
|
|
||||||
"named": "never"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"typedef": [
|
|
||||||
true,
|
|
||||||
"call-signature",
|
|
||||||
"parameter",
|
|
||||||
"property-declaration",
|
|
||||||
"variable-declaration"
|
|
||||||
],
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"variable-name": {
|
|
||||||
"options": [
|
|
||||||
"ban-keywords",
|
|
||||||
"check-format",
|
|
||||||
"allow-leading-underscore",
|
|
||||||
"require-const-for-all-caps"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"whitespace": {
|
|
||||||
"options": [
|
|
||||||
"check-branch",
|
|
||||||
"check-decl",
|
|
||||||
"check-operator",
|
|
||||||
"check-separator",
|
|
||||||
"check-type",
|
|
||||||
"check-typecast",
|
|
||||||
"check-module"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"component-class-suffix": true,
|
|
||||||
"contextual-lifecycle": true,
|
|
||||||
"directive-class-suffix": true,
|
|
||||||
"no-conflicting-lifecycle": true,
|
|
||||||
"no-host-metadata-property": true,
|
|
||||||
"no-input-rename": true,
|
|
||||||
"no-inputs-metadata-property": true,
|
|
||||||
"no-output-native": true,
|
|
||||||
"no-output-on-prefix": true,
|
|
||||||
"no-output-rename": true,
|
|
||||||
"no-outputs-metadata-property": true,
|
|
||||||
"template-banana-in-box": true,
|
|
||||||
"template-no-negated-async": true,
|
|
||||||
"use-lifecycle-interface": true,
|
|
||||||
"use-pipe-transform-interface": true,
|
|
||||||
"directive-selector": [
|
|
||||||
true,
|
|
||||||
"attribute",
|
|
||||||
"app",
|
|
||||||
"camelCase"
|
|
||||||
],
|
|
||||||
"component-selector": [
|
|
||||||
true,
|
|
||||||
"element",
|
|
||||||
"app",
|
|
||||||
"kebab-case"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
844
front/yarn.lock
844
front/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user