Skip to content

Commit f0331b7

Browse files
docs: defaultOptions + TODO add configs
1 parent 2f11cdb commit f0331b7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ const { name, version } =
1616
require("../package.json") as typeof import("../package.json");
1717

1818
const plugin: Plugin = {
19+
/**
20+
* TODO: Add configs (recommended, etc.)
21+
* @see https://github.com/typescript-eslint/examples/blob/main/packages/eslint-plugin-example-typed-linting/src/index.ts
22+
*/
1923
meta: {
2024
name,
2125
version,

src/rules/my-rule.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ export const myRule = createRule<Options, MessageIds>({
5353
],
5454
type: "suggestion",
5555
},
56+
/**
57+
* About `defaultOptions`:
58+
* - `defaultOptions` is not used in the generated documentation
59+
* - `defaultOptions` is used when options are not provided in the rules configuration
60+
* - If some configuration is provided as the second argument, it is ignored, not merged
61+
* - In other words, the `defaultOptions` is only used when the rule is used without configuration
62+
*/
5663
defaultOptions: [{ someBool: false, someEnum: "always" }],
5764
create: (context, options) => {
5865
return {

0 commit comments

Comments
 (0)