Skip to content

Commit fd6fc2d

Browse files
Merge pull request #1972 from patricklx/patch-2
add fcct rules docs
2 parents 19bceeb + 7b79619 commit fd6fc2d

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = {
4444

4545
## gts/gjs
4646

47-
lint files having `First-Class Component Templates`
47+
lint files having `First-Class Component Templates` (fcct)
4848

4949
learn more [here](https://github.com/ember-template-imports/ember-template-imports)
5050

@@ -60,6 +60,49 @@ module.exports = {
6060
};
6161
```
6262

63+
### rules applied to fcct templates
64+
65+
- semi rule, same as [prettier plugin](https://github.com/gitKrystan/prettier-plugin-ember-template-tag/issues/1)
66+
- no-undef rule will take effect for template vars (includes js scope)
67+
- no-unsed rule will take effect for template block params
68+
69+
rules in tempates can be disabled with eslint directives with mustache or html comments:
70+
71+
[!NOTE]
72+
html does not have the distinction of line or block comments, which is why block comments should start with `<!--- ... -->` (3 dashes and a space, end with 2 dashes)
73+
74+
```hbs
75+
<template>
76+
<div>
77+
{{!eslint-disable-next-line}}
78+
{{test}}
79+
</div>
80+
<div>
81+
{{!--eslint-disable--}}
82+
{{test}}
83+
{{test}}
84+
{{test}}
85+
{{!--eslint-enable--}}
86+
</div>
87+
</template>
88+
```
89+
90+
```hbs
91+
<template>
92+
<div>
93+
<!--eslint-disable-next-line-->
94+
{{test}}
95+
</div>
96+
<div>
97+
<!--- eslint-disable -->
98+
{{test}}
99+
{{test}}
100+
{{test}}
101+
<!--- eslint-enable -->
102+
</div>
103+
</template>
104+
```
105+
63106
## 🧰 Configurations
64107

65108
<!-- begin auto-generated configs list -->

0 commit comments

Comments
 (0)