From 8cf94e076140bd37e4b58e2b60d378246fe7ee76 Mon Sep 17 00:00:00 2001 From: Mathias Schreck Date: Thu, 23 Jan 2025 13:42:46 +0100 Subject: [PATCH] Rename no-async-describe to no-async-suite --- README.md | 2 +- docs/rules/{no-async-describe.md => no-async-suite.md} | 2 +- index.js | 8 ++++---- lib/rules/{no-async-describe.js => no-async-suite.js} | 4 ++-- test/rules/{no-async-describe.js => no-async-suite.js} | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) rename docs/rules/{no-async-describe.md => no-async-suite.md} (96%) rename lib/rules/{no-async-describe.js => no-async-suite.js} (96%) rename test/rules/{no-async-describe.js => no-async-suite.js} (96%) diff --git a/README.md b/README.md index 32b53e9..5b9fb3e 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ See [Configuring Eslint](http://eslint.org/docs/user-guide/configuring) on [esli | [consistent-spacing-between-blocks](docs/rules/consistent-spacing-between-blocks.md) | Require consistent spacing between blocks | ✅ | | | 🔧 | | [handle-done-callback](docs/rules/handle-done-callback.md) | Enforces handling of callbacks for async tests | ✅ | | | | | [max-top-level-suites](docs/rules/max-top-level-suites.md) | Enforce the number of top-level suites in a single file | ✅ | | | | -| [no-async-describe](docs/rules/no-async-describe.md) | Disallow async functions passed to a suite | ✅ | | | 🔧 | +| [no-async-suite](docs/rules/no-async-suite.md) | Disallow async functions passed to a suite | ✅ | | | 🔧 | | [no-empty-description](docs/rules/no-empty-description.md) | Disallow empty test descriptions | ✅ | | | | | [no-exclusive-tests](docs/rules/no-exclusive-tests.md) | Disallow exclusive tests | | ✅ | | | | [no-exports](docs/rules/no-exports.md) | Disallow exports from test files | ✅ | | | | diff --git a/docs/rules/no-async-describe.md b/docs/rules/no-async-suite.md similarity index 96% rename from docs/rules/no-async-describe.md rename to docs/rules/no-async-suite.md index 4130a0f..a2fd28f 100644 --- a/docs/rules/no-async-describe.md +++ b/docs/rules/no-async-suite.md @@ -1,4 +1,4 @@ -# Disallow async functions passed to a suite (`mocha/no-async-describe`) +# Disallow async functions passed to a suite (`mocha/no-async-suite`) 💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/lo1tuma/eslint-plugin-mocha#configs). diff --git a/index.js b/index.js index 96d8baf..6efa6b9 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ import globals from 'globals'; import { consistentSpacingBetweenBlocksRule } from './lib/rules/consistent-spacing-between-blocks.js'; import { handleDoneCallbackRule } from './lib/rules/handle-done-callback.js'; import { maxTopLevelSuitesRule } from './lib/rules/max-top-level-suites.js'; -import { noAsyncDescribeRule } from './lib/rules/no-async-describe.js'; +import { noAsyncSuiteRule } from './lib/rules/no-async-suite.js'; import { noEmptyDescriptionRule } from './lib/rules/no-empty-description.js'; import { noExclusiveTestsRule } from './lib/rules/no-exclusive-tests.js'; import { noExportsRule } from './lib/rules/no-exports.js'; @@ -26,7 +26,7 @@ import { validTestDescriptionRule } from './lib/rules/valid-test-description.js' const allRules = { 'mocha/handle-done-callback': 'error', 'mocha/max-top-level-suites': 'error', - 'mocha/no-async-describe': 'error', + 'mocha/no-async-suite': 'error', 'mocha/no-exclusive-tests': 'error', 'mocha/no-exports': 'error', 'mocha/no-global-tests': 'error', @@ -52,7 +52,7 @@ const allRules = { const recommendedRules = { 'mocha/handle-done-callback': 'error', 'mocha/max-top-level-suites': ['error', { limit: 1 }], - 'mocha/no-async-describe': 'error', + 'mocha/no-async-suite': 'error', 'mocha/no-exclusive-tests': 'warn', 'mocha/no-exports': 'error', 'mocha/no-global-tests': 'error', @@ -79,7 +79,7 @@ const mochaPlugin = { rules: { 'handle-done-callback': handleDoneCallbackRule, 'max-top-level-suites': maxTopLevelSuitesRule, - 'no-async-describe': noAsyncDescribeRule, + 'no-async-suite': noAsyncSuiteRule, 'no-exclusive-tests': noExclusiveTestsRule, 'no-exports': noExportsRule, 'no-global-tests': noGlobalTestsRule, diff --git a/lib/rules/no-async-describe.js b/lib/rules/no-async-suite.js similarity index 96% rename from lib/rules/no-async-describe.js rename to lib/rules/no-async-suite.js index a938fbd..81adaa8 100644 --- a/lib/rules/no-async-describe.js +++ b/lib/rules/no-async-suite.js @@ -42,12 +42,12 @@ function fixAsyncFunction(sourceCode, fixer, fn) { return undefined; } -export const noAsyncDescribeRule = { +export const noAsyncSuiteRule = { meta: { type: 'problem', docs: { description: 'Disallow async functions passed to a suite', - url: 'https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-async-describe.md' + url: 'https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-async-suite.md' }, fixable: 'code', schema: [] diff --git a/test/rules/no-async-describe.js b/test/rules/no-async-suite.js similarity index 96% rename from test/rules/no-async-describe.js rename to test/rules/no-async-suite.js index 217be5d..edd9fcf 100644 --- a/test/rules/no-async-describe.js +++ b/test/rules/no-async-suite.js @@ -1,8 +1,8 @@ import { RuleTester } from 'eslint'; -import { noAsyncDescribeRule } from '../../lib/rules/no-async-describe.js'; +import { noAsyncSuiteRule } from '../../lib/rules/no-async-suite.js'; const ruleTester = new RuleTester({ languageOptions: { sourceType: 'script' } }); -ruleTester.run('no-async-describe', noAsyncDescribeRule, { +ruleTester.run('no-async-suite', noAsyncSuiteRule, { valid: [ 'describe()', 'describe("hello")',