You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/rules/accessor-pairs.md
+66Lines changed: 66 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,7 @@ This rule always checks object literals and property descriptors. By default, it
51
51
*`setWithoutGet` set to `true` will warn for setters without getters (Default `true`).
52
52
*`getWithoutSet` set to `true` will warn for getters without setters (Default `false`).
53
53
*`enforceForClassMembers` set to `true` additionally applies this rule to class getters/setters (Default `true`). Set `enforceForClassMembers` to `false` if you want this rule to ignore class declarations and class expressions.
54
+
*`enforceForTSTypes`: set to `true` additionally applies this rule to TypeScript type definitions (Default `false`).
54
55
55
56
### setWithoutGet
56
57
@@ -273,6 +274,71 @@ const Quux = class {
273
274
274
275
:::
275
276
277
+
### enforceForTSTypes
278
+
279
+
When `enforceForTSTypes` is set to `true`:
280
+
281
+
*`"getWithoutSet": true` will also warn for getters without setters in TypeScript types.
282
+
*`"setWithoutGet": true` will also warn for setters without getters in TypeScript types.
283
+
284
+
Examples of **incorrect** code for `{ "getWithoutSet": true, "enforceForTSTypes": true }`:
0 commit comments