Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta.docs.description to all rules #257

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/rules/handle-done-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const astUtils = require('../util/ast');

module.exports = {
meta: {
type: 'problem'
type: 'problem',
docs: {
description: 'Enforces handling of callbacks for async tests'
}
},
create(context) {
function isAsyncFunction(functionExpression) {
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/max-top-level-suites.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ function isTopLevelScope(scope) {
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Limit the number of top-level suites in a single file'
},
schema: [
{
type: 'object',
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/no-async-describe.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const { additionalSuiteNames } = require('../util/settings');
module.exports = {
meta: {
type: 'problem',
docs: {
description: 'Disallow async functions passed to describe'
},
fixable: 'code'
},
create(context) {
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-exclusive-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const astUtils = require('../util/ast');

module.exports = {
meta: {
type: 'problem'
type: 'problem',
docs: {
description: 'Disallow exclusive tests'
}
},
create(context) {
let mochaTestFunctions = [
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-global-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const astUtils = require('../util/ast');

module.exports = {
meta: {
type: 'suggestion'
type: 'suggestion',
docs: {
description: 'Disallow global tests'
}
},
create(context) {
function isGlobalScope(scope) {
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/no-hooks-for-single-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ function newDescribeLayer(describeNode) {
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallow hooks for a single test or test suite'
},
schema: [
{
type: 'object',
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/no-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const astUtil = require('../util/ast');
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallow hooks'
},
schema: [
{
type: 'object',
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-identical-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ function isFirstArgLiteral(node) {

module.exports = {
meta: {
type: 'suggestion'
type: 'suggestion',
docs: {
description: 'Disallow identical titles'
}
},
create(context) {
const titleLayers = [ newLayer() ];
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/no-mocha-arrows.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const astUtils = require('../util/ast');
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallow arrow functions as arguments to mocha functions'
},
fixable: 'code'
},
create(context) {
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-nested-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const { additionalSuiteNames } = require('../util/settings');

module.exports = {
meta: {
type: 'problem'
type: 'problem',
docs: {
description: 'Disallow tests to be nested within other tests '
}
},
create(context) {
const settings = context.settings;
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-pending-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const astUtils = require('../util/ast');

module.exports = {
meta: {
type: 'suggestion'
type: 'suggestion',
docs: {
description: 'Disallow pending tests'
}
},
create(context) {
function isPendingMochaTest(node) {
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-return-and-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ function reportIfFunctionWithBlock(context, node, doneName) {

module.exports = {
meta: {
type: 'problem'
type: 'problem',
docs: {
description: 'Disallow returning in a test or hook function that uses a callback'
}
},
create(context) {
function check(node) {
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-return-from-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ function reportIfFunctionWithBlock(context, node) {

module.exports = {
meta: {
type: 'suggestion'
type: 'suggestion',
docs: {
description: 'Disallow returning from an async test or hook'
}
},
create(context) {
function check(node) {
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-setup-in-describe.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const PURE = 3;

module.exports = {
meta: {
type: 'suggestion'
type: 'suggestion',
docs: {
description: 'Disallow setup in describe blocks'
}
},
create(context) {
const nesting = [];
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-sibling-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ function newDescribeLayer(describeNode) {

module.exports = {
meta: {
type: 'suggestion'
type: 'suggestion',
docs: {
description: 'Disallow duplicate uses of a hook at the same level inside a describe'
}
},
create(context) {
const isUsed = [];
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/no-skipped-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ function isCallToMochaXFunction(callee) {
module.exports = {
meta: {
fixable: 'code',
docs: {
description: 'Disallow skipped tests'
},
type: 'problem'
},
create(context) {
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/no-synchronous-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ function doesReturnPromise(functionExpression) {
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallow synchronous tests'
},
schema: [
{
type: 'object',
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-top-level-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const { additionalSuiteNames } = require('../util/settings');

module.exports = {
meta: {
type: 'problem'
type: 'problem',
docs: {
description: 'Disallow top-level hooks'
}
},
create(context) {
const settings = context.settings;
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/prefer-arrow-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ module.exports = {
type: 'suggestion',

docs: {
description: 'require using arrow functions for callbacks',
description: 'Require using arrow functions for callbacks',
category: 'ECMAScript 6',
recommended: false,
url: 'https://eslint.org/docs/rules/prefer-arrow-callback'
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/valid-suite-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const messageSchema = {
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Match suite descriptions against a pre-configured regular expression'
},
schema: [
{
oneOf: [ patternSchema, {
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/valid-test-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ const messageSchema = {
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Match test descriptions against a pre-configured regular expression'
},
schema: [
{
oneOf: [ patternSchema, {
Expand Down