@yoo-digital/eslint-plugin-angular 3.0.7 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,30 @@ isVegan = input<boolean, BooleanInput>(true|false, { transform: booleanAttribute
|
|
|
42
42
|
@Input({ transform: booleanAttribute }) isVegan: boolean = true|false;
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
### Required boolean input
|
|
46
|
+
|
|
47
|
+
Should be avoided as it might be in conflict with `boolean-attribute-shorthand`
|
|
48
|
+
```typescript
|
|
49
|
+
isVegan = input.required<boolean, BooleanInput>({
|
|
50
|
+
transform: booleanAttribute,
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<!-- This will not work : -->
|
|
56
|
+
<!-- True value -->
|
|
57
|
+
<mealComponent isVegan />
|
|
58
|
+
<!-- False value -->
|
|
59
|
+
<mealComponent />
|
|
60
|
+
|
|
61
|
+
<!-- Values must be set, which does not respect boolean-attribute-shorthand : -->
|
|
62
|
+
<!-- True value -->
|
|
63
|
+
<mealComponent [isVegan]="true" />
|
|
64
|
+
<!-- False value -->
|
|
65
|
+
<mealComponent [isVegan]="false" />
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
45
69
|
## 2️⃣ boolean-attribute-shorthand
|
|
46
70
|
|
|
47
71
|
HTML rule that enforces shorthand syntax for `[attr]="true"` bindings
|
|
@@ -107,29 +131,3 @@ HTML set it true or false this way :
|
|
|
107
131
|
<!-- False value -->
|
|
108
132
|
<mealComponent />
|
|
109
133
|
```
|
|
110
|
-
|
|
111
|
-
### Required boolean input
|
|
112
|
-
|
|
113
|
-
Should be avoided as it might be in conflict with boolean-attribute-shorthand
|
|
114
|
-
```typescript
|
|
115
|
-
isVegan = input.required<boolean, BooleanInput>({
|
|
116
|
-
transform: booleanAttribute,
|
|
117
|
-
});
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
```html
|
|
121
|
-
<!-- This will not work : -->
|
|
122
|
-
<!-- True value -->
|
|
123
|
-
<mealComponent isVegan />
|
|
124
|
-
<!-- False value -->
|
|
125
|
-
<mealComponent />
|
|
126
|
-
|
|
127
|
-
<!-- Values must be set, which does not respect boolean-attribute-shorthand : -->
|
|
128
|
-
<!-- True value -->
|
|
129
|
-
<mealComponent [isVegan]="true" />
|
|
130
|
-
<!-- False value -->
|
|
131
|
-
<mealComponent [isVegan]="false" />
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
package/package.json
CHANGED