Skip to content

Commit c023c75

Browse files
mohammedzamakhanmgechev
authored andcommitted
docs(readme): add new rules as experimental (#756)
* docs(readme): add new rules as experimental * docs: add new rules * docs: add new rules // rename old rules * docs: adjust minor info * docs: remove '2' from Ionic
1 parent 049be66 commit c023c75

File tree

2 files changed

+118
-114
lines changed

2 files changed

+118
-114
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Must be one of the following:
205205
### Scope
206206
207207
The scope could be anything specifying place of the commit change. For example
208-
`ngWalker`, `useLifeCycleInterface`, etc.
208+
`ngWalker`, `useLifecycleInterface`, etc.
209209
210210
### Subject
211211

README.md

Lines changed: 117 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -96,38 +96,38 @@ Create the following `tslint.json` file like:
9696
{
9797
"extends": ["codelyzer"],
9898
"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,
102101
"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,
116109
"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,
118113
"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,
120118
"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],
129123
"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
131131
}
132132
}
133133
```
@@ -156,38 +156,38 @@ Now create the following `tslint.json` file where your `node_modules` directory
156156
{
157157
"rulesDirectory": ["node_modules/codelyzer"],
158158
"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,
162161
"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,
176169
"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,
178173
"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,
180178
"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],
189183
"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
191191
}
192192
}
193193
```
@@ -257,77 +257,81 @@ Below you can find a recommended configuration which is based on the [Angular St
257257
{
258258
// The rule have the following arguments:
259259
// [ENABLED, "attribute" | "element", "selectorPrefix" | ["listOfPrefixes"], "camelCase" | "kebab-case"]
260-
"directive-selector": [true, "attribute", ["dir-prefix1", "dir-prefix2"], "camelCase"],
261260
"component-selector": [true, "element", ["cmp-prefix1", "cmp-prefix2"], "kebab-case"],
261+
"directive-selector": [true, "attribute", ["dir-prefix1", "dir-prefix2"], "camelCase"],
262262

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,
267265
"no-input-rename": true,
266+
"no-inputs-metadata-property": true,
268267
"no-output-on-prefix": true,
269268
"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,
280271
"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.
283275
"component-class-suffix": [true, "Component"],
284276
"directive-class-suffix": [true, "Directive"]
285277
}
286278
```
287279

288280
## Rules Status
289281

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_ |
331335

332336
## Disable a rule that validates Template or Styles
333337

@@ -338,7 +342,7 @@ To disable rules that validate templates or styles you'd need to add a marker in
338342
```ts
339343
import { Component } from '@angular/core';
340344

341-
/* tslint:disable:trackBy-function */
345+
/* tslint:disable:template-use-track-by-function */
342346
@Component({
343347
selector: 'codelyzer',
344348
templateUrl: './codelyzer.component.html'

0 commit comments

Comments
 (0)