build: improve eslint config
This commit is contained in:
parent
c5078cc1e1
commit
fe9954e977
|
@ -4,21 +4,32 @@
|
|||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": ["tsconfig.json", "e2e/tsconfig.e2e.json"],
|
||||
"ecmaVersion": 2020,
|
||||
"sourceType": "module",
|
||||
"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",
|
||||
"prettier"
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@angular-eslint/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"plugins": ["prettier", "unused-imports"],
|
||||
"plugins": ["@typescript-eslint", "prettier", "unused-imports", "prefer-arrow"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/ban-ts-comment": 0,
|
||||
"@typescript-eslint/no-empty-function": 0,
|
||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
||||
"prettier/prettier": "error",
|
||||
"@angular-eslint/component-selector": ["off"],
|
||||
"no-unused-vars": [2, { "args": "none" }],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"args": "none"
|
||||
}
|
||||
],
|
||||
"unused-imports/no-unused-imports": "error",
|
||||
"@typescript-eslint/explicit-function-return-type": [
|
||||
"error",
|
||||
|
@ -85,7 +96,6 @@
|
|||
"@typescript-eslint/no-shadow": ["error"],
|
||||
"comma-dangle": ["error", "always-multiline"],
|
||||
"no-mixed-operators": "error",
|
||||
|
||||
"prefer-arrow/prefer-arrow-functions": "error",
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
|
@ -100,7 +110,16 @@
|
|||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"],
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@angular-eslint/template/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2020,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"processor": "@angular-eslint/template/extract-inline-html",
|
||||
"plugins": ["prettier"],
|
||||
"rules": {
|
||||
"@angular-eslint/template/no-negated-async": "off",
|
||||
|
|
|
@ -63,8 +63,7 @@ export interface LegacyPersistenceBaseModel<T> {
|
|||
|
||||
save(state: T, isForce?: boolean): Promise<unknown>;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export interface LegacyPersistenceForProjectModel<S, M> {
|
||||
appDataKey: keyof LegacyAppDataForProjects;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ export interface PersistenceBaseEntityModel<S, M> extends PersistenceBaseModel<S
|
|||
execAction(action: Action): Promise<S>;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export interface EntityModelHelpers<S, M> {
|
||||
getById(projectId: string, id: string): Promise<M>;
|
||||
}
|
||||
|
|
|
@ -276,6 +276,7 @@ export class CaldavClientService {
|
|||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
||||
xhr.open = function (): void {
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
const result = oldOpen.apply(this, arguments);
|
||||
// @ts-ignore
|
||||
xhr.setRequestHeader('X-Requested-With', 'SuperProductivity');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ChangeDetectionStrategy, Component, Inject, OnInit } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { GithubCfg } from '../../github.model';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
|
@ -12,7 +12,7 @@ import { T } from '../../../../../../t.const';
|
|||
styleUrls: ['./dialog-github-initial-setup.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DialogGithubInitialSetupComponent implements OnInit {
|
||||
export class DialogGithubInitialSetupComponent {
|
||||
T: typeof T = T;
|
||||
githubCfg: GithubCfg;
|
||||
formGroup: FormGroup = new FormGroup({});
|
||||
|
@ -25,8 +25,6 @@ export class DialogGithubInitialSetupComponent implements OnInit {
|
|||
this.githubCfg = this.data.githubCfg || DEFAULT_GITHUB_CFG;
|
||||
}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
saveGithubCfg(gitCfg: GithubCfg): void {
|
||||
this._matDialogRef.close(gitCfg);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ChangeDetectionStrategy, Component, Inject, OnInit } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FormlyFieldConfig } from '@ngx-formly/core';
|
||||
|
@ -12,7 +12,7 @@ import { DEFAULT_GITLAB_CFG, GITLAB_CONFIG_FORM } from '../gitlab.const';
|
|||
styleUrls: ['./dialog-gitlab-initial-setup.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DialogGitlabInitialSetupComponent implements OnInit {
|
||||
export class DialogGitlabInitialSetupComponent {
|
||||
T: typeof T = T;
|
||||
gitlabCfg: GitlabCfg;
|
||||
formGroup: FormGroup = new FormGroup({});
|
||||
|
@ -25,8 +25,6 @@ export class DialogGitlabInitialSetupComponent implements OnInit {
|
|||
this.gitlabCfg = this.data.gitlabCfg || DEFAULT_GITLAB_CFG;
|
||||
}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
saveGitlabCfg(gitlabCfg: GitlabCfg): void {
|
||||
this._matDialogRef.close(gitlabCfg);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ChangeDetectionStrategy, Component, Inject, OnInit } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { OpenProjectCfg } from '../../open-project.model';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
|
@ -15,7 +15,7 @@ import { T } from '../../../../../../t.const';
|
|||
styleUrls: ['./dialog-open-project-initial-setup.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DialogOpenProjectInitialSetupComponent implements OnInit {
|
||||
export class DialogOpenProjectInitialSetupComponent {
|
||||
T: typeof T = T;
|
||||
openProjectCfg: OpenProjectCfg;
|
||||
formGroup: FormGroup = new FormGroup({});
|
||||
|
@ -28,8 +28,6 @@ export class DialogOpenProjectInitialSetupComponent implements OnInit {
|
|||
this.openProjectCfg = this.data.openProjectCfg || DEFAULT_OPEN_PROJECT_CFG;
|
||||
}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
saveOpenProjectCfg(gitCfg: OpenProjectCfg): void {
|
||||
this._matDialogRef.close(gitCfg);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { TaskService } from '../tasks/task.service';
|
||||
import { T } from '../../t.const';
|
||||
|
||||
|
@ -8,10 +8,8 @@ import { T } from '../../t.const';
|
|||
styleUrls: ['./procrastination.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ProcrastinationComponent implements OnInit {
|
||||
export class ProcrastinationComponent {
|
||||
T: typeof T = T;
|
||||
|
||||
constructor(public taskService: TaskService) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
}
|
||||
|
|
|
@ -112,9 +112,9 @@ const _convertToWesternArabicDateKeys = (task: Task): Task => {
|
|||
const _deleteUnusedFields = (task: Task): Task => {
|
||||
const {
|
||||
// legacy
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
_isAdditionalInfoOpen,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
_currentTab,
|
||||
// the rest
|
||||
...cleanTask
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { TimelineCustomEvent } from '../timeline.model';
|
||||
|
||||
@Component({
|
||||
|
@ -7,7 +7,7 @@ import { TimelineCustomEvent } from '../timeline.model';
|
|||
styleUrls: ['./timeline-custom-event.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class TimelineCustomEventComponent implements OnInit {
|
||||
export class TimelineCustomEventComponent {
|
||||
@Input() event: TimelineCustomEvent = {
|
||||
title: '',
|
||||
icon: '',
|
||||
|
@ -16,6 +16,4 @@ export class TimelineCustomEventComponent implements OnInit {
|
|||
};
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,4 @@ import { expandFadeAnimation } from '../animations/expand.ani';
|
|||
})
|
||||
export class HelpSectionComponent {
|
||||
@Input() isShowHelp: boolean = false;
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
import { Observable } from 'rxjs';
|
||||
|
||||
export const observeMutation = (
|
||||
target: HTMLElement,
|
||||
config,
|
||||
): Observable<MutationRecord[]> => {
|
||||
return new Observable((observer) => {
|
||||
const mutation = new MutationObserver((mutations, instance) => {
|
||||
observer.next(mutations);
|
||||
});
|
||||
mutation.observe(target, config);
|
||||
return () => {
|
||||
mutation.disconnect();
|
||||
};
|
||||
});
|
||||
};
|
Loading…
Reference in New Issue