Skip to content

Commit

Permalink
eslint-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri Cherepanov committed Nov 17, 2019
1 parent 632c454 commit 7637f45
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 9 deletions.
6 changes: 4 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"eslintConfig": "src/eslintrc.config.json",
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
Expand All @@ -153,8 +154,9 @@
"projectType": "application",
"architect": {
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"eslintConfig": "e2e/eslintrc.e2e.json",
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
Expand Down
6 changes: 6 additions & 0 deletions e2e/eslintrc.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../eslintrc.json",
"parserOptions": {
"project": ["e2e/tsconfig.e2e.json"]
}
}
24 changes: 24 additions & 0 deletions eslintrc.json
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { app, BrowserWindow, screen } from 'electron';
import * as path from 'path';
import * as url from 'url';

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

function createWindow() {
function createWindow(): BrowserWindow {

const electronScreen = screen;
const size = electronScreen.getPrimaryDisplay().workAreaSize;
Expand Down Expand Up @@ -48,6 +48,7 @@ function createWindow() {
win = null;
});

return win;
}

try {
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"devDependencies": {
"@angular-builders/custom-webpack": "^8.2.0",
"@angular-devkit/build-angular": "0.803.6",
"@angular-eslint/builder": "0.0.1-alpha.17",
"@angular/cli": "8.3.6",
"@angular/common": "8.2.12",
"@angular/compiler": "8.2.12",
Expand All @@ -55,13 +56,17 @@
"@types/jasminewd2": "2.0.6",
"@types/mocha": "5.2.7",
"@types/node": "12.6.8",
"@typescript-eslint/eslint-plugin": "^2.7.0",
"@typescript-eslint/parser": "^2.7.0",
"chai": "4.2.0",
"codelyzer": "5.1.0",
"conventional-changelog-cli": "2.0.25",
"core-js": "3.1.4",
"electron": "7.1.1",
"electron-builder": "21.2.0",
"electron-reload": "1.5.0",
"eslint": "^6.6.0",
"eslint-plugin-import": "^2.18.2",
"jasmine-core": "3.4.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "4.2.0",
Expand All @@ -74,7 +79,6 @@
"rxjs": "6.5.3",
"spectron": "9.0.0",
"ts-node": "8.3.0",
"tslint": "5.20.0",
"typescript": "3.5.3",
"wait-on": "3.3.0",
"webdriver-manager": "12.1.5",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { HomeModule } from './home/home.module';
import { AppComponent } from './app.component';

// 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');
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/electron/electron.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ElectronService {
childProcess: typeof childProcess;
fs: typeof fs;

get isElectron() {
get isElectron(): boolean {
return window && window.process && window.process.type;
}

Expand Down
6 changes: 6 additions & 0 deletions src/eslintrc.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../eslintrc.json",
"parserOptions": {
"project": ["src/tsconfig.app.json", "src/tsconfig.spec.json"]
}
}

0 comments on commit 7637f45

Please sign in to comment.