0.1.0 • Published 5 years ago
@kfn-modern-dx/code-check-schematic v0.1.0
Code Check Schematic
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-schematicoption
| option | value | default | description |
|---|---|---|---|
| project | project name | workspace root name | The name of the project to which settings are added. |
| style | css|scss | css | style sheet type. Use setting .stylelintrc.json |
npm script
This schematics add these npm scripts.
lint:ts: Lint ts files with TSLint, same as defaultlintcommand.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.tsAuto 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.