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
docs(linter): Move documentation comments for the valid-typeof rule to the struct (#14841)
This ensures the autogenerated documentation handles the configuration
section. Part of #14743.
The generated docs look like this (but without the backslashes before
the code blocks):
```md
## Configuration
This rule accepts a configuration object with the following properties:
### requireStringLiterals
type: `boolean`
default: `false`
The `requireStringLiterals` option when set to `true`, allows the comparison of `typeof`
expressions with only string literals or other `typeof` expressions, and disallows
comparisons to any other value. Default is `false`.
With `requireStringLiterals` set to `true`, the following are examples of **incorrect** code:
\```js
typeof foo === undefined
typeof bar == Object
typeof baz === "strnig"
typeof qux === "some invalid type"
typeof baz === anotherVariable
typeof foo == 5
\```
With `requireStringLiterals` set to `true`, the following are examples of **correct** code:
\```js
typeof foo === "undefined"
typeof bar == "object"
typeof baz === "string"
typeof bar === typeof qux
\```
```
0 commit comments