diff --git a/README.md b/README.md index 7156618..eefbb96 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,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 10ab8eb..8ba6483 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ import { consistentInterfaceRule } from './lib/rules/consistent-interface.js'; 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'; @@ -27,7 +27,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', @@ -54,7 +54,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', @@ -81,7 +81,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")',