From a79c9f35d665c2bcc63267bdf359a8176e0a84ce Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Tue, 24 Aug 2021 09:24:22 +0800 Subject: [PATCH] Chore: Enforce jsdoc check-line-alignment never (#14955) --- Makefile.js | 4 +-- lib/cli-engine/cli-engine.js | 2 +- lib/cli-engine/hash.js | 4 +-- lib/init/autoconfig.js | 32 +++++++++++------------ lib/init/config-file.js | 6 ++--- lib/init/config-initializer.js | 16 ++++++------ lib/init/config-rule.js | 30 ++++++++++----------- lib/init/npm-utils.js | 30 ++++++++++----------- lib/init/source-code-utils.js | 6 ++--- lib/linter/linter.js | 2 +- lib/linter/source-code-fixer.js | 4 +-- lib/rules/consistent-this.js | 2 +- lib/rules/default-case.js | 2 +- lib/rules/eqeqeq.js | 2 +- lib/rules/key-spacing.js | 6 ++--- lib/rules/newline-after-var.js | 6 ++--- lib/rules/newline-per-chained-call.js | 2 +- lib/rules/no-bitwise.js | 10 +++---- lib/rules/no-shadow.js | 2 +- lib/rules/object-shorthand.js | 6 ++--- lib/rules/one-var.js | 2 +- lib/rules/operator-assignment.js | 12 ++++----- lib/rules/quote-props.js | 16 ++++++------ lib/rules/utils/ast-utils.js | 6 ++--- packages/eslint-config-eslint/default.yml | 2 +- tests/lib/rules/complexity.js | 8 +++--- tests/lib/rules/dot-notation.js | 4 +-- 27 files changed, 112 insertions(+), 112 deletions(-) diff --git a/Makefile.js b/Makefile.js index 8c2be3f69c5..42e8ed03b64 100644 --- a/Makefile.js +++ b/Makefile.js @@ -149,8 +149,8 @@ function generateBlogPost(releaseInfo, prereleaseMajorVersion) { /** * Generates a doc page with formatter result examples - * @param {Object} formatterInfo Linting results from each formatter - * @param {string} [prereleaseVersion] The version used for a prerelease. This + * @param {Object} formatterInfo Linting results from each formatter + * @param {string} [prereleaseVersion] The version used for a prerelease. This * changes where the output is stored. * @returns {void} */ diff --git a/lib/cli-engine/cli-engine.js b/lib/cli-engine/cli-engine.js index d89addf3403..aae71607d2c 100644 --- a/lib/cli-engine/cli-engine.js +++ b/lib/cli-engine/cli-engine.js @@ -280,7 +280,7 @@ function verifyText({ /** * Returns result with warning by ignore settings * @param {string} filePath File path of checked code - * @param {string} baseDir Absolute path of base directory + * @param {string} baseDir Absolute path of base directory * @returns {LintResult} Result with single warning * @private */ diff --git a/lib/cli-engine/hash.js b/lib/cli-engine/hash.js index 6d7ef8bf1b2..8e467734a02 100644 --- a/lib/cli-engine/hash.js +++ b/lib/cli-engine/hash.js @@ -21,8 +21,8 @@ const murmur = require("imurmurhash"); /** * hash the given string - * @param {string} str the string to hash - * @returns {string} the hash + * @param {string} str the string to hash + * @returns {string} the hash */ function hash(str) { return murmur(str).result().toString(36); diff --git a/lib/init/autoconfig.js b/lib/init/autoconfig.js index 9d87a7f2be8..ea2523421c2 100644 --- a/lib/init/autoconfig.js +++ b/lib/init/autoconfig.js @@ -36,9 +36,9 @@ const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only /** * Information about a rule configuration, in the context of a Registry. * @typedef {Object} registryItem - * @property {ruleConfig} config A valid configuration for the rule - * @property {number} specificity The number of elements in the ruleConfig array - * @property {number} errorCount The number of errors encountered when linting with the config + * @property {ruleConfig} config A valid configuration for the rule + * @property {number} specificity The number of elements in the ruleConfig array + * @property {number} errorCount The number of errors encountered when linting with the config */ /** @@ -49,8 +49,8 @@ const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only /** * Create registryItems for rules - * @param {rulesConfig} rulesConfig Hash of rule names and arrays of ruleConfig items - * @returns {Object} registryItems for each rule in provided rulesConfig + * @param {rulesConfig} rulesConfig Hash of rule names and arrays of ruleConfig items + * @returns {Object} registryItems for each rule in provided rulesConfig */ function makeRegistryItems(rulesConfig) { return Object.keys(rulesConfig).reduce((accumulator, ruleId) => { @@ -103,7 +103,7 @@ class Registry { * configurations. * * The length of the returned array will be <= MAX_CONFIG_COMBINATIONS. - * @returns {Object[]} "rules" configurations to use for linting + * @returns {Object[]} "rules" configurations to use for linting */ buildRuleSets() { let idx = 0; @@ -115,7 +115,7 @@ class Registry { * * This is broken out into its own function so that it doesn't need to be * created inside of the while loop. - * @param {string} rule The ruleId to add. + * @param {string} rule The ruleId to add. * @returns {void} */ const addRuleToRuleSet = function(rule) { @@ -202,7 +202,7 @@ class Registry { * Creates a registry of rules which had no error-free configs. * The new registry is intended to be analyzed to determine whether its rules * should be disabled or set to warning. - * @returns {Registry} A registry of failing rules. + * @returns {Registry} A registry of failing rules. */ getFailingRulesRegistry() { const ruleIds = Object.keys(this.rules), @@ -239,8 +239,8 @@ class Registry { /** * Return a cloned registry containing only configs with a desired specificity - * @param {number} specificity Only keep configs with this specificity - * @returns {Registry} A registry of rules + * @param {number} specificity Only keep configs with this specificity + * @returns {Registry} A registry of rules */ filterBySpecificity(specificity) { const ruleIds = Object.keys(this.rules), @@ -256,10 +256,10 @@ class Registry { /** * Lint SourceCodes against all configurations in the registry, and record results - * @param {Object[]} sourceCodes SourceCode objects for each filename - * @param {Object} config ESLint config object - * @param {progressCallback} [cb] Optional callback for reporting execution status - * @returns {Registry} New registry with errorCount populated + * @param {Object[]} sourceCodes SourceCode objects for each filename + * @param {Object} config ESLint config object + * @param {progressCallback} [cb] Optional callback for reporting execution status + * @returns {Registry} New registry with errorCount populated */ lintSourceCode(sourceCodes, config, cb) { let lintedRegistry = new Registry(); @@ -321,8 +321,8 @@ class Registry { * * This will return a new config with `["extends": [ ..., "eslint:recommended"]` and * only the rules which have configurations different from the recommended config. - * @param {Object} config config object - * @returns {Object} config object using `"extends": ["eslint:recommended"]` + * @param {Object} config config object + * @returns {Object} config object using `"extends": ["eslint:recommended"]` */ function extendFromRecommended(config) { const newConfig = Object.assign({}, config); diff --git a/lib/init/config-file.js b/lib/init/config-file.js index a51f92e1c48..9eb10fab3a4 100644 --- a/lib/init/config-file.js +++ b/lib/init/config-file.js @@ -23,9 +23,9 @@ const debug = require("debug")("eslint:config-file"); * Determines sort order for object keys for json-stable-stringify * * see: https://github.com/samn/json-stable-stringify#cmp - * @param {Object} a The first comparison object ({key: akey, value: avalue}) - * @param {Object} b The second comparison object ({key: bkey, value: bvalue}) - * @returns {number} 1 or -1, used in stringify cmp method + * @param {Object} a The first comparison object ({key: akey, value: avalue}) + * @param {Object} b The second comparison object ({key: bkey, value: bvalue}) + * @returns {number} 1 or -1, used in stringify cmp method */ function sortByKey(a, b) { return a.key > b.key ? 1 : -1; diff --git a/lib/init/config-initializer.js b/lib/init/config-initializer.js index b9b35c67c21..3c244b7bcc0 100644 --- a/lib/init/config-initializer.js +++ b/lib/init/config-initializer.js @@ -102,8 +102,8 @@ getPeerDependencies.cache = new Map(); /** * Return necessary plugins, configs, parsers, etc. based on the config - * @param {Object} config config object - * @param {boolean} [installESLint=true] If `false` is given, it does not install eslint. + * @param {Object} config config object + * @param {boolean} [installESLint=true] If `false` is given, it does not install eslint. * @returns {string[]} An array of modules to be installed. */ function getModulesList(config, installESLint) { @@ -161,10 +161,10 @@ function getModulesList(config, installESLint) { * * Note: This clones the config object and returns a new config to avoid mutating * the original config parameter. - * @param {Object} answers answers received from enquirer - * @param {Object} config config object + * @param {Object} answers answers received from enquirer + * @param {Object} config config object * @throws {Error} If source code retrieval fails or source code file count is 0. - * @returns {Object} config object with configured rules + * @returns {Object} config object with configured rules */ function configureRules(answers, config) { const BAR_TOTAL = 20, @@ -416,7 +416,7 @@ function hasESLintVersionConflict(answers) { /** * Install modules. - * @param {string[]} modules Modules to be installed. + * @param {string[]} modules Modules to be installed. * @returns {void} */ function installModules(modules) { @@ -427,8 +427,8 @@ function installModules(modules) { /* istanbul ignore next: no need to test enquirer */ /** * Ask user to install modules. - * @param {string[]} modules Array of modules to be installed. - * @param {boolean} packageJsonExists Indicates if package.json is existed. + * @param {string[]} modules Array of modules to be installed. + * @param {boolean} packageJsonExists Indicates if package.json is existed. * @returns {Promise} Answer that indicates if user wants to install. */ function askInstallModules(modules, packageJsonExists) { diff --git a/lib/init/config-rule.js b/lib/init/config-rule.js index a93142b8abe..131e84a60c5 100644 --- a/lib/init/config-rule.js +++ b/lib/init/config-rule.js @@ -17,8 +17,8 @@ const builtInRules = require("../rules"); /** * Wrap all of the elements of an array into arrays. - * @param {*[]} xs Any array. - * @returns {Array[]} An array of arrays. + * @param {*[]} xs Any array. + * @returns {Array[]} An array of arrays. */ function explodeArray(xs) { return xs.reduce((accumulator, x) => { @@ -33,9 +33,9 @@ function explodeArray(xs) { * * For example: * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]] - * @param {Array} arr1 The first array to combine. - * @param {Array} arr2 The second array to combine. - * @returns {Array} A mixture of the elements of the first and second arrays. + * @param {Array} arr1 The first array to combine. + * @param {Array} arr2 The second array to combine. + * @returns {Array} A mixture of the elements of the first and second arrays. */ function combineArrays(arr1, arr2) { const res = []; @@ -70,8 +70,8 @@ function combineArrays(arr1, arr2) { * [{before: true}, {before: false}], * [{after: true}, {after: false}] * ] - * @param {Object[]} objects Array of objects, each with one property/value pair - * @returns {Array[]} Array of arrays of objects grouped by property + * @param {Object[]} objects Array of objects, each with one property/value pair + * @returns {Array[]} Array of arrays of objects grouped by property */ function groupByProperty(objects) { const groupedObj = objects.reduce((accumulator, obj) => { @@ -97,7 +97,7 @@ function groupByProperty(objects) { * Configs may also have one or more additional elements to specify rule * configuration or options. * @typedef {Array|number} ruleConfig - * @param {number} 0 The rule's severity (0, 1, 2). + * @param {number} 0 The rule's severity (0, 1, 2). */ /** @@ -131,9 +131,9 @@ function groupByProperty(objects) { * {before: false, after: true}, * {before: false, after: false} * ] - * @param {Object[]} objArr1 Single key/value objects, all with the same key - * @param {Object[]} objArr2 Single key/value objects, all with another key - * @returns {Object[]} Combined objects for each combination of input properties and values + * @param {Object[]} objArr1 Single key/value objects, all with the same key + * @param {Object[]} objArr2 Single key/value objects, all with another key + * @returns {Object[]} Combined objects for each combination of input properties and values */ function combinePropertyObjects(objArr1, objArr2) { const res = []; @@ -205,7 +205,7 @@ class RuleConfigSet { /** * Add rule configs from an array of strings (schema enums) - * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"]) + * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"]) * @returns {void} */ addEnums(enums) { @@ -214,7 +214,7 @@ class RuleConfigSet { /** * Add rule configurations from a schema object - * @param {Object} obj Schema item with type === "object" + * @param {Object} obj Schema item with type === "object" * @returns {boolean} true if at least one schema for the object could be generated, false otherwise */ addObject(obj) { @@ -259,8 +259,8 @@ class RuleConfigSet { /** * Generate valid rule configurations based on a schema object - * @param {Object} schema A rule's schema object - * @returns {Array[]} Valid rule configurations + * @param {Object} schema A rule's schema object + * @returns {Array[]} Valid rule configurations */ function generateConfigsFromSchema(schema) { const configSet = new RuleConfigSet(); diff --git a/lib/init/npm-utils.js b/lib/init/npm-utils.js index 76a1618b36f..4a8efe964f3 100644 --- a/lib/init/npm-utils.js +++ b/lib/init/npm-utils.js @@ -21,8 +21,8 @@ const fs = require("fs"), /** * Find the closest package.json file, starting at process.cwd (by default), * and working up to root. - * @param {string} [startDir=process.cwd()] Starting directory - * @returns {string} Absolute path to closest package.json file + * @param {string} [startDir=process.cwd()] Starting directory + * @returns {string} Absolute path to closest package.json file */ function findPackageJson(startDir) { let dir = path.resolve(startDir || process.cwd()); @@ -45,7 +45,7 @@ function findPackageJson(startDir) { /** * Install node modules synchronously and save to devDependencies in package.json - * @param {string|string[]} packages Node module or modules to install + * @param {string|string[]} packages Node module or modules to install * @returns {void} */ function installSyncSaveDev(packages) { @@ -86,13 +86,13 @@ function fetchPeerDependencies(packageName) { /** * Check whether node modules are include in a project's package.json. - * @param {string[]} packages Array of node module names - * @param {Object} opt Options Object - * @param {boolean} opt.dependencies Set to true to check for direct dependencies - * @param {boolean} opt.devDependencies Set to true to check for development dependencies - * @param {boolean} opt.startdir Directory to begin searching from + * @param {string[]} packages Array of node module names + * @param {Object} opt Options Object + * @param {boolean} opt.dependencies Set to true to check for direct dependencies + * @param {boolean} opt.devDependencies Set to true to check for development dependencies + * @param {boolean} opt.startdir Directory to begin searching from * @throws {Error} If cannot find valid `package.json` file. - * @returns {Object} An object whose keys are the module names + * @returns {Object} An object whose keys are the module names * and values are booleans indicating installation. */ function check(packages, opt) { @@ -134,9 +134,9 @@ function check(packages, opt) { * package.json. * * Convenience wrapper around check(). - * @param {string[]} packages Array of node modules to check. - * @param {string} rootDir The directory containing a package.json - * @returns {Object} An object whose keys are the module names + * @param {string[]} packages Array of node modules to check. + * @param {string} rootDir The directory containing a package.json + * @returns {Object} An object whose keys are the module names * and values are booleans indicating installation. */ function checkDeps(packages, rootDir) { @@ -148,8 +148,8 @@ function checkDeps(packages, rootDir) { * package.json. * * Convenience wrapper around check(). - * @param {string[]} packages Array of node modules to check. - * @returns {Object} An object whose keys are the module names + * @param {string[]} packages Array of node modules to check. + * @returns {Object} An object whose keys are the module names * and values are booleans indicating installation. */ function checkDevDeps(packages) { @@ -158,7 +158,7 @@ function checkDevDeps(packages) { /** * Check whether package.json is found in current path. - * @param {string} [startDir] Starting directory + * @param {string} [startDir] Starting directory * @returns {boolean} Whether a package.json is found in current path. */ function checkPackageJson(startDir) { diff --git a/lib/init/source-code-utils.js b/lib/init/source-code-utils.js index 456eef41b91..08c20e5d56e 100644 --- a/lib/init/source-code-utils.js +++ b/lib/init/source-code-utils.js @@ -33,10 +33,10 @@ const debug = require("debug")("eslint:source-code-utils"); /** * Get the SourceCode object for a single file - * @param {string} filename The fully resolved filename to get SourceCode from. - * @param {Object} engine A CLIEngine. + * @param {string} filename The fully resolved filename to get SourceCode from. + * @param {Object} engine A CLIEngine. * @throws {Error} Upon fatal errors from execution. - * @returns {Array} Array of the SourceCode object representing the file + * @returns {Array} Array of the SourceCode object representing the file * and fatal error message. */ function getSourceCodeOfFile(filename, engine) { diff --git a/lib/linter/linter.js b/lib/linter/linter.js index dd2e830a4a1..aa87557d107 100644 --- a/lib/linter/linter.js +++ b/lib/linter/linter.js @@ -1067,7 +1067,7 @@ class Linter { /** * Initialize the Linter. * @param {Object} [config] the config object - * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined. + * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined. */ constructor({ cwd } = {}) { internalSlotsMap.set(this, { diff --git a/lib/linter/source-code-fixer.js b/lib/linter/source-code-fixer.js index 53dc1dc6be7..15386c926c2 100644 --- a/lib/linter/source-code-fixer.js +++ b/lib/linter/source-code-fixer.js @@ -80,8 +80,8 @@ SourceCodeFixer.applyFixes = function(sourceText, messages, shouldFix) { /** * Try to use the 'fix' from a problem. - * @param {Message} problem The message object to apply fixes from - * @returns {boolean} Whether fix was successfully applied + * @param {Message} problem The message object to apply fixes from + * @returns {boolean} Whether fix was successfully applied */ function attemptFix(problem) { const fix = problem.fix; diff --git a/lib/rules/consistent-this.js b/lib/rules/consistent-this.js index e5bc9678dae..75b30e8fc04 100644 --- a/lib/rules/consistent-this.js +++ b/lib/rules/consistent-this.js @@ -47,7 +47,7 @@ module.exports = { * Reports that a variable declarator or assignment expression is assigning * a non-'this' value to the specified alias. * @param {ASTNode} node The assigning node. - * @param {string} name the name of the alias that was incorrectly used. + * @param {string} name the name of the alias that was incorrectly used. * @returns {void} */ function reportBadAssignment(node, name) { diff --git a/lib/rules/default-case.js b/lib/rules/default-case.js index 968aefe9cc8..023854153f9 100644 --- a/lib/rules/default-case.js +++ b/lib/rules/default-case.js @@ -50,7 +50,7 @@ module.exports = { /** * Shortcut to get last element of array - * @param {*[]} collection Array + * @param {*[]} collection Array * @returns {any} Last element */ function last(collection) { diff --git a/lib/rules/eqeqeq.js b/lib/rules/eqeqeq.js index 57926dbed0e..09fb3bc14b5 100644 --- a/lib/rules/eqeqeq.js +++ b/lib/rules/eqeqeq.js @@ -78,7 +78,7 @@ module.exports = { /** * Checks if an expression is a typeof expression - * @param {ASTNode} node The node to check + * @param {ASTNode} node The node to check * @returns {boolean} if the node is a typeof expression */ function isTypeOf(node) { diff --git a/lib/rules/key-spacing.js b/lib/rules/key-spacing.js index c7230078958..12b5ce8e10a 100644 --- a/lib/rules/key-spacing.js +++ b/lib/rules/key-spacing.js @@ -531,7 +531,7 @@ module.exports = { /** * Creates groups of properties. - * @param {ASTNode} node ObjectExpression node being evaluated. + * @param {ASTNode} node ObjectExpression node being evaluated. * @returns {Array} Groups of property AST node lists. */ function createGroups(node) { @@ -600,7 +600,7 @@ module.exports = { /** * Verifies spacing of property conforms to specified options. - * @param {ASTNode} node Property node being evaluated. + * @param {ASTNode} node Property node being evaluated. * @param {Object} lineOptions Configured singleLine or multiLine options * @returns {void} */ @@ -629,7 +629,7 @@ module.exports = { /** * Verifies vertical alignment, taking into account groups of properties. - * @param {ASTNode} node ObjectExpression node being evaluated. + * @param {ASTNode} node ObjectExpression node being evaluated. * @returns {void} */ function verifyAlignment(node) { diff --git a/lib/rules/newline-after-var.js b/lib/rules/newline-after-var.js index 4809d9bfc5a..3c36e2bd0ac 100644 --- a/lib/rules/newline-after-var.js +++ b/lib/rules/newline-after-var.js @@ -145,9 +145,9 @@ module.exports = { /** * Determine if a token starts more than one line after a comment ends - * @param {token} token The token being checked - * @param {integer} commentStartLine The line number on which the comment starts - * @returns {boolean} True if `token` does not start immediately after a comment + * @param {token} token The token being checked + * @param {integer} commentStartLine The line number on which the comment starts + * @returns {boolean} True if `token` does not start immediately after a comment */ function hasBlankLineAfterComment(token, commentStartLine) { return token.loc.start.line > getLastCommentLineOfBlock(commentStartLine) + 1; diff --git a/lib/rules/newline-per-chained-call.js b/lib/rules/newline-per-chained-call.js index 46c9d6c10f8..7ae5c429c99 100644 --- a/lib/rules/newline-per-chained-call.js +++ b/lib/rules/newline-per-chained-call.js @@ -53,7 +53,7 @@ module.exports = { * Get the prefix of a given MemberExpression node. * If the MemberExpression node is a computed value it returns a * left bracket. If not it returns a period. - * @param {ASTNode} node A MemberExpression node to get + * @param {ASTNode} node A MemberExpression node to get * @returns {string} The prefix of the node. */ function getPrefix(node) { diff --git a/lib/rules/no-bitwise.js b/lib/rules/no-bitwise.js index a9c3360a7c5..1c9d8768155 100644 --- a/lib/rules/no-bitwise.js +++ b/lib/rules/no-bitwise.js @@ -63,7 +63,7 @@ module.exports = { /** * Reports an unexpected use of a bitwise operator. - * @param {ASTNode} node Node which contains the bitwise operator. + * @param {ASTNode} node Node which contains the bitwise operator. * @returns {void} */ function report(node) { @@ -72,7 +72,7 @@ module.exports = { /** * Checks if the given node has a bitwise operator. - * @param {ASTNode} node The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} Whether or not the node has a bitwise operator. */ function hasBitwiseOperator(node) { @@ -81,7 +81,7 @@ module.exports = { /** * Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`. - * @param {ASTNode} node The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} Whether or not the node has a bitwise operator. */ function allowedOperator(node) { @@ -90,7 +90,7 @@ module.exports = { /** * Checks if the given bitwise operator is used for integer typecasting, i.e. "|0" - * @param {ASTNode} node The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} whether the node is used in integer typecasting. */ function isInt32Hint(node) { @@ -100,7 +100,7 @@ module.exports = { /** * Report if the given node contains a bitwise operator. - * @param {ASTNode} node The node to check. + * @param {ASTNode} node The node to check. * @returns {void} */ function checkNodeForBitwiseOperator(node) { diff --git a/lib/rules/no-shadow.js b/lib/rules/no-shadow.js index a0b1db50c0b..7a8c24e1894 100644 --- a/lib/rules/no-shadow.js +++ b/lib/rules/no-shadow.js @@ -59,7 +59,7 @@ module.exports = { /** * Check if variable name is allowed. - * @param {ASTNode} variable The variable to check. + * @param {ASTNode} variable The variable to check. * @returns {boolean} Whether or not the variable name is allowed. */ function isAllowed(variable) { diff --git a/lib/rules/object-shorthand.js b/lib/rules/object-shorthand.js index 020fe49a23f..d78b1a71dfb 100644 --- a/lib/rules/object-shorthand.js +++ b/lib/rules/object-shorthand.js @@ -156,7 +156,7 @@ module.exports = { /** * Checks whether a node is a string literal. - * @param {ASTNode} node Any AST node. + * @param {ASTNode} node Any AST node. * @returns {boolean} `true` if it is a string literal. */ function isStringLiteral(node) { @@ -196,8 +196,8 @@ module.exports = { /** * Ensures that an object's properties are consistently shorthand, or not shorthand at all. - * @param {ASTNode} node Property AST node - * @param {boolean} checkRedundancy Whether to check longform redundancy + * @param {ASTNode} node Property AST node + * @param {boolean} checkRedundancy Whether to check longform redundancy * @returns {void} */ function checkConsistency(node, checkRedundancy) { diff --git a/lib/rules/one-var.js b/lib/rules/one-var.js index e3df8320f8b..3f338a48aaa 100644 --- a/lib/rules/one-var.js +++ b/lib/rules/one-var.js @@ -209,7 +209,7 @@ module.exports = { /** * Determines the current scope (function or block) - * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {string} statementType node.kind, one of: "var", "let", or "const" * @returns {Object} The scope associated with statementType */ function getCurrentScope(statementType) { diff --git a/lib/rules/operator-assignment.js b/lib/rules/operator-assignment.js index a48d2725197..17cb4debfd8 100644 --- a/lib/rules/operator-assignment.js +++ b/lib/rules/operator-assignment.js @@ -17,8 +17,8 @@ const astUtils = require("./utils/ast-utils"); /** * Checks whether an operator is commutative and has an operator assignment * shorthand form. - * @param {string} operator Operator to check. - * @returns {boolean} True if the operator is commutative and has a + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is commutative and has a * shorthand form. */ function isCommutativeOperatorWithShorthand(operator) { @@ -28,8 +28,8 @@ function isCommutativeOperatorWithShorthand(operator) { /** * Checks whether an operator is not commutative and has an operator assignment * shorthand form. - * @param {string} operator Operator to check. - * @returns {boolean} True if the operator is not commutative and has + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is not commutative and has * a shorthand form. */ function isNonCommutativeOperatorWithShorthand(operator) { @@ -96,7 +96,7 @@ module.exports = { /** * Ensures that an assignment uses the shorthand form where possible. - * @param {ASTNode} node An AssignmentExpression node. + * @param {ASTNode} node An AssignmentExpression node. * @returns {void} */ function verify(node) { @@ -149,7 +149,7 @@ module.exports = { /** * Warns if an assignment expression uses operator assignment shorthand. - * @param {ASTNode} node An AssignmentExpression node. + * @param {ASTNode} node An AssignmentExpression node. * @returns {void} */ function prohibit(node) { diff --git a/lib/rules/quote-props.js b/lib/rules/quote-props.js index fab7bdc9c15..741acf8db9f 100644 --- a/lib/rules/quote-props.js +++ b/lib/rules/quote-props.js @@ -91,7 +91,7 @@ module.exports = { /** * Checks whether a certain string constitutes an ES3 token - * @param {string} tokenStr The string to be checked. + * @param {string} tokenStr The string to be checked. * @returns {boolean} `true` if it is an ES3 token. */ function isKeyword(tokenStr) { @@ -100,9 +100,9 @@ module.exports = { /** * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary) - * @param {string} rawKey The raw key value from the source - * @param {espreeTokens} tokens The espree-tokenized node key - * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked + * @param {string} rawKey The raw key value from the source + * @param {espreeTokens} tokens The espree-tokenized node key + * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked * @returns {boolean} Whether or not a key has redundant quotes. * @private */ @@ -139,7 +139,7 @@ module.exports = { /** * Ensures that a property's key is quoted only when necessary - * @param {ASTNode} node Property AST node + * @param {ASTNode} node Property AST node * @returns {void} */ function checkUnnecessaryQuotes(node) { @@ -195,7 +195,7 @@ module.exports = { /** * Ensures that a property's key is quoted - * @param {ASTNode} node Property AST node + * @param {ASTNode} node Property AST node * @returns {void} */ function checkOmittedQuotes(node) { @@ -213,8 +213,8 @@ module.exports = { /** * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes - * @param {ASTNode} node Property AST node - * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy + * @param {ASTNode} node Property AST node + * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy * @returns {void} */ function checkConsistency(node, checkQuotesRedundancy) { diff --git a/lib/rules/utils/ast-utils.js b/lib/rules/utils/ast-utils.js index d7f9c9777b7..4b031db4d64 100644 --- a/lib/rules/utils/ast-utils.js +++ b/lib/rules/utils/ast-utils.js @@ -858,8 +858,8 @@ module.exports = { /** * Validate that a string passed in is surrounded by the specified character - * @param {string} val The text to check. - * @param {string} character The character to see if it's surrounded by. + * @param {string} val The text to check. + * @param {string} character The character to see if it's surrounded by. * @returns {boolean} True if the text is surrounded by the character, false if not. * @private */ @@ -1635,7 +1635,7 @@ module.exports = { /** * Determine if a node has a possibility to be an Error object - * @param {ASTNode} node ASTNode to check + * @param {ASTNode} node ASTNode to check * @returns {boolean} True if there is a chance it contains an Error obj */ couldBeError(node) { diff --git a/packages/eslint-config-eslint/default.yml b/packages/eslint-config-eslint/default.yml index efd7a5a1430..87843463cf2 100644 --- a/packages/eslint-config-eslint/default.yml +++ b/packages/eslint-config-eslint/default.yml @@ -88,7 +88,7 @@ rules: # jsdoc: adopt non-recommended rules or change recommended configuration # jsdoc/check-examples: "error" # jsdoc/check-indentation: "error" # Revisit if allowing configurable spaces after tag line breaks - # jsdoc/check-line-alignment: ["error", "never"] + jsdoc/check-line-alignment: ["error", "never"] jsdoc/check-syntax: "error" # jsdoc/check-types': ["error', { exemptTagContexts: [ { tag: "typedef", types: ["object", "GenericObject"] } ] } diff --git a/tests/lib/rules/complexity.js b/tests/lib/rules/complexity.js index 9a30b6edbb0..afc0164a51e 100644 --- a/tests/lib/rules/complexity.js +++ b/tests/lib/rules/complexity.js @@ -36,10 +36,10 @@ function createComplexity(complexity) { /** * Create an expected error object - * @param {string} name The name of the symbol being tested - * @param {number} complexity The cyclomatic complexity value of the symbol - * @param {number} max The maximum cyclomatic complexity value of the symbol - * @returns {Object} The error object + * @param {string} name The name of the symbol being tested + * @param {number} complexity The cyclomatic complexity value of the symbol + * @param {number} max The maximum cyclomatic complexity value of the symbol + * @returns {Object} The error object */ function makeError(name, complexity, max) { return { diff --git a/tests/lib/rules/dot-notation.js b/tests/lib/rules/dot-notation.js index 249faf80e8f..e3283106bff 100644 --- a/tests/lib/rules/dot-notation.js +++ b/tests/lib/rules/dot-notation.js @@ -21,8 +21,8 @@ const ruleTester = new RuleTester(); /** * Quote a string in "double quotes" because it’s painful * with a double-quoted string literal - * @param {string} str The string to quote - * @returns {string} `"${str}"` + * @param {string} str The string to quote + * @returns {string} `"${str}"` */ function q(str) { return `"${str}"`;