A set of tslint rules for static code analysis of Angular 2 TypeScript projects.
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"],
"host-parameter-decorator": true,
"input-parameter-decorator": true,
"output-parameter-decorator": true
}- Directive selector type.
- Directive selector name convention.
- Directive selector name prefix.
- Component selector type.
- Component selector name convention.
- Component selector name prefix.
- Use
@Inputinstead ofinputsdecorator property. - Use
@Outputinstead ofoutputsdecorator property. - Use
@HostListenersand@HostBindingsinstead ofhostdecorator property. - Do not use
nativeElementinjected withElementRef. - Do not rename inputs.
- Do not rename outputs.
- Externalize template above n lines of code.
- Do not use the
@Attributedecorator. - Do not use
forwardRef. - Rise a warning for impure pipes.
- Do not declare global providers.
- Follow convention for naming the routes.
- Use
@Injectableinstead of@Inject.
MIT