From 54c09530c778eb4076d89777165d59db96c9acb5 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 29 May 2022 16:31:12 -0400 Subject: [PATCH] fix: cleanup typos (#15939) --- bin/eslint.js | 2 +- lib/eslint/eslint.js | 6 +++--- lib/rules/function-paren-newline.js | 2 +- lib/rules/max-statements.js | 2 +- lib/rules/no-constant-binary-expression.js | 6 +++--- lib/rules/no-implicit-coercion.js | 4 ++-- lib/rules/no-loop-func.js | 2 +- lib/rules/no-new-object.js | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/eslint.js b/bin/eslint.js index d00a870c089..0f76fc92e1f 100755 --- a/bin/eslint.js +++ b/bin/eslint.js @@ -69,7 +69,7 @@ function getErrorMessage(error) { // Lazy loading because this is used only if an error happened. const util = require("util"); - // Foolproof -- thirdparty module might throw non-object. + // Foolproof -- third-party module might throw non-object. if (typeof error !== "object" || error === null) { return String(error); } diff --git a/lib/eslint/eslint.js b/lib/eslint/eslint.js index 927b60802a3..9a3bd66e487 100644 --- a/lib/eslint/eslint.js +++ b/lib/eslint/eslint.js @@ -104,9 +104,9 @@ function isNonEmptyString(x) { } /** - * Check if a given value is an array of non-empty stringss or not. + * Check if a given value is an array of non-empty strings or not. * @param {any} x The value to check. - * @returns {boolean} `true` if `x` is an array of non-empty stringss. + * @returns {boolean} `true` if `x` is an array of non-empty strings. */ function isArrayOfNonEmptyString(x) { return Array.isArray(x) && x.every(isNonEmptyString); @@ -599,7 +599,7 @@ class ESLint { * The following values are allowed: * - `undefined` ... Load `stylish` builtin formatter. * - A builtin formatter name ... Load the builtin formatter. - * - A thirdparty formatter name: + * - A third-party formatter name: * - `foo` → `eslint-formatter-foo` * - `@foo` → `@foo/eslint-formatter` * - `@foo/bar` → `@foo/eslint-formatter-bar` diff --git a/lib/rules/function-paren-newline.js b/lib/rules/function-paren-newline.js index a5b8f0d70c6..cad27b9927d 100644 --- a/lib/rules/function-paren-newline.js +++ b/lib/rules/function-paren-newline.js @@ -183,7 +183,7 @@ module.exports = { /** * Gets the left paren and right paren tokens of a node. * @param {ASTNode} node The node with parens - * @throws {TypeError} Unexecpted node type. + * @throws {TypeError} Unexpected node type. * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token. * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression * with a single parameter) diff --git a/lib/rules/max-statements.js b/lib/rules/max-statements.js index ac117e92e72..1f627b6843e 100644 --- a/lib/rules/max-statements.js +++ b/lib/rules/max-statements.js @@ -126,7 +126,7 @@ module.exports = { /* * This rule does not apply to class static blocks, but we have to track them so - * that stataments in them do not count as statements in the enclosing function. + * that statements in them do not count as statements in the enclosing function. */ if (node.type === "StaticBlock") { return; diff --git a/lib/rules/no-constant-binary-expression.js b/lib/rules/no-constant-binary-expression.js index d550bcf1d91..6cad0eff3e5 100644 --- a/lib/rules/no-constant-binary-expression.js +++ b/lib/rules/no-constant-binary-expression.js @@ -120,7 +120,7 @@ function isStaticBoolean(scope, node) { /** * Test if an AST node will always give the same result when compared to a - * bolean value. Note that comparison to boolean values is different than + * boolean value. Note that comparison to boolean values is different than * truthiness. * https://262.ecma-international.org/5.1/#sec-11.9.3 * @@ -238,7 +238,7 @@ function hasConstantLooseBooleanComparison(scope, node) { /** * Test if an AST node will always give the same result when _strictly_ compared - * to a bolean value. This can happen if the expression can never be boolean, or + * to a boolean value. This can happen if the expression can never be boolean, or * if it is always the same boolean value. * @param {Scope} scope The scope in which the node was found. * @param {ASTNode} node The node to test @@ -488,7 +488,7 @@ module.exports = { } /* - * In theory we could handle short circuting assignment operators, + * In theory we could handle short-circuiting assignment operators, * for some constant values, but that would require walking the * scope to find the value of the variable being assigned. This is * dependant on https://github.com/eslint/eslint/issues/13776 diff --git a/lib/rules/no-implicit-coercion.js b/lib/rules/no-implicit-coercion.js index 4b21e3d94f4..428f63b81db 100644 --- a/lib/rules/no-implicit-coercion.js +++ b/lib/rules/no-implicit-coercion.js @@ -30,9 +30,9 @@ function parseOptions(options) { } /** - * Checks whether or not a node is a double logical nigating. + * Checks whether or not a node is a double logical negating. * @param {ASTNode} node An UnaryExpression node to check. - * @returns {boolean} Whether or not the node is a double logical nigating. + * @returns {boolean} Whether or not the node is a double logical negating. */ function isDoubleLogicalNegating(node) { return ( diff --git a/lib/rules/no-loop-func.js b/lib/rules/no-loop-func.js index c5460616dc1..d087974e64b 100644 --- a/lib/rules/no-loop-func.js +++ b/lib/rules/no-loop-func.js @@ -125,7 +125,7 @@ function isSafe(loopNode, reference) { * The reference is every reference of the upper scope's variable we are * looking now. * - * It's safeafe if the reference matches one of the following condition. + * It's safe if the reference matches one of the following condition. * - is readonly. * - doesn't exist inside a local function and after the border. * @param {eslint-scope.Reference} upperRef A reference to check. diff --git a/lib/rules/no-new-object.js b/lib/rules/no-new-object.js index 1a5784df24d..02ff772678c 100644 --- a/lib/rules/no-new-object.js +++ b/lib/rules/no-new-object.js @@ -29,7 +29,7 @@ module.exports = { schema: [], messages: { - preferLiteral: "The object literal notation {} is preferrable." + preferLiteral: "The object literal notation {} is preferable." } },