diff --git a/docs/examples/eslint-plugin-test/docs/rules/no-foo.md b/docs/examples/eslint-plugin-test/docs/rules/no-foo.md index 377621cf..eb00fa5f 100644 --- a/docs/examples/eslint-plugin-test/docs/rules/no-foo.md +++ b/docs/examples/eslint-plugin-test/docs/rules/no-foo.md @@ -1,5 +1,7 @@ # test/no-foo +πŸ“ Disallow using foo. + πŸ’Ό This rule is enabled in the βœ… `recommended` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). @@ -10,8 +12,6 @@ ❗ This rule identifies problems that could cause errors or unexpected behavior. -πŸ“ Disallow using foo. - ## Rule details diff --git a/docs/examples/eslint-plugin-test/docs/rules/prefer-bar.md b/docs/examples/eslint-plugin-test/docs/rules/prefer-bar.md index 3e453805..f65d9d52 100644 --- a/docs/examples/eslint-plugin-test/docs/rules/prefer-bar.md +++ b/docs/examples/eslint-plugin-test/docs/rules/prefer-bar.md @@ -1,5 +1,7 @@ # test/prefer-bar +πŸ“ Enforce using bar. + πŸ’Όβš οΈ This rule is enabled in the βœ… `recommended` config. This rule _warns_ in the 🎨 `stylistic` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). @@ -8,8 +10,6 @@ πŸ“– This rule identifies potential improvements. -πŸ“ Enforce using bar. - ## Rule details diff --git a/docs/examples/eslint-plugin-test/docs/rules/require-baz.md b/docs/examples/eslint-plugin-test/docs/rules/require-baz.md index 12c7a65b..ab788430 100644 --- a/docs/examples/eslint-plugin-test/docs/rules/require-baz.md +++ b/docs/examples/eslint-plugin-test/docs/rules/require-baz.md @@ -1,5 +1,7 @@ # test/require-baz +πŸ“ Require using baz. + ❌ This rule is deprecated. It was replaced by [`test/prefer-bar`](prefer-bar.md). 🚫 This rule is _disabled_ in the ⌨️ `typescript` config. @@ -8,8 +10,6 @@ πŸ“ This rule focuses on code formatting. -πŸ“ Require using baz. - ## Rule details diff --git a/lib/options.ts b/lib/options.ts index df01fea7..63e7927a 100644 --- a/lib/options.ts +++ b/lib/options.ts @@ -38,6 +38,7 @@ export const NOTICE_TYPE_DEFAULT_PRESENCE_AND_ORDERING: { } = { // Object keys ordered in display order. // Object values indicate whether the column is displayed by default. + [NOTICE_TYPE.DESCRIPTION]: true, [NOTICE_TYPE.DEPRECATED]: true, // Most important. [NOTICE_TYPE.CONFIGS]: true, [NOTICE_TYPE.FIXABLE]: false, @@ -46,7 +47,6 @@ export const NOTICE_TYPE_DEFAULT_PRESENCE_AND_ORDERING: { [NOTICE_TYPE.OPTIONS]: false, [NOTICE_TYPE.REQUIRES_TYPE_CHECKING]: true, [NOTICE_TYPE.TYPE]: false, - [NOTICE_TYPE.DESCRIPTION]: true, }; // Using these variables ensures they have the correct type (not just a plain string). diff --git a/test/fixtures/cjs-config-extends/docs/rules/no-bar.md b/test/fixtures/cjs-config-extends/docs/rules/no-bar.md index 3849708a..cfeed955 100644 --- a/test/fixtures/cjs-config-extends/docs/rules/no-bar.md +++ b/test/fixtures/cjs-config-extends/docs/rules/no-bar.md @@ -1,7 +1,7 @@ # test/no-bar -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - πŸ“ Description of no-bar. +πŸ’Ό This rule is enabled in the βœ… `recommended` config. + diff --git a/test/fixtures/cjs-config-extends/docs/rules/no-baz.md b/test/fixtures/cjs-config-extends/docs/rules/no-baz.md index af604ccb..966554d5 100644 --- a/test/fixtures/cjs-config-extends/docs/rules/no-baz.md +++ b/test/fixtures/cjs-config-extends/docs/rules/no-baz.md @@ -1,7 +1,7 @@ # test/no-baz -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - πŸ“ Description of no-baz. +πŸ’Ό This rule is enabled in the βœ… `recommended` config. + diff --git a/test/fixtures/cjs-config-extends/docs/rules/no-biz.md b/test/fixtures/cjs-config-extends/docs/rules/no-biz.md index 1eb94cf5..e0a99615 100644 --- a/test/fixtures/cjs-config-extends/docs/rules/no-biz.md +++ b/test/fixtures/cjs-config-extends/docs/rules/no-biz.md @@ -1,7 +1,7 @@ # test/no-biz -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - πŸ“ Description of no-biz. +πŸ’Ό This rule is enabled in the βœ… `recommended` config. + diff --git a/test/fixtures/cjs-config-extends/docs/rules/no-foo.md b/test/fixtures/cjs-config-extends/docs/rules/no-foo.md index e1c76e1e..b0a77aa9 100644 --- a/test/fixtures/cjs-config-extends/docs/rules/no-foo.md +++ b/test/fixtures/cjs-config-extends/docs/rules/no-foo.md @@ -1,7 +1,7 @@ # test/no-foo -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - πŸ“ Description of no-foo. +πŸ’Ό This rule is enabled in the βœ… `recommended` config. + diff --git a/test/lib/generate/__snapshots__/cjs-test.ts.snap b/test/lib/generate/__snapshots__/cjs-test.ts.snap index febef1bf..cc0107ed 100644 --- a/test/lib/generate/__snapshots__/cjs-test.ts.snap +++ b/test/lib/generate/__snapshots__/cjs-test.ts.snap @@ -46,10 +46,10 @@ exports[`generate (cjs) config that extends another config generates the documen exports[`generate (cjs) config that extends another config generates the documentation 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description of no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -57,10 +57,10 @@ exports[`generate (cjs) config that extends another config generates the documen exports[`generate (cjs) config that extends another config generates the documentation 3`] = ` "# test/no-bar -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description of no-bar. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -68,10 +68,10 @@ exports[`generate (cjs) config that extends another config generates the documen exports[`generate (cjs) config that extends another config generates the documentation 4`] = ` "# test/no-baz -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description of no-baz. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -79,10 +79,10 @@ exports[`generate (cjs) config that extends another config generates the documen exports[`generate (cjs) config that extends another config generates the documentation 5`] = ` "# test/no-biz -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description of no-biz. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; diff --git a/test/lib/generate/__snapshots__/comment-markers-test.ts.snap b/test/lib/generate/__snapshots__/comment-markers-test.ts.snap index 9142fdf3..88fa61f6 100644 --- a/test/lib/generate/__snapshots__/comment-markers-test.ts.snap +++ b/test/lib/generate/__snapshots__/comment-markers-test.ts.snap @@ -40,10 +40,10 @@ exports[`generate (comment markers) no existing comment markers - minimal doc co exports[`generate (comment markers) no existing comment markers - minimal doc content generates the documentation 2`] = ` "# test/no-foo -πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). - πŸ“ Description of no-foo. +πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + " `; @@ -58,10 +58,10 @@ since: "v0.12.0" --- # test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + Pre-existing notice about the rule being recommended. ## Rule details @@ -85,10 +85,10 @@ Existing rules section content." exports[`generate (comment markers) no existing comment markers - with no blank lines in existing content generates the documentation 2`] = ` "# test/no-foo -πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). - πŸ“ Description of no-foo. +πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + Existing rule doc content." `; @@ -111,10 +111,10 @@ Existing rules section content." exports[`generate (comment markers) no existing comment markers - with one blank line around existing content generates the documentation 2`] = ` "# test/no-foo -πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). - πŸ“ Description of no-foo. +πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + Existing rule doc content." @@ -130,10 +130,10 @@ since: "v0.12.0" --- # test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + ## Rule details Details." @@ -149,10 +149,10 @@ since: "v0.12.0" --- # test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -160,10 +160,10 @@ since: "v0.12.0" exports[`generate (comment markers) rule doc without header marker but pre-existing header updates the documentation 1`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + Pre-existing notice about the rule being recommended. ## Rule details @@ -189,10 +189,10 @@ No blank line before this." exports[`generate (comment markers) with no blank lines around comment markers generates the documentation 2`] = ` "# test/no-foo -πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). - πŸ“ Description of no-foo. +πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + No blank line before this." `; @@ -218,10 +218,10 @@ One blank line before this." exports[`generate (comment markers) with one blank line around comment markers generates the documentation 2`] = ` "# test/no-foo -πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). - πŸ“ Description of no-foo. +πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + One blank line before this." diff --git a/test/lib/generate/__snapshots__/configs-test.ts.snap b/test/lib/generate/__snapshots__/configs-test.ts.snap index 434b9ce8..83bfef81 100644 --- a/test/lib/generate/__snapshots__/configs-test.ts.snap +++ b/test/lib/generate/__snapshots__/configs-test.ts.snap @@ -17,10 +17,10 @@ exports[`generate (configs) config as flat config updates the documentation 1`] exports[`generate (configs) config as flat config updates the documentation 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description of no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -28,10 +28,10 @@ exports[`generate (configs) config as flat config updates the documentation 2`] exports[`generate (configs) config as flat config updates the documentation 3`] = ` "# test/no-bar -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description of no-bar. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -54,10 +54,10 @@ exports[`generate (configs) config with overrides generates the documentation 1` exports[`generate (configs) config with overrides generates the documentation 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description of no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -78,10 +78,10 @@ exports[`generate (configs) only a \`recommended\` config updates the documentat exports[`generate (configs) only a \`recommended\` config updates the documentation 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -104,10 +104,10 @@ exports[`generate (configs) rule config with options generates the documentation exports[`generate (configs) rule config with options generates the documentation 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description of no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -139,10 +139,10 @@ exports[`generate (configs) rules that are disabled or set to warn generates the exports[`generate (configs) rules that are disabled or set to warn generates the documentation 2`] = ` "# test/no-foo -🚫 This rule is _disabled_ in the πŸ”₯ \`recommended\` config. - πŸ“ Description of no-foo. +🚫 This rule is _disabled_ in the πŸ”₯ \`recommended\` config. + " `; @@ -150,10 +150,10 @@ exports[`generate (configs) rules that are disabled or set to warn generates the exports[`generate (configs) rules that are disabled or set to warn generates the documentation 3`] = ` "# test/no-bar -🚫 This rule is _disabled_ in the following configs: 🌟 \`other\`, πŸ”₯ \`recommended\`. - πŸ“ Description of no-bar. +🚫 This rule is _disabled_ in the following configs: 🌟 \`other\`, πŸ”₯ \`recommended\`. + " `; @@ -161,10 +161,10 @@ exports[`generate (configs) rules that are disabled or set to warn generates the exports[`generate (configs) rules that are disabled or set to warn generates the documentation 4`] = ` "# test/no-baz -πŸ’ΌπŸš« This rule is enabled in the πŸ”₯ \`recommended\` config. This rule is _disabled_ in the 🌟 \`other\` config. - πŸ“ Description of no-baz. +πŸ’ΌπŸš« This rule is enabled in the πŸ”₯ \`recommended\` config. This rule is _disabled_ in the 🌟 \`other\` config. + " `; @@ -172,10 +172,10 @@ exports[`generate (configs) rules that are disabled or set to warn generates the exports[`generate (configs) rules that are disabled or set to warn generates the documentation 5`] = ` "# test/no-biz -🚫 This rule is _disabled_ in the 🌟 \`other\` config. - πŸ“ Description of no-biz. +🚫 This rule is _disabled_ in the 🌟 \`other\` config. + " `; @@ -183,10 +183,10 @@ exports[`generate (configs) rules that are disabled or set to warn generates the exports[`generate (configs) rules that are disabled or set to warn generates the documentation 6`] = ` "# test/no-boz -⚠️ This rule _warns_ in the πŸ”₯ \`recommended\` config. - πŸ“ Description of no-boz. +⚠️ This rule _warns_ in the πŸ”₯ \`recommended\` config. + " `; @@ -194,10 +194,10 @@ exports[`generate (configs) rules that are disabled or set to warn generates the exports[`generate (configs) rules that are disabled or set to warn generates the documentation 7`] = ` "# test/no-buz -⚠️ This rule _warns_ in the following configs: 🌟 \`other\`, πŸ”₯ \`recommended\`. - πŸ“ Description of no-buz. +⚠️ This rule _warns_ in the following configs: 🌟 \`other\`, πŸ”₯ \`recommended\`. + " `; @@ -205,10 +205,10 @@ exports[`generate (configs) rules that are disabled or set to warn generates the exports[`generate (configs) rules that are disabled or set to warn generates the documentation 8`] = ` "# test/no-bez -⚠️ This rule _warns_ in the 🌟 \`other\` config. - πŸ“ Description of no-bez. +⚠️ This rule _warns_ in the 🌟 \`other\` config. + " `; @@ -233,10 +233,10 @@ exports[`generate (configs) rules that are disabled or set to warn, only one con exports[`generate (configs) rules that are disabled or set to warn, only one config present generates the documentation 2`] = ` "# test/no-foo -⚠️ This rule _warns_ in the βœ… \`recommended\` config. - πŸ“ Description of no-foo. +⚠️ This rule _warns_ in the βœ… \`recommended\` config. + " `; @@ -244,10 +244,10 @@ exports[`generate (configs) rules that are disabled or set to warn, only one con exports[`generate (configs) rules that are disabled or set to warn, only one config present generates the documentation 3`] = ` "# test/no-bar -🚫 This rule is _disabled_ in the βœ… \`recommended\` config. - πŸ“ Description of no-bar. +🚫 This rule is _disabled_ in the βœ… \`recommended\` config. + " `; @@ -272,10 +272,10 @@ exports[`generate (configs) rules that are disabled or set to warn, two configs exports[`generate (configs) rules that are disabled or set to warn, two configs present generates the documentation 2`] = ` "# test/no-foo -⚠️🚫 This rule _warns_ in the βœ… \`recommended\` config. This rule is _disabled_ in the ⌨️ \`typescript\` config. - πŸ“ Description of no-foo. +⚠️🚫 This rule _warns_ in the βœ… \`recommended\` config. This rule is _disabled_ in the ⌨️ \`typescript\` config. + " `; @@ -298,10 +298,10 @@ exports[`generate (configs) with --ignore-config hides the ignored config 1`] = exports[`generate (configs) with --ignore-config hides the ignored config 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -324,10 +324,10 @@ exports[`generate (configs) with config that does not have any rules uses recomm exports[`generate (configs) with config that does not have any rules uses recommended config emoji since it is the only relevant config 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; diff --git a/test/lib/generate/__snapshots__/general-test.ts.snap b/test/lib/generate/__snapshots__/general-test.ts.snap index 79cc9104..02756257 100644 --- a/test/lib/generate/__snapshots__/general-test.ts.snap +++ b/test/lib/generate/__snapshots__/general-test.ts.snap @@ -26,12 +26,12 @@ more content." exports[`generate (general) basic updates the documentation 2`] = ` "# test/no-foo +πŸ“ Description of no-foo. + πŸ’Ό This rule is enabled in the following configs: 🌐 \`all\`, βœ… \`recommended\`. πŸ”§πŸ’‘ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). -πŸ“ Description of no-foo. - ## Rule details details @@ -43,12 +43,12 @@ optionToDoSomething2 - explanation" exports[`generate (general) basic updates the documentation 3`] = ` "# test/no-bar +πŸ“ Description of no-bar. + πŸ’Ό This rule is enabled in the following configs: 🌐 \`all\`, 🎨 \`style\`. πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). -πŸ“ Description of no-bar. - ## Rule details details" @@ -86,10 +86,10 @@ more content." exports[`generate (general) plugin prefix uses \`plugin.meta.name\` as source for rule prefix 2`] = ` "# custom/no-foo -πŸ”§πŸ’‘ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). - πŸ“ Description of no-foo. +πŸ”§πŸ’‘ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). + ## Rule details details @@ -101,10 +101,10 @@ optionToDoSomething2 - explanation" exports[`generate (general) plugin prefix uses \`plugin.meta.name\` as source for rule prefix 3`] = ` "# custom/no-bar -πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). - πŸ“ Description of no-bar. +πŸ”§ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + ## Rule details details" diff --git a/test/lib/generate/__snapshots__/option-config-emoji-test.ts.snap b/test/lib/generate/__snapshots__/option-config-emoji-test.ts.snap index 1e964b28..4eafbd55 100644 --- a/test/lib/generate/__snapshots__/option-config-emoji-test.ts.snap +++ b/test/lib/generate/__snapshots__/option-config-emoji-test.ts.snap @@ -22,10 +22,10 @@ exports[`generate (--config-emoji) basic shows the correct emojis 1`] = ` exports[`generate (--config-emoji) basic shows the correct emojis 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the πŸ”₯ \`recommended\` config. - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the πŸ”₯ \`recommended\` config. + " `; @@ -33,10 +33,10 @@ exports[`generate (--config-emoji) basic shows the correct emojis 2`] = ` exports[`generate (--config-emoji) basic shows the correct emojis 3`] = ` "# test/no-bar -πŸ’Ό This rule is enabled in the following configs: πŸ”₯ \`recommended\`, 🎨 \`stylistic\`. - πŸ“ Description for no-bar. +πŸ’Ό This rule is enabled in the following configs: πŸ”₯ \`recommended\`, 🎨 \`stylistic\`. + " `; @@ -44,10 +44,10 @@ exports[`generate (--config-emoji) basic shows the correct emojis 3`] = ` exports[`generate (--config-emoji) basic shows the correct emojis 4`] = ` "# test/no-baz -πŸ’Ό This rule is enabled in the following configs: 🌟 \`custom\`, 🎨 \`stylistic\`. - πŸ“ Description for no-boz. +πŸ’Ό This rule is enabled in the following configs: 🌟 \`custom\`, 🎨 \`stylistic\`. + " `; @@ -70,10 +70,10 @@ exports[`generate (--config-emoji) with default emoji for common config uses the exports[`generate (--config-emoji) with default emoji for common config uses the default emoji when no configEmoji option is provided 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -96,10 +96,10 @@ exports[`generate (--config-emoji) with manually supplied badge markdown uses th exports[`generate (--config-emoji) with manually supplied badge markdown uses the badge markdown as provided 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the ![fun config badge](https://img.shields.io/badge/-fun-blue.svg) \`funConfig\` config. - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the ![fun config badge](https://img.shields.io/badge/-fun-blue.svg) \`funConfig\` config. + " `; diff --git a/test/lib/generate/__snapshots__/option-config-format-test.ts.snap b/test/lib/generate/__snapshots__/option-config-format-test.ts.snap index f0b98e45..f92ffdfa 100644 --- a/test/lib/generate/__snapshots__/option-config-format-test.ts.snap +++ b/test/lib/generate/__snapshots__/option-config-format-test.ts.snap @@ -18,10 +18,10 @@ exports[`generate (--config-format) name uses the right format 1`] = ` exports[`generate (--config-format) name uses the right format 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -44,10 +44,10 @@ exports[`generate (--config-format) plugin-colon-prefix-name uses the right form exports[`generate (--config-format) plugin-colon-prefix-name uses the right format 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`plugin:test/recommended\` config. - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the βœ… \`plugin:test/recommended\` config. + " `; @@ -70,10 +70,10 @@ exports[`generate (--config-format) prefix-name uses the right format 1`] = ` exports[`generate (--config-format) prefix-name uses the right format 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`test/recommended\` config. - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the βœ… \`test/recommended\` config. + " `; diff --git a/test/lib/generate/__snapshots__/option-rule-doc-notices-test.ts.snap b/test/lib/generate/__snapshots__/option-rule-doc-notices-test.ts.snap index 43b5eefc..85cac333 100644 --- a/test/lib/generate/__snapshots__/option-rule-doc-notices-test.ts.snap +++ b/test/lib/generate/__snapshots__/option-rule-doc-notices-test.ts.snap @@ -1,5 +1,18 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`generate (--rule-doc-notices) basic shows description before other notices when using default notice ordering 1`] = ` +"# test/no-foo + +πŸ“ Description for no-foo. + +❌ This rule is deprecated. + +πŸ”§πŸ’‘ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). + + +" +`; + exports[`generate (--rule-doc-notices) basic shows the right rule doc notices 1`] = ` "## Rules diff --git a/test/lib/generate/__snapshots__/option-rule-list-columns-test.ts.snap b/test/lib/generate/__snapshots__/option-rule-list-columns-test.ts.snap index 6084c926..c3f7f4a2 100644 --- a/test/lib/generate/__snapshots__/option-rule-list-columns-test.ts.snap +++ b/test/lib/generate/__snapshots__/option-rule-list-columns-test.ts.snap @@ -18,12 +18,12 @@ exports[`generate (--rule-list-columns) basic shows the right columns and legend exports[`generate (--rule-list-columns) basic shows the right columns and legend 2`] = ` "# test/no-foo +πŸ“ Description for no-foo. + ❌ This rule is deprecated. πŸ”§πŸ’‘ This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). -πŸ“ Description for no-foo. - " `; @@ -63,10 +63,10 @@ exports[`generate (--rule-list-columns) shows column and notice for requiresType exports[`generate (--rule-list-columns) shows column and notice for requiresTypeChecking updates the documentation 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the 🌐 \`all\` config. - πŸ“ Description of no-foo. +πŸ’Ό This rule is enabled in the 🌐 \`all\` config. + " `; @@ -74,10 +74,10 @@ exports[`generate (--rule-list-columns) shows column and notice for requiresType exports[`generate (--rule-list-columns) shows column and notice for requiresTypeChecking updates the documentation 3`] = ` "# test/no-bar -πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting). - πŸ“ Description of no-bar. +πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting). + " `; diff --git a/test/lib/generate/__snapshots__/option-url-configs-test.ts.snap b/test/lib/generate/__snapshots__/option-url-configs-test.ts.snap index 8cc58f11..9f0ef15a 100644 --- a/test/lib/generate/__snapshots__/option-url-configs-test.ts.snap +++ b/test/lib/generate/__snapshots__/option-url-configs-test.ts.snap @@ -20,10 +20,10 @@ exports[`generate (--url-configs) basic includes the config link 1`] = ` exports[`generate (--url-configs) basic includes the config link 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the πŸ”₯ \`recommended\` [config](https://example.com/configs). - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the πŸ”₯ \`recommended\` [config](https://example.com/configs). + " `; @@ -31,10 +31,10 @@ exports[`generate (--url-configs) basic includes the config link 2`] = ` exports[`generate (--url-configs) basic includes the config link 3`] = ` "# test/no-bar -πŸ’Ό This rule is enabled in the ⭐ \`customConfig\` [config](https://example.com/configs). - πŸ“ Description for no-bar. +πŸ’Ό This rule is enabled in the ⭐ \`customConfig\` [config](https://example.com/configs). + " `; @@ -57,10 +57,10 @@ exports[`generate (--url-configs) with only recommended config includes the conf exports[`generate (--url-configs) with only recommended config includes the config link 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` [config](https://example.com/configs). - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` [config](https://example.com/configs). + " `; diff --git a/test/lib/generate/__snapshots__/option-url-rule-doc-test.ts.snap b/test/lib/generate/__snapshots__/option-url-rule-doc-test.ts.snap index 4e7af0bc..44f2d996 100644 --- a/test/lib/generate/__snapshots__/option-url-rule-doc-test.ts.snap +++ b/test/lib/generate/__snapshots__/option-url-rule-doc-test.ts.snap @@ -18,10 +18,10 @@ exports[`generate (--url-rule-doc) basic uses the right URLs 1`] = ` exports[`generate (--url-rule-doc) basic uses the right URLs 2`] = ` "# test/no-foo -❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](https://example.com/rule-docs/no-bar/). - πŸ“ Description for no-foo. +❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](https://example.com/rule-docs/no-bar/). + " `; @@ -68,10 +68,10 @@ exports[`generate (--url-rule-doc) function returns undefined should fallback to exports[`generate (--url-rule-doc) function returns undefined should fallback to the normal URL 3`] = ` "# test/no-foo -❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](no-bar.md). - πŸ“ Description for no-foo. +❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](no-bar.md). + " `; @@ -118,10 +118,10 @@ exports[`generate (--url-rule-doc) function uses the custom URL 2`] = ` exports[`generate (--url-rule-doc) function uses the custom URL 3`] = ` "# test/no-foo -❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](https://example.com/rule-docs/name:no-bar/path:docs/rules/no-foo.md). - πŸ“ Description for no-foo. +❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](https://example.com/rule-docs/name:no-bar/path:docs/rules/no-foo.md). + " `; diff --git a/test/lib/generate/__snapshots__/package-json-test.ts.snap b/test/lib/generate/__snapshots__/package-json-test.ts.snap index dfc88b09..cb1b0553 100644 --- a/test/lib/generate/__snapshots__/package-json-test.ts.snap +++ b/test/lib/generate/__snapshots__/package-json-test.ts.snap @@ -28,10 +28,10 @@ exports[`generate (package.json) No exported rules object found throws an error exports[`generate (package.json) Scoped plugin name determines the correct plugin prefix 1`] = ` "# @my-scope/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Disallow foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -52,10 +52,10 @@ exports[`generate (package.json) Scoped plugin with custom plugin name determine exports[`generate (package.json) Scoped plugin with custom plugin name determines the correct plugin prefix 2`] = ` "# @my-scope/foo/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Disallow foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; @@ -76,10 +76,10 @@ exports[`generate (package.json) plugin entry point in JSON format generates the exports[`generate (package.json) plugin entry point in JSON format generates the documentation 2`] = ` "# test/no-foo -πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. - πŸ“ Description for no-foo. +πŸ’Ό This rule is enabled in the βœ… \`recommended\` config. + " `; diff --git a/test/lib/generate/__snapshots__/rule-deprecation-test.ts.snap b/test/lib/generate/__snapshots__/rule-deprecation-test.ts.snap index f68218ea..e396acf8 100644 --- a/test/lib/generate/__snapshots__/rule-deprecation-test.ts.snap +++ b/test/lib/generate/__snapshots__/rule-deprecation-test.ts.snap @@ -15,10 +15,10 @@ exports[`generate (deprecated rules) replaced by ESLint core rule uses correct r exports[`generate (deprecated rules) replaced by ESLint core rule uses correct replacement rule link 2`] = ` "# test/no-foo -❌ This rule is deprecated. It was replaced by [\`no-unused-vars\`](https://eslint.org/docs/latest/rules/no-unused-vars). - πŸ“ Description. +❌ This rule is deprecated. It was replaced by [\`no-unused-vars\`](https://eslint.org/docs/latest/rules/no-unused-vars). + " `; @@ -38,10 +38,10 @@ exports[`generate (deprecated rules) replaced by third-party plugin rule uses co exports[`generate (deprecated rules) replaced by third-party plugin rule uses correct replacement rule link 2`] = ` "# test/no-foo -❌ This rule is deprecated. It was replaced by \`other-plugin/no-unused-vars\`. - πŸ“ Description. +❌ This rule is deprecated. It was replaced by \`other-plugin/no-unused-vars\`. + " `; @@ -61,10 +61,10 @@ exports[`generate (deprecated rules) replaced by third-party plugin rule with sa exports[`generate (deprecated rules) replaced by third-party plugin rule with same rule name as one of our rules uses correct replacement rule link 2`] = ` "# test/no-foo -❌ This rule is deprecated. It was replaced by \`other-plugin/no-foo\`. - πŸ“ Description. +❌ This rule is deprecated. It was replaced by \`other-plugin/no-foo\`. + " `; @@ -88,10 +88,10 @@ exports[`generate (deprecated rules) several deprecated rules updates the docume exports[`generate (deprecated rules) several deprecated rules updates the documentation 2`] = ` "# test/no-foo -❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](no-bar.md). - πŸ“ Description. +❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](no-bar.md). + " `; @@ -99,10 +99,10 @@ exports[`generate (deprecated rules) several deprecated rules updates the docume exports[`generate (deprecated rules) several deprecated rules updates the documentation 3`] = ` "# test/no-bar -❌ This rule is deprecated. - πŸ“ Description. +❌ This rule is deprecated. + " `; @@ -110,10 +110,10 @@ exports[`generate (deprecated rules) several deprecated rules updates the docume exports[`generate (deprecated rules) several deprecated rules updates the documentation 4`] = ` "# test/no-baz -❌ This rule is deprecated. - πŸ“ Description. +❌ This rule is deprecated. + " `; @@ -130,10 +130,10 @@ exports[`generate (deprecated rules) several deprecated rules updates the docume exports[`generate (deprecated rules) several deprecated rules updates the documentation 6`] = ` "# test/no-boz -❌ This rule is deprecated. It was replaced by [\`test/no-baz\`](no-baz.md), [\`test/no-biz\`](no-biz.md). - πŸ“ Description. +❌ This rule is deprecated. It was replaced by [\`test/no-baz\`](no-baz.md), [\`test/no-biz\`](no-biz.md). + " `; @@ -154,10 +154,10 @@ exports[`generate (deprecated rules) using prefix ahead of replacement rule name exports[`generate (deprecated rules) using prefix ahead of replacement rule name uses correct replacement rule link 2`] = ` "# test/no-foo -❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](no-bar.md). - πŸ“ Description. +❌ This rule is deprecated. It was replaced by [\`test/no-bar\`](no-bar.md). + " `; @@ -187,10 +187,10 @@ exports[`generate (deprecated rules) with --path-rule-doc has the correct links, exports[`generate (deprecated rules) with --path-rule-doc has the correct links, especially replacement rule link 2`] = ` "# test/category/no-foo -❌ This rule is deprecated. It was replaced by [\`test/category/no-bar\`](../no-bar/README.md). - πŸ“ Description. +❌ This rule is deprecated. It was replaced by [\`test/category/no-bar\`](../no-bar/README.md). + " `; @@ -198,10 +198,10 @@ exports[`generate (deprecated rules) with --path-rule-doc has the correct links, exports[`generate (deprecated rules) with --path-rule-doc has the correct links, especially replacement rule link 3`] = ` "# test/category/no-bar -❌ This rule is deprecated. It was replaced by [\`test/category/no-foo\`](../no-foo/README.md). - πŸ“ Description. +❌ This rule is deprecated. It was replaced by [\`test/category/no-foo\`](../no-foo/README.md). + " `; @@ -222,10 +222,10 @@ exports[`generate (deprecated rules) with nested rule names has the correct link exports[`generate (deprecated rules) with nested rule names has the correct links, especially replacement rule link 2`] = ` "# test/category/no-foo -❌ This rule is deprecated. It was replaced by [\`test/category/no-bar\`](no-bar.md). - πŸ“ Description. +❌ This rule is deprecated. It was replaced by [\`test/category/no-bar\`](no-bar.md). + " `; @@ -233,10 +233,10 @@ exports[`generate (deprecated rules) with nested rule names has the correct link exports[`generate (deprecated rules) with nested rule names has the correct links, especially replacement rule link 3`] = ` "# test/category/no-bar -❌ This rule is deprecated. It was replaced by [\`test/category/no-foo\`](no-foo.md). - πŸ“ Description. +❌ This rule is deprecated. It was replaced by [\`test/category/no-foo\`](no-foo.md). + " `; diff --git a/test/lib/generate/option-rule-doc-notices-test.ts b/test/lib/generate/option-rule-doc-notices-test.ts index a20e2d7e..59ef682d 100644 --- a/test/lib/generate/option-rule-doc-notices-test.ts +++ b/test/lib/generate/option-rule-doc-notices-test.ts @@ -50,6 +50,11 @@ describe('generate (--rule-doc-notices)', function () { jest.resetModules(); }); + it('shows description before other notices when using default notice ordering', async function () { + await generate('.'); + expect(readFileSync('docs/rules/no-foo.md', 'utf8')).toMatchSnapshot(); + }); + it('shows the right rule doc notices', async function () { await generate('.', { ruleDocNotices: [