From 7e1fb120631faf4a33dbbc2814141162e29af99e Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 29 May 2022 14:02:09 -0400 Subject: [PATCH] test: cleanup typos --- tests/bench/large.js | 8 +++---- .../{identifer-type.js => identifier-type.js} | 0 tests/lib/cli-engine/cli-engine.js | 2 +- tests/lib/eslint/eslint.js | 2 +- tests/lib/linter/apply-disable-directives.js | 2 +- .../linter/code-path-analysis/code-path.js | 2 +- tests/lib/linter/config-comment-parser.js | 2 +- tests/lib/linter/linter.js | 8 +++---- tests/lib/linter/node-event-generator.js | 2 +- tests/lib/rules/array-bracket-newline.js | 2 +- tests/lib/rules/arrow-parens.js | 6 ++--- tests/lib/rules/camelcase.js | 4 ++-- tests/lib/rules/max-lines-per-function.js | 24 +++++++++---------- .../rules/no-constant-binary-expression.js | 2 +- tests/lib/rules/no-constant-condition.js | 2 +- tests/lib/rules/no-extra-parens.js | 2 +- tests/lib/rules/no-multi-assign.js | 2 +- tests/lib/rules/space-unary-ops.js | 2 +- tests/lib/rules/utils/fix-tracker.js | 2 +- tests/lib/rules/wrap-iife.js | 4 ++-- tests/performance/jshint.js | 16 ++++++------- 21 files changed, 48 insertions(+), 48 deletions(-) rename tests/fixtures/parsers/arrow-parens/{identifer-type.js => identifier-type.js} (100%) diff --git a/tests/bench/large.js b/tests/bench/large.js index a3db1ac6c8d3..7929db5ff501 100644 --- a/tests/bench/large.js +++ b/tests/bench/large.js @@ -50947,7 +50947,7 @@ exports.debuglog = function(set) { /** - * Echos the value of a value. Trys to print the value out + * Echos the value of a value. Tries to print the value out * in the best way possible given the different types. * * @param {Object} obj The object to print out. @@ -54968,13 +54968,13 @@ var JSHINT = (function () { return that; }, 30); - var orPrecendence = 40; + var orPrecedence = 40; infix("||", function (left, that) { increaseComplexityCount(); that.left = left; - that.right = expression(orPrecendence); + that.right = expression(orPrecedence); return that; - }, orPrecendence); + }, orPrecedence); infix("&&", "and", 50); bitwise("|", "bitor", 70); bitwise("^", "bitxor", 80); diff --git a/tests/fixtures/parsers/arrow-parens/identifer-type.js b/tests/fixtures/parsers/arrow-parens/identifier-type.js similarity index 100% rename from tests/fixtures/parsers/arrow-parens/identifer-type.js rename to tests/fixtures/parsers/arrow-parens/identifier-type.js diff --git a/tests/lib/cli-engine/cli-engine.js b/tests/lib/cli-engine/cli-engine.js index b979bd892018..2d2d8ba98924 100644 --- a/tests/lib/cli-engine/cli-engine.js +++ b/tests/lib/cli-engine/cli-engine.js @@ -5336,7 +5336,7 @@ describe("CLIEngine", () => { }); }); - describe("when retreiving version number", () => { + describe("when retrieving version number", () => { it("should return current version number", () => { const eslintCLI = require("../../../lib/cli-engine").CLIEngine; const version = eslintCLI.version; diff --git a/tests/lib/eslint/eslint.js b/tests/lib/eslint/eslint.js index 2cec67fde6b3..980e7b49aa2c 100644 --- a/tests/lib/eslint/eslint.js +++ b/tests/lib/eslint/eslint.js @@ -5212,7 +5212,7 @@ describe("ESLint", () => { }); }); - describe("when retreiving version number", () => { + describe("when retrieving version number", () => { it("should return current version number", () => { const eslintCLI = require("../../../lib/eslint").ESLint; const version = eslintCLI.version; diff --git a/tests/lib/linter/apply-disable-directives.js b/tests/lib/linter/apply-disable-directives.js index 512e400832ec..de56f729627f 100644 --- a/tests/lib/linter/apply-disable-directives.js +++ b/tests/lib/linter/apply-disable-directives.js @@ -667,7 +667,7 @@ describe("apply-disable-directives", () => { line: 1, column: 1, ruleId: null, - justification: "justificatiion" + justification: "justification" }], problems: [{ line: 3, column: 3, ruleId: "foo" }] }), diff --git a/tests/lib/linter/code-path-analysis/code-path.js b/tests/lib/linter/code-path-analysis/code-path.js index 760d5b399898..683f592145e9 100644 --- a/tests/lib/linter/code-path-analysis/code-path.js +++ b/tests/lib/linter/code-path-analysis/code-path.js @@ -69,7 +69,7 @@ describe("CodePathAnalyzer", () => { /* * If you need to output the code paths and DOT graph information for a - * particular piece of code, udpate and uncomment the following test and + * particular piece of code, update and uncomment the following test and * then run: * DEBUG=eslint:code-path npx mocha tests/lib/linter/code-path-analysis/ * diff --git a/tests/lib/linter/config-comment-parser.js b/tests/lib/linter/config-comment-parser.js index f51fe693a735..e9f595d77504 100644 --- a/tests/lib/linter/config-comment-parser.js +++ b/tests/lib/linter/config-comment-parser.js @@ -215,7 +215,7 @@ describe("ConfigCommentParser", () => { }); }); - it("should parse list config with two items and exta whitespace", () => { + it("should parse list config with two items and extra whitespace", () => { const code = " a , b "; const result = commentParser.parseListConfig(code); diff --git a/tests/lib/linter/linter.js b/tests/lib/linter/linter.js index 8c121808e1bf..05cb6d0f1d92 100644 --- a/tests/lib/linter/linter.js +++ b/tests/lib/linter/linter.js @@ -2625,7 +2625,7 @@ describe("Linter", () => { assert.strictEqual(suppressedMessages[1].ruleId, "quotes"); }); - it("should ignore violations of multiple rules when specified in mixed sinlge line and multi line comments", () => { + it("should ignore violations of multiple rules when specified in mixed single line and multi line comments", () => { const code = [ "/* eslint-disable-next-line", "no-alert", @@ -3915,7 +3915,7 @@ var a = "test2"; assert.strictEqual(suppressedMessages[0].suppressions.length, 2); }); - it("reports problems for multiple unused eslint-disable comments with mutliple ruleIds", () => { + it("reports problems for multiple unused eslint-disable comments with multiple ruleIds", () => { const code = [ "/* eslint no-undef: 2, no-void: 2 */", "/* eslint-disable no-undef -- j1 */", @@ -12562,7 +12562,7 @@ var a = "test2"; const code = ` /* eslint-disable-next-line no-alert -- description on why this exception is seen as appropriate but past a - comfortable reading line length + comfortable reading line length */ alert("buzz"); `; @@ -12689,7 +12689,7 @@ var a = "test2"; assert.strictEqual(suppressedMessages[1].ruleId, "quotes"); }); - it("should ignore violations of multiple rules when specified in mixed sinlge line and multi line comments", () => { + it("should ignore violations of multiple rules when specified in mixed single line and multi line comments", () => { const code = [ "/* eslint-disable-next-line", "no-alert", diff --git a/tests/lib/linter/node-event-generator.js b/tests/lib/linter/node-event-generator.js index 4004f7a2835e..2719bf30e300 100644 --- a/tests/lib/linter/node-event-generator.js +++ b/tests/lib/linter/node-event-generator.js @@ -60,7 +60,7 @@ describe("NodeEventGenerator", () => { assert(emitter.emit.calledWith("Foo", dummyNode)); }); - it("should generate events for exitting AST node.", () => { + it("should generate events for exiting AST node.", () => { const dummyNode = { type: "Foo", value: 1 }; generator.leaveNode(dummyNode); diff --git a/tests/lib/rules/array-bracket-newline.js b/tests/lib/rules/array-bracket-newline.js index 90ee8213b778..3f2b66f549f6 100644 --- a/tests/lib/rules/array-bracket-newline.js +++ b/tests/lib/rules/array-bracket-newline.js @@ -440,7 +440,7 @@ ruleTester.run("array-bracket-newline", rule, { invalid: [ - // default : { mutliline : true} + // default : { multiline : true} { code: `var foo = [ [1,2] diff --git a/tests/lib/rules/arrow-parens.js b/tests/lib/rules/arrow-parens.js index d2f32a784a3a..c7af7f6dea87 100644 --- a/tests/lib/rules/arrow-parens.js +++ b/tests/lib/rules/arrow-parens.js @@ -46,7 +46,7 @@ const valid = [ { code: "a.then((foo) => {});", options: ["always"] }, { code: "a.then((foo) => { if (true) {}; });", options: ["always"] }, { code: "a.then(async (foo) => { if (true) {}; });", options: ["always"], parserOptions: { ecmaVersion: 8 } }, - { code: "(a: T) => a", options: ["always"], parser: parser("identifer-type") }, + { code: "(a: T) => a", options: ["always"], parser: parser("identifier-type") }, { code: "(a): T => a", options: ["always"], parser: parser("return-type") }, // "as-needed" @@ -64,7 +64,7 @@ const valid = [ { code: "async a => a", options: ["as-needed"], parserOptions: { ecmaVersion: 8 } }, { code: "async ([a, b]) => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 8 } }, { code: "async (a, b) => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 8 } }, - { code: "(a: T) => a", options: ["as-needed"], parser: parser("identifer-type") }, + { code: "(a: T) => a", options: ["as-needed"], parser: parser("identifier-type") }, { code: "(a): T => a", options: ["as-needed"], parser: parser("return-type") }, // "as-needed", { "requireForBlockBody": true } @@ -83,7 +83,7 @@ const valid = [ { code: "a => ({})", options: ["as-needed", { requireForBlockBody: true }] }, { code: "async a => ({})", options: ["as-needed", { requireForBlockBody: true }], parserOptions: { ecmaVersion: 8 } }, { code: "async a => a", options: ["as-needed", { requireForBlockBody: true }], parserOptions: { ecmaVersion: 8 } }, - { code: "(a: T) => a", options: ["as-needed", { requireForBlockBody: true }], parser: parser("identifer-type") }, + { code: "(a: T) => a", options: ["as-needed", { requireForBlockBody: true }], parser: parser("identifier-type") }, { code: "(a): T => a", options: ["as-needed", { requireForBlockBody: true }], parser: parser("return-type") }, { code: "const f = (/** @type {number} */a/**hello*/) => a + a;", diff --git a/tests/lib/rules/camelcase.js b/tests/lib/rules/camelcase.js index 79c237ce202a..f634c71b43d3 100644 --- a/tests/lib/rules/camelcase.js +++ b/tests/lib/rules/camelcase.js @@ -409,7 +409,7 @@ ruleTester.run("camelcase", rule, { parserOptions: { ecmaVersion: 2022 } }, - // Combinations of `properties` and `ignoreDestructring` + // Combinations of `properties` and `ignoreDestructuring` { code: ` const { some_property } = obj; @@ -1447,7 +1447,7 @@ ruleTester.run("camelcase", rule, { errors: [{ messageId: "notCamelCasePrivate", data: { name: "snake_case" } }] }, - // Combinations of `properties` and `ignoreDestructring` + // Combinations of `properties` and `ignoreDestructuring` { code: ` const { some_property } = obj; diff --git a/tests/lib/rules/max-lines-per-function.js b/tests/lib/rules/max-lines-per-function.js index ba01206f4a35..621d66e312d5 100644 --- a/tests/lib/rules/max-lines-per-function.js +++ b/tests/lib/rules/max-lines-per-function.js @@ -143,7 +143,7 @@ if ( x === y ) { options: [{ max: 5, skipComments: true, skipBlankLines: false }] }, - // IIFEs should be recognised if IIFEs: true + // IIFEs should be recognized if IIFEs: true { code: `(function(){ let x = 0; @@ -155,7 +155,7 @@ if ( x === y ) { options: [{ max: 7, skipComments: true, skipBlankLines: false, IIFEs: true }] }, - // IIFEs should not be recognised if IIFEs: false + // IIFEs should not be recognized if IIFEs: false { code: `(function(){ let x = 0; @@ -167,7 +167,7 @@ if ( x === y ) { options: [{ max: 2, skipComments: true, skipBlankLines: false, IIFEs: false }] }, - // Arrow IIFEs should be recognised if IIFEs: true + // Arrow IIFEs should be recognized if IIFEs: true { code: `(() => { let x = 0; @@ -179,7 +179,7 @@ if ( x === y ) { options: [{ max: 7, skipComments: true, skipBlankLines: false, IIFEs: true }] }, - // Arrow IIFEs should not be recognised if IIFEs: false + // Arrow IIFEs should not be recognized if IIFEs: false { code: `(() => { let x = 0; @@ -194,7 +194,7 @@ if ( x === y ) { invalid: [ - // Test simple standalone function is recognised + // Test simple standalone function is recognized { code: "function name() {\n}", options: [1], @@ -203,7 +203,7 @@ if ( x === y ) { ] }, - // Test anonymous function assigned to variable is recognised + // Test anonymous function assigned to variable is recognized { code: "var func = function() {\n}", options: [1], @@ -212,7 +212,7 @@ if ( x === y ) { ] }, - // Test arrow functions are recognised + // Test arrow functions are recognized { code: "const bar = () => {\nconst x = 2 + 1;\nreturn x;\n}", options: [3], @@ -221,7 +221,7 @@ if ( x === y ) { ] }, - // Test inline arrow functions are recognised + // Test inline arrow functions are recognized { code: "const bar = () =>\n 2", options: [1], @@ -369,7 +369,7 @@ if ( x === y ) { ] }, - // Test regular methods are recognised + // Test regular methods are recognized { code: `class foo { method() { @@ -384,7 +384,7 @@ if ( x === y ) { ] }, - // Test static methods are recognised + // Test static methods are recognized { code: `class A { static @@ -399,7 +399,7 @@ if ( x === y ) { ] }, - // Test getters are recognised as properties + // Test getters are recognized as properties { code: `var obj = { get @@ -414,7 +414,7 @@ if ( x === y ) { ] }, - // Test setters are recognised as properties + // Test setters are recognized as properties { code: `var obj = { set diff --git a/tests/lib/rules/no-constant-binary-expression.js b/tests/lib/rules/no-constant-binary-expression.js index 5f80e53cdfe6..c430c7787fd3 100644 --- a/tests/lib/rules/no-constant-binary-expression.js +++ b/tests/lib/rules/no-constant-binary-expression.js @@ -21,7 +21,7 @@ const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2021, ecmaFeat ruleTester.run("no-constant-binary-expression", rule, { valid: [ - // While this _would_ be a constant condition in React, ESLint has a polciy of not attributing any specific behavior to JSX. + // While this _would_ be a constant condition in React, ESLint has a policy of not attributing any specific behavior to JSX. "

