Skip to content

Commit

Permalink
eslint-migration - disable warnings/errors
Browse files Browse the repository at this point in the history
Disable warnings and errors on initial code
empty functions/require
remove transations stub from spec test
  • Loading branch information
Yuri Cherepanov committed Nov 17, 2019
1 parent 3c1f9f6 commit 99e7ec0
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
5 changes: 4 additions & 1 deletion e2e/common-setup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/* eslint "@typescript-eslint/no-var-requires": 0 */
const Application = require('spectron').Application;
/* eslint "@typescript-eslint/no-var-requires": 0 */
const electronPath = require('electron'); // Require Electron from the binaries included in node_modules.
/* eslint "@typescript-eslint/no-var-requires": 0 */
const path = require('path');

export default function setup() {
export default function setup(): void {
beforeEach(async function () {
this.app = new Application({
// Your electron path can be any binary
Expand Down
4 changes: 3 additions & 1 deletion e2e/main.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import {expect, assert} from 'chai';
import {expect} from 'chai';
import {SpectronClient} from 'spectron';

import commonSetup from './common-setup';

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

/* eslint "@typescript-eslint/no-explicit-any": 0 */
let browser: any;
let client: SpectronClient;

beforeEach(function () {
client = this.app.client;
/* eslint "@typescript-eslint/no-explicit-any": 0 */
browser = client as any;
});

Expand Down
7 changes: 1 addition & 6 deletions eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,5 @@
"parserOptions": {
"tsconfigRootDir": "."
},
"plugins": ["@typescript-eslint"],
"rules": {
"no-empty-function": ["warn"],
"@typescript-eslint/no-empty-function": ["warn"],
"@typescript-eslint/no-var-requires": ["warn"]
}
"plugins": ["@typescript-eslint"]
}
1 change: 1 addition & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function createWindow(): BrowserWindow {
});

if (serve) {
/* eslint "@typescript-eslint/no-var-requires": 0 */
require('electron-reload')(__dirname, {
electron: require(`${__dirname}/node_modules/electron`)
});
Expand Down
5 changes: 0 additions & 5 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
import { TranslateModule } from '@ngx-translate/core';
import { ElectronService } from './core/services';

describe('AppComponent', () => {
Expand All @@ -19,7 +18,3 @@ describe('AppComponent', () => {
expect(app).toBeTruthy();
}));
});

class TranslateServiceStub {
setDefaultLang(lang: string): void {}
}
5 changes: 3 additions & 2 deletions src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { Component, OnInit } from '@angular/core';
})
export class HomeComponent implements OnInit {

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

ngOnInit() {
}
/* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */
ngOnInit(): void { }

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./page-not-found.component.scss']
})
export class PageNotFoundComponent implements OnInit {
/* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */
constructor() {}

ngOnInit() {}
/* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */
ngOnInit(): void {}
}
1 change: 1 addition & 0 deletions src/app/shared/directives/webview/webview.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import { Directive } from '@angular/core';
selector: '[webview]'
})
export class WebviewDirective {
/* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */
constructor() {}
}
1 change: 1 addition & 0 deletions src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

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

// First, initialize the Angular testing environment.
Expand Down

0 comments on commit 99e7ec0

Please sign in to comment.