Package Exports
- codelyzer/util/utils
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (codelyzer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Codelyzer
A set of tslint rules for static code analysis of Angular 2 TypeScript projects.
You can run the static code analyzer over web apps, NativeScript, Ionic, etc.
Install
npm install --save-dev codelyzer
Then hop to your tslint.json
and add rulesDirectory which points to codelyzer, like this:
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules":{
}
}
Now you can apply codelyzer rules to your tslint config.
In order to run the rules through tslint use:
tslint -c tslint.json **/*.ts
Enjoy!
Recommended configuration
Below you can find a recommended configuration which is based on the Angular 2 Style Guide.
{
"directive-selector-name": [true, "camelCase"],
"component-selector-name": [true, "kebab-case"],
"directive-selector-type": [true, "attribute"],
"component-selector-type": [true, "element"],
"directive-selector-prefix": [true, "sg"],
"component-selector-prefix": [true, "sg"],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-attribute-parameter-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"no-forward-ref": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"pipe-naming": [true, "camelCase", "sg"],
"component-class-suffix": true,
"directive-class-suffix": true,
"import-destructuring-spacing": true,
"templates-use-public": true,
"no-access-missing-member": true
}
License
MIT