&& foo", "<> && foo", "

?? foo", diff --git a/tests/lib/rules/no-constant-condition.js b/tests/lib/rules/no-constant-condition.js index c22b2947a6ff..af7bd355db45 100644 --- a/tests/lib/rules/no-constant-condition.js +++ b/tests/lib/rules/no-constant-condition.js @@ -410,7 +410,7 @@ ruleTester.run("no-constant-condition", rule, { /* * undefined is always falsy (except in old browsers that let you - * re-assign, but that's an abscure enough edge case to not worry about) + * re-assign, but that's an obscure enough edge case to not worry about) */ { code: "if (undefined) {}", errors: [{ messageId: "unexpected" }] }, diff --git a/tests/lib/rules/no-extra-parens.js b/tests/lib/rules/no-extra-parens.js index cb488c891e52..acaacd7a5257 100644 --- a/tests/lib/rules/no-extra-parens.js +++ b/tests/lib/rules/no-extra-parens.js @@ -1,5 +1,5 @@ /** - * @fileoverview Disallow parenthesesisng higher precedence subexpressions. + * @fileoverview Disallow parenthesising higher precedence subexpressions. * @author Michael Ficarra */ diff --git a/tests/lib/rules/no-multi-assign.js b/tests/lib/rules/no-multi-assign.js index 7920d9900fbd..94db78ff81dc 100644 --- a/tests/lib/rules/no-multi-assign.js +++ b/tests/lib/rules/no-multi-assign.js @@ -39,7 +39,7 @@ function errorAt(line, column, type) { const ruleTester = new RuleTester(); -ruleTester.run("no-mutli-assign", rule, { +ruleTester.run("no-multi-assign", rule, { valid: [ "var a, b, c,\nd = 0;", "var a = 1; var b = 2; var c = 3;\nvar d = 0;", diff --git a/tests/lib/rules/space-unary-ops.js b/tests/lib/rules/space-unary-ops.js index ccee19c663dc..9969bbc64e32 100644 --- a/tests/lib/rules/space-unary-ops.js +++ b/tests/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/tests/lib/rules/utils/fix-tracker.js b/tests/lib/rules/utils/fix-tracker.js index 33fe23eee124..aeed89173bbf 100644 --- a/tests/lib/rules/utils/fix-tracker.js +++ b/tests/lib/rules/utils/fix-tracker.js @@ -129,7 +129,7 @@ describe("FixTracker", () => { }); }); - describe("retainSurroungingTokens", () => { + describe("retainSurroundingTokens", () => { it("handles a change to a binary operator", () => { const sourceCode = createSourceCode("const i = j + k;"); const plusToken = sourceCode.ast.tokens[4]; diff --git a/tests/lib/rules/wrap-iife.js b/tests/lib/rules/wrap-iife.js index 035e265da404..642e29b26dfe 100644 --- a/tests/lib/rules/wrap-iife.js +++ b/tests/lib/rules/wrap-iife.js @@ -434,7 +434,7 @@ ruleTester.run("wrap-iife", rule, { }, { code: "if ((function (){}())) {}", - output: "if ((function (){})()) {}", // wrap function expression and remove unnecessary grouping parens aroung the call expression + output: "if ((function (){})()) {}", // wrap function expression and remove unnecessary grouping parens around the call expression options: ["inside"], errors: [wrapExpressionError] }, @@ -557,7 +557,7 @@ ruleTester.run("wrap-iife", rule, { }, { code: "if ((function (){}.call())) {}", - output: "if ((function (){}).call()) {}", // wrap function expression and remove unnecessary grouping parens aroung the call expression + output: "if ((function (){}).call()) {}", // wrap function expression and remove unnecessary grouping parens around the call expression options: ["inside", { functionPrototypeMethods: true }], errors: [wrapExpressionError] }, diff --git a/tests/performance/jshint.js b/tests/performance/jshint.js index f79d6ed15ffb..2efb8044608d 100644 --- a/tests/performance/jshint.js +++ b/tests/performance/jshint.js @@ -3160,13 +3160,13 @@ var JSHINT = (function () { return that; }, 30); - var orPrecendence = 40; + var orPrecedence = 40; infix("||", function (left, that) { increaseComplexityCount(); that.left = left; - that.right = expression(orPrecendence); + that.right = expression(orPrecedence); return that; - }, orPrecendence); + }, orPrecedence); infix("&&", "and", 50); bitwise("|", "bitor", 70); bitwise("^", "bitxor", 80); @@ -5972,8 +5972,8 @@ var warnings = { W006: "Confusing minuses.", W007: "Confusing pluses.", W008: "A leading decimal point can be confused with a dot: '{a}'.", - W009: "The array literal notation [] is preferrable.", - W010: "The object literal notation {} is preferrable.", + W009: "The array literal notation [] is preferable.", + W010: "The object literal notation {} is preferable.", W011: "Unexpected space after '{a}'.", W012: "Unexpected space before '{a}'.", W013: "Missing space after '{a}'.", @@ -7761,7 +7761,7 @@ Lexer.prototype = { line: this.line, character: this.char }, checks, function () { - return state.directive["use strict"] && token.base === 8; + return state.directive["use strict"] && token.base === 8; }); this.trigger("Number", { @@ -11209,7 +11209,7 @@ SlowBuffer.prototype.writeDoubleBE = Buffer.prototype.writeDoubleBE; function b64ToByteArray(b64) { var i, j, l, tmp, placeHolders, arr; - + if (b64.length % 4 > 0) { throw 'Invalid string. Length must be a multiple of 4'; } @@ -11290,4 +11290,4 @@ SlowBuffer.prototype.writeDoubleBE = Buffer.prototype.writeDoubleBE; },{}]},{},["E/GbHF"]) ; JSHINT = require('jshint').JSHINT; -}()); \ No newline at end of file +}());