🔧 Add ESLint rules
parent
6f12da98eb
commit
9c3d5d82ed
|
@ -16,7 +16,7 @@
|
||||||
"createDefaultProgram": true
|
"createDefaultProgram": true
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:@angular-eslint/recommended",
|
"plugin:@angular-eslint/all",
|
||||||
"plugin:@angular-eslint/template/process-inline-templates"
|
"plugin:@angular-eslint/template/process-inline-templates"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
@ -36,6 +36,7 @@
|
||||||
"style": "kebab-case"
|
"style": "kebab-case"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
// Custom rules
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -43,9 +44,12 @@
|
||||||
"*.html"
|
"*.html"
|
||||||
],
|
],
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:@angular-eslint/template/recommended"
|
"plugin:@angular-eslint/template/all"
|
||||||
],
|
],
|
||||||
"rules": {}
|
"rules": {
|
||||||
|
// Custom rules
|
||||||
|
"@angular-eslint/template/i18n": "off"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,27 @@
|
||||||
{
|
{
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll": true,
|
"source.fixAll": true,
|
||||||
|
"source.fixAll.eslint": true,
|
||||||
"source.organizeImports": true
|
"source.organizeImports": true
|
||||||
},
|
},
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.rulers": [
|
"editor.rulers": [
|
||||||
140
|
140
|
||||||
],
|
],
|
||||||
|
"eslint.options": {
|
||||||
|
"extensions": [
|
||||||
|
".ts",
|
||||||
|
".html"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"eslint.packageManager": "yarn",
|
||||||
|
"eslint.validate": [
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"html"
|
||||||
|
],
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
".ipfs-npmrc": "json"
|
".ipfs-npmrc": "json"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import { Component } from '@angular/core';
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||||
import { ThemeService } from './services/theme.service';
|
import { ThemeService } from './services/theme.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrls: ['./app.component.scss']
|
styleUrls: ['./app.component.scss'],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
constructor(
|
constructor(
|
||||||
|
|
|
@ -15,14 +15,12 @@ import { AppComponent } from './app.component';
|
||||||
AppComponent
|
AppComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
|
||||||
BrowserModule,
|
|
||||||
BrowserAnimationsModule,
|
|
||||||
HttpClientModule,
|
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
|
BrowserAnimationsModule,
|
||||||
// Material
|
BrowserModule,
|
||||||
|
CommonModule,
|
||||||
FlexLayoutModule,
|
FlexLayoutModule,
|
||||||
|
HttpClientModule,
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatToolbarModule,
|
MatToolbarModule,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { Component, EventEmitter, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, EventEmitter, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ThemePalette } from '@angular/material/core';
|
import { ThemePalette } from '@angular/material/core';
|
||||||
import { MatTable, MatTableDataSource } from '@angular/material/table';
|
import { MatTable, MatTableDataSource } from '@angular/material/table';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
@ -13,7 +13,8 @@ import { ThemeService } from '../services/theme.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pages',
|
selector: 'app-pages',
|
||||||
templateUrl: './pages.component.html',
|
templateUrl: './pages.component.html',
|
||||||
styleUrls: ['./pages.component.scss']
|
styleUrls: ['./pages.component.scss'],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class PagesComponent implements OnInit, OnDestroy {
|
export class PagesComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
/***************************************************************************************************
|
/***************************************************************************************************
|
||||||
* Zone JS is required by default for Angular itself.
|
* Zone JS is required by default for Angular itself.
|
||||||
*/
|
*/
|
||||||
import 'zone.js'; // Included with Angular CLI.
|
import 'zone.js'; // Included with Angular CLI.
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************************************
|
/***************************************************************************************************
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Custom Theming for Angular Material
|
// Custom Theming for Angular Material
|
||||||
@use '@angular/material' as mat;
|
@use '@angular/material'as mat;
|
||||||
// For more information: https://material.angular.io/guide/theming
|
// For more information: https://material.angular.io/guide/theming
|
||||||
// Plus imports for other components in your app.
|
// Plus imports for other components in your app.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@use '@angular/material' as mat;
|
@use '@angular/material'as mat;
|
||||||
@import 'ipfs-colours.scss';
|
@import 'ipfs-colours.scss';
|
||||||
|
|
||||||
$ipfs-primary: mat.define-palette($ipfs-colour-navy, 'default', 'lighter', 'darker');
|
$ipfs-primary: mat.define-palette($ipfs-colour-navy, 'default', 'lighter', 'darker');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@use '@angular/material' as mat;
|
@use '@angular/material'as mat;
|
||||||
@import 'ipfs-palettes.scss';
|
@import 'ipfs-palettes.scss';
|
||||||
|
|
||||||
$ipfs-light-theme: mat.define-light-theme($ipfs-primary, $ipfs-accent, $ipfs-warn);
|
$ipfs-light-theme: mat.define-light-theme($ipfs-primary, $ipfs-accent, $ipfs-warn);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||||
|
|
||||||
import 'zone.js/testing';
|
|
||||||
import { getTestBed } from '@angular/core/testing';
|
import { getTestBed } from '@angular/core/testing';
|
||||||
import {
|
import {
|
||||||
BrowserDynamicTestingModule,
|
BrowserDynamicTestingModule,
|
||||||
platformBrowserDynamicTesting
|
platformBrowserDynamicTesting
|
||||||
} from '@angular/platform-browser-dynamic/testing';
|
} from '@angular/platform-browser-dynamic/testing';
|
||||||
|
import 'zone.js/testing';
|
||||||
|
|
||||||
declare const require: any;
|
declare const require: any;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ declare const require: any;
|
||||||
getTestBed().initTestEnvironment(
|
getTestBed().initTestEnvironment(
|
||||||
BrowserDynamicTestingModule,
|
BrowserDynamicTestingModule,
|
||||||
platformBrowserDynamicTesting(), {
|
platformBrowserDynamicTesting(), {
|
||||||
teardown: { destroyAfterEach: false }
|
teardown: { destroyAfterEach: false }
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// Then we find all the tests.
|
// Then we find all the tests.
|
||||||
|
|
|
@ -6,8 +6,22 @@
|
||||||
"outDir": "./dist/out-tsc",
|
"outDir": "./dist/out-tsc",
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"strictFunctionTypes": true,
|
||||||
|
"strictBindCallApply": true,
|
||||||
|
"strictPropertyInitialization": true,
|
||||||
|
"noImplicitThis": true,
|
||||||
|
"useUnknownInCatchVariables": true,
|
||||||
|
"alwaysStrict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"exactOptionalPropertyTypes": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noUncheckedIndexedAccess": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
"downlevelIteration": true,
|
"downlevelIteration": true,
|
||||||
|
|
Loading…
Reference in New Issue