Skip to content

Commit

Permalink
docs: auto-generate configs list and some rule options lists with esl…
Browse files Browse the repository at this point in the history
…int-doc-generator (#416)
  • Loading branch information
bmish authored Oct 14, 2023
1 parent 257ba14 commit 6fa0bdd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ You can extend from a configuration in order to simplify manual configuration of

For more details on how to extend your configuration from a plugin configuration, please see the [ESLint plugin configuration documentation](https://eslint.org/docs/user-guide/configuring#using-the-configuration-from-a-plugin).

| | Name | Description |
| :-- | :--- | :---------- |
|| recommended | This configuration includes rules which I recommend to avoid QUnit runtime errors or incorrect behavior, some of which can be difficult to debug. Some of these rules also encourage best practices that help QUnit work better for you. You can use this configuration by extending from `"plugin:qunit/recommended"` in your configuration file. |
<!-- begin auto-generated configs list -->

| | Name | Description |
| :- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|| `recommended` | This configuration includes rules which I recommend to avoid QUnit runtime errors or incorrect behavior, some of which can be difficult to debug. Some of these rules also encourage best practices that help QUnit work better for you. You can use this configuration by extending from `"plugin:qunit/recommended"` in your configuration file. |

<!-- end auto-generated configs list -->

## Rules

Expand Down
8 changes: 6 additions & 2 deletions docs/rules/no-ok-equality.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ QUnit.test("Name", function (assert) { assert.ok(x instanceof Number); });

## Options

This rule takes an optional object containing:
<!-- begin auto-generated rule options list -->

* `allowGlobals` (boolean, default: true): Whether the rule should check global assertions
| Name | Description | Type | Default |
| :------------ | :----------------------------------------------- | :------ | :------ |
| `allowGlobal` | Whether the rule should check global assertions. | Boolean | `true` |

<!-- end auto-generated rule options list -->

## When Not to Use It

Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
// eslint-disable-next-line sort-keys
configs: {
recommended: {
description: "This configuration includes rules which I recommend to avoid QUnit runtime errors or incorrect behavior, some of which can be difficult to debug. Some of these rules also encourage best practices that help QUnit work better for you. You can use this configuration by extending from `\"plugin:qunit/recommended\"` in your configuration file.",
plugins: ["qunit"],
rules: {
"qunit/assert-args": "error",
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/no-ok-equality.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ module.exports = {
type: "object",
properties: {
allowGlobal: {
type: "boolean"
type: "boolean",
description: "Whether the rule should check global assertions.",
default: true
}
},
additionalProperties: false
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"chai": "^4.3.10",
"coveralls": "^3.1.1",
"eslint": "^8.51.0",
"eslint-doc-generator": "^1.4.3",
"eslint-doc-generator": "^1.5.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-eslint-plugin": "^5.1.1",
"eslint-plugin-markdown": "^3.0.1",
Expand Down

0 comments on commit 6fa0bdd

Please sign in to comment.