Skip to content

Commit 0f0c6f0

Browse files
authored
Automate docs with eslint-doc-generator (#348)
1 parent bd8c4c6 commit 0f0c6f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+241
-147
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
22
coverage
3+
yarn.lock

docs/new-rule.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Use the [`astexplorer` site](https://astexplorer.net) with the `espree` parser a
1818
- Add the correct [`meta.type`](https://eslint.org/docs/developer-guide/working-with-rules#rule-basics) to the rule.
1919
- Go to the `docs/rules` directory and duplicate the `no-todo-test.md` file and rename it to the name of your rule. Then write some documentation.
2020
- Add the rule in alphabetically sorted order to:
21-
- [The recommended config](https://github.com/avajs/eslint-plugin-ava/blob/0ded4b5c3cd09504e846309760566c9499a24196/index.js#L19)
22-
- [The recommended config in the readme](https://github.com/avajs/eslint-plugin-ava/blame/0ded4b5c3cd09504e846309760566c9499a24196/readme.md#L35)
23-
- [The rule listing in the readme](https://github.com/avajs/eslint-plugin-ava/blame/0ded4b5c3cd09504e846309760566c9499a24196/readme.md#L73)\
21+
- [The recommended config](https://github.com/avajs/eslint-plugin-ava/blob/0ded4b5c3cd09504e846309760566c9499a24196/index.js#L19)
22+
- [The recommended config in the readme](https://github.com/avajs/eslint-plugin-ava/blame/0ded4b5c3cd09504e846309760566c9499a24196/readme.md#L35)
2423
*(The description should be the same as the heading of the documentation file).*
2524
- Run `$ npm test` to ensure the tests pass.
2625
- Run `$ npm run integration` to run the rules against real projects to ensure your rule does not fail on real-world code.
26+
- Run `$ npm run update:eslint-docs` to update the readme rules list and standardized rule doc title/notices.
2727
- Open a pull request with a title in exactly the format `` Add `rule-name` rule ``, for example, `` Add `no-unused-properties` rule ``.
2828
- The pull request description should include the issue it fixes, for example, `Fixes #123`.

docs/rules/assertion-arguments.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Enforce passing correct arguments to assertions
1+
# Enforce passing correct arguments to assertions (`ava/assertion-arguments`)
2+
3+
✅ This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
4+
5+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6+
7+
<!-- end auto-generated rule header -->
28

39
Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/docs/rules/assertion-arguments.md)
410

docs/rules/hooks-order.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Enforce test hook ordering
1+
# Enforce test hook ordering (`ava/hooks-order`)
2+
3+
✅ This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
4+
5+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6+
7+
<!-- end auto-generated rule header -->
28

39
Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/docs/rules/hooks-order.md)
410

docs/rules/max-asserts.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Limit the number of assertions in a test
1+
# Enforce a limit on the number of assertions in a test (`ava/max-asserts`)
2+
3+
✅ This rule is _disabled_ in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
4+
5+
<!-- end auto-generated rule header -->
26

37
Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/docs/rules/max-asserts.md)
48

docs/rules/no-async-fn-without-await.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Ensure that async tests use `await`
1+
# Ensure that async tests use `await` (`ava/no-async-fn-without-await`)
2+
3+
✅ This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
4+
5+
<!-- end auto-generated rule header -->
26

37
Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/docs/rules/no-async-fn-without-await.md)
48

docs/rules/no-duplicate-modifiers.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Ensure tests do not have duplicate modifiers
1+
# Ensure tests do not have duplicate modifiers (`ava/no-duplicate-modifiers`)
2+
3+
✅ This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
4+
5+
<!-- end auto-generated rule header -->
26

37
Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/docs/rules/no-duplicate-modifiers.md)
48

docs/rules/no-identical-title.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Ensure no tests have the same title
1+
# Ensure no tests have the same title (`ava/no-identical-title`)
2+
3+
✅ This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
4+
5+
<!-- end auto-generated rule header -->
26

37
Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/docs/rules/no-identical-title.md)
48

docs/rules/no-ignored-test-files.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Ensure no tests are written in ignored files
1+
# Ensure no tests are written in ignored files (`ava/no-ignored-test-files`)
2+
3+
✅ This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
4+
5+
<!-- end auto-generated rule header -->
26

37
Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/docs/rules/no-ignored-test-files.md)
48

docs/rules/no-import-test-files.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Ensure no test files are imported anywhere
1+
# Ensure no test files are imported anywhere (`ava/no-import-test-files`)
2+
3+
✅ This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
4+
5+
<!-- end auto-generated rule header -->
26

37
Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/docs/rules/no-import-test-files.md)
48

0 commit comments

Comments
 (0)