Skip to content

Commit 99e7ec0

Browse files
author
Yuri Cherepanov
committed
eslint-migration - disable warnings/errors
Disable warnings and errors on initial code empty functions/require remove transations stub from spec test
1 parent 3c1f9f6 commit 99e7ec0

File tree

9 files changed

+17
-16
lines changed

9 files changed

+17
-16
lines changed

Diff for: e2e/common-setup.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
/* eslint "@typescript-eslint/no-var-requires": 0 */
12
const Application = require('spectron').Application;
3+
/* eslint "@typescript-eslint/no-var-requires": 0 */
24
const electronPath = require('electron'); // Require Electron from the binaries included in node_modules.
5+
/* eslint "@typescript-eslint/no-var-requires": 0 */
36
const path = require('path');
47

5-
export default function setup() {
8+
export default function setup(): void {
69
beforeEach(async function () {
710
this.app = new Application({
811
// Your electron path can be any binary

Diff for: e2e/main.spec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
import {expect, assert} from 'chai';
1+
import {expect} from 'chai';
22
import {SpectronClient} from 'spectron';
33

44
import commonSetup from './common-setup';
55

66
describe('angular-electron App', function () {
77
commonSetup.apply(this);
88

9+
/* eslint "@typescript-eslint/no-explicit-any": 0 */
910
let browser: any;
1011
let client: SpectronClient;
1112

1213
beforeEach(function () {
1314
client = this.app.client;
15+
/* eslint "@typescript-eslint/no-explicit-any": 0 */
1416
browser = client as any;
1517
});
1618

Diff for: eslintrc.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,5 @@
1515
"parserOptions": {
1616
"tsconfigRootDir": "."
1717
},
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-
}
18+
"plugins": ["@typescript-eslint"]
2419
}

Diff for: main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function createWindow(): BrowserWindow {
2424
});
2525

2626
if (serve) {
27+
/* eslint "@typescript-eslint/no-var-requires": 0 */
2728
require('electron-reload')(__dirname, {
2829
electron: require(`${__dirname}/node_modules/electron`)
2930
});

Diff for: src/app/app.component.spec.ts

-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { TestBed, async } from '@angular/core/testing';
22
import { RouterTestingModule } from '@angular/router/testing';
33
import { AppComponent } from './app.component';
4-
import { TranslateModule } from '@ngx-translate/core';
54
import { ElectronService } from './core/services';
65

76
describe('AppComponent', () => {
@@ -19,7 +18,3 @@ describe('AppComponent', () => {
1918
expect(app).toBeTruthy();
2019
}));
2120
});
22-
23-
class TranslateServiceStub {
24-
setDefaultLang(lang: string): void {}
25-
}

Diff for: src/app/home/home.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import { Component, OnInit } from '@angular/core';
77
})
88
export class HomeComponent implements OnInit {
99

10+
/* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */
1011
constructor() { }
1112

12-
ngOnInit() {
13-
}
13+
/* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */
14+
ngOnInit(): void { }
1415

1516
}

Diff for: src/app/shared/components/page-not-found/page-not-found.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import { Component, OnInit } from '@angular/core';
66
styleUrls: ['./page-not-found.component.scss']
77
})
88
export class PageNotFoundComponent implements OnInit {
9+
/* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */
910
constructor() {}
1011

11-
ngOnInit() {}
12+
/* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */
13+
ngOnInit(): void {}
1214
}

Diff for: src/app/shared/directives/webview/webview.directive.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ import { Directive } from '@angular/core';
44
selector: '[webview]'
55
})
66
export class WebviewDirective {
7+
/* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */
78
constructor() {}
89
}

Diff for: src/test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
platformBrowserDynamicTesting
88
} from '@angular/platform-browser-dynamic/testing';
99

10+
/* eslint "@typescript-eslint/no-explicit-any":0 */
1011
declare const require: any;
1112

1213
// First, initialize the Angular testing environment.

0 commit comments

Comments
 (0)