Commit 74f8e326 authored by Florent Poittevin's avatar Florent Poittevin Committed by Alicia.DeDiosFuente
Browse files

feat: [AOU-1891] migrate TSLint to ESLint

parent 329f9124
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config
It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
Happy linting! 💖
*/
module.exports = {
"env": {
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@angular-eslint/eslint-plugin",
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"@typescript-eslint",
"@typescript-eslint/tslint"
],
"rules": {
"@angular-eslint/component-class-suffix": [
"error",
{
"suffixes": [
"AppComponent",
"Routable",
"Presentational",
"Container",
"Dialog",
"Form"
]
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "",
"style": "kebab-case"
}
],
"@angular-eslint/directive-class-suffix": "off",
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "",
"style": "camelCase"
}
],
"@angular-eslint/no-host-metadata-property": "error",
"@angular-eslint/no-input-rename": "off",
"@angular-eslint/no-inputs-metadata-property": "error",
"@angular-eslint/no-output-on-prefix": "off",
"@angular-eslint/no-output-rename": "off",
"@angular-eslint/no-outputs-metadata-property": "error",
"@angular-eslint/use-pipe-transform-interface": "error",
"@typescript-eslint/array-type": [
"error",
{
"default": "array"
}
],
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/indent": [
"error",
4,
{
"FunctionDeclaration": {
"parameters": "first"
},
"FunctionExpression": {
"parameters": "first"
}
}
],
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "none",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/naming-convention": "error",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-inferrable-types": [
"off",
{
"ignoreParameters": true
}
],
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-shadow": [
"error",
{
"hoist": "all"
}
],
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": [
"error",
"double"
],
"@typescript-eslint/semi": [
"error",
null
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": [
"error",
"always"
],
"brace-style": [
"error",
"1tbs"
],
"comma-dangle": "error",
"complexity": [
"error",
{
"max": 200
}
],
"constructor-super": "error",
"curly": "error",
"dot-notation": "off",
"eol-last": "error",
"eqeqeq": [
"error",
"smart"
],
"guard-for-in": "error",
"id-denylist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
],
"id-match": "error",
"import/no-deprecated": "off",
"indent": "error",
"jsdoc/no-types": "off",
"max-len": "off",
"no-bitwise": "error",
"no-caller": "error",
"no-console": [
"error",
{
"allow": [
"warn",
"dir",
"timeLog",
"assert",
"clear",
"count",
"countReset",
"group",
"groupEnd",
"table",
"dirxml",
"error",
"groupCollapsed",
"Console",
"profile",
"profileEnd",
"timeStamp",
"context"
]
}
],
"no-debugger": "error",
"no-empty": "off",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "error",
"no-new-wrappers": "error",
"no-redeclare": "error",
"no-restricted-imports": [
"error",
"rxjs/Rx",
"@app/generated-api"
],
"no-shadow": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "off",
"no-underscore-dangle": "error",
"no-unused-expressions": "error",
"no-unused-labels": "error",
"no-use-before-define": "off",
"no-var": "error",
"prefer-const": "error",
"quotes": "error",
"radix": "error",
"semi": "error",
"use-isnan": "error",
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"ban": [
true,
[
"fdescribe"
],
[
"fit"
],
[
"describe",
"only"
],
[
"it",
"only"
]
],
"no-mergeable-namespace": true,
"typedef": [
true,
"call-signature",
"parameter",
"property-declaration",
"member-variable-declaration"
],
"use-life-cycle-interface": true,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}
]
}
};
{
"root": true,
"ignorePatterns": [
"projects/**/*",
"src/app/generated-api"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-class-suffix": [
"error",
{
"suffixes": [
"AppComponent",
"Routable",
"Presentational",
"Container",
"Dialog",
"Form"
]
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "dlcm",
"style": "kebab-case"
}
],
"@angular-eslint/directive-class-suffix": "off",
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "dlcm",
"style": "camelCase"
}
],
"@angular-eslint/no-input-rename": "off",
"@angular-eslint/no-output-on-prefix": "off",
"@angular-eslint/no-output-rename": "off",
"@typescript-eslint/array-type": [
"error",
{
"default": "array"
}
],
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "comma",
"requireLast": false
}
}
],
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "variable",
"format": [
"camelCase",
"UPPER_CASE",
"snake_case",
"PascalCase"
]
}
],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-namespace": [
"off",
{
"allowDeclarations": true,
"allowDefinitionFiles": true
}
],
"@typescript-eslint/no-inferrable-types": [
"off",
{
"ignoreParameters": true
}
],
"@typescript-eslint/quotes": [
"error",
"double",
{
"allowTemplateLiterals": true
}
],
"@typescript-eslint/semi": [
"error"
],
"@typescript-eslint/no-unused-expressions": [
"error"
],
"arrow-body-style": [
"error",
"as-needed"
],
"brace-style": [
"error",
"1tbs"
],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
}
],
"complexity": [
"error",
{
"max": 200
}
],
"import/no-deprecated": "off",
"jsdoc/no-types": "off",
"max-len": "off",
"no-console": [
"error",
{
"allow": [
"null"
]
}
],
"no-redeclare": "off",
"no-undef-init": "off",
"no-underscore-dangle": "off",
"no-mixed-spaces-and-tabs": [
"error"
],
"no-restricted-imports": [
"error",
{
"paths": [
],
"patterns": [
"rxjs/Rx",
"@app/generated-api",
"**/generated-api"
]
}
],
"object-shorthand": "off"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
......@@ -204,15 +204,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/**",
"src/app/generated-api/**"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
......
......@@ -38,7 +38,7 @@ async function createVersionsFile(filename: string): Promise<void> {
export const versions: Versions = {
version: "${version}",
revision: "${revision}",
branch: "${branch}"
branch: "${branch}",
};
export interface Versions {
......
This diff is collapsed.
......@@ -10,12 +10,12 @@
<router-outlet></router-outlet>
</ng-template>
<div *ngIf="!(isApplicationInitializedObs | async)"
<div *ngIf="isApplicationInitializedObs | async | isFalsy"
[solidifySpinner]="true"
class="spinner-general-wrapper"
>
</div>
<div [class.hide]="!(isApplicationInitializedObs | async)"
<div [class.hide]="isApplicationInitializedObs | async | isFalsy"
class="app-wrapper"
>
<div class="header">
......
......@@ -152,9 +152,12 @@ const appInitializerFn = (appConfig: AppConfigService) => () => appConfig.mergeC
export const WINDOW = "windowObject";
export function createDefaultStorage(): Storage | null {
return environment.tokenInMemoryStorage ? new InMemoryStorage() : (typeof sessionStorage !== "undefined" ? sessionStorage : null);
}
export const createDefaultStorage: () => Storage | null = () => environment.tokenInMemoryStorage ? new InMemoryStorage() : (typeof sessionStorage !== "undefined" ? sessionStorage : null);
// required for AOT compilation
export const HttpLoaderFactory: (http: HttpClient) => HttpTranslateLoaderExtra = http => new HttpTranslateLoaderExtra(http, {
suffix: `.json?cacheBuster=${versions.version}${versions.branch}${versions.revision}`,
}, environment);
@NgModule({
declarations: [
......@@ -300,10 +303,3 @@ export function createDefaultStorage(): Storage | null {
})
export class AppModule {
}
// required for AOT compilation
export function HttpLoaderFactory(http: HttpClient): HttpTranslateLoaderExtra {
return new HttpTranslateLoaderExtra(http, {
suffix: `.json?cacheBuster=${versions.version}${versions.branch}${versions.revision}`,
}, environment);
}
......@@ -7,8 +7,9 @@ import {
import {SharedAbstractPresentational} from "@app/shared/components/presentationals/shared-abstract/shared-abstract.presentational";
import {environment} from "@environments/environment";
import {GoogleAnalyticsService} from "@shared/services/google-analytics.service";
import {SolidifyObject} from "solidify-frontend";
declare let gtag: Function;
declare let gtag: (name: string, id: string, option: SolidifyObject) => void;
@Component({
selector: "dlcm-cookie-consent",
......
/* tslint:disable */
/* eslint-disable no-restricted-imports */
import {Aip as AipPartial} from "@app/generated-api/model/aip.partial.model";
import {License as LicensePartial} from "@app/generated-api/model/license.partial.model";
import {MetadataType as MetadataTypePartial} from "@app/generated-api/model/metadata-type.partial.model";
......@@ -16,6 +16,7 @@ import {
} from "solidify-frontend";
import {Deposit as DepositPartial} from "../generated-api/model/deposit.partial.model";
import {DisseminationPolicy as DisseminationPolicyPartial} from "../generated-api/model/dissemination-policy.partial.model";
/* eslint-enable no-restricted-imports */
export namespace Enums {
export namespace Facet {
......@@ -213,7 +214,7 @@ export namespace Enums {
},
];