Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

Commit

Permalink
feat: New command 'npm run linter'
Browse files Browse the repository at this point in the history
  • Loading branch information
about-code committed Jul 4, 2018
1 parent 02c6e2c commit b39084c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// which require something to be exported. Feel free to remove `packageInfo`
// once you have got something else to export.
export const packageInfo = {
"name": "<%= pkg_fullname %>",
"description": "<%= pkg_description %>",
"author": "<%= pkg_author %>",
"copyright": "<%= pkg_author %>"
name: "<%= pkg_fullname %>",
description: "<%= pkg_description %>",
author: "<%= pkg_author %>",
copyright: "<%= pkg_author %>"
};

// Export the package's __public__ api, here.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { Router } from '@angular/router';
import { Component } from "@angular/core";
import { ComponentFixture, TestBed } from "@angular/core/testing";
import { Router } from "@angular/router";
import { AppComponent } from "./AppComponent";

@Component({selector: 'router-outlet', template: ''})
@Component({selector: "router-outlet", template: ""})
class RouterOutletStubComponent { }

/**
Expand All @@ -13,10 +13,10 @@ class RouterOutletStubComponent { }
* like our sample AppComponent. See angular.io to learn more about Angular
* testing.
*/
describe('AppComponent', () => {
describe("AppComponent", () => {

beforeEach(() => {
const routerSpy = jasmine.createSpyObj('Router', ['navigateByUrl']);
const routerSpy = jasmine.createSpyObj("Router", ["navigateByUrl"]);
TestBed.configureTestingModule({
declarations: [AppComponent, RouterOutletStubComponent],
providers: [
Expand All @@ -25,8 +25,8 @@ describe('AppComponent', () => {
});
});

it('should succeed', () => {
it("should succeed", () => {
const fixture: ComponentFixture<AppComponent> = TestBed.createComponent(AppComponent);
expect(fixture).toBeDefined('No fixture created');
expect(fixture).toBeDefined("No fixture created");
});
});
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {browser, by} from 'protractor';
import { browser, by } from "protractor";

describe('AppComponent', () => {
describe("AppComponent", () => {

it('should display "Welcome Home"', (done: any) => {
browser.get('http://localhost:8080<%= app_ctx_root %>');
it("should display 'Welcome Home'", (done: any) => {
browser.get("http://localhost:8080<%= app_ctx_root %>");
browser
.findElement(by.xpath('.//h1'))
.findElement(by.xpath(".//h1"))
.then(el => el.getText())
.then(innerText => {
expect(innerText).toBe('Welcome Home', 'Wrong inner text. Did HomeViewComponent-Template change?');
expect(innerText).toBe("Welcome Home", "Wrong inner text. Did HomeViewComponent-Template change?");
done();
})
.catch((err: any) => {
Expand Down
3 changes: 2 additions & 1 deletion generators/project-app/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"build-serve": "webpack-serve --config ./config/webpack.prod.js",
"clean": "node ./scripts/clean.js",
"lerna": "lerna",
"linter-fix": "tslint --fix --project='./tslint.json' --type-check",
"linter": "tslint -c ./tslint.json --project ./tsconfig.json",
"linter-fix": "tslint -c ./tslint.json --project ./tsconfig.json --fix --type-check",
"release": "standard-version",
"selenium": "webdriver-manager start",
"start": "webpack-serve --config ./config/webpack.dev.js",
Expand Down
6 changes: 3 additions & 3 deletions generators/project-app/template/src/bundle-polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import 'core-js/es6';
import 'core-js/es7/reflect';
require('zone.js/dist/zone');
import "core-js/es6";
import "core-js/es7/reflect";
require("zone.js/dist/zone");
17 changes: 9 additions & 8 deletions generators/project-app/template/src/bundle-vendor.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/animations';
import '@angular/core';
import '@angular/common';
import '@angular/forms';
import '@angular/http';
import '@angular/router';
import "@angular/animations";
import "@angular/common";
import "@angular/core";
import "@angular/forms";
import "@angular/http";
import "@angular/platform-browser";
import "@angular/platform-browser-dynamic";
import "@angular/router";

0 comments on commit b39084c

Please sign in to comment.