Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: fix typos #13960

Merged
merged 1 commit into from Dec 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/eslint/eslint.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/arrow-body-style.js
Expand Up @@ -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))) {
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/callback-return.js
Expand Up @@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/dot-location.js
Expand Up @@ -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}
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/func-call-spacing.js
Expand Up @@ -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]], "?.");
}
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-extend-native.js
Expand Up @@ -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 =
Expand Down
8 changes: 4 additions & 4 deletions lib/rules/no-import-assign.js
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-restricted-exports.js
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-this-before-super.js
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/prefer-destructuring.js
Expand Up @@ -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);
}
Expand All @@ -291,7 +291,7 @@ module.exports = {

return {
VariableDeclarator: checkVariableDeclarator,
AssignmentExpression: checkAssigmentExpression
AssignmentExpression: checkAssignmentExpression
};
}
};
4 changes: 2 additions & 2 deletions lib/rules/prefer-reflect.js
Expand Up @@ -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]);
}
},
Expand Down
2 changes: 1 addition & 1 deletion 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";
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/utils/ast-utils.js
Expand Up @@ -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));
Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/deprecation-warnings.js
Expand Up @@ -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.",
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/types.js
Expand Up @@ -46,9 +46,9 @@ module.exports = {};
/**
* @typedef {Object} OverrideConfigData
* @property {Record<string, boolean>} [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<string, GlobalConf>} [globals] The global variable settings.
* @property {boolean} [noInlineConfig] The flag that disables directive comments.
* @property {OverrideConfigData[]} [overrides] The override settings per kind of files.
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/eslint/eslint.js
Expand Up @@ -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")
);
});
Expand Down