Skip to content

Commit 7637f45

Browse files
author
Yuri Cherepanov
committed
eslint-migration
1 parent 632c454 commit 7637f45

File tree

8 files changed

+52
-9
lines changed

8 files changed

+52
-9
lines changed

Diff for: angular.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@
135135
}
136136
},
137137
"lint": {
138-
"builder": "@angular-devkit/build-angular:tslint",
138+
"builder": "@angular-eslint/builder:lint",
139139
"options": {
140+
"eslintConfig": "src/eslintrc.config.json",
140141
"tsConfig": [
141142
"src/tsconfig.app.json",
142143
"src/tsconfig.spec.json"
@@ -153,8 +154,9 @@
153154
"projectType": "application",
154155
"architect": {
155156
"lint": {
156-
"builder": "@angular-devkit/build-angular:tslint",
157+
"builder": "@angular-eslint/builder:lint",
157158
"options": {
159+
"eslintConfig": "e2e/eslintrc.e2e.json",
158160
"tsConfig": [
159161
"e2e/tsconfig.e2e.json"
160162
],

Diff for: e2e/eslintrc.e2e.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../eslintrc.json",
3+
"parserOptions": {
4+
"project": ["e2e/tsconfig.e2e.json"]
5+
}
6+
}

Diff for: eslintrc.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"es6": true,
6+
"es2017": true
7+
},
8+
"extends": [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/eslint-recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
13+
],
14+
"parser": "@typescript-eslint/parser",
15+
"parserOptions": {
16+
"tsconfigRootDir": "."
17+
},
18+
"plugins": ["@typescript-eslint"],
19+
"rules": {
20+
"no-empty-function": ["warn"],
21+
"@typescript-eslint/no-empty-function": ["warn"],
22+
"@typescript-eslint/no-var-requires": ["warn"]
23+
}
24+
}

Diff for: main.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { app, BrowserWindow, screen } from 'electron';
22
import * as path from 'path';
33
import * as url from 'url';
44

5-
let win, serve;
6-
const args = process.argv.slice(1);
7-
serve = args.some(val => val === '--serve');
5+
let win: BrowserWindow = null;
6+
const args = process.argv.slice(1),
7+
serve = args.some(val => val === '--serve');
88

9-
function createWindow() {
9+
function createWindow(): BrowserWindow {
1010

1111
const electronScreen = screen;
1212
const size = electronScreen.getPrimaryDisplay().workAreaSize;
@@ -48,6 +48,7 @@ function createWindow() {
4848
win = null;
4949
});
5050

51+
return win;
5152
}
5253

5354
try {

Diff for: package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"devDependencies": {
4040
"@angular-builders/custom-webpack": "^8.2.0",
4141
"@angular-devkit/build-angular": "0.803.6",
42+
"@angular-eslint/builder": "0.0.1-alpha.17",
4243
"@angular/cli": "8.3.6",
4344
"@angular/common": "8.2.12",
4445
"@angular/compiler": "8.2.12",
@@ -55,13 +56,17 @@
5556
"@types/jasminewd2": "2.0.6",
5657
"@types/mocha": "5.2.7",
5758
"@types/node": "12.6.8",
59+
"@typescript-eslint/eslint-plugin": "^2.7.0",
60+
"@typescript-eslint/parser": "^2.7.0",
5861
"chai": "4.2.0",
5962
"codelyzer": "5.1.0",
6063
"conventional-changelog-cli": "2.0.25",
6164
"core-js": "3.1.4",
6265
"electron": "7.1.1",
6366
"electron-builder": "21.2.0",
6467
"electron-reload": "1.5.0",
68+
"eslint": "^6.6.0",
69+
"eslint-plugin-import": "^2.18.2",
6570
"jasmine-core": "3.4.0",
6671
"jasmine-spec-reporter": "4.2.1",
6772
"karma": "4.2.0",
@@ -74,7 +79,6 @@
7479
"rxjs": "6.5.3",
7580
"spectron": "9.0.0",
7681
"ts-node": "8.3.0",
77-
"tslint": "5.20.0",
7882
"typescript": "3.5.3",
7983
"wait-on": "3.3.0",
8084
"webdriver-manager": "12.1.5",

Diff for: src/app/app.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { HomeModule } from './home/home.module';
1919
import { AppComponent } from './app.component';
2020

2121
// AoT requires an exported function for factories
22-
export function HttpLoaderFactory(http: HttpClient) {
22+
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
2323
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
2424
}
2525

Diff for: src/app/core/services/electron/electron.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class ElectronService {
1616
childProcess: typeof childProcess;
1717
fs: typeof fs;
1818

19-
get isElectron() {
19+
get isElectron(): boolean {
2020
return window && window.process && window.process.type;
2121
}
2222

Diff for: src/eslintrc.config.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../eslintrc.json",
3+
"parserOptions": {
4+
"project": ["src/tsconfig.app.json", "src/tsconfig.spec.json"]
5+
}
6+
}

0 commit comments

Comments
 (0)