@@ -96,38 +96,38 @@ Create the following `tslint.json` file like:
96
96
{
97
97
"extends" : [" codelyzer" ],
98
98
"rules" : {
99
- "banana-in-box" : true ,
100
- "templates-no-negated-async" : true ,
101
- "directive-selector" : [true , " attribute" , " sg" , " camelCase" ],
99
+ "component-class-suffix" : true ,
100
+ "component-max-inline-declarations" : true ,
102
101
"component-selector" : [true , " element" , " sg" , " kebab-case" ],
103
- "max-inline-declarations" : true ,
104
- "no-life-cycle-call" : true ,
105
- "prefer-output-readonly" : true ,
106
- "no-conflicting-life-cycle-hooks" : true ,
107
- "enforce-component-selector" : true ,
108
- "no-queries-parameter" : true ,
109
- "prefer-inline-decorator" : true ,
110
- "use-input-property-decorator" : true ,
111
- "use-output-property-decorator" : true ,
112
- "use-host-property-decorator" : true ,
113
- "use-view-encapsulation" : true ,
114
- "no-attribute-parameter-decorator" : true ,
115
- "no-output-named-after-standard-event" : true ,
102
+ "contextual-lifecycle" : true ,
103
+ "directive-class-suffix" : true ,
104
+ "directive-selector" : [true , " attribute" , " sg" , " camelCase" ],
105
+ "no-attribute-decorator" : true ,
106
+ "no-conflicting-lifecycle" : true ,
107
+ "no-forward-ref" : true ,
108
+ "no-host-metadata-property" : true ,
116
109
"no-input-rename" : true ,
117
- "no-output-rename" : true ,
110
+ "no-inputs-metadata-property" : true ,
111
+ "no-lifecycle-call" : true ,
112
+ "no-output-native" : true ,
118
113
"no-output-on-prefix" : true ,
119
- "no-forward-ref" : true ,
114
+ "no-output-rename" : true ,
115
+ "no-outputs-metadata-property" : true ,
116
+ "no-pipe-impure" : true ,
117
+ "no-queries-metadata-property" : true ,
120
118
"no-unused-css" : true ,
121
- "use-life-cycle-interface" : true ,
122
- "contextual-life-cycle" : true ,
123
- "trackBy-function" : true ,
124
- "use-pipe-transform-interface" : true ,
125
- "component-class-suffix" : true ,
126
- "directive-class-suffix" : true ,
127
- "pipe-impure" : true ,
128
- "i18n" : [true , " check-id" , " check-text" ],
119
+ "prefer-inline-decorator" : true ,
120
+ "prefer-output-readonly" : true ,
121
+ "template-banana-in-box" : true ,
122
+ "template-conditional-complexity" : [true , 4 ],
129
123
"template-cyclomatic-complexity" : [true , 5 ],
130
- "template-conditional-complexity" : [true , 4 ]
124
+ "template-i18n" : [true , " check-id" , " check-text" ],
125
+ "template-no-negated-async" : true ,
126
+ "template-use-track-by-function" : true ,
127
+ "use-component-selector" : true ,
128
+ "use-component-view-encapsulation" : true ,
129
+ "use-lifecycle-interface" : true ,
130
+ "use-pipe-transform-interface" : true
131
131
}
132
132
}
133
133
```
@@ -156,38 +156,38 @@ Now create the following `tslint.json` file where your `node_modules` directory
156
156
{
157
157
"rulesDirectory" : [" node_modules/codelyzer" ],
158
158
"rules" : {
159
- "banana-in-box" : true ,
160
- "templates-no-negated-async" : true ,
161
- "directive-selector" : [true , " attribute" , " sg" , " camelCase" ],
159
+ "component-class-suffix" : true ,
160
+ "component-max-inline-declarations" : true ,
162
161
"component-selector" : [true , " element" , " sg" , " kebab-case" ],
163
- "max-inline-declarations" : true ,
164
- "no-life-cycle-call" : true ,
165
- "prefer-output-readonly" : true ,
166
- "no-conflicting-life-cycle-hooks" : true ,
167
- "enforce-component-selector" : true ,
168
- "no-queries-parameter" : true ,
169
- "prefer-inline-decorator" : true ,
170
- "use-input-property-decorator" : true ,
171
- "use-output-property-decorator" : true ,
172
- "use-host-property-decorator" : true ,
173
- "use-view-encapsulation" : true ,
174
- "no-attribute-parameter-decorator" : true ,
175
- "no-output-named-after-standard-event" : true ,
162
+ "contextual-lifecycle" : true ,
163
+ "directive-class-suffix" : true ,
164
+ "directive-selector" : [true , " attribute" , " sg" , " camelCase" ],
165
+ "no-attribute-decorator" : true ,
166
+ "no-conflicting-lifecycle" : true ,
167
+ "no-forward-ref" : true ,
168
+ "no-host-metadata-property" : true ,
176
169
"no-input-rename" : true ,
177
- "no-output-rename" : true ,
170
+ "no-inputs-metadata-property" : true ,
171
+ "no-lifecycle-call" : true ,
172
+ "no-output-native" : true ,
178
173
"no-output-on-prefix" : true ,
179
- "no-forward-ref" : true ,
174
+ "no-output-rename" : true ,
175
+ "no-outputs-metadata-property" : true ,
176
+ "no-pipe-impure" : true ,
177
+ "no-queries-metadata-property" : true ,
180
178
"no-unused-css" : true ,
181
- "use-life-cycle-interface" : true ,
182
- "contextual-life-cycle" : true ,
183
- "trackBy-function" : true ,
184
- "use-pipe-transform-interface" : true ,
185
- "component-class-suffix" : true ,
186
- "directive-class-suffix" : true ,
187
- "pipe-impure" : true ,
188
- "i18n" : [true , " check-id" , " check-text" ],
179
+ "prefer-inline-decorator" : true ,
180
+ "prefer-output-readonly" : true ,
181
+ "template-banana-in-box" : true ,
182
+ "template-conditional-complexity" : [true , 4 ],
189
183
"template-cyclomatic-complexity" : [true , 5 ],
190
- "template-conditional-complexity" : [true , 4 ]
184
+ "template-i18n" : [true , " check-id" , " check-text" ],
185
+ "template-no-negated-async" : true ,
186
+ "template-use-track-by-function" : true ,
187
+ "use-component-selector" : true ,
188
+ "use-component-view-encapsulation" : true ,
189
+ "use-lifecycle-interface" : true ,
190
+ "use-pipe-transform-interface" : true
191
191
}
192
192
}
193
193
```
@@ -257,77 +257,81 @@ Below you can find a recommended configuration which is based on the [Angular St
257
257
{
258
258
// The rule have the following arguments:
259
259
// [ENABLED, "attribute" | "element", "selectorPrefix" | ["listOfPrefixes"], "camelCase" | "kebab-case"]
260
- " directive-selector" : [true , " attribute" , [" dir-prefix1" , " dir-prefix2" ], " camelCase" ],
261
260
" component-selector" : [true , " element" , [" cmp-prefix1" , " cmp-prefix2" ], " kebab-case" ],
261
+ " directive-selector" : [true , " attribute" , [" dir-prefix1" , " dir-prefix2" ], " camelCase" ],
262
262
263
- " use-input-property-decorator" : true ,
264
- " use-output-property-decorator" : true ,
265
- " use-host-property-decorator" : true ,
266
- " no-attribute-parameter-decorator" : true ,
263
+ " component-max-inline-declarations" : true ,
264
+ " no-host-metadata-property" : true ,
267
265
" no-input-rename" : true ,
266
+ " no-inputs-metadata-property" : true ,
268
267
" no-output-on-prefix" : true ,
269
268
" no-output-rename" : true ,
270
- " no-forward-ref" : true ,
271
- " use-life-cycle-interface" : true ,
272
- " use-pipe-transform-interface" : true ,
273
- " no-output-named-after-standard-event" : true ,
274
- " max-inline-declarations" : true ,
275
- " no-life-cycle-call" : true ,
276
- " prefer-output-readonly" : true ,
277
- " no-conflicting-life-cycle-hooks" : true ,
278
- " enforce-component-selector" : true ,
279
- " no-queries-parameter" : true ,
269
+ " no-outputs-metadata-property" : true ,
270
+ " no-queries-metadata-property" : true ,
280
271
" prefer-inline-decorator" : true ,
281
- // [ENABLED, "SUFFIX"]
282
- // Where "SUFFIX" is your custom suffix, for instance "Page" for Ionic 2 components.
272
+ " use-lifecycle-interface" : true ,
273
+ // [ENABLED, "Suffix" | ["listOfSuffixes"]]
274
+ // Where "Suffix" is/are your custom(s) suffix(s), for instance "Page" for Ionic components.
283
275
" component-class-suffix" : [true , " Component" ],
284
276
" directive-class-suffix" : [true , " Directive" ]
285
277
}
286
278
```
287
279
288
280
## Rules Status
289
281
290
- | Rule | Status |
291
- | -------------------------------------- | :------------: |
292
- | ` banana-in-box ` | Stable |
293
- | ` contextual-life-cycle ` | Stable |
294
- | ` decorator-not-allowed ` | Stable |
295
- | ` pipe-impure ` | Stable |
296
- | ` templates-no-negated-async ` | Stable |
297
- | ` no-attribute-parameter-decorator ` | Stable |
298
- | ` no-forward-ref ` | Stable |
299
- | ` no-input-prefix ` | Stable |
300
- | ` no-input-rename ` | Stable |
301
- | ` no-output-on-prefix ` | Stable |
302
- | ` no-output-rename ` | Stable |
303
- | ` use-life-cycle-interface ` | Stable |
304
- | ` use-pipe-decorator ` | Stable |
305
- | ` use-pipe-transform-interface ` | Stable |
306
- | ` use-view-encapsulation ` | Stable |
307
- | ` component-class-suffix ` | Stable |
308
- | ` component-selector ` | Stable |
309
- | ` directive-class-suffix ` | Stable |
310
- | ` directive-selector ` | Stable |
311
- | ` use-host-property-decorator ` | Stable |
312
- | ` use-input-property-decorator ` | Stable |
313
- | ` use-output-property-decorator ` | Stable |
314
- | ` trackBy-function ` | Stable |
315
- | ` import-destructuring-spacing ` | Stable |
316
- | ` no-output-named-after-standard-event ` | Stable |
317
- | ` max-inline-declarations ` | Stable |
318
- | ` prefer-output-readonly ` | Stable |
319
- | ` enforce-component-selector ` | Stable |
320
- | ` no-life-cycle-call ` | Stable |
321
- | ` no-template-call-expression ` | Stable |
322
- | ` no-queries-parameter ` | Stable |
323
- | ` prefer-inline-decorator ` | Stable |
324
- | ` template-cyclomatic-complexity ` | Stable |
325
- | ` pipe-prefix ` | _ Experimental_ |
326
- | ` no-conflicting-life-cycle-hooks ` | _ Experimental_ |
327
- | ` i18n ` | _ Experimental_ |
328
- | ` no-unused-css ` | _ Experimental_ |
329
- | ` template-conditional-complexity ` | _ Experimental_ |
330
- | ` angular-whitespace ` | _ Deprecated_ |
282
+ | Rule | Status |
283
+ | --------------------------------------------- | :------------: |
284
+ | ` component-class-suffix ` | Stable |
285
+ | ` component-max-inline-declarations ` | Stable |
286
+ | ` component-selector ` | Stable |
287
+ | ` contextual-decorator ` | Stable |
288
+ | ` contextual-lifecycle ` | Stable |
289
+ | ` directive-class-suffix ` | Stable |
290
+ | ` directive-selector ` | Stable |
291
+ | ` import-destructuring-spacing ` | Stable |
292
+ | ` no-attribute-decorator ` | Stable |
293
+ | ` no-forward-ref ` | Stable |
294
+ | ` no-host-metadata-property ` | Stable |
295
+ | ` no-input-prefix ` | Stable |
296
+ | ` no-input-rename ` | Stable |
297
+ | ` no-inputs-metadata-property ` | Stable |
298
+ | ` no-lifecycle-call ` | Stable |
299
+ | ` no-output-native ` | Stable |
300
+ | ` no-output-on-prefix ` | Stable |
301
+ | ` no-output-rename ` | Stable |
302
+ | ` no-outputs-metadata-property ` | Stable |
303
+ | ` no-pipe-impure ` | Stable |
304
+ | ` no-queries-metadata-property ` | Stable |
305
+ | ` prefer-inline-decorator ` | Stable |
306
+ | ` prefer-output-readonly ` | Stable |
307
+ | ` template-banana-in-box ` | Stable |
308
+ | ` template-cyclomatic-complexity ` | Stable |
309
+ | ` template-no-call-expression ` | Stable |
310
+ | ` template-no-negated-async ` | Stable |
311
+ | ` template-use-track-by-function ` | Stable |
312
+ | ` use-component-selector ` | Stable |
313
+ | ` use-component-view-encapsulation ` | Stable |
314
+ | ` use-lifecycle-interface ` | Stable |
315
+ | ` use-pipe-decorator ` | Stable |
316
+ | ` use-pipe-transform-interface ` | Stable |
317
+ | ` no-conflicting-lifecycle ` | _ Experimental_ |
318
+ | ` no-unused-css ` | _ Experimental_ |
319
+ | ` pipe-prefix ` | _ Experimental_ |
320
+ | ` relative-url-prefix ` | _ Experimental_ |
321
+ | ` template-accessibility-alt-text ` | _ Experimental_ |
322
+ | ` template-accessibility-element-content ` | _ Experimental_ |
323
+ | ` template-accessibility-label-for ` | _ Experimental_ |
324
+ | ` template-accessibility-tabindex-no-positive ` | _ Experimental_ |
325
+ | ` template-accessibility-table-scope ` | _ Experimental_ |
326
+ | ` template-accessibility-valid-aria ` | _ Experimental_ |
327
+ | ` template-click-events-have-key-events ` | _ Experimental_ |
328
+ | ` template-conditional-complexity ` | _ Experimental_ |
329
+ | ` template-i18n ` | _ Experimental_ |
330
+ | ` template-mouse-events-have-key-events ` | _ Experimental_ |
331
+ | ` template-no-any ` | _ Experimental_ |
332
+ | ` template-no-autofocus ` | _ Experimental_ |
333
+ | ` template-no-distracting-elements ` | _ Experimental_ |
334
+ | ` angular-whitespace ` | _ Deprecated_ |
331
335
332
336
## Disable a rule that validates Template or Styles
333
337
@@ -338,7 +342,7 @@ To disable rules that validate templates or styles you'd need to add a marker in
338
342
``` ts
339
343
import { Component } from ' @angular/core' ;
340
344
341
- /* tslint:disable:trackBy -function */
345
+ /* tslint:disable:template-use-track-by -function */
342
346
@Component ({
343
347
selector: ' codelyzer' ,
344
348
templateUrl: ' ./codelyzer.component.html'
0 commit comments