eslint-migration
This commit is contained in:
@@ -135,8 +135,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
"builder": "@angular-eslint/builder:lint",
|
||||||
"options": {
|
"options": {
|
||||||
|
"eslintConfig": "src/eslintrc.config.json",
|
||||||
"tsConfig": [
|
"tsConfig": [
|
||||||
"src/tsconfig.app.json",
|
"src/tsconfig.app.json",
|
||||||
"src/tsconfig.spec.json"
|
"src/tsconfig.spec.json"
|
||||||
@@ -153,8 +154,9 @@
|
|||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"architect": {
|
"architect": {
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
"builder": "@angular-eslint/builder:lint",
|
||||||
"options": {
|
"options": {
|
||||||
|
"eslintConfig": "e2e/eslintrc.e2e.json",
|
||||||
"tsConfig": [
|
"tsConfig": [
|
||||||
"e2e/tsconfig.e2e.json"
|
"e2e/tsconfig.e2e.json"
|
||||||
],
|
],
|
||||||
|
|||||||
6
e2e/eslintrc.e2e.json
Normal file
6
e2e/eslintrc.e2e.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "../eslintrc.json",
|
||||||
|
"parserOptions": {
|
||||||
|
"project": ["e2e/tsconfig.e2e.json"]
|
||||||
|
}
|
||||||
|
}
|
||||||
24
eslintrc.json
Normal file
24
eslintrc.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"node": true,
|
||||||
|
"es6": true,
|
||||||
|
"es2017": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
||||||
|
],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"tsconfigRootDir": "."
|
||||||
|
},
|
||||||
|
"plugins": ["@typescript-eslint"],
|
||||||
|
"rules": {
|
||||||
|
"no-empty-function": ["warn"],
|
||||||
|
"@typescript-eslint/no-empty-function": ["warn"],
|
||||||
|
"@typescript-eslint/no-var-requires": ["warn"]
|
||||||
|
}
|
||||||
|
}
|
||||||
9
main.ts
9
main.ts
@@ -2,11 +2,11 @@ import { app, BrowserWindow, screen } from 'electron';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as url from 'url';
|
import * as url from 'url';
|
||||||
|
|
||||||
let win, serve;
|
let win: BrowserWindow = null;
|
||||||
const args = process.argv.slice(1);
|
const args = process.argv.slice(1),
|
||||||
serve = args.some(val => val === '--serve');
|
serve = args.some(val => val === '--serve');
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow(): BrowserWindow {
|
||||||
|
|
||||||
const electronScreen = screen;
|
const electronScreen = screen;
|
||||||
const size = electronScreen.getPrimaryDisplay().workAreaSize;
|
const size = electronScreen.getPrimaryDisplay().workAreaSize;
|
||||||
@@ -48,6 +48,7 @@ function createWindow() {
|
|||||||
win = null;
|
win = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-builders/custom-webpack": "^8.2.0",
|
"@angular-builders/custom-webpack": "^8.2.0",
|
||||||
"@angular-devkit/build-angular": "0.803.6",
|
"@angular-devkit/build-angular": "0.803.6",
|
||||||
|
"@angular-eslint/builder": "0.0.1-alpha.17",
|
||||||
"@angular/cli": "8.3.6",
|
"@angular/cli": "8.3.6",
|
||||||
"@angular/common": "8.2.12",
|
"@angular/common": "8.2.12",
|
||||||
"@angular/compiler": "8.2.12",
|
"@angular/compiler": "8.2.12",
|
||||||
@@ -55,6 +56,8 @@
|
|||||||
"@types/jasminewd2": "2.0.6",
|
"@types/jasminewd2": "2.0.6",
|
||||||
"@types/mocha": "5.2.7",
|
"@types/mocha": "5.2.7",
|
||||||
"@types/node": "12.6.8",
|
"@types/node": "12.6.8",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^2.7.0",
|
||||||
|
"@typescript-eslint/parser": "^2.7.0",
|
||||||
"chai": "4.2.0",
|
"chai": "4.2.0",
|
||||||
"codelyzer": "5.1.0",
|
"codelyzer": "5.1.0",
|
||||||
"conventional-changelog-cli": "2.0.25",
|
"conventional-changelog-cli": "2.0.25",
|
||||||
@@ -62,6 +65,8 @@
|
|||||||
"electron": "7.1.1",
|
"electron": "7.1.1",
|
||||||
"electron-builder": "21.2.0",
|
"electron-builder": "21.2.0",
|
||||||
"electron-reload": "1.5.0",
|
"electron-reload": "1.5.0",
|
||||||
|
"eslint": "^6.6.0",
|
||||||
|
"eslint-plugin-import": "^2.18.2",
|
||||||
"jasmine-core": "3.4.0",
|
"jasmine-core": "3.4.0",
|
||||||
"jasmine-spec-reporter": "4.2.1",
|
"jasmine-spec-reporter": "4.2.1",
|
||||||
"karma": "4.2.0",
|
"karma": "4.2.0",
|
||||||
@@ -74,7 +79,6 @@
|
|||||||
"rxjs": "6.5.3",
|
"rxjs": "6.5.3",
|
||||||
"spectron": "9.0.0",
|
"spectron": "9.0.0",
|
||||||
"ts-node": "8.3.0",
|
"ts-node": "8.3.0",
|
||||||
"tslint": "5.20.0",
|
|
||||||
"typescript": "3.5.3",
|
"typescript": "3.5.3",
|
||||||
"wait-on": "3.3.0",
|
"wait-on": "3.3.0",
|
||||||
"webdriver-manager": "12.1.5",
|
"webdriver-manager": "12.1.5",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { HomeModule } from './home/home.module';
|
|||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
// AoT requires an exported function for factories
|
// AoT requires an exported function for factories
|
||||||
export function HttpLoaderFactory(http: HttpClient) {
|
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
||||||
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class ElectronService {
|
|||||||
childProcess: typeof childProcess;
|
childProcess: typeof childProcess;
|
||||||
fs: typeof fs;
|
fs: typeof fs;
|
||||||
|
|
||||||
get isElectron() {
|
get isElectron(): boolean {
|
||||||
return window && window.process && window.process.type;
|
return window && window.process && window.process.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
src/eslintrc.config.json
Normal file
6
src/eslintrc.config.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "../eslintrc.json",
|
||||||
|
"parserOptions": {
|
||||||
|
"project": ["src/tsconfig.app.json", "src/tsconfig.spec.json"]
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user