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

test: cleanup typos #15937

Merged
merged 1 commit into from May 30, 2022
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
2 changes: 1 addition & 1 deletion tests/lib/cli-engine/cli-engine.js
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/eslint/eslint.js
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/linter/apply-disable-directives.js
Expand Up @@ -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" }]
}),
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/linter/code-path-analysis/code-path.js
Expand Up @@ -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/
*
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/linter/config-comment-parser.js
Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions tests/lib/linter/linter.js
Expand Up @@ -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",
Expand Down Expand Up @@ -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 */",
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also okay, it doesn't look like this test was intended to have a trailing space here, so it's better to remove it to avoid confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that was just an EditorConfig change rather than an intentional one on my part

*/
alert("buzz");
`;
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/linter/node-event-generator.js
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/array-bracket-newline.js
Expand Up @@ -440,7 +440,7 @@ ruleTester.run("array-bracket-newline", rule, {

invalid: [

// default : { mutliline : true}
// default : { multiline : true}
{
code: `var foo = [
[1,2]
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/rules/arrow-parens.js
Expand Up @@ -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"
Expand All @@ -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 }
Expand All @@ -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;",
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/rules/camelcase.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
24 changes: 12 additions & 12 deletions tests/lib/rules/max-lines-per-function.js
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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],
Expand All @@ -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],
Expand All @@ -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],
Expand All @@ -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],
Expand Down Expand Up @@ -369,7 +369,7 @@ if ( x === y ) {
]
},

// Test regular methods are recognised
// Test regular methods are recognized
{
code: `class foo {
method() {
Expand All @@ -384,7 +384,7 @@ if ( x === y ) {
]
},

// Test static methods are recognised
// Test static methods are recognized
{
code: `class A {
static
Expand All @@ -399,7 +399,7 @@ if ( x === y ) {
]
},

// Test getters are recognised as properties
// Test getters are recognized as properties
{
code: `var obj = {
get
Expand All @@ -414,7 +414,7 @@ if ( x === y ) {
]
},

// Test setters are recognised as properties
// Test setters are recognized as properties
{
code: `var obj = {
set
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-constant-binary-expression.js
Expand Up @@ -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.
"<p /> && foo",
"<></> && foo",
"<p /> ?? foo",
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-constant-condition.js
Expand Up @@ -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" }] },

Expand Down
2 changes: 1 addition & 1 deletion 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
*/

Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-multi-assign.js
Expand Up @@ -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;",
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/rules/no-redeclare.js
Expand Up @@ -105,8 +105,8 @@ ruleTester.run("no-redeclare", rule, {
options: [{ builtinGlobals: true }],
env: { browser: false }
},
{ code: "var glovalThis = foo", options: [{ builtinGlobals: true }], env: { es6: true } },
{ code: "var glovalThis = foo", options: [{ builtinGlobals: true }], env: { es2017: true } },
{ code: "var globalThis = foo", options: [{ builtinGlobals: true }], env: { es6: true } },
nschonni marked this conversation as resolved.
Show resolved Hide resolved
{ code: "var globalThis = foo", options: [{ builtinGlobals: true }], env: { es2017: true } },

// Comments and built-ins.
{
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-restricted-exports.js
Expand Up @@ -401,7 +401,7 @@ ruleTester.run("no-restricted-exports", rule, {

// Note: duplicate identifiers in the same export declaration are a 'duplicate export' syntax error. Example: export var a, a;

// invalid and valid or multiple ivalid in the same declaration
// invalid and valid or multiple invalid in the same declaration
{
code: "export var a, b;",
options: [{ restrictedNamedExports: ["a"] }],
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/rules/padding-line-between-statements.js
Expand Up @@ -2729,7 +2729,7 @@ ruleTester.run("padding-line-between-statements", rule, {
parserOptions: { ecmaVersion: 2022 }
},
{
code: "class C { static { 'use strict'; let x; } }", // 'use strict'; is "espression", because class static blocks don't have directives
code: "class C { static { 'use strict'; let x; } }", // 'use strict'; is "expression", because class static blocks don't have directives
nschonni marked this conversation as resolved.
Show resolved Hide resolved
options: [
{ blankLine: "always", prev: "directive", next: "let" }
],
Expand Down Expand Up @@ -5188,7 +5188,7 @@ ruleTester.run("padding-line-between-statements", rule, {
errors: [{ messageId: "expectedBlankLine" }]
},
{
code: "class C { static { 'use strict'; let x; } }", // 'use strict'; is "espression", because class static blocks don't have directives
code: "class C { static { 'use strict'; let x; } }", // 'use strict'; is "expression", because class static blocks don't have directives
output: "class C { static { 'use strict';\n\n let x; } }",
options: [
{ blankLine: "always", prev: "expression", next: "let" }
Expand Down
2 changes: 1 addition & 1 deletion 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";
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/utils/fix-tracker.js
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/rules/wrap-iife.js
Expand Up @@ -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]
},
Expand Down Expand Up @@ -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]
},
Expand Down