Skip to content

Commit 4ebc646

Browse files
committed
docs: update docs
1 parent e2bce24 commit 4ebc646

File tree

3 files changed

+25
-290
lines changed

3 files changed

+25
-290
lines changed

docs/_data/rules.json

Lines changed: 10 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
"description": "Disallows usage of @Attribute decorator.",
212212
"options": null,
213213
"optionsDescription": "Not configurable.",
214+
"rationale": "@Attribute is considered bad practice. Use @Input instead.",
214215
"ruleName": "no-attribute-decorator",
215216
"type": "functionality",
216217
"typescriptOnly": true
@@ -376,142 +377,20 @@
376377
"typescriptOnly": true
377378
},
378379
{
379-
"description": "Ensures that declarations are on the same line as its decorator(s).",
380+
"description": "Ensures that decorators are on the same line as the property/method it decorates.",
380381
"descriptionDetails": "See more at https://angular.io/guide/styleguide#style-05-12.",
381-
"optionExamples": [
382-
true,
383-
[
384-
true,
382+
"hasFix": true,
383+
"optionExamples": [true, [true, "HostListener"], [true, "Input", "MyCustomDecorator"]],
384+
"options": {
385+
"items": [
385386
{
386-
"methods": false
387+
"type": "string"
387388
}
388389
],
389-
[
390-
true,
391-
{
392-
"getters": {
393-
"safelist": ["Input"]
394-
},
395-
"methods": true,
396-
"parameter-properties": false,
397-
"parameters": false,
398-
"properties": {
399-
"safelist": ["Output", "MyCustomDecorator"]
400-
},
401-
"setters": true
402-
}
403-
]
404-
],
405-
"options": {
406-
"additionalProperties": false,
407-
"properties": {
408-
"getters": {
409-
"oneOf": [
410-
{
411-
"type": "boolean"
412-
},
413-
{
414-
"properties": {
415-
"items": {
416-
"type": "string"
417-
},
418-
"type": "array",
419-
"uniqueItems": true
420-
},
421-
"type": "object"
422-
}
423-
]
424-
},
425-
"methods": {
426-
"oneOf": [
427-
{
428-
"type": "boolean"
429-
},
430-
{
431-
"properties": {
432-
"items": {
433-
"type": "string"
434-
},
435-
"type": "array",
436-
"uniqueItems": true
437-
},
438-
"type": "object"
439-
}
440-
]
441-
},
442-
"parameter-properties": {
443-
"oneOf": [
444-
{
445-
"type": "boolean"
446-
},
447-
{
448-
"properties": {
449-
"items": {
450-
"type": "string"
451-
},
452-
"type": "array",
453-
"uniqueItems": true
454-
},
455-
"type": "object"
456-
}
457-
]
458-
},
459-
"parameters": {
460-
"oneOf": [
461-
{
462-
"type": "boolean"
463-
},
464-
{
465-
"properties": {
466-
"items": {
467-
"type": "string"
468-
},
469-
"type": "array",
470-
"uniqueItems": true
471-
},
472-
"type": "object"
473-
}
474-
]
475-
},
476-
"properties": {
477-
"oneOf": [
478-
{
479-
"type": "boolean"
480-
},
481-
{
482-
"properties": {
483-
"items": {
484-
"type": "string"
485-
},
486-
"type": "array",
487-
"uniqueItems": true
488-
},
489-
"type": "object"
490-
}
491-
]
492-
},
493-
"setters": {
494-
"oneOf": [
495-
{
496-
"type": "boolean"
497-
},
498-
{
499-
"properties": {
500-
"items": {
501-
"type": "string"
502-
},
503-
"type": "array",
504-
"uniqueItems": true
505-
},
506-
"type": "object"
507-
}
508-
]
509-
}
510-
},
511-
"type": "object"
390+
"type": "array"
512391
},
513-
"optionsDescription": "\nAn optional object with optional `getters`, `methods`, `parameter-properties`, `parameters`, `properties` and `setters` properties.\n\nThe properties can be specifed as booleans or as objects with the property `safelist` containing the names of the decorators that should be ignored. Note that if a declaration is decorated with multiple decorators and at least one of them is present in `safelist`, this declaration is ignored.\n\n* `getters` - requires that getters are on the same line as its decorator(s). Defaults to `true`.\n* `methods` - requires that methods are on the same line as its decorator(s). Defaults to `true`.\n* `parameter-properties` - requires that parameter properties are on the same line as its decorator(s). Defaults to `true`.\n* `parameters` - requires that parameters are on the same line as its decorator(s). Defaults to `true`.\n* `properties` - requires that properties are on the same line as its decorator(s). Defaults to `true`.\n* `setters` - requires that setters are on the same line as its decorator(s). Defaults to `true`.\n ",
514-
"rationale": "Placing the decorator on the same line usually makes for shorter code and still easily identifies the declarations.",
392+
"optionsDescription": "A list of blacklisted decorators.",
393+
"rationale": "Placing the decorator on the same line usually makes for shorter code and still easily identifies the property/method.",
515394
"ruleName": "prefer-inline-decorator",
516395
"type": "style",
517396
"typescriptOnly": true

docs/rules/no-attribute-decorator/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
description: Disallows usage of @Attribute decorator.
33
options: null
44
optionsDescription: Not configurable.
5+
rationale: '@Attribute is considered bad practice. Use @Input instead.'
56
ruleName: no-attribute-decorator
67
type: functionality
78
typescriptOnly: true
Lines changed: 14 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,29 @@
11
---
2-
description: Ensures that declarations are on the same line as its decorator(s).
2+
description: Ensures that decorators are on the same line as the property/method it decorates.
33
descriptionDetails: 'See more at https://angular.io/guide/styleguide#style-05-12.'
4+
hasFix: true
45
optionExamples:
56
- 'true'
6-
- '[true, {"methods": false}]'
7-
- |-
8-
[
9-
true,
10-
{
11-
"getters": {"safelist": ["Input"]},
12-
"methods": true,
13-
"parameter-properties": false,
14-
"parameters": false,
15-
"properties": {"safelist": ["Output", "MyCustomDecorator"]},
16-
"setters": true
17-
}
18-
]
7+
- '[true, "HostListener"]'
8+
- '[true, "Input", "MyCustomDecorator"]'
199
options:
20-
additionalProperties: false
21-
properties:
22-
getters: &ref_0
23-
oneOf:
24-
- type: boolean
25-
- properties:
26-
items:
27-
type: string
28-
type: array
29-
uniqueItems: true
30-
type: object
31-
methods: *ref_0
32-
parameter-properties: *ref_0
33-
parameters: *ref_0
34-
properties: *ref_0
35-
setters: *ref_0
36-
type: object
37-
optionsDescription: >-
38-
39-
An optional object with optional `getters`, `methods`, `parameter-properties`, `parameters`, `properties` and `setters` properties.
40-
41-
42-
The properties can be specifed as booleans or as objects with the property `safelist` containing the names of the decorators that should
43-
be ignored. Note that if a declaration is decorated with multiple decorators and at least one of them is present in `safelist`, this
44-
declaration is ignored.
45-
46-
47-
* `getters` - requires that getters are on the same line as its decorator(s). Defaults to `true`.
48-
49-
* `methods` - requires that methods are on the same line as its decorator(s). Defaults to `true`.
50-
51-
* `parameter-properties` - requires that parameter properties are on the same line as its decorator(s). Defaults to `true`.
52-
53-
* `parameters` - requires that parameters are on the same line as its decorator(s). Defaults to `true`.
54-
55-
* `properties` - requires that properties are on the same line as its decorator(s). Defaults to `true`.
56-
57-
* `setters` - requires that setters are on the same line as its decorator(s). Defaults to `true`.
58-
59-
rationale: Placing the decorator on the same line usually makes for shorter code and still easily identifies the declarations.
10+
items:
11+
- type: string
12+
type: array
13+
optionsDescription: A list of blacklisted decorators.
14+
rationale: Placing the decorator on the same line usually makes for shorter code and still easily identifies the property/method.
6015
ruleName: prefer-inline-decorator
6116
type: style
6217
typescriptOnly: true
6318
layout: rule
6419
title: 'Rule: prefer-inline-decorator'
6520
optionsJSON: |-
6621
{
67-
"additionalProperties": false,
68-
"properties": {
69-
"getters": {
70-
"oneOf": [
71-
{
72-
"type": "boolean"
73-
},
74-
{
75-
"properties": {
76-
"items": {
77-
"type": "string"
78-
},
79-
"type": "array",
80-
"uniqueItems": true
81-
},
82-
"type": "object"
83-
}
84-
]
85-
},
86-
"methods": {
87-
"oneOf": [
88-
{
89-
"type": "boolean"
90-
},
91-
{
92-
"properties": {
93-
"items": {
94-
"type": "string"
95-
},
96-
"type": "array",
97-
"uniqueItems": true
98-
},
99-
"type": "object"
100-
}
101-
]
102-
},
103-
"parameter-properties": {
104-
"oneOf": [
105-
{
106-
"type": "boolean"
107-
},
108-
{
109-
"properties": {
110-
"items": {
111-
"type": "string"
112-
},
113-
"type": "array",
114-
"uniqueItems": true
115-
},
116-
"type": "object"
117-
}
118-
]
119-
},
120-
"parameters": {
121-
"oneOf": [
122-
{
123-
"type": "boolean"
124-
},
125-
{
126-
"properties": {
127-
"items": {
128-
"type": "string"
129-
},
130-
"type": "array",
131-
"uniqueItems": true
132-
},
133-
"type": "object"
134-
}
135-
]
136-
},
137-
"properties": {
138-
"oneOf": [
139-
{
140-
"type": "boolean"
141-
},
142-
{
143-
"properties": {
144-
"items": {
145-
"type": "string"
146-
},
147-
"type": "array",
148-
"uniqueItems": true
149-
},
150-
"type": "object"
151-
}
152-
]
153-
},
154-
"setters": {
155-
"oneOf": [
156-
{
157-
"type": "boolean"
158-
},
159-
{
160-
"properties": {
161-
"items": {
162-
"type": "string"
163-
},
164-
"type": "array",
165-
"uniqueItems": true
166-
},
167-
"type": "object"
168-
}
169-
]
22+
"items": [
23+
{
24+
"type": "string"
17025
}
171-
},
172-
"type": "object"
26+
],
27+
"type": "array"
17328
}
17429
---

0 commit comments

Comments
 (0)