style(lint): improve lint issues

This commit is contained in:
KostyaDanovsky 2017-05-06 15:35:15 +03:00
parent 3ac268a096
commit f04763cecd
16 changed files with 19 additions and 78 deletions

View file

@ -15,6 +15,7 @@
"test": "ng test -sr",
"test:coverage": "rimraf coverage && npm run test -- -cc",
"lint": "ng lint",
"lint:fix": "ng lint --fix",
"lint:styles": "stylelint ./src/**/*.scss",
"lint:ci": "npm run lint && npm run lint:styles",
"pree2e": "webdriver-manager update --standalone false --gecko false",

View file

@ -5,9 +5,9 @@ import { throwIfAlreadyLoaded } from './module-import-guard';
@NgModule({
imports: [
CommonModule
CommonModule,
],
declarations: []
declarations: [],
})
export class CoreModule {
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {

View file

@ -20,8 +20,7 @@ export class TinyMCEComponent implements OnDestroy, AfterViewInit {
setup: editor => {
this.editor = editor;
editor.on('keyup', () => {
let content = editor.getContent();
this.editorKeyup.emit(content);
this.editorKeyup.emit(editor.getContent());
});
},
});

View file

@ -1,7 +1,7 @@
import { Component } from '@angular/core';
@Component({
selector: 'one-column-layout',
selector: 'ngx-one-column-layout',
template: `
<nga-layout>
<nga-layout-header fixed>

View file

@ -17,7 +17,7 @@ import {
HeaderComponent,
FooterComponent,
SearchInputComponent,
TinyMCEComponent
TinyMCEComponent,
} from './components';
import { OneColumnLayoutComponent } from './layouts';

View file

@ -6,7 +6,7 @@
import { Component } from '@angular/core';
@Component({
selector: 'app',
selector: 'ngx-app',
template: '<router-outlet></router-outlet>',
})
export class AppComponent {

View file

@ -1,7 +1,7 @@
import { Component } from '@angular/core';
@Component({
selector: 'components',
selector: 'ngx-components',
template: `
<p>
components works!

View file

@ -1,7 +1,7 @@
import { Component } from '@angular/core';
@Component({
selector: 'dashboard',
selector: 'ngx-dashboard',
template: `
<nga-card>
<nga-card-header>Test card</nga-card-header>

View file

@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EditorsComponent } from './editors.component';
import { TinyMCEComponent, TinyMCEEditorComponent } from './tinyMCE.component';
import { TinyMCEComponent } from './tiny-mce/tiny-mce.component';
import { CKEditorComponent } from './ckeditor.component';
const routes: Routes = [{
@ -26,6 +26,5 @@ export class EditorsRoutingModule { }
export const routedComponents = [
EditorsComponent,
TinyMCEComponent,
TinyMCEEditorComponent,
CKEditorComponent,
];

View file

@ -1,56 +0,0 @@
import { Component, OnDestroy, AfterViewInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'ngx-tinymce-editor',
template: `
<textarea id="{{ elementId }}"></textarea>
`,
})
export class TinyMCEEditorComponent implements OnDestroy, AfterViewInit {
@Input() elementId: string;
@Output() editorKeyup = new EventEmitter<any>();
editor: any;
ngAfterViewInit() {
tinymce.init({
selector: '#' + this.elementId,
plugins: ['link', 'paste', 'table'],
skin_url: 'assets/skins/lightgray',
setup: editor => {
this.editor = editor;
editor.on('keyup', () => {
const content = editor.getContent();
this.editorKeyup.emit(content);
});
},
});
}
ngOnDestroy() {
tinymce.remove(this.editor);
}
}
@Component({
selector: 'ngx-tinymce',
template: `
<nga-card>
<nga-card-body>
<ngx-tinymce-editor elementId="tinymceEditor" (editorKeyup)="editorKeyupHandler($event)"></ngx-tinymce-editor>
</nga-card-body>
</nga-card>
`,
})
export class TinyMCEComponent {
editorKeyupHandler($event) {
console.info($event);
}
}

View file

@ -1,7 +1,7 @@
import { Component } from '@angular/core';
@Component({
selector: 'maps',
selector: 'ngx-maps',
template: `
<p>
maps works!

View file

@ -4,12 +4,12 @@ import 'style-loader!../@theme/styles/gorgeous/gorgeous.theme.scss';
import 'style-loader!../@theme/styles/pure/pure.theme.scss';
@Component({
selector: 'pages',
selector: 'ngx-pages',
template: `
<one-column-layout>
<ngx-one-column-layout>
<nga-menu></nga-menu>
<router-outlet></router-outlet>
</one-column-layout>
</ngx-one-column-layout>
`,
})
export class PagesComponent {

View file

@ -9,6 +9,6 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app>Loading...</app>
<ngx-app>Loading...</ngx-app>
</body>
</html>

View file

@ -54,14 +54,12 @@ import 'core-js/es7/reflect';
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/***************************************************************************************************
* Zone JS is required by Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/

View file

@ -14,7 +14,7 @@ import 'zone.js/dist/fake-async-test';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
platformBrowserDynamicTesting,
} from '@angular/platform-browser-dynamic/testing';
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
@ -27,7 +27,7 @@ __karma__.loaded = function () {};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
platformBrowserDynamicTesting(),
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);