0.1.0 • Published 5 years ago

@kfn-modern-dx/code-check-schematic v0.1.0

Weekly downloads
3
License
MIT
Repository
-
Last release
5 years ago

Code Check Schematic

wercker status

Schematic of auto code check settings in angular workspace. This schematics set these OSS.

  • Prettier: code formatter
  • StyleLint: Stylesheet code check (CSS or SCSS)
  • TSLint: only prettier extends
  • hasky & lint-staged: auto run before code commit

ng add

$ ng new <your ng ws name>
$ cd <your ng ws>
$ ng add @kfn-modern-dx/code-check-schematic

option

optionvaluedefaultdescription
projectproject nameworkspace root nameThe name of the project to which settings are added.
stylecss|scsscssstyle sheet type. Use setting .stylelintrc.json

npm script

This schematics add these npm scripts.

  • lint:ts: Lint ts files with TSLint, same as default lint command.
  • lint:style: Lint stylesheet with StyleLint.
  • format: Code format with prettier.
  • format:all: All code format with prettier.

and change the lint command so that tslint and style lint are executed.

File format example.

$  npm run format -- src/app/app.component.ts

Auto code check

Prettier and Lint execute before git commit. Developer can't commit if d'not pass code check. This helps keep the repository clean.

Feature

  • Auto detect project stylesheet type.
  • Add stylelint settings other than CSS and SCSS.