fix/ ng lint with eslint

This commit is contained in:
Maxime GRIS
2020-06-20 19:48:08 +02:00
parent 21f7401740
commit 92d7419bc1
14 changed files with 109 additions and 55 deletions

View File

@@ -10,19 +10,19 @@ import { AppConfig } from '../environments/environment';
})
export class AppComponent {
constructor(
public electronService: ElectronService,
private electronService: ElectronService,
private translate: TranslateService
) {
translate.setDefaultLang('en');
this.translate.setDefaultLang('en');
console.log('AppConfig', AppConfig);
if (electronService.isElectron) {
console.log(process.env);
console.log('Mode electron');
console.log('Electron ipcRenderer', electronService.ipcRenderer);
console.log('NodeJS childProcess', electronService.childProcess);
console.log('Run in electron');
console.log('Electron ipcRenderer', this.electronService.ipcRenderer);
console.log('NodeJS childProcess', this.electronService.childProcess);
} else {
console.log('Mode web');
console.log('Run in browser');
}
}
}

View File

@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
// If you import a module but never use any of the imported values other than as TypeScript types,
// the resulting javascript file will look as if you never imported the module at all.
import { ipcRenderer, webFrame } from 'electron';
import { ipcRenderer, webFrame, remote } from 'electron';
import * as childProcess from 'child_process';
import * as fs from 'fs';
@@ -12,6 +12,7 @@ import * as fs from 'fs';
export class ElectronService {
ipcRenderer: typeof ipcRenderer;
webFrame: typeof webFrame;
remote: typeof remote;
childProcess: typeof childProcess;
fs: typeof fs;
@@ -24,6 +25,7 @@ export class ElectronService {
if (this.isElectron) {
this.ipcRenderer = window.require('electron').ipcRenderer;
this.webFrame = window.require('electron').webFrame;
this.remote = window.require('electron').remote;
this.childProcess = window.require('child_process');
this.fs = window.require('fs');

View File

@@ -8,9 +8,9 @@ describe('PageNotFoundComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PageNotFoundComponent ]
declarations: [PageNotFoundComponent]
})
.compileComponents();
.compileComponents();
}));
beforeEach(() => {

View File

@@ -4,5 +4,5 @@ import { Directive } from '@angular/core';
selector: 'webview'
})
export class WebviewDirective {
constructor() {}
constructor() { }
}

9
src/eslintrc.app.json Normal file
View File

@@ -0,0 +1,9 @@
{
"extends": "../.eslintrc.json",
"parserOptions": {
"project": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
]
}
}

View File

@@ -1,6 +0,0 @@
{
"extends": "../eslintrc.json",
"parserOptions": {
"project": ["src/tsconfig.app.json", "src/tsconfig.spec.json"]
}
}

View File

@@ -6,7 +6,16 @@
"baseUrl": "",
"types": []
},
"include": [
"**/*.ts",
],
"exclude": [
"**/*.spec.ts"
]
],
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"preserveWhitespaces": true
}
}