From abca2a2b1460770da192b9ef62c150a816123b8b Mon Sep 17 00:00:00 2001 From: Ed S Date: Fri, 22 Oct 2021 17:35:57 +0100 Subject: [PATCH] README: Show which rules have options, and which are fixable (#289) --- README.md | 53 +++++++++++++++++++++++-------------------- README.md.template | 5 +++- tools/build-readme.js | 10 ++++++++ 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index b49d186c..45eb50bb 100644 --- a/README.md +++ b/README.md @@ -81,11 +81,14 @@ The following global settings can be used under the `no-jquery` property to conf ## 📖 Rules -Where rules are included in the configs `recommended`, `slim`, `all` or `deprecated-X.X` it is indicated below. Where rules are included with options this is indicated with a `†`. +Rules with options are indicated with ⚙️. Rules which are fixable are indicated with 🔧. + +Where rules are included in the configs `recommended`, `slim`, `all` or `deprecated-X.X` it is indicated below. Where rules are included in a config with non-default options this is indicated with a `†`. + * [`no-jquery/no-ajax`](docs/rules/no-ajax.md) `slim`, `all` * [`no-jquery/no-ajax-events`](docs/rules/no-ajax-events.md) `slim` -* [`no-jquery/no-and-self`](docs/rules/no-and-self.md) `1.8` -* [`no-jquery/no-animate`](docs/rules/no-animate.md) `slim`, `all` +* [`no-jquery/no-and-self`](docs/rules/no-and-self.md) 🔧 `1.8` +* [`no-jquery/no-animate`](docs/rules/no-animate.md) ⚙️ `slim`, `all` * [`no-jquery/no-animate-toggle`](docs/rules/no-animate-toggle.md) `slim` * [`no-jquery/no-append-html`](docs/rules/no-append-html.md) * [`no-jquery/no-attr`](docs/rules/no-attr.md) `all` @@ -107,11 +110,11 @@ Where rules are included in the configs `recommended`, `slim`, `all` or `depreca * [`no-jquery/no-each`](docs/rules/no-each.md) * [`no-jquery/no-each-collection`](docs/rules/no-each-collection.md) `all` * [`no-jquery/no-each-util`](docs/rules/no-each-util.md) `all` -* [`no-jquery/no-error`](docs/rules/no-error.md) `all` -* [`no-jquery/no-error-shorthand`](docs/rules/no-error-shorthand.md) `1.8` -* [`no-jquery/no-escape-selector`](docs/rules/no-escape-selector.md) `all` -* [`no-jquery/no-event-shorthand`](docs/rules/no-event-shorthand.md) `3.5`, `3.3†`, `all` -* [`no-jquery/no-extend`](docs/rules/no-extend.md) `all` +* [`no-jquery/no-error`](docs/rules/no-error.md) 🔧 `all` +* [`no-jquery/no-error-shorthand`](docs/rules/no-error-shorthand.md) 🔧 `1.8` +* [`no-jquery/no-escape-selector`](docs/rules/no-escape-selector.md) 🔧 `all` +* [`no-jquery/no-event-shorthand`](docs/rules/no-event-shorthand.md) ⚙️ 🔧 `3.5`, `3.3†`, `all` +* [`no-jquery/no-extend`](docs/rules/no-extend.md) ⚙️ `all` * [`no-jquery/no-fade`](docs/rules/no-fade.md) `slim`, `all` * [`no-jquery/no-filter`](docs/rules/no-filter.md) `all` * [`no-jquery/no-find`](docs/rules/no-find.md) @@ -119,48 +122,48 @@ Where rules are included in the configs `recommended`, `slim`, `all` or `depreca * [`no-jquery/no-find-util`](docs/rules/no-find-util.md) `all` * [`no-jquery/no-fx-interval`](docs/rules/no-fx-interval.md) `3.0` * [`no-jquery/no-global-eval`](docs/rules/no-global-eval.md) `all` -* [`no-jquery/no-global-selector`](docs/rules/no-global-selector.md) +* [`no-jquery/no-global-selector`](docs/rules/no-global-selector.md) ⚙️ * [`no-jquery/no-grep`](docs/rules/no-grep.md) `all` * [`no-jquery/no-has`](docs/rules/no-has.md) `all` * [`no-jquery/no-hold-ready`](docs/rules/no-hold-ready.md) `3.2`, `all` -* [`no-jquery/no-html`](docs/rules/no-html.md) `all` +* [`no-jquery/no-html`](docs/rules/no-html.md) ⚙️ `all` * [`no-jquery/no-in-array`](docs/rules/no-in-array.md) `all` * [`no-jquery/no-is`](docs/rules/no-is.md) `all` -* [`no-jquery/no-is-array`](docs/rules/no-is-array.md) `3.2`, `all` +* [`no-jquery/no-is-array`](docs/rules/no-is-array.md) 🔧 `3.2`, `all` * [`no-jquery/no-is-empty-object`](docs/rules/no-is-empty-object.md) `all` -* [`no-jquery/no-is-function`](docs/rules/no-is-function.md) `3.3`, `all` +* [`no-jquery/no-is-function`](docs/rules/no-is-function.md) 🔧 `3.3`, `all` * [`no-jquery/no-is-numeric`](docs/rules/no-is-numeric.md) `3.3`, `all` * [`no-jquery/no-is-plain-object`](docs/rules/no-is-plain-object.md) `all` * [`no-jquery/no-is-window`](docs/rules/no-is-window.md) `3.3`, `all` * [`no-jquery/no-jquery-constructor`](docs/rules/no-jquery-constructor.md) `all` * [`no-jquery/no-live`](docs/rules/no-live.md) `1.7`, `all` * [`no-jquery/no-load`](docs/rules/no-load.md) `slim`, `all` -* [`no-jquery/no-load-shorthand`](docs/rules/no-load-shorthand.md) `1.8` +* [`no-jquery/no-load-shorthand`](docs/rules/no-load-shorthand.md) 🔧 `1.8` * [`no-jquery/no-map`](docs/rules/no-map.md) * [`no-jquery/no-map-collection`](docs/rules/no-map-collection.md) `all` * [`no-jquery/no-map-util`](docs/rules/no-map-util.md) `all` * [`no-jquery/no-merge`](docs/rules/no-merge.md) `all` * [`no-jquery/no-node-name`](docs/rules/no-node-name.md) `3.2`, `all` -* [`no-jquery/no-noop`](docs/rules/no-noop.md) `all` -* [`no-jquery/no-now`](docs/rules/no-now.md) `3.3`, `all` -* [`no-jquery/no-on-ready`](docs/rules/no-on-ready.md) `1.8` +* [`no-jquery/no-noop`](docs/rules/no-noop.md) 🔧 `all` +* [`no-jquery/no-now`](docs/rules/no-now.md) 🔧 `3.3`, `all` +* [`no-jquery/no-on-ready`](docs/rules/no-on-ready.md) 🔧 `1.8` * [`no-jquery/no-other-methods`](docs/rules/no-other-methods.md) `all` * [`no-jquery/no-other-utils`](docs/rules/no-other-utils.md) `all` * [`no-jquery/no-param`](docs/rules/no-param.md) `all` * [`no-jquery/no-parent`](docs/rules/no-parent.md) `all` * [`no-jquery/no-parents`](docs/rules/no-parents.md) `all` * [`no-jquery/no-parse-html`](docs/rules/no-parse-html.md) `all` -* [`no-jquery/no-parse-html-literal`](docs/rules/no-parse-html-literal.md) -* [`no-jquery/no-parse-json`](docs/rules/no-parse-json.md) `3.0`, `all` -* [`no-jquery/no-parse-xml`](docs/rules/no-parse-xml.md) `slim`, `all` +* [`no-jquery/no-parse-html-literal`](docs/rules/no-parse-html-literal.md) ⚙️ 🔧 +* [`no-jquery/no-parse-json`](docs/rules/no-parse-json.md) 🔧 `3.0`, `all` +* [`no-jquery/no-parse-xml`](docs/rules/no-parse-xml.md) 🔧 `slim`, `all` * [`no-jquery/no-prop`](docs/rules/no-prop.md) `all` -* [`no-jquery/no-proxy`](docs/rules/no-proxy.md) `3.3`, `all` +* [`no-jquery/no-proxy`](docs/rules/no-proxy.md) 🔧 `3.3`, `all` * [`no-jquery/no-ready`](docs/rules/no-ready.md) -* [`no-jquery/no-ready-shorthand`](docs/rules/no-ready-shorthand.md) `3.0`, `all` +* [`no-jquery/no-ready-shorthand`](docs/rules/no-ready-shorthand.md) 🔧 `3.0`, `all` * [`no-jquery/no-selector-prop`](docs/rules/no-selector-prop.md) `1.7` * [`no-jquery/no-serialize`](docs/rules/no-serialize.md) `all` -* [`no-jquery/no-size`](docs/rules/no-size.md) `1.8`, `all` -* [`no-jquery/no-sizzle`](docs/rules/no-sizzle.md) `3.4†` +* [`no-jquery/no-size`](docs/rules/no-size.md) 🔧 `1.8`, `all` +* [`no-jquery/no-sizzle`](docs/rules/no-sizzle.md) ⚙️ `3.4†` * [`no-jquery/no-slide`](docs/rules/no-slide.md) `slim`, `all` * [`no-jquery/no-sub`](docs/rules/no-sub.md) `1.7`, `all` * [`no-jquery/no-support`](docs/rules/no-support.md) `1.9` @@ -168,8 +171,8 @@ Where rules are included in the configs `recommended`, `slim`, `all` or `depreca * [`no-jquery/no-trigger`](docs/rules/no-trigger.md) `all` * [`no-jquery/no-trim`](docs/rules/no-trim.md) `3.5`, `all` * [`no-jquery/no-type`](docs/rules/no-type.md) `3.3`, `all` -* [`no-jquery/no-unique`](docs/rules/no-unique.md) `3.0`, `all` -* [`no-jquery/no-unload-shorthand`](docs/rules/no-unload-shorthand.md) `1.8` +* [`no-jquery/no-unique`](docs/rules/no-unique.md) 🔧 `3.0`, `all` +* [`no-jquery/no-unload-shorthand`](docs/rules/no-unload-shorthand.md) 🔧 `1.8` * [`no-jquery/no-val`](docs/rules/no-val.md) `all` * [`no-jquery/no-visibility`](docs/rules/no-visibility.md) `all` * [`no-jquery/no-when`](docs/rules/no-when.md) `all` diff --git a/README.md.template b/README.md.template index ed0d730e..c9737b18 100644 --- a/README.md.template +++ b/README.md.template @@ -80,7 +80,10 @@ The following global settings can be used under the `no-jquery` property to conf ## 📖 Rules -Where rules are included in the configs `recommended`, `slim`, `all` or `deprecated-X.X` it is indicated below. Where rules are included with options this is indicated with a `†`. +Rules with options are indicated with ⚙️. Rules which are fixable are indicated with 🔧. + +Where rules are included in the configs `recommended`, `slim`, `all` or `deprecated-X.X` it is indicated below. Where rules are included in a config with non-default options this is indicated with a `†`. + ### ⚠️ Deprecated diff --git a/tools/build-readme.js b/tools/build-readme.js index f9b9d2ac..afb63d30 100644 --- a/tools/build-readme.js +++ b/tools/build-readme.js @@ -16,6 +16,16 @@ function getRules( deprecated ) { const docs = ruleData.meta.docs; if ( !!docs.deprecated === deprecated ) { return '* [`' + fullRule + '`](' + docPath.replace( '{name}', rule ) + ')' + + ( + ruleData.meta.schema.length ? + ' ⚙️' : + '' + ) + + ( + ruleData.meta.fixable ? + ' 🔧' : + '' + ) + ( docs.replacedBy ? ' (use [`' + pluginName + '/' + docs.replacedBy + '`](' + docPath.replace( '{name}', docs.replacedBy ) + '))' :