Skip to content

Commit

Permalink
chore: add jsdoc type annotation to rules
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Nov 12, 2021
1 parent 1055f16 commit a39a99e
Show file tree
Hide file tree
Showing 286 changed files with 286 additions and 3 deletions.
4 changes: 1 addition & 3 deletions docs/developer-guide/working-with-rules.md
Expand Up @@ -24,9 +24,7 @@ Here is the basic format of the source file for a rule:
// Rule Definition
//------------------------------------------------------------------------------

/**
* @type {import('eslint').Rule.RuleModule}
*/
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/accessor-pairs.js
Expand Up @@ -134,6 +134,7 @@ function isPropertyDescriptor(node) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/array-bracket-newline.js
Expand Up @@ -11,6 +11,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/array-bracket-spacing.js
Expand Up @@ -10,6 +10,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/array-callback-return.js
Expand Up @@ -133,6 +133,7 @@ function getArrayMethodName(node) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/array-element-newline.js
Expand Up @@ -11,6 +11,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/arrow-body-style.js
Expand Up @@ -14,6 +14,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/arrow-parens.js
Expand Up @@ -27,6 +27,7 @@ function hasBlockBody(node) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/arrow-spacing.js
Expand Up @@ -14,6 +14,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/block-scoped-var.js
Expand Up @@ -8,6 +8,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/block-spacing.js
Expand Up @@ -11,6 +11,7 @@ const util = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/brace-style.js
Expand Up @@ -11,6 +11,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/callback-return.js
Expand Up @@ -9,6 +9,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: true,
Expand Down
1 change: 1 addition & 0 deletions lib/rules/camelcase.js
Expand Up @@ -9,6 +9,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/capitalized-comments.js
Expand Up @@ -99,6 +99,7 @@ function createRegExpForIgnorePatterns(normalizedOptions) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/class-methods-use-this.js
Expand Up @@ -15,6 +15,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/comma-dangle.js
Expand Up @@ -70,6 +70,7 @@ function normalizeOptions(optionValue, ecmaVersion) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/comma-spacing.js
Expand Up @@ -10,6 +10,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/comma-style.js
Expand Up @@ -11,6 +11,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/complexity.js
Expand Up @@ -17,6 +17,7 @@ const { upperCaseFirst } = require("../shared/string-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/computed-property-spacing.js
Expand Up @@ -10,6 +10,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/consistent-return.js
Expand Up @@ -40,6 +40,7 @@ function isClassConstructor(node) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/consistent-this.js
Expand Up @@ -8,6 +8,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/constructor-super.js
Expand Up @@ -116,6 +116,7 @@ function isPossibleConstructor(node) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/curly.js
Expand Up @@ -14,6 +14,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/default-case-last.js
Expand Up @@ -9,6 +9,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/default-case.js
Expand Up @@ -10,6 +10,7 @@ const DEFAULT_COMMENT_PATTERN = /^no default$/iu;
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/default-param-last.js
Expand Up @@ -5,6 +5,7 @@

"use strict";

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/dot-location.js
Expand Up @@ -11,6 +11,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/dot-notation.js
Expand Up @@ -20,6 +20,7 @@ const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u;
// `null` literal must be handled separately.
const literalTypesToCheck = new Set(["string", "boolean"]);

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/eol-last.js
Expand Up @@ -8,6 +8,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/eqeqeq.js
Expand Up @@ -15,6 +15,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/for-direction.js
Expand Up @@ -9,6 +9,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/func-call-spacing.js
Expand Up @@ -15,6 +15,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/func-name-matching.js
Expand Up @@ -68,6 +68,7 @@ const optionsObject = {
additionalProperties: false
};

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/func-names.js
Expand Up @@ -24,6 +24,7 @@ function isFunctionName(variable) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/func-style.js
Expand Up @@ -8,6 +8,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/function-call-argument-newline.js
Expand Up @@ -9,6 +9,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/function-paren-newline.js
Expand Up @@ -14,6 +14,7 @@ const astUtils = require("./utils/ast-utils");
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/generator-star-spacing.js
Expand Up @@ -25,6 +25,7 @@ const OVERRIDE_SCHEMA = {
]
};

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/getter-return.js
Expand Up @@ -29,6 +29,7 @@ function isReachable(segment) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/global-require.js
Expand Up @@ -48,6 +48,7 @@ function isShadowed(scope, node) {
return reference && reference.resolved && reference.resolved.defs.length > 0;
}

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: true,
Expand Down
1 change: 1 addition & 0 deletions lib/rules/grouped-accessor-pairs.js
Expand Up @@ -90,6 +90,7 @@ function isAccessorKind(node) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/guard-for-in.js
Expand Up @@ -9,6 +9,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/handle-callback-err.js
Expand Up @@ -10,6 +10,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: true,
Expand Down
1 change: 1 addition & 0 deletions lib/rules/id-blacklist.js
Expand Up @@ -110,6 +110,7 @@ function isShorthandPropertyDefinition(node) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: true,
Expand Down
1 change: 1 addition & 0 deletions lib/rules/id-denylist.js
Expand Up @@ -93,6 +93,7 @@ function isPropertyNameInDestructuring(node) {
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/id-length.js
Expand Up @@ -10,6 +10,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down
1 change: 1 addition & 0 deletions lib/rules/id-match.js
Expand Up @@ -9,6 +9,7 @@
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
Expand Down

0 comments on commit a39a99e

Please sign in to comment.