From 17b35c8d99632f3893f4d40032f0be57b2a43c21 Mon Sep 17 00:00:00 2001 From: Tyler Vigario Date: Thu, 25 Apr 2024 16:11:59 -0700 Subject: [PATCH 1/6] Initial migration to ESLint v9 --- docs/rules/no-only-test.md | 2 +- docs/rules/no-skip-test.md | 2 +- index.js | 4 ++-- package.json | 4 ++-- readme.md | 2 +- rules/assertion-arguments.js | 2 +- rules/prefer-t-regex.js | 9 +++++---- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/rules/no-only-test.md b/docs/rules/no-only-test.md index b575249..4143aeb 100644 --- a/docs/rules/no-only-test.md +++ b/docs/rules/no-only-test.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). -πŸ”§πŸ’‘ 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/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ 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). diff --git a/docs/rules/no-skip-test.md b/docs/rules/no-skip-test.md index 471c78d..c14ffc0 100644 --- a/docs/rules/no-skip-test.md +++ b/docs/rules/no-skip-test.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). -πŸ”§πŸ’‘ 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/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ 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). diff --git a/index.js b/index.js index f671c8f..63fbc5b 100644 --- a/index.js +++ b/index.js @@ -7,8 +7,8 @@ module.exports = { rules: importModules(path.resolve(__dirname, 'rules'), {camelize: false}), configs: { recommended: { - env: { - es6: true, + languageOptions: { + ecmaVersion: 2015, }, parserOptions: { ecmaVersion: 'latest', diff --git a/package.json b/package.json index abd1da9..b245fc7 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": "avajs/eslint-plugin-ava", "engines": { - "node": ">=14.17 <15 || >=16.4" + "node": ">=18.18" }, "scripts": { "integration": "node ./test/integration/test.js", @@ -63,7 +63,7 @@ "xo": "^0.52.4" }, "peerDependencies": { - "eslint": ">=8.26.0" + "eslint": ">=9.1.1" }, "ava": { "files": [ diff --git a/readme.md b/readme.md index cbc2721..7252dd8 100644 --- a/readme.md +++ b/readme.md @@ -51,7 +51,7 @@ The rules will only activate in test files. 🚫 [Configurations](https://github.com/avajs/eslint-plugin-ava#recommended-config) disabled in.\ βœ… Set in the `recommended` [configuration](https://github.com/avajs/eslint-plugin-ava#recommended-config).\ πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ -πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | | :------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- | :- | :- | :- | :- | :- | diff --git a/rules/assertion-arguments.js b/rules/assertion-arguments.js index 6afcf17..0bf5117 100644 --- a/rules/assertion-arguments.js +++ b/rules/assertion-arguments.js @@ -282,7 +282,7 @@ const create = context => { let lastArg = node.arguments[node.arguments.length - 1]; if (lastArg.type === 'Identifier') { - const variable = findVariable(context.getScope(), lastArg); + const variable = findVariable(context.sourceCode.getScope(node), lastArg); let value; for (const ref of variable.references) { value = ref.writeExpr ?? value; diff --git a/rules/prefer-t-regex.js b/rules/prefer-t-regex.js index 6d103cf..6464f59 100644 --- a/rules/prefer-t-regex.js +++ b/rules/prefer-t-regex.js @@ -20,8 +20,9 @@ const create = context => { ]); // Find the latest reference to the given identifier's name. - const findReference = name => { - const reference = context.getScope().references.find(reference => reference.identifier.name === name); + const findReference = node => { + const sourceCode = context.sourceCode; + const reference = sourceCode.getScope(node).references.find(reference => reference.identifier.name === node.name); if (reference?.resolved) { const definitions = reference.resolved.defs; @@ -37,7 +38,7 @@ const create = context => { /* Recursively find the "origin" node of the given node. - Note: `context.getScope()` doesn't contain information about the outer scope so in most cases this function will only find the reference directly above the current scope. So the following code will only find the reference in this order: y -> x, and it will have no knowledge of the number `0`. (assuming we run this function on the identifier `y`) + Note: `sourceCode.getScope()` doesn't contain information about the outer scope so in most cases this function will only find the reference directly above the current scope. So the following code will only find the reference in this order: y -> x, and it will have no knowledge of the number `0`. (assuming we run this function on the identifier `y`) ``` const test = require('ava'); @@ -56,7 +57,7 @@ const create = context => { } if (node.type === 'Identifier') { - const reference = findReference(node.name); + const reference = findReference(node); if (reference?.init) { return findRootReference(reference.init); From b2a2945975ffe7eac7e1a58177d30b93e7a6827f Mon Sep 17 00:00:00 2001 From: Tyler Vigario Date: Thu, 25 Apr 2024 16:17:36 -0700 Subject: [PATCH 2/6] Remove recommended languageOptions --- index.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/index.js b/index.js index 63fbc5b..9e9a0ee 100644 --- a/index.js +++ b/index.js @@ -7,13 +7,6 @@ module.exports = { rules: importModules(path.resolve(__dirname, 'rules'), {camelize: false}), configs: { recommended: { - languageOptions: { - ecmaVersion: 2015, - }, - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - }, plugins: [ 'ava', ], From 76f7c8f99080c0e0baf27a00abeb83edc5d1f6e9 Mon Sep 17 00:00:00 2001 From: Tyler Vigario Date: Thu, 25 Apr 2024 16:26:16 -0700 Subject: [PATCH 3/6] Add flat recommended config --- index.js | 78 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 31 deletions(-) diff --git a/index.js b/index.js index 9e9a0ee..b3b9e53 100644 --- a/index.js +++ b/index.js @@ -3,45 +3,61 @@ const path = require('path'); const importModules = require('import-modules'); +const rules = { + 'ava/assertion-arguments': 'error', + 'ava/hooks-order': 'error', + 'ava/max-asserts': [ + 'off', + 5, + ], + 'ava/no-async-fn-without-await': 'error', + 'ava/no-duplicate-modifiers': 'error', + 'ava/no-identical-title': 'error', + 'ava/no-ignored-test-files': 'error', + 'ava/no-import-test-files': 'error', + 'ava/no-incorrect-deep-equal': 'error', + 'ava/no-inline-assertions': 'error', + 'ava/no-nested-tests': 'error', + 'ava/no-only-test': 'error', + 'ava/no-skip-assert': 'error', + 'ava/no-skip-test': 'error', + 'ava/no-todo-implementation': 'error', + 'ava/no-todo-test': 'warn', + 'ava/no-unknown-modifiers': 'error', + 'ava/prefer-async-await': 'error', + 'ava/prefer-power-assert': 'off', + 'ava/prefer-t-regex': 'error', + 'ava/test-title': 'error', + 'ava/test-title-format': 'off', + 'ava/use-t-well': 'error', + 'ava/use-t': 'error', + 'ava/use-t-throws-async-well': 'error', + 'ava/use-test': 'error', + 'ava/use-true-false': 'error', +}; + module.exports = { - rules: importModules(path.resolve(__dirname, 'rules'), {camelize: false}), + rules: importModules(path.resolve(__dirname, 'rules'), { camelize: false }), configs: { recommended: { + env: { + es6: true, + }, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, plugins: [ 'ava', ], rules: { - 'ava/assertion-arguments': 'error', - 'ava/hooks-order': 'error', - 'ava/max-asserts': [ - 'off', - 5, - ], - 'ava/no-async-fn-without-await': 'error', - 'ava/no-duplicate-modifiers': 'error', - 'ava/no-identical-title': 'error', - 'ava/no-ignored-test-files': 'error', - 'ava/no-import-test-files': 'error', - 'ava/no-incorrect-deep-equal': 'error', - 'ava/no-inline-assertions': 'error', - 'ava/no-nested-tests': 'error', - 'ava/no-only-test': 'error', - 'ava/no-skip-assert': 'error', - 'ava/no-skip-test': 'error', - 'ava/no-todo-implementation': 'error', - 'ava/no-todo-test': 'warn', - 'ava/no-unknown-modifiers': 'error', - 'ava/prefer-async-await': 'error', - 'ava/prefer-power-assert': 'off', - 'ava/prefer-t-regex': 'error', - 'ava/test-title': 'error', - 'ava/test-title-format': 'off', - 'ava/use-t-well': 'error', - 'ava/use-t': 'error', - 'ava/use-t-throws-async-well': 'error', - 'ava/use-test': 'error', - 'ava/use-true-false': 'error', + ...rules, }, }, + "flat/recommended": { + rules: { + ...rules + } + } }, }; From 07d8615fadd6d4d48edfdedcdbcd69b41f61ae75 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Fri, 26 Apr 2024 12:50:24 +0700 Subject: [PATCH 4/6] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b3b9e53..155e031 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,7 @@ const rules = { }; module.exports = { - rules: importModules(path.resolve(__dirname, 'rules'), { camelize: false }), + rules: importModules(path.resolve(__dirname, 'rules'), {camelize: false}), configs: { recommended: { env: { From f9a9888b490dc3dc12932dbd59f5152f3b7bf6b6 Mon Sep 17 00:00:00 2001 From: Tyler Vigario Date: Tue, 30 Apr 2024 20:41:17 -0700 Subject: [PATCH 5/6] Clear up Node requirements --- .github/workflows/ci.yml | 2 +- index.js | 3 +++ package.json | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c0efd2..869d4f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [^14.17, ^16.4] + node-version: [^18.18] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/index.js b/index.js index 155e031..b6a54fb 100644 --- a/index.js +++ b/index.js @@ -55,6 +55,9 @@ module.exports = { }, }, "flat/recommended": { + plugins: { + 'ava': 'ava' + }, rules: { ...rules } diff --git a/package.json b/package.json index b245fc7..9144460 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": "avajs/eslint-plugin-ava", "engines": { - "node": ">=18.18" + "node": "^18.18 || >=20" }, "scripts": { "integration": "node ./test/integration/test.js", @@ -63,7 +63,7 @@ "xo": "^0.52.4" }, "peerDependencies": { - "eslint": ">=9.1.1" + "eslint": ">=9" }, "ava": { "files": [ From 880cc1f2c6398c73ab1fcd8ff8edbf6bd1b2bc74 Mon Sep 17 00:00:00 2001 From: Tyler Vigario Date: Tue, 30 Apr 2024 20:41:29 -0700 Subject: [PATCH 6/6] Update docs --- docs/rules/assertion-arguments.md | 2 +- docs/rules/hooks-order.md | 2 +- docs/rules/max-asserts.md | 2 +- docs/rules/no-async-fn-without-await.md | 2 +- docs/rules/no-duplicate-modifiers.md | 2 +- docs/rules/no-identical-title.md | 2 +- docs/rules/no-ignored-test-files.md | 2 +- docs/rules/no-import-test-files.md | 2 +- docs/rules/no-incorrect-deep-equal.md | 2 +- docs/rules/no-inline-assertions.md | 2 +- docs/rules/no-nested-tests.md | 2 +- docs/rules/no-only-test.md | 2 +- docs/rules/no-skip-assert.md | 2 +- docs/rules/no-skip-test.md | 2 +- docs/rules/no-todo-implementation.md | 2 +- docs/rules/no-todo-test.md | 2 +- docs/rules/no-unknown-modifiers.md | 2 +- docs/rules/prefer-async-await.md | 2 +- docs/rules/prefer-power-assert.md | 2 +- docs/rules/prefer-t-regex.md | 2 +- docs/rules/test-title-format.md | 2 +- docs/rules/test-title.md | 2 +- docs/rules/use-t-throws-async-well.md | 2 +- docs/rules/use-t-well.md | 2 +- docs/rules/use-t.md | 2 +- docs/rules/use-test.md | 2 +- docs/rules/use-true-false.md | 2 +- readme.md | 58 ++++++++++++------------- 28 files changed, 56 insertions(+), 56 deletions(-) diff --git a/docs/rules/assertion-arguments.md b/docs/rules/assertion-arguments.md index 3794e45..a5e5d53 100644 --- a/docs/rules/assertion-arguments.md +++ b/docs/rules/assertion-arguments.md @@ -1,6 +1,6 @@ # Enforce passing correct arguments to assertions (`ava/assertion-arguments`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/hooks-order.md b/docs/rules/hooks-order.md index 26c67dc..06e6611 100644 --- a/docs/rules/hooks-order.md +++ b/docs/rules/hooks-order.md @@ -1,6 +1,6 @@ # Enforce test hook ordering (`ava/hooks-order`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/max-asserts.md b/docs/rules/max-asserts.md index 52c4793..04244ae 100644 --- a/docs/rules/max-asserts.md +++ b/docs/rules/max-asserts.md @@ -1,6 +1,6 @@ # Enforce a limit on the number of assertions in a test (`ava/max-asserts`) -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +🚫 This rule is _disabled_ in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-async-fn-without-await.md b/docs/rules/no-async-fn-without-await.md index 4f5b249..325ab0d 100644 --- a/docs/rules/no-async-fn-without-await.md +++ b/docs/rules/no-async-fn-without-await.md @@ -1,6 +1,6 @@ # Ensure that async tests use `await` (`ava/no-async-fn-without-await`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-duplicate-modifiers.md b/docs/rules/no-duplicate-modifiers.md index 6ddd0b5..a0842f8 100644 --- a/docs/rules/no-duplicate-modifiers.md +++ b/docs/rules/no-duplicate-modifiers.md @@ -1,6 +1,6 @@ # Ensure tests do not have duplicate modifiers (`ava/no-duplicate-modifiers`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index 3b69185..2da828d 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -1,6 +1,6 @@ # Ensure no tests have the same title (`ava/no-identical-title`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-ignored-test-files.md b/docs/rules/no-ignored-test-files.md index ff358c3..89256b0 100644 --- a/docs/rules/no-ignored-test-files.md +++ b/docs/rules/no-ignored-test-files.md @@ -1,6 +1,6 @@ # Ensure no tests are written in ignored files (`ava/no-ignored-test-files`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-import-test-files.md b/docs/rules/no-import-test-files.md index 57bfd36..32ca1cb 100644 --- a/docs/rules/no-import-test-files.md +++ b/docs/rules/no-import-test-files.md @@ -1,6 +1,6 @@ # Ensure no test files are imported anywhere (`ava/no-import-test-files`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-incorrect-deep-equal.md b/docs/rules/no-incorrect-deep-equal.md index 1aefeb0..6343f0e 100644 --- a/docs/rules/no-incorrect-deep-equal.md +++ b/docs/rules/no-incorrect-deep-equal.md @@ -1,6 +1,6 @@ # Disallow using `deepEqual` with primitives (`ava/no-incorrect-deep-equal`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-inline-assertions.md b/docs/rules/no-inline-assertions.md index da142b6..84039de 100644 --- a/docs/rules/no-inline-assertions.md +++ b/docs/rules/no-inline-assertions.md @@ -1,6 +1,6 @@ # Ensure assertions are not called from inline arrow functions (`ava/no-inline-assertions`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-nested-tests.md b/docs/rules/no-nested-tests.md index 8f5195a..12751e7 100644 --- a/docs/rules/no-nested-tests.md +++ b/docs/rules/no-nested-tests.md @@ -1,6 +1,6 @@ # Ensure no tests are nested (`ava/no-nested-tests`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-only-test.md b/docs/rules/no-only-test.md index 4143aeb..8b46bbc 100644 --- a/docs/rules/no-only-test.md +++ b/docs/rules/no-only-test.md @@ -1,6 +1,6 @@ # Ensure no `test.only()` are present (`ava/no-only-test`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `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). diff --git a/docs/rules/no-skip-assert.md b/docs/rules/no-skip-assert.md index aaf239d..315b27f 100644 --- a/docs/rules/no-skip-assert.md +++ b/docs/rules/no-skip-assert.md @@ -1,6 +1,6 @@ # Ensure no assertions are skipped (`ava/no-skip-assert`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-skip-test.md b/docs/rules/no-skip-test.md index c14ffc0..035cf14 100644 --- a/docs/rules/no-skip-test.md +++ b/docs/rules/no-skip-test.md @@ -1,6 +1,6 @@ # Ensure no tests are skipped (`ava/no-skip-test`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `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). diff --git a/docs/rules/no-todo-implementation.md b/docs/rules/no-todo-implementation.md index 4bbf236..7ebf457 100644 --- a/docs/rules/no-todo-implementation.md +++ b/docs/rules/no-todo-implementation.md @@ -1,6 +1,6 @@ # Ensure `test.todo()` is not given an implementation function (`ava/no-todo-implementation`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-todo-test.md b/docs/rules/no-todo-test.md index 0b5cd1b..da8deca 100644 --- a/docs/rules/no-todo-test.md +++ b/docs/rules/no-todo-test.md @@ -1,6 +1,6 @@ # Ensure no `test.todo()` is used (`ava/no-todo-test`) -⚠️ This rule _warns_ in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +⚠️ This rule _warns_ in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/no-unknown-modifiers.md b/docs/rules/no-unknown-modifiers.md index fba9e90..7cb6d0e 100644 --- a/docs/rules/no-unknown-modifiers.md +++ b/docs/rules/no-unknown-modifiers.md @@ -1,6 +1,6 @@ # Disallow the use of unknown test modifiers (`ava/no-unknown-modifiers`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/prefer-async-await.md b/docs/rules/prefer-async-await.md index da96b20..ef12b37 100644 --- a/docs/rules/prefer-async-await.md +++ b/docs/rules/prefer-async-await.md @@ -1,6 +1,6 @@ # Prefer using async/await instead of returning a Promise (`ava/prefer-async-await`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/prefer-power-assert.md b/docs/rules/prefer-power-assert.md index aeddaf2..df33c5e 100644 --- a/docs/rules/prefer-power-assert.md +++ b/docs/rules/prefer-power-assert.md @@ -1,6 +1,6 @@ # Enforce the use of the asserts that have no [power-assert](https://github.com/power-assert-js/power-assert) alternative (`ava/prefer-power-assert`) -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +🚫 This rule is _disabled_ in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/prefer-t-regex.md b/docs/rules/prefer-t-regex.md index f04a186..2fa41d7 100644 --- a/docs/rules/prefer-t-regex.md +++ b/docs/rules/prefer-t-regex.md @@ -1,6 +1,6 @@ # Prefer using `t.regex()` to test regular expressions (`ava/prefer-t-regex`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/test-title-format.md b/docs/rules/test-title-format.md index 7953453..d3b9150 100644 --- a/docs/rules/test-title-format.md +++ b/docs/rules/test-title-format.md @@ -1,6 +1,6 @@ # Ensure test titles have a certain format (`ava/test-title-format`) -🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +🚫 This rule is _disabled_ in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/test-title.md b/docs/rules/test-title.md index 7fa8c02..ee06e61 100644 --- a/docs/rules/test-title.md +++ b/docs/rules/test-title.md @@ -1,6 +1,6 @@ # Ensure tests have a title (`ava/test-title`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/use-t-throws-async-well.md b/docs/rules/use-t-throws-async-well.md index 1c72763..108b743 100644 --- a/docs/rules/use-t-throws-async-well.md +++ b/docs/rules/use-t-throws-async-well.md @@ -1,6 +1,6 @@ # Ensure that `t.throwsAsync()` and `t.notThrowsAsync()` are awaited (`ava/use-t-throws-async-well`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/use-t-well.md b/docs/rules/use-t-well.md index 220ba35..8383844 100644 --- a/docs/rules/use-t-well.md +++ b/docs/rules/use-t-well.md @@ -1,6 +1,6 @@ # Disallow the incorrect use of `t` (`ava/use-t-well`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/use-t.md b/docs/rules/use-t.md index 5467cea..d47e451 100644 --- a/docs/rules/use-t.md +++ b/docs/rules/use-t.md @@ -1,6 +1,6 @@ # Ensure test functions use `t` as their parameter (`ava/use-t`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/use-test.md b/docs/rules/use-test.md index d8b1108..42f4e5a 100644 --- a/docs/rules/use-test.md +++ b/docs/rules/use-test.md @@ -1,6 +1,6 @@ # Ensure that AVA is imported with `test` as the variable name (`ava/use-test`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/docs/rules/use-true-false.md b/docs/rules/use-true-false.md index 5b41ed0..5ef3602 100644 --- a/docs/rules/use-true-false.md +++ b/docs/rules/use-true-false.md @@ -1,6 +1,6 @@ # Ensure that `t.true()`/`t.false()` are used instead of `t.truthy()`/`t.falsy()` (`ava/use-true-false`) -πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). +πŸ’Ό This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, βœ… `recommended`. diff --git a/readme.md b/readme.md index 7252dd8..4985d37 100644 --- a/readme.md +++ b/readme.md @@ -53,35 +53,35 @@ The rules will only activate in test files. πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). -| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | -| :------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- | :- | :- | :- | :- | :- | -| [assertion-arguments](docs/rules/assertion-arguments.md) | Enforce passing correct arguments to assertions. | βœ… | | | πŸ”§ | | -| [hooks-order](docs/rules/hooks-order.md) | Enforce test hook ordering. | βœ… | | | πŸ”§ | | -| [max-asserts](docs/rules/max-asserts.md) | Enforce a limit on the number of assertions in a test. | | | βœ… | | | -| [no-async-fn-without-await](docs/rules/no-async-fn-without-await.md) | Ensure that async tests use `await`. | βœ… | | | | | -| [no-duplicate-modifiers](docs/rules/no-duplicate-modifiers.md) | Ensure tests do not have duplicate modifiers. | βœ… | | | | | -| [no-identical-title](docs/rules/no-identical-title.md) | Ensure no tests have the same title. | βœ… | | | | | -| [no-ignored-test-files](docs/rules/no-ignored-test-files.md) | Ensure no tests are written in ignored files. | βœ… | | | | | -| [no-import-test-files](docs/rules/no-import-test-files.md) | Ensure no test files are imported anywhere. | βœ… | | | | | -| [no-incorrect-deep-equal](docs/rules/no-incorrect-deep-equal.md) | Disallow using `deepEqual` with primitives. | βœ… | | | πŸ”§ | | -| [no-inline-assertions](docs/rules/no-inline-assertions.md) | Ensure assertions are not called from inline arrow functions. | βœ… | | | πŸ”§ | | -| [no-nested-tests](docs/rules/no-nested-tests.md) | Ensure no tests are nested. | βœ… | | | | | -| [no-only-test](docs/rules/no-only-test.md) | Ensure no `test.only()` are present. | βœ… | | | πŸ”§ | πŸ’‘ | -| [no-skip-assert](docs/rules/no-skip-assert.md) | Ensure no assertions are skipped. | βœ… | | | | | -| [no-skip-test](docs/rules/no-skip-test.md) | Ensure no tests are skipped. | βœ… | | | πŸ”§ | πŸ’‘ | -| [no-todo-implementation](docs/rules/no-todo-implementation.md) | Ensure `test.todo()` is not given an implementation function. | βœ… | | | | | -| [no-todo-test](docs/rules/no-todo-test.md) | Ensure no `test.todo()` is used. | | βœ… | | | | -| [no-unknown-modifiers](docs/rules/no-unknown-modifiers.md) | Disallow the use of unknown test modifiers. | βœ… | | | | | -| [prefer-async-await](docs/rules/prefer-async-await.md) | Prefer using async/await instead of returning a Promise. | βœ… | | | | | -| [prefer-power-assert](docs/rules/prefer-power-assert.md) | Enforce the use of the asserts that have no [power-assert](https://github.com/power-assert-js/power-assert) alternative. | | | βœ… | | | -| [prefer-t-regex](docs/rules/prefer-t-regex.md) | Prefer using `t.regex()` to test regular expressions. | βœ… | | | πŸ”§ | | -| [test-title](docs/rules/test-title.md) | Ensure tests have a title. | βœ… | | | | | -| [test-title-format](docs/rules/test-title-format.md) | Ensure test titles have a certain format. | | | βœ… | | | -| [use-t](docs/rules/use-t.md) | Ensure test functions use `t` as their parameter. | βœ… | | | | | -| [use-t-throws-async-well](docs/rules/use-t-throws-async-well.md) | Ensure that `t.throwsAsync()` and `t.notThrowsAsync()` are awaited. | βœ… | | | πŸ”§ | | -| [use-t-well](docs/rules/use-t-well.md) | Disallow the incorrect use of `t`. | βœ… | | | πŸ”§ | | -| [use-test](docs/rules/use-test.md) | Ensure that AVA is imported with `test` as the variable name. | βœ… | | | | | -| [use-true-false](docs/rules/use-true-false.md) | Ensure that `t.true()`/`t.false()` are used instead of `t.truthy()`/`t.falsy()`. | βœ… | | | | | +| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | +| :------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- | :---------------------------- | :---------------------------- | :---------------------------- | :- | :- | +| [assertion-arguments](docs/rules/assertion-arguments.md) | Enforce passing correct arguments to assertions. | βœ… ![badge-flat/recommended][] | | | πŸ”§ | | +| [hooks-order](docs/rules/hooks-order.md) | Enforce test hook ordering. | βœ… ![badge-flat/recommended][] | | | πŸ”§ | | +| [max-asserts](docs/rules/max-asserts.md) | Enforce a limit on the number of assertions in a test. | | | βœ… ![badge-flat/recommended][] | | | +| [no-async-fn-without-await](docs/rules/no-async-fn-without-await.md) | Ensure that async tests use `await`. | βœ… ![badge-flat/recommended][] | | | | | +| [no-duplicate-modifiers](docs/rules/no-duplicate-modifiers.md) | Ensure tests do not have duplicate modifiers. | βœ… ![badge-flat/recommended][] | | | | | +| [no-identical-title](docs/rules/no-identical-title.md) | Ensure no tests have the same title. | βœ… ![badge-flat/recommended][] | | | | | +| [no-ignored-test-files](docs/rules/no-ignored-test-files.md) | Ensure no tests are written in ignored files. | βœ… ![badge-flat/recommended][] | | | | | +| [no-import-test-files](docs/rules/no-import-test-files.md) | Ensure no test files are imported anywhere. | βœ… ![badge-flat/recommended][] | | | | | +| [no-incorrect-deep-equal](docs/rules/no-incorrect-deep-equal.md) | Disallow using `deepEqual` with primitives. | βœ… ![badge-flat/recommended][] | | | πŸ”§ | | +| [no-inline-assertions](docs/rules/no-inline-assertions.md) | Ensure assertions are not called from inline arrow functions. | βœ… ![badge-flat/recommended][] | | | πŸ”§ | | +| [no-nested-tests](docs/rules/no-nested-tests.md) | Ensure no tests are nested. | βœ… ![badge-flat/recommended][] | | | | | +| [no-only-test](docs/rules/no-only-test.md) | Ensure no `test.only()` are present. | βœ… ![badge-flat/recommended][] | | | πŸ”§ | πŸ’‘ | +| [no-skip-assert](docs/rules/no-skip-assert.md) | Ensure no assertions are skipped. | βœ… ![badge-flat/recommended][] | | | | | +| [no-skip-test](docs/rules/no-skip-test.md) | Ensure no tests are skipped. | βœ… ![badge-flat/recommended][] | | | πŸ”§ | πŸ’‘ | +| [no-todo-implementation](docs/rules/no-todo-implementation.md) | Ensure `test.todo()` is not given an implementation function. | βœ… ![badge-flat/recommended][] | | | | | +| [no-todo-test](docs/rules/no-todo-test.md) | Ensure no `test.todo()` is used. | | βœ… ![badge-flat/recommended][] | | | | +| [no-unknown-modifiers](docs/rules/no-unknown-modifiers.md) | Disallow the use of unknown test modifiers. | βœ… ![badge-flat/recommended][] | | | | | +| [prefer-async-await](docs/rules/prefer-async-await.md) | Prefer using async/await instead of returning a Promise. | βœ… ![badge-flat/recommended][] | | | | | +| [prefer-power-assert](docs/rules/prefer-power-assert.md) | Enforce the use of the asserts that have no [power-assert](https://github.com/power-assert-js/power-assert) alternative. | | | βœ… ![badge-flat/recommended][] | | | +| [prefer-t-regex](docs/rules/prefer-t-regex.md) | Prefer using `t.regex()` to test regular expressions. | βœ… ![badge-flat/recommended][] | | | πŸ”§ | | +| [test-title](docs/rules/test-title.md) | Ensure tests have a title. | βœ… ![badge-flat/recommended][] | | | | | +| [test-title-format](docs/rules/test-title-format.md) | Ensure test titles have a certain format. | | | βœ… ![badge-flat/recommended][] | | | +| [use-t](docs/rules/use-t.md) | Ensure test functions use `t` as their parameter. | βœ… ![badge-flat/recommended][] | | | | | +| [use-t-throws-async-well](docs/rules/use-t-throws-async-well.md) | Ensure that `t.throwsAsync()` and `t.notThrowsAsync()` are awaited. | βœ… ![badge-flat/recommended][] | | | πŸ”§ | | +| [use-t-well](docs/rules/use-t-well.md) | Disallow the incorrect use of `t`. | βœ… ![badge-flat/recommended][] | | | πŸ”§ | | +| [use-test](docs/rules/use-test.md) | Ensure that AVA is imported with `test` as the variable name. | βœ… ![badge-flat/recommended][] | | | | | +| [use-true-false](docs/rules/use-true-false.md) | Ensure that `t.true()`/`t.false()` are used instead of `t.truthy()`/`t.falsy()`. | βœ… ![badge-flat/recommended][] | | | | |