├── .gitignore ├── LICENSE ├── README.MD ├── angular.json ├── package.json ├── src ├── app │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.ts │ ├── app.module.ts │ └── app.route.ts ├── assets │ ├── .gitkeep │ ├── browserslist │ ├── favicon.ico │ └── i18n │ │ ├── cn.json │ │ └── en.json ├── core │ ├── core.module.ts │ └── index.ts ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── index.html ├── main.ts ├── pages │ ├── home │ │ ├── home.component.html │ │ ├── home.component.scss │ │ └── home.component.ts │ ├── index.ts │ └── notfound │ │ ├── notfound.component.html │ │ ├── notfound.component.scss │ │ ├── notfound.component.ts │ │ └── notfound.module.ts ├── polyfills.ts ├── shared │ ├── index.ts │ └── shared.module.ts └── styles │ ├── styles.scss │ └── var.scss ├── tsconfig.json ├── tslint.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | yarn-error.log 4 | /dist 5 | /tmp 6 | /out-tsc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Yitimo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | # angular-starter-yitimo 2 | 3 | Angular starter by yitimo. Bases on project created by angular-cli. 4 | 5 | 1. Use yarn for package managing. 6 | 2. Use SCSS for styling. 7 | 3. Use material UIs. 8 | 4. Add i18n ability. 9 | 5. Remove test related code. 10 | 11 | ## Build it by yourself 12 | 13 | As this is a repo just based on angular-cli created, you can just build it manually. Just see as the following steps. 14 | 15 | 1. install yarn 16 | 2. install @angular/cli globally by ``yarn global add @angular/cli`` 17 | 3. config angular-cli to use yarn defaultly by ``ng config -g cli.packageManager yarn`` 18 | 4. ng new yourAppName --style=scss 19 | 5. delete test related files if you don't need them like me 20 | 6. move global config files to where you want 21 | 7. add material by ``yarn add @angular/material @angular/cdk`` and then import the css file 22 | 8. add shared module to put material modules or others common modules in 23 | 9. add core module to put global services/modules 24 | 10. add translate module and config it 25 | 11. add app routes and sub routes 26 | 12. start writing your fantastic app 27 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "angular-starter-yitimo": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": { 12 | "@schematics/angular:component": { 13 | "styleext": "scss" 14 | } 15 | }, 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "outputPath": "dist/angular-starter-yitimo", 21 | "index": "src/index.html", 22 | "main": "src/main.ts", 23 | "polyfills": "src/polyfills.ts", 24 | "tsConfig": "tsconfig.json", 25 | "assets": [ 26 | "src/assets" 27 | ], 28 | "styles": [ 29 | "src/styles/styles.scss" 30 | ], 31 | "scripts": [] 32 | }, 33 | "configurations": { 34 | "production": { 35 | "fileReplacements": [ 36 | { 37 | "replace": "src/environments/environment.ts", 38 | "with": "src/environments/environment.prod.ts" 39 | } 40 | ], 41 | "optimization": true, 42 | "outputHashing": "all", 43 | "sourceMap": false, 44 | "extractCss": true, 45 | "namedChunks": false, 46 | "aot": true, 47 | "extractLicenses": true, 48 | "vendorChunk": false, 49 | "buildOptimizer": true 50 | } 51 | } 52 | }, 53 | "serve": { 54 | "builder": "@angular-devkit/build-angular:dev-server", 55 | "options": { 56 | "browserTarget": "angular-starter-yitimo:build" 57 | }, 58 | "configurations": { 59 | "production": { 60 | "browserTarget": "angular-starter-yitimo:build:production" 61 | } 62 | } 63 | }, 64 | "extract-i18n": { 65 | "builder": "@angular-devkit/build-angular:extract-i18n", 66 | "options": { 67 | "browserTarget": "angular-starter-yitimo:build" 68 | } 69 | }, 70 | "lint": { 71 | "builder": "@angular-devkit/build-angular:tslint", 72 | "options": { 73 | "tsConfig": [ 74 | "src/tsconfig.app.json", 75 | "src/tsconfig.spec.json" 76 | ], 77 | "exclude": [ 78 | "**/node_modules/**" 79 | ] 80 | } 81 | } 82 | } 83 | } 84 | }, 85 | "defaultProject": "angular-starter-yitimo" 86 | } 87 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-starter-yitimo", 3 | "version": "4.0.0", 4 | "description": "Angular demo by yitimo, fixing from angular-cli", 5 | "keywords": [ 6 | "angular", 7 | "webpack", 8 | "typescript" 9 | ], 10 | "author": "yitimo ", 11 | "private": true, 12 | "license": "MIT", 13 | "scripts": { 14 | "start": "ng serve", 15 | "build": "ng build", 16 | "rimraf": "rimraf", 17 | "preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/')\"" 18 | }, 19 | "dependencies": { 20 | "@angular/animations": "^6.0.3", 21 | "@angular/cdk": "^6.3.0", 22 | "@angular/common": "^6.0.3", 23 | "@angular/compiler": "^6.0.3", 24 | "@angular/core": "^6.0.3", 25 | "@angular/forms": "^6.0.3", 26 | "@angular/http": "^6.0.3", 27 | "@angular/material": "^6.3.0", 28 | "@angular/platform-browser": "^6.0.3", 29 | "@angular/platform-browser-dynamic": "^6.0.3", 30 | "@angular/router": "^6.0.3", 31 | "@ngx-translate/core": "^10.0.2", 32 | "@ngx-translate/http-loader": "^3.0.1", 33 | "core-js": "^2.5.4", 34 | "rxjs": "^6.0.0", 35 | "zone.js": "^0.8.26" 36 | }, 37 | "devDependencies": { 38 | "@angular-devkit/build-angular": "~0.6.8", 39 | "@angular/cli": "~6.0.8", 40 | "@angular/compiler-cli": "^6.0.3", 41 | "@angular/language-service": "^6.0.3", 42 | "@types/node": "~8.9.4", 43 | "codelyzer": "~4.2.1", 44 | "rimraf": "^2.6.2", 45 | "ts-node": "~5.0.1", 46 | "tslint": "~5.9.1", 47 | "typescript": "~2.7.2" 48 | }, 49 | "repository": { 50 | "type": "git", 51 | "url": "https://github.com/yitimo/angular-starter-yitimo.git" 52 | }, 53 | "bugs": { 54 | "url": "https://github.com/yitimo/angular-starter-yitimo/issues" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | {{'APP_NAME' | translate}} 2 | -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yitimo/angular-starter-yitimo/32d2d021b6501828d5a1d633cdf757fbbd97306a/src/app/app.component.scss -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'angular-starter-yitimo', 5 | templateUrl: 'app.component.html', 6 | styleUrls: ['app.component.scss'] 7 | }) 8 | export class AppComponent { } 9 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { CoreModule } from '../core'; 5 | import { SharedModule } from '../shared'; 6 | 7 | import { AppRoutingModule } from './app.route'; 8 | import { AppComponent } from './app.component'; 9 | import { HomeComponent, NotfoundModule } from '../pages'; 10 | 11 | import { HttpClient } from '@angular/common/http'; 12 | import { TranslateModule, TranslateLoader, TranslateService } from '@ngx-translate/core'; 13 | import { TranslateHttpLoader } from '@ngx-translate/http-loader'; 14 | 15 | // for i18n 16 | function createTranslateLoader(http: HttpClient) { 17 | return new TranslateHttpLoader(http, 'assets/i18n/', '.json'); 18 | } 19 | const translateModuleConfig = { 20 | loader: { 21 | provide: TranslateLoader, 22 | useFactory: (createTranslateLoader), 23 | deps: [HttpClient] 24 | } 25 | }; 26 | 27 | @NgModule({ 28 | declarations: [ 29 | AppComponent, HomeComponent 30 | ], 31 | imports: [ 32 | BrowserModule, SharedModule, CoreModule, 33 | TranslateModule.forRoot(translateModuleConfig), 34 | AppRoutingModule, 35 | NotfoundModule 36 | ], 37 | providers: [], 38 | bootstrap: [AppComponent] 39 | }) 40 | export class AppModule { 41 | constructor( 42 | private translate: TranslateService 43 | ) { 44 | this.translate.setDefaultLang('en'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/app/app.route.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { HomeComponent } from '../pages'; 5 | 6 | const routes: Routes = [ 7 | { path: '', redirectTo: '/home', pathMatch: 'full' }, 8 | { path: 'home', component: HomeComponent } 9 | ]; 10 | 11 | @NgModule({ 12 | imports: [RouterModule.forRoot(routes, {useHash: true})], 13 | exports: [RouterModule], 14 | }) 15 | export class AppRoutingModule { } 16 | 17 | export const routedComponents = [HomeComponent]; 18 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yitimo/angular-starter-yitimo/32d2d021b6501828d5a1d633cdf757fbbd97306a/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/assets/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /src/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yitimo/angular-starter-yitimo/32d2d021b6501828d5a1d633cdf757fbbd97306a/src/assets/favicon.ico -------------------------------------------------------------------------------- /src/assets/i18n/cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "APP_NAME": "Angular 启动项目 by Yitimo" 3 | } -------------------------------------------------------------------------------- /src/assets/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "APP_NAME": "Angular Starter Yitimo" 3 | } -------------------------------------------------------------------------------- /src/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 3 | import { HttpClientModule } from '@angular/common/http'; 4 | 5 | @NgModule({ 6 | imports: [ 7 | BrowserAnimationsModule, HttpClientModule 8 | ], 9 | exports: [], 10 | declarations: [], 11 | providers: [], 12 | }) 13 | export class CoreModule { } 14 | -------------------------------------------------------------------------------- /src/core/index.ts: -------------------------------------------------------------------------------- 1 | export { CoreModule } from './core.module'; 2 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular Starter By Yitimo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /src/pages/home/home.component.html: -------------------------------------------------------------------------------- 1 | Home page ! 2 | -------------------------------------------------------------------------------- /src/pages/home/home.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yitimo/angular-starter-yitimo/32d2d021b6501828d5a1d633cdf757fbbd97306a/src/pages/home/home.component.scss -------------------------------------------------------------------------------- /src/pages/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'home.component.html', 5 | styleUrls: ['home.component.scss'] 6 | }) 7 | export class HomeComponent implements OnInit { 8 | constructor() { 9 | // 10 | } 11 | 12 | public ngOnInit() { 13 | // 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/pages/index.ts: -------------------------------------------------------------------------------- 1 | // add sub module here 2 | export { HomeComponent } from './home/home.component'; 3 | export { NotfoundModule } from './notfound/notfound.module'; 4 | -------------------------------------------------------------------------------- /src/pages/notfound/notfound.component.html: -------------------------------------------------------------------------------- 1 | 404 -------------------------------------------------------------------------------- /src/pages/notfound/notfound.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yitimo/angular-starter-yitimo/32d2d021b6501828d5a1d633cdf757fbbd97306a/src/pages/notfound/notfound.component.scss -------------------------------------------------------------------------------- /src/pages/notfound/notfound.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'notfound.component.html', 5 | styleUrls: ['notfound.component.scss'] 6 | }) 7 | export class NotfoundComponent implements OnInit { 8 | constructor() { 9 | // 10 | } 11 | 12 | public ngOnInit() { 13 | // 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/pages/notfound/notfound.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { NotfoundComponent } from './notfound.component'; 5 | 6 | const routes: Routes = [ 7 | { path: 'path', component: NotfoundComponent }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule], 13 | declarations: [NotfoundComponent] 14 | }) 15 | export class NotfoundModule { } 16 | 17 | export const routedComponents = [NotfoundComponent]; 18 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /src/shared/index.ts: -------------------------------------------------------------------------------- 1 | export { SharedModule } from './shared.module'; 2 | -------------------------------------------------------------------------------- /src/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { ReactiveFormsModule } from '@angular/forms'; 4 | import { 5 | MatButtonModule, MatToolbarModule 6 | } from '@angular/material'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | CommonModule, ReactiveFormsModule, MatButtonModule, 11 | MatToolbarModule 12 | ], 13 | exports: [ 14 | CommonModule, ReactiveFormsModule, MatButtonModule, 15 | MatToolbarModule 16 | ], 17 | declarations: [], 18 | providers: [], 19 | }) 20 | export class SharedModule { } 21 | -------------------------------------------------------------------------------- /src/styles/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import 'var'; 3 | 4 | * { 5 | margin: 0;padding: 0; 6 | box-sizing: border-box; 7 | } 8 | html, body { 9 | width: 100%; 10 | height: 100%; 11 | } 12 | -------------------------------------------------------------------------------- /src/styles/var.scss: -------------------------------------------------------------------------------- 1 | @import "~@angular/material/prebuilt-themes/indigo-pink.css"; 2 | /* add var css here */ 3 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc/app", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "module": "es2015", 13 | "types": [], 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2017", 19 | "dom" 20 | ] 21 | }, 22 | "exclude": [ 23 | "src/test.ts", 24 | "**/*.spec.ts" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "no-output-on-prefix": true, 120 | "use-input-property-decorator": true, 121 | "use-output-property-decorator": true, 122 | "use-host-property-decorator": true, 123 | "no-input-rename": true, 124 | "no-output-rename": true, 125 | "use-life-cycle-interface": true, 126 | "use-pipe-transform-interface": true, 127 | "component-class-suffix": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | --------------------------------------------------------------------------------