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
BREAKING CHANGE: change <> to no longer apply to SomeType.<> but instead to now support SomeType<>
feat: pseudo-type [] to catch parent array types of form string[], number[], etc.
feat: support .<> as separate type
fix: ensure working with nested type arrays/objects
fix: ensure fixer preserves angle-bracket-dot or square bracket notation for arrays/objects
chore: Update husky, semantic-release devDeps; add typescript devDep for type-fest peer dep. (used indirectly by husky and semantic-release)
Copy file name to clipboardExpand all lines: .README/rules/check-types.md
+15-7Lines changed: 15 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -25,17 +25,25 @@ RegExp
25
25
- with the key `noDefaults` to insist that only the supplied option type
26
26
map is to be used, and that the default preferences (such as "string"
27
27
over "String") will not be enforced.
28
-
- with the key `unifyParentAndChildTypeChecks` to treat
29
-
`settings.jsdoc.preferredTypes` keys the same whether they are of the form
30
-
`SomeType` or `SomeType<>`. If this is `false` or unset, the former
31
-
will only apply to types which are not parent types/unions whereas the
32
-
latter will only apply for parent types/unions.
28
+
- with the key `unifyParentAndChildTypeChecks` which will treat
29
+
`settings.jsdoc.preferredTypes` keys such as `SomeType` as matching
30
+
not only child types such as an unadorned `SomeType` but also
31
+
`SomeType<aChildType>`, `SomeType.<aChildType>`, or if `SomeType` is
32
+
`Array` (or `[]`), it will match `aChildType[]`. If this is `false` or
33
+
unset, the former format will only apply to types which are not parent
34
+
types/unions whereas the latter formats will only apply for parent
35
+
types/unions. The special types `[]`, `.<>` (or `.`), and `<>`
36
+
act only as parent types (and will not match a bare child type such as
37
+
`Array` even when unified, though, as mentioned, `Array` will match
38
+
say `string[]` or `Array.<string>` when unified). The special type
39
+
`*` is only a child type. Note that there is no detection of parent
40
+
and child type together, e.g., you cannot specify preferences for
41
+
`string[]` specifically as distinct from say `number[]`, but you can
42
+
target both with `[]` or the child types `number` or `string`.
33
43
34
44
See also the documentation on `settings.jsdoc.preferredTypes` which impacts
35
45
the behavior of `check-types`.
36
46
37
-
38
-
39
47
#### Why not capital case everything?
40
48
41
49
Why are `boolean`, `number` and `string` exempt from starting with a capital letter? Let's take `string` as an example. In Javascript, everything is an object. The string Object has prototypes for string functions such as `.toUpperCase()`.
0 commit comments