diff --git a/lib/eslint/eslint.js b/lib/eslint/eslint.js index a51ffbfe41a..0bd7a41c6fd 100644 --- a/lib/eslint/eslint.js +++ b/lib/eslint/eslint.js @@ -272,7 +272,7 @@ function processOptions({ errors.push("'rulePaths' must be an array of non-empty strings."); } if (typeof useEslintrc !== "boolean") { - errors.push("'useElintrc' must be a boolean."); + errors.push("'useEslintrc' must be a boolean."); } if (errors.length > 0) { @@ -563,7 +563,7 @@ class ESLint { /** * Returns the formatter representing the given formatter name. - * @param {string} [name] The name of the formattter to load. + * @param {string} [name] The name of the formatter to load. * The following values are allowed: * - `undefined` ... Load `stylish` builtin formatter. * - A builtin formatter name ... Load the builtin formatter. diff --git a/lib/rules/arrow-body-style.js b/lib/rules/arrow-body-style.js index 7b318ea8b3a..b2167fde77b 100644 --- a/lib/rules/arrow-body-style.js +++ b/lib/rules/arrow-body-style.js @@ -191,7 +191,7 @@ module.exports = { } /* - * If the first token of the reutrn value is `{` or the return value is a sequence expression, + * If the first token of the return value is `{` or the return value is a sequence expression, * enclose the return value by parentheses to avoid syntax error. */ if (astUtils.isOpeningBraceToken(firstValueToken) || blockBody[0].argument.type === "SequenceExpression" || (funcInfo.hasInOperator && isInsideForLoopInitializer(node))) { diff --git a/lib/rules/callback-return.js b/lib/rules/callback-return.js index ba13c9a6481..fa66e6383b7 100644 --- a/lib/rules/callback-return.js +++ b/lib/rules/callback-return.js @@ -59,9 +59,9 @@ module.exports = { } /** - * Check to see if a node contains only identifers + * Check to see if a node contains only identifiers * @param {ASTNode} node The node to check - * @returns {boolean} Whether or not the node contains only identifers + * @returns {boolean} Whether or not the node contains only identifiers */ function containsOnlyIdentifiers(node) { if (node.type === "Identifier") { diff --git a/lib/rules/dot-location.js b/lib/rules/dot-location.js index 0a739b1712b..a8d5a760562 100644 --- a/lib/rules/dot-location.js +++ b/lib/rules/dot-location.js @@ -46,7 +46,7 @@ module.exports = { const sourceCode = context.getSourceCode(); /** - * Reports if the dot between object and property is on the correct loccation. + * Reports if the dot between object and property is on the correct location. * @param {ASTNode} node The `MemberExpression` node. * @returns {void} */ diff --git a/lib/rules/func-call-spacing.js b/lib/rules/func-call-spacing.js index 8fe690d4a6b..132a5833143 100644 --- a/lib/rules/func-call-spacing.js +++ b/lib/rules/func-call-spacing.js @@ -131,7 +131,7 @@ module.exports = { return null; } - // If `?.` exsits, it doesn't hide no-undexpected-multiline errors + // If `?.` exists, it doesn't hide no-unexpected-multiline errors if (node.optional) { return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], "?."); } @@ -177,7 +177,7 @@ module.exports = { /* * Only autofix if there is no newline * https://github.com/eslint/eslint/issues/7787 - * But if `?.` exsits, it doesn't hide no-undexpected-multiline errors + * But if `?.` exists, it doesn't hide no-unexpected-multiline errors */ if (!node.optional) { return null; diff --git a/lib/rules/no-extend-native.js b/lib/rules/no-extend-native.js index db365b50924..2a804b56398 100644 --- a/lib/rules/no-extend-native.js +++ b/lib/rules/no-extend-native.js @@ -138,7 +138,7 @@ module.exports = { } /* - * `identifierNode.parent` is a MamberExpression `*.prototype`. + * `identifierNode.parent` is a MemberExpression `*.prototype`. * If it's an optional member access, it may be wrapped by a `ChainExpression` node. */ const prototypeNode = diff --git a/lib/rules/no-import-assign.js b/lib/rules/no-import-assign.js index 7a349bb730b..41060d8ac9e 100644 --- a/lib/rules/no-import-assign.js +++ b/lib/rules/no-import-assign.js @@ -97,10 +97,10 @@ function isIterationVariable(node) { * - `Object.defineProperties` * - `Object.freeze` * - `Object.setPrototypeOf` - * - `Refrect.defineProperty` - * - `Refrect.deleteProperty` - * - `Refrect.set` - * - `Refrect.setPrototypeOf` + * - `Reflect.defineProperty` + * - `Reflect.deleteProperty` + * - `Reflect.set` + * - `Reflect.setPrototypeOf` * @param {ASTNode} node The node to check. * @param {Scope} scope A `escope.Scope` object to find variable (whichever). * @returns {boolean} `true` if the node is at the first argument of a well-known mutation function. diff --git a/lib/rules/no-restricted-exports.js b/lib/rules/no-restricted-exports.js index 6031e26de2c..f0df0ffaedb 100644 --- a/lib/rules/no-restricted-exports.js +++ b/lib/rules/no-restricted-exports.js @@ -45,7 +45,7 @@ module.exports = { /** * Checks and reports given exported identifier. - * @param {ASTNode} node exported `Identifer` node to check. + * @param {ASTNode} node exported `Identifier` node to check. * @returns {void} */ function checkExportedName(node) { diff --git a/lib/rules/no-this-before-super.js b/lib/rules/no-this-before-super.js index 44288c0c971..5bfba66fc65 100644 --- a/lib/rules/no-this-before-super.js +++ b/lib/rules/no-this-before-super.js @@ -171,7 +171,7 @@ module.exports = { /** * Removes the top of stack item. * - * And this treverses all segments of this code path then reports every + * And this traverses all segments of this code path then reports every * invalid node. * @param {CodePath} codePath A code path which was ended. * @returns {void} diff --git a/lib/rules/prefer-destructuring.js b/lib/rules/prefer-destructuring.js index b2d3c8a0b01..413f7272cc1 100644 --- a/lib/rules/prefer-destructuring.js +++ b/lib/rules/prefer-destructuring.js @@ -279,7 +279,7 @@ module.exports = { * @param {ASTNode} node the AssignmentExpression node * @returns {void} */ - function checkAssigmentExpression(node) { + function checkAssignmentExpression(node) { if (node.operator === "=") { performCheck(node.left, node.right, node); } @@ -291,7 +291,7 @@ module.exports = { return { VariableDeclarator: checkVariableDeclarator, - AssignmentExpression: checkAssigmentExpression + AssignmentExpression: checkAssignmentExpression }; } }; diff --git a/lib/rules/prefer-reflect.js b/lib/rules/prefer-reflect.js index fb2de923bea..156d61251c4 100644 --- a/lib/rules/prefer-reflect.js +++ b/lib/rules/prefer-reflect.js @@ -105,10 +105,10 @@ module.exports = { CallExpression(node) { const methodName = (node.callee.property || {}).name; const isReflectCall = (node.callee.object || {}).name === "Reflect"; - const hasReflectSubsitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName); + const hasReflectSubstitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName); const userConfiguredException = exceptions.indexOf(methodName) !== -1; - if (hasReflectSubsitute && !isReflectCall && !userConfiguredException) { + if (hasReflectSubstitute && !isReflectCall && !userConfiguredException) { report(node, existingNames[methodName], reflectSubstitutes[methodName]); } }, diff --git a/lib/rules/space-unary-ops.js b/lib/rules/space-unary-ops.js index f417eea58d8..57f6e784501 100644 --- a/lib/rules/space-unary-ops.js +++ b/lib/rules/space-unary-ops.js @@ -1,5 +1,5 @@ /** - * @fileoverview This rule shoud require or disallow spaces before or after unary operations. + * @fileoverview This rule should require or disallow spaces before or after unary operations. * @author Marcin Kumorek */ "use strict"; diff --git a/lib/rules/utils/ast-utils.js b/lib/rules/utils/ast-utils.js index 1fd6340df7c..679eebb4c45 100644 --- a/lib/rules/utils/ast-utils.js +++ b/lib/rules/utils/ast-utils.js @@ -82,7 +82,7 @@ function startsWithUpperCase(s) { /** * Checks whether or not a node is a constructor. * @param {ASTNode} node A function node to check. - * @returns {boolean} Wehether or not a node is a constructor. + * @returns {boolean} Whether or not a node is a constructor. */ function isES5Constructor(node) { return (node.id && startsWithUpperCase(node.id.name)); @@ -1574,7 +1574,7 @@ module.exports = { }, /* - * Determine if a node has a possiblity to be an Error object + * Determine if a node has a possibility to be an Error object * @param {ASTNode} node ASTNode to check * @returns {boolean} True if there is a chance it contains an Error obj */ diff --git a/lib/shared/deprecation-warnings.js b/lib/shared/deprecation-warnings.js index e1481a2e9aa..1438eaa69bf 100644 --- a/lib/shared/deprecation-warnings.js +++ b/lib/shared/deprecation-warnings.js @@ -15,7 +15,7 @@ const lodash = require("lodash"); // Private //------------------------------------------------------------------------------ -// Defitions for deprecation warnings. +// Definitions for deprecation warnings. const deprecationWarningMessages = { ESLINT_LEGACY_ECMAFEATURES: "The 'ecmaFeatures' config file property is deprecated and has no effect.", diff --git a/lib/shared/types.js b/lib/shared/types.js index 8ad3b1b64ce..c3b76e42d5f 100644 --- a/lib/shared/types.js +++ b/lib/shared/types.js @@ -46,9 +46,9 @@ module.exports = {}; /** * @typedef {Object} OverrideConfigData * @property {Record} [env] The environment settings. - * @property {string | string[]} [excludedFiles] The glob pattarns for excluded files. + * @property {string | string[]} [excludedFiles] The glob patterns for excluded files. * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. - * @property {string | string[]} files The glob pattarns for target files. + * @property {string | string[]} files The glob patterns for target files. * @property {Record} [globals] The global variable settings. * @property {boolean} [noInlineConfig] The flag that disables directive comments. * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. diff --git a/tests/lib/eslint/eslint.js b/tests/lib/eslint/eslint.js index e4f37f404c4..530464ecaa1 100644 --- a/tests/lib/eslint/eslint.js +++ b/tests/lib/eslint/eslint.js @@ -208,7 +208,7 @@ describe("ESLint", () => { "- 'reportUnusedDisableDirectives' must be any of \"error\", \"warn\", \"off\", and null.", "- 'resolvePluginsRelativeTo' must be a non-empty string or null.", "- 'rulePaths' must be an array of non-empty strings.", - "- 'useElintrc' must be a boolean." + "- 'useEslintrc' must be a boolean." ].join("\n")), "u") ); });