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 11, 2021
1 parent 1055f16 commit b47d925
Show file tree
Hide file tree
Showing 285 changed files with 855 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rules/accessor-pairs.js
Expand Up @@ -134,6 +134,9 @@ function isPropertyDescriptor(node) {
// Rule Definition
//------------------------------------------------------------------------------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

"use strict";

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

/**
* @type {import('eslint').Rule.RuleModule}
*/
module.exports = {
meta: {
type: "layout",
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/dot-notation.js
Expand Up @@ -20,6 +20,9 @@ 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
3 changes: 3 additions & 0 deletions lib/rules/eol-last.js
Expand Up @@ -8,6 +8,9 @@
// Rule Definition
//------------------------------------------------------------------------------

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

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

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

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

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

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

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

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

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

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

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

0 comments on commit b47d925

Please sign in to comment.