diff --git a/test/snapshots/consistent-function-scoping.js.md b/test/snapshots/consistent-function-scoping.js.md new file mode 100644 index 0000000000..33f8fd5fbd --- /dev/null +++ b/test/snapshots/consistent-function-scoping.js.md @@ -0,0 +1,101 @@ +# Snapshot report for `test/consistent-function-scoping.js` + +The actual snapshot is saved in `consistent-function-scoping.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## consistent-function-scoping - #1 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | function foo() {␊ + > 2 | function bar() {}␊ + | ^^^^^^^^^^^^ Move function 'bar' to the outer scope.␊ + 3 | }␊ + ` + +## consistent-function-scoping - #2 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | function foo() {␊ + > 2 | async function bar() {}␊ + | ^^^^^^^^^^^^^^^^^^ Move async function 'bar' to the outer scope.␊ + 3 | }␊ + ` + +## consistent-function-scoping - #3 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | function foo() {␊ + > 2 | function * bar() {}␊ + | ^^^^^^^^^^^^^^ Move generator function 'bar' to the outer scope.␊ + 3 | }␊ + ` + +## consistent-function-scoping - #4 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | function foo() {␊ + > 2 | async function * bar() {}␊ + | ^^^^^^^^^^^^^^^^^^^^ Move async generator function 'bar' to the outer scope.␊ + 3 | }␊ + ` + +## consistent-function-scoping - #5 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | function foo() {␊ + > 2 | const bar = () => {}␊ + | ^^ Move arrow function 'bar' to the outer scope.␊ + 3 | }␊ + ` + +## consistent-function-scoping - #6 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const doFoo = () => bar => bar;␊ + | ^^ Move arrow function to the outer scope.␊ + ` + +## consistent-function-scoping - #7 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | function foo() {␊ + > 2 | const bar = async () => {}␊ + | ^^ Move async arrow function 'bar' to the outer scope.␊ + 3 | }␊ + ` + +## consistent-function-scoping - #8 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | function doFoo() {␊ + > 2 | const doBar = function(bar) {␊ + | ^^^^^^^^ Move function to the outer scope.␊ + 3 | return bar;␊ + 4 | };␊ + 5 | }␊ + ` diff --git a/test/snapshots/consistent-function-scoping.js.snap b/test/snapshots/consistent-function-scoping.js.snap new file mode 100644 index 0000000000..ef9f640673 Binary files /dev/null and b/test/snapshots/consistent-function-scoping.js.snap differ diff --git a/test/snapshots/empty-brace-spaces.js.md b/test/snapshots/empty-brace-spaces.js.md new file mode 100644 index 0000000000..7673525330 --- /dev/null +++ b/test/snapshots/empty-brace-spaces.js.md @@ -0,0 +1,33 @@ +# Snapshot report for `test/empty-brace-spaces.js` + +The actual snapshot is saved in `empty-brace-spaces.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## empty-brace-spaces - #1 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | try {␊ + 2 | foo();␊ + 3 | } catch (error) {␊ + 4 | ␊ + 5 | }␊ + ␊ + Output:␊ + 1 | try {␊ + 2 | foo();␊ + 3 | } catch (error) {}␊ + ␊ + Error 1/1:␊ + 1 | try {␊ + 2 | foo();␊ + > 3 | } catch (error) {␊ + | ^␊ + > 4 | ␊ + | ^^^^^^^^␊ + > 5 | }␊ + | ^ Do not add spaces between braces.␊ + ` diff --git a/test/snapshots/empty-brace-spaces.js.snap b/test/snapshots/empty-brace-spaces.js.snap new file mode 100644 index 0000000000..13ed1185b6 Binary files /dev/null and b/test/snapshots/empty-brace-spaces.js.snap differ diff --git a/test/snapshots/error-message.js.md b/test/snapshots/error-message.js.md new file mode 100644 index 0000000000..30f4e649c0 --- /dev/null +++ b/test/snapshots/error-message.js.md @@ -0,0 +1,191 @@ +# Snapshot report for `test/error-message.js` + +The actual snapshot is saved in `error-message.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## error-message - #1 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error()␊ + | ^^^^^^^^^^^ Pass a message to the `Error` constructor.␊ + ` + +## error-message - #2 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw Error()␊ + | ^^^^^^^ Pass a message to the `Error` constructor.␊ + ` + +## error-message - #3 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error('')␊ + | ^^ Error message should not be an empty string.␊ + ` + +## error-message - #4 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error(``)␊ + | ^^ Error message should not be an empty string.␊ + ` + +## error-message - #5 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const err = new Error();␊ + | ^^^^^^^^^^^ Pass a message to the `Error` constructor.␊ + 2 | throw err;␊ + ` + +## error-message - #6 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | let err = 1;␊ + > 2 | err = new Error();␊ + | ^^^^^^^^^^^ Pass a message to the `Error` constructor.␊ + 3 | throw err;␊ + ` + +## error-message - #7 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | let err = new Error();␊ + | ^^^^^^^^^^^ Pass a message to the `Error` constructor.␊ + 2 | err = 1;␊ + 3 | throw err;␊ + ` + +## error-message - #8 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const foo = new TypeError()␊ + | ^^^^^^^^^^^^^^^ Pass a message to the `TypeError` constructor.␊ + ` + +## error-message - #9 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const foo = new SyntaxError()␊ + | ^^^^^^^^^^^^^^^^^ Pass a message to the `SyntaxError` constructor.␊ + ` + +## error-message - #10 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | const errorMessage = Object.freeze({errorMessage: 1}).errorMessage;␊ + > 2 | throw new Error(errorMessage)␊ + | ^^^^^^^^^^^^ Error message should be a string.␊ + ` + +## error-message - #11 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error([])␊ + | ^^ Error message should be a string.␊ + ` + +## error-message - #12 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error([foo])␊ + | ^^^^^ Error message should be a string.␊ + ` + +## error-message - #13 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error([0][0])␊ + | ^^^^^^ Error message should be a string.␊ + ` + +## error-message - #14 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error({})␊ + | ^^ Error message should be a string.␊ + ` + +## error-message - #15 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error({foo})␊ + | ^^^^^ Error message should be a string.␊ + ` + +## error-message - #16 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error({foo: 0}.foo)␊ + | ^^^^^^^^^^^^ Error message should be a string.␊ + ` + +## error-message - #17 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | throw new Error(lineNumber=2)␊ + | ^^^^^^^^^^^^ Error message should be a string.␊ + ` + +## error-message - #18 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const error = new RangeError;␊ + | ^^^^^^^^^^^^^^ Pass a message to the `RangeError` constructor.␊ + ` diff --git a/test/snapshots/error-message.js.snap b/test/snapshots/error-message.js.snap new file mode 100644 index 0000000000..17e4826499 Binary files /dev/null and b/test/snapshots/error-message.js.snap differ diff --git a/test/snapshots/no-console-spaces.js.md b/test/snapshots/no-console-spaces.js.md new file mode 100644 index 0000000000..9d50486a71 --- /dev/null +++ b/test/snapshots/no-console-spaces.js.md @@ -0,0 +1,226 @@ +# Snapshot report for `test/no-console-spaces.js` + +The actual snapshot is saved in `no-console-spaces.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-console-spaces - #1 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.log("abc", " def ", "ghi");␊ + ␊ + Output:␊ + 1 | console.log("abc", "def", "ghi");␊ + ␊ + Error 1/2:␊ + > 1 | console.log("abc", " def ", "ghi");␊ + | ^ Do not use leading space between `console.log` parameters.␊ + Error 2/2:␊ + > 1 | console.log("abc", " def ", "ghi");␊ + | ^ Do not use trailing space between `console.log` parameters.␊ + ` + +## no-console-spaces - #2 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.error(␊ + 2 | theme.error('✗'),␊ + 3 | 'Verifying "packaging" fixture\\n ',␊ + 4 | theme.error(errorMessage)␊ + 5 | );␊ + ␊ + Output:␊ + 1 | console.error(␊ + 2 | theme.error('✗'),␊ + 3 | 'Verifying "packaging" fixture\\n',␊ + 4 | theme.error(errorMessage)␊ + 5 | );␊ + ␊ + Error 1/1:␊ + 1 | console.error(␊ + 2 | theme.error('✗'),␊ + > 3 | 'Verifying "packaging" fixture\\n ',␊ + | ^ Do not use trailing space between `console.error` parameters.␊ + 4 | theme.error(errorMessage)␊ + 5 | );␊ + ` + +## no-console-spaces - #3 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.log(␊ + 2 | 'abc',␊ + 3 | 'def ',␊ + 4 | 'ghi'␊ + 5 | );␊ + ␊ + Output:␊ + 1 | console.log(␊ + 2 | 'abc',␊ + 3 | 'def',␊ + 4 | 'ghi'␊ + 5 | );␊ + ␊ + Error 1/1:␊ + 1 | console.log(␊ + 2 | 'abc',␊ + > 3 | 'def ',␊ + | ^ Do not use trailing space between `console.log` parameters.␊ + 4 | 'ghi'␊ + 5 | );␊ + ` + +## no-console-spaces - #4 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.log("_", " leading", "_")␊ + ␊ + Output:␊ + 1 | console.log("_", "leading", "_")␊ + ␊ + Error 1/1:␊ + > 1 | console.log("_", " leading", "_")␊ + | ^ Do not use leading space between `console.log` parameters.␊ + ` + +## no-console-spaces - #5 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.log("_", "trailing ", "_")␊ + ␊ + Output:␊ + 1 | console.log("_", "trailing", "_")␊ + ␊ + Error 1/1:␊ + > 1 | console.log("_", "trailing ", "_")␊ + | ^ Do not use trailing space between `console.log` parameters.␊ + ` + +## no-console-spaces - #6 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.log("_", " leading and trailing ", "_")␊ + ␊ + Output:␊ + 1 | console.log("_", "leading and trailing", "_")␊ + ␊ + Error 1/2:␊ + > 1 | console.log("_", " leading and trailing ", "_")␊ + | ^ Do not use leading space between `console.log` parameters.␊ + Error 2/2:␊ + > 1 | console.log("_", " leading and trailing ", "_")␊ + | ^ Do not use trailing space between `console.log` parameters.␊ + ` + +## no-console-spaces - #7 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.log("_", " log ", "_")␊ + ␊ + Output:␊ + 1 | console.log("_", "log", "_")␊ + ␊ + Error 1/2:␊ + > 1 | console.log("_", " log ", "_")␊ + | ^ Do not use leading space between `console.log` parameters.␊ + Error 2/2:␊ + > 1 | console.log("_", " log ", "_")␊ + | ^ Do not use trailing space between `console.log` parameters.␊ + ` + +## no-console-spaces - #8 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.debug("_", " debug ", "_")␊ + ␊ + Output:␊ + 1 | console.debug("_", "debug", "_")␊ + ␊ + Error 1/2:␊ + > 1 | console.debug("_", " debug ", "_")␊ + | ^ Do not use leading space between `console.debug` parameters.␊ + Error 2/2:␊ + > 1 | console.debug("_", " debug ", "_")␊ + | ^ Do not use trailing space between `console.debug` parameters.␊ + ` + +## no-console-spaces - #9 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.info("_", " info ", "_")␊ + ␊ + Output:␊ + 1 | console.info("_", "info", "_")␊ + ␊ + Error 1/2:␊ + > 1 | console.info("_", " info ", "_")␊ + | ^ Do not use leading space between `console.info` parameters.␊ + Error 2/2:␊ + > 1 | console.info("_", " info ", "_")␊ + | ^ Do not use trailing space between `console.info` parameters.␊ + ` + +## no-console-spaces - #10 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.warn("_", " warn ", "_")␊ + ␊ + Output:␊ + 1 | console.warn("_", "warn", "_")␊ + ␊ + Error 1/2:␊ + > 1 | console.warn("_", " warn ", "_")␊ + | ^ Do not use leading space between `console.warn` parameters.␊ + Error 2/2:␊ + > 1 | console.warn("_", " warn ", "_")␊ + | ^ Do not use trailing space between `console.warn` parameters.␊ + ` + +## no-console-spaces - #11 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | console.error("_", " error ", "_")␊ + ␊ + Output:␊ + 1 | console.error("_", "error", "_")␊ + ␊ + Error 1/2:␊ + > 1 | console.error("_", " error ", "_")␊ + | ^ Do not use leading space between `console.error` parameters.␊ + Error 2/2:␊ + > 1 | console.error("_", " error ", "_")␊ + | ^ Do not use trailing space between `console.error` parameters.␊ + ` diff --git a/test/snapshots/no-console-spaces.js.snap b/test/snapshots/no-console-spaces.js.snap new file mode 100644 index 0000000000..9952aedd00 Binary files /dev/null and b/test/snapshots/no-console-spaces.js.snap differ diff --git a/test/snapshots/no-for-loop.js.md b/test/snapshots/no-for-loop.js.md new file mode 100644 index 0000000000..13fcb9acbf --- /dev/null +++ b/test/snapshots/no-for-loop.js.md @@ -0,0 +1,162 @@ +# Snapshot report for `test/no-for-loop.js` + +The actual snapshot is saved in `no-for-loop.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-for-loop - #1 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | for (let i = 0; i < arr.length; i += 1) {␊ + 2 | console.log(arr[i])␊ + 3 | }␊ + ␊ + Output:␊ + 1 | for (const element of arr) {␊ + 2 | console.log(element)␊ + 3 | }␊ + ␊ + Error 1/1:␊ + > 1 | for (let i = 0; i < arr.length; i += 1) {␊ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a `for-of` loop instead of this `for` loop.␊ + 2 | console.log(arr[i])␊ + 3 | }␊ + ` + +## no-for-loop - #2 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | for (let i = 0; i < plugins.length; i++) {␊ + 2 | let plugin = plugins[i];␊ + 3 | plugin = calculateSomeNewValue();␊ + 4 | // ...␊ + 5 | }␊ + ␊ + Output:␊ + 1 | for (let plugin of plugins) {␊ + 2 | plugin = calculateSomeNewValue();␊ + 3 | // ...␊ + 4 | }␊ + ␊ + Error 1/1:␊ + > 1 | for (let i = 0; i < plugins.length; i++) {␊ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a `for-of` loop instead of this `for` loop.␊ + 2 | let plugin = plugins[i];␊ + 3 | plugin = calculateSomeNewValue();␊ + 4 | // ...␊ + 5 | }␊ + ` + +## no-for-loop - #3 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | for (␊ + 2 | let i = 0;␊ + 3 | i < array.length;␊ + 4 | i++␊ + 5 | )␊ + 6 | // comment (foo)␊ + 7 | {␊ + 8 | var foo = array[i];␊ + 9 | foo = bar();␊ + 10 | }␊ + ␊ + Output:␊ + 1 | for (␊ + 2 | var foo of array␊ + 3 | )␊ + 4 | // comment (foo)␊ + 5 | {␊ + 6 | foo = bar();␊ + 7 | }␊ + ␊ + Error 1/1:␊ + > 1 | for (␊ + | ^^^^^␊ + > 2 | let i = 0;␊ + | ^^^^^^^^^^^␊ + > 3 | i < array.length;␊ + | ^^^^^^^^^^^␊ + > 4 | i++␊ + | ^^^^^^^^^^^␊ + > 5 | )␊ + | ^^ Use a `for-of` loop instead of this `for` loop.␊ + 6 | // comment (foo)␊ + 7 | {␊ + 8 | var foo = array[i];␊ + 9 | foo = bar();␊ + 10 | }␊ + ` + +## no-for-loop - #4 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | for (let i = 0; i < array.length; i++) {␊ + 2 | let foo = array[i];␊ + 3 | }␊ + ␊ + Output:␊ + 1 | for (let foo of array) {␊ + 2 | }␊ + ␊ + Error 1/1:␊ + > 1 | for (let i = 0; i < array.length; i++) {␊ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a `for-of` loop instead of this `for` loop.␊ + 2 | let foo = array[i];␊ + 3 | }␊ + ` + +## no-for-loop - #5 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | for (let i = 0; i < array.length; i++) {␊ + 2 | const foo = array[i];␊ + 3 | }␊ + ␊ + Output:␊ + 1 | for (const foo of array) {␊ + 2 | }␊ + ␊ + Error 1/1:␊ + > 1 | for (let i = 0; i < array.length; i++) {␊ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a `for-of` loop instead of this `for` loop.␊ + 2 | const foo = array[i];␊ + 3 | }␊ + ` + +## no-for-loop - #6 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | for (let i = 0; i < array.length; i++) {␊ + 2 | var foo = array[i], bar = 1;␊ + 3 | }␊ + ␊ + Output:␊ + 1 | for (var foo of array) {␊ + 2 | var bar = 1;␊ + 3 | }␊ + ␊ + Error 1/1:␊ + > 1 | for (let i = 0; i < array.length; i++) {␊ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a `for-of` loop instead of this `for` loop.␊ + 2 | var foo = array[i], bar = 1;␊ + 3 | }␊ + ` diff --git a/test/snapshots/no-for-loop.js.snap b/test/snapshots/no-for-loop.js.snap new file mode 100644 index 0000000000..b3112c7711 Binary files /dev/null and b/test/snapshots/no-for-loop.js.snap differ diff --git a/test/snapshots/no-hex-escape.js.md b/test/snapshots/no-hex-escape.js.md new file mode 100644 index 0000000000..9a62f9d512 --- /dev/null +++ b/test/snapshots/no-hex-escape.js.md @@ -0,0 +1,21 @@ +# Snapshot report for `test/no-hex-escape.js` + +The actual snapshot is saved in `no-hex-escape.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-hex-escape - #1 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | const foo = "\\xb1"␊ + ␊ + Output:␊ + 1 | const foo = "\\u00b1"␊ + ␊ + Error 1/1:␊ + > 1 | const foo = "\\xb1"␊ + | ^^^^^^ Use Unicode escapes instead of hexadecimal escapes.␊ + ` diff --git a/test/snapshots/no-hex-escape.js.snap b/test/snapshots/no-hex-escape.js.snap new file mode 100644 index 0000000000..388c681025 Binary files /dev/null and b/test/snapshots/no-hex-escape.js.snap differ diff --git a/test/snapshots/no-instanceof-array.js.md b/test/snapshots/no-instanceof-array.js.md new file mode 100644 index 0000000000..c48666a737 --- /dev/null +++ b/test/snapshots/no-instanceof-array.js.md @@ -0,0 +1,21 @@ +# Snapshot report for `test/no-instanceof-array.js` + +The actual snapshot is saved in `no-instanceof-array.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-instanceof-array - #1 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (arr instanceof Array) {}␊ + ␊ + Output:␊ + 1 | if (Array.isArray(arr)) {}␊ + ␊ + Error 1/1:␊ + > 1 | if (arr instanceof Array) {}␊ + | ^^^^^^^^^^^^^^^^^^^^ Use `Array.isArray()` instead of `instanceof Array`.␊ + ` diff --git a/test/snapshots/no-instanceof-array.js.snap b/test/snapshots/no-instanceof-array.js.snap new file mode 100644 index 0000000000..fb1a903263 Binary files /dev/null and b/test/snapshots/no-instanceof-array.js.snap differ diff --git a/test/snapshots/no-lonely-if.js.md b/test/snapshots/no-lonely-if.js.md new file mode 100644 index 0000000000..6c5e4cce16 --- /dev/null +++ b/test/snapshots/no-lonely-if.js.md @@ -0,0 +1,477 @@ +# Snapshot report for `test/no-lonely-if.js` + +The actual snapshot is saved in `no-lonely-if.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-lonely-if - #1 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (a) {␊ + 2 | if (b) {␊ + 3 | }␊ + 4 | }␊ + ␊ + Output:␊ + 1 | if (a && b) {␊ + 2 | }␊ + ␊ + Error 1/1:␊ + 1 | if (a) {␊ + > 2 | if (b) {␊ + | ^^^^^^^^␊ + > 3 | }␊ + | ^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 4 | }␊ + ` + +## no-lonely-if - #2 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (a) if (b) {␊ + 2 | foo();␊ + 3 | }␊ + ␊ + Output:␊ + 1 | if (a && b) {␊ + 2 | foo();␊ + 3 | }␊ + ␊ + Error 1/1:␊ + > 1 | if (a) if (b) {␊ + | ^^^^^^^^␊ + > 2 | foo();␊ + | ^^^^^^^␊ + > 3 | }␊ + | ^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + ` + +## no-lonely-if - #3 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (a) {␊ + 2 | if (b) foo();␊ + 3 | }␊ + ␊ + Output:␊ + 1 | if (a && b) foo();␊ + ␊ + Error 1/1:␊ + 1 | if (a) {␊ + > 2 | if (b) foo();␊ + | ^^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 3 | }␊ + ` + +## no-lonely-if - #4 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (a) if (b) foo();␊ + ␊ + Output:␊ + 1 | if (a && b) foo();␊ + ␊ + Error 1/1:␊ + > 1 | if (a) if (b) foo();␊ + | ^^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + ` + +## no-lonely-if - #5 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (a) if (b);␊ + ␊ + Output:␊ + 1 | if (a && b) ;␊ + ␊ + Error 1/1:␊ + > 1 | if (a) if (b);␊ + | ^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + ` + +## no-lonely-if - #6 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (a) {␊ + 2 | if (b) {␊ + 3 | // Should not report␊ + 4 | }␊ + 5 | } else if (c) {␊ + 6 | if (d) {␊ + 7 | }␊ + 8 | }␊ + ␊ + Output:␊ + 1 | if (a) {␊ + 2 | if (b) {␊ + 3 | // Should not report␊ + 4 | }␊ + 5 | } else if (c && d) {␊ + 6 | }␊ + ␊ + Error 1/1:␊ + 1 | if (a) {␊ + 2 | if (b) {␊ + 3 | // Should not report␊ + 4 | }␊ + 5 | } else if (c) {␊ + > 6 | if (d) {␊ + | ^^^^^^^^␊ + > 7 | }␊ + | ^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 8 | }␊ + ` + +## no-lonely-if - #7 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | function * foo() {␊ + 2 | if (a || b)␊ + 3 | if (a ?? b)␊ + 4 | if (a ? b : c)␊ + 5 | if (a = b)␊ + 6 | if (a += b)␊ + 7 | if (a -= b)␊ + 8 | if (a &&= b)␊ + 9 | if (yield a)␊ + 10 | if (a, b);␊ + 11 | }␊ + ␊ + Output:␊ + 1 | function * foo() {␊ + 2 | if ((a || b) && (a ?? b) && (a ? b : c) && (a = b) && (a += b) && (a -= b) && (a &&= b) && (yield a) && (a, b))␊ + 3 | ;␊ + 4 | }␊ + ␊ + Error 1/8:␊ + 1 | function * foo() {␊ + 2 | if (a || b)␊ + > 3 | if (a ?? b)␊ + | ^^^^^^^^^^^␊ + > 4 | if (a ? b : c)␊ + | ^^^^^^^^^^^^^^^␊ + > 5 | if (a = b)␊ + | ^^^^^^^^^^^^^^^␊ + > 6 | if (a += b)␊ + | ^^^^^^^^^^^^^^^␊ + > 7 | if (a -= b)␊ + | ^^^^^^^^^^^^^^^␊ + > 8 | if (a &&= b)␊ + | ^^^^^^^^^^^^^^^␊ + > 9 | if (yield a)␊ + | ^^^^^^^^^^^^^^^␊ + > 10 | if (a, b);␊ + | ^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 11 | }␊ + Error 2/8:␊ + 1 | function * foo() {␊ + 2 | if (a || b)␊ + 3 | if (a ?? b)␊ + > 4 | if (a ? b : c)␊ + | ^^^^^^^^^^^^^^␊ + > 5 | if (a = b)␊ + | ^^^^^^^^^^^␊ + > 6 | if (a += b)␊ + | ^^^^^^^^^^^␊ + > 7 | if (a -= b)␊ + | ^^^^^^^^^^^␊ + > 8 | if (a &&= b)␊ + | ^^^^^^^^^^^␊ + > 9 | if (yield a)␊ + | ^^^^^^^^^^^␊ + > 10 | if (a, b);␊ + | ^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 11 | }␊ + Error 3/8:␊ + 1 | function * foo() {␊ + 2 | if (a || b)␊ + 3 | if (a ?? b)␊ + 4 | if (a ? b : c)␊ + > 5 | if (a = b)␊ + | ^^^^^^^^^^␊ + > 6 | if (a += b)␊ + | ^^^^^^^^^^^^␊ + > 7 | if (a -= b)␊ + | ^^^^^^^^^^^^␊ + > 8 | if (a &&= b)␊ + | ^^^^^^^^^^^^␊ + > 9 | if (yield a)␊ + | ^^^^^^^^^^^^␊ + > 10 | if (a, b);␊ + | ^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 11 | }␊ + Error 4/8:␊ + 1 | function * foo() {␊ + 2 | if (a || b)␊ + 3 | if (a ?? b)␊ + 4 | if (a ? b : c)␊ + 5 | if (a = b)␊ + > 6 | if (a += b)␊ + | ^^^^^^^^^^^␊ + > 7 | if (a -= b)␊ + | ^^^^^^^^^^^^␊ + > 8 | if (a &&= b)␊ + | ^^^^^^^^^^^^␊ + > 9 | if (yield a)␊ + | ^^^^^^^^^^^^␊ + > 10 | if (a, b);␊ + | ^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 11 | }␊ + Error 5/8:␊ + 1 | function * foo() {␊ + 2 | if (a || b)␊ + 3 | if (a ?? b)␊ + 4 | if (a ? b : c)␊ + 5 | if (a = b)␊ + 6 | if (a += b)␊ + > 7 | if (a -= b)␊ + | ^^^^^^^^^^^␊ + > 8 | if (a &&= b)␊ + | ^^^^^^^^^^^^^␊ + > 9 | if (yield a)␊ + | ^^^^^^^^^^^^^␊ + > 10 | if (a, b);␊ + | ^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 11 | }␊ + Error 6/8:␊ + 1 | function * foo() {␊ + 2 | if (a || b)␊ + 3 | if (a ?? b)␊ + 4 | if (a ? b : c)␊ + 5 | if (a = b)␊ + 6 | if (a += b)␊ + 7 | if (a -= b)␊ + > 8 | if (a &&= b)␊ + | ^^^^^^^^^^^^␊ + > 9 | if (yield a)␊ + | ^^^^^^^^^^^^^␊ + > 10 | if (a, b);␊ + | ^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 11 | }␊ + Error 7/8:␊ + 1 | function * foo() {␊ + 2 | if (a || b)␊ + 3 | if (a ?? b)␊ + 4 | if (a ? b : c)␊ + 5 | if (a = b)␊ + 6 | if (a += b)␊ + 7 | if (a -= b)␊ + 8 | if (a &&= b)␊ + > 9 | if (yield a)␊ + | ^^^^^^^^^^^^␊ + > 10 | if (a, b);␊ + | ^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 11 | }␊ + Error 8/8:␊ + 1 | function * foo() {␊ + 2 | if (a || b)␊ + 3 | if (a ?? b)␊ + 4 | if (a ? b : c)␊ + 5 | if (a = b)␊ + 6 | if (a += b)␊ + 7 | if (a -= b)␊ + 8 | if (a &&= b)␊ + 9 | if (yield a)␊ + > 10 | if (a, b);␊ + | ^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 11 | }␊ + ` + +## no-lonely-if - #8 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | async function foo() {␊ + 2 | if (a)␊ + 3 | if (await a)␊ + 4 | if (a.b)␊ + 5 | if (a && b);␊ + 6 | }␊ + ␊ + Output:␊ + 1 | async function foo() {␊ + 2 | if (a && await a && a.b && a && b)␊ + 3 | ;␊ + 4 | }␊ + ␊ + Error 1/3:␊ + 1 | async function foo() {␊ + 2 | if (a)␊ + > 3 | if (await a)␊ + | ^^^^^^^^^^^^␊ + > 4 | if (a.b)␊ + | ^^^^^^^^^␊ + > 5 | if (a && b);␊ + | ^^^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 6 | }␊ + Error 2/3:␊ + 1 | async function foo() {␊ + 2 | if (a)␊ + 3 | if (await a)␊ + > 4 | if (a.b)␊ + | ^^^^^^^^␊ + > 5 | if (a && b);␊ + | ^^^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 6 | }␊ + Error 3/3:␊ + 1 | async function foo() {␊ + 2 | if (a)␊ + 3 | if (await a)␊ + 4 | if (a.b)␊ + > 5 | if (a && b);␊ + | ^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 6 | }␊ + ` + +## no-lonely-if - #9 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (((a || b))) if (((c || d)));␊ + ␊ + Output:␊ + 1 | if ((((a || b) && (c || d)))) ;␊ + ␊ + Error 1/1:␊ + > 1 | if (((a || b))) if (((c || d)));␊ + | ^^^^^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + ` + +## no-lonely-if - #10 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if /* will keep */␊ + 2 | (␊ + 3 | /* will keep */␊ + 4 | a /* will keep */␊ + 5 | .b /* will keep */␊ + 6 | ) /* keep */{␊ + 7 | /* will remove */␊ + 8 | if (␊ + 9 | /* will remove */␊ + 10 | c /* will keep */␊ + 11 | .d /* will remove */␊ + 12 | ) {␊ + 13 | /* will keep */␊ + 14 | foo();␊ + 15 | /* will keep */␊ + 16 | }␊ + 17 | /* will remove */␊ + 18 | }␊ + ␊ + Output:␊ + 1 | if /* will keep */␊ + 2 | (␊ + 3 | /* will keep */␊ + 4 | a /* will keep */␊ + 5 | .b && c /* will keep */␊ + 6 | .d /* will keep */␊ + 7 | ) /* keep */{␊ + 8 | /* will keep */␊ + 9 | foo();␊ + 10 | /* will keep */␊ + 11 | }␊ + ␊ + Error 1/1:␊ + 1 | if /* will keep */␊ + 2 | (␊ + 3 | /* will keep */␊ + 4 | a /* will keep */␊ + 5 | .b /* will keep */␊ + 6 | ) /* keep */{␊ + 7 | /* will remove */␊ + > 8 | if (␊ + | ^^^^␊ + > 9 | /* will remove */␊ + | ^^^^^^^^^^^^^^^^^^^␊ + > 10 | c /* will keep */␊ + | ^^^^^^^^^^^^^^^^^^^␊ + > 11 | .d /* will remove */␊ + | ^^^^^^^^^^^^^^^^^^^␊ + > 12 | ) {␊ + | ^^^^^^^^^^^^^^^^^^^␊ + > 13 | /* will keep */␊ + | ^^^^^^^^^^^^^^^^^^^␊ + > 14 | foo();␊ + | ^^^^^^^^^^^^^^^^^^^␊ + > 15 | /* will keep */␊ + | ^^^^^^^^^^^^^^^^^^^␊ + > 16 | }␊ + | ^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 17 | /* will remove */␊ + 18 | }␊ + ` + +## no-lonely-if - #11 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (a) {␊ + 2 | if (b) foo()␊ + 3 | }␊ + 4 | [].forEach(bar)␊ + ␊ + Output:␊ + 1 | if (a && b) foo();␊ + 2 | [].forEach(bar)␊ + ␊ + Error 1/1:␊ + 1 | if (a) {␊ + > 2 | if (b) foo()␊ + | ^^^^^^^^^^^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + 3 | }␊ + 4 | [].forEach(bar)␊ + ` + +## no-lonely-if - #12 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | if (a)␊ + 2 | if (b) foo()␊ + 3 | ;[].forEach(bar)␊ + ␊ + Output:␊ + 1 | if (a && b)␊ + 2 | foo()␊ + 3 | ;[].forEach(bar)␊ + ␊ + Error 1/1:␊ + 1 | if (a)␊ + > 2 | if (b) foo()␊ + | ^^^^^^^^^^^^␊ + > 3 | ;[].forEach(bar)␊ + | ^^ Unexpected `if` as the only statement in a `if` block without `else`.␊ + ` diff --git a/test/snapshots/no-lonely-if.js.snap b/test/snapshots/no-lonely-if.js.snap new file mode 100644 index 0000000000..b95c2cff47 Binary files /dev/null and b/test/snapshots/no-lonely-if.js.snap differ diff --git a/test/snapshots/no-new-buffer.js.md b/test/snapshots/no-new-buffer.js.md new file mode 100644 index 0000000000..46eae886a1 --- /dev/null +++ b/test/snapshots/no-new-buffer.js.md @@ -0,0 +1,37 @@ +# Snapshot report for `test/no-new-buffer.js` + +The actual snapshot is saved in `no-new-buffer.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-new-buffer - #1 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | const buf = new Buffer()␊ + ␊ + Output:␊ + 1 | const buf = Buffer.from()␊ + ␊ + Error 1/1:␊ + > 1 | const buf = new Buffer()␊ + | ^^^^^^^^^^^^ `new Buffer()` is deprecated, use `Buffer.from()` instead.␊ + ` + +## no-new-buffer - #2 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | const buf = new Buffer([0x62, 0x75, 0x66, 0x66, 0x65, 0x72])␊ + ␊ + Output:␊ + 1 | const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72])␊ + ␊ + Error 1/1:␊ + > 1 | const buf = new Buffer([0x62, 0x75, 0x66, 0x66, 0x65, 0x72])␊ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `new Buffer()` is deprecated, use `Buffer.from()` instead.␊ + ` diff --git a/test/snapshots/no-new-buffer.js.snap b/test/snapshots/no-new-buffer.js.snap new file mode 100644 index 0000000000..39500f26ec Binary files /dev/null and b/test/snapshots/no-new-buffer.js.snap differ diff --git a/test/snapshots/no-object-as-default-parameter.js.md b/test/snapshots/no-object-as-default-parameter.js.md new file mode 100644 index 0000000000..34c2b3ce07 --- /dev/null +++ b/test/snapshots/no-object-as-default-parameter.js.md @@ -0,0 +1,25 @@ +# Snapshot report for `test/no-object-as-default-parameter.js` + +The actual snapshot is saved in `no-object-as-default-parameter.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-object-as-default-parameter - #1 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | function abc(foo = {a: 123}) {}␊ + | ^^^ Do not use an object literal as default for parameter `foo`.␊ + ` + +## no-object-as-default-parameter - #2 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const abc = (foo = {a: false}) => {};␊ + | ^^^ Do not use an object literal as default for parameter `foo`.␊ + ` diff --git a/test/snapshots/no-object-as-default-parameter.js.snap b/test/snapshots/no-object-as-default-parameter.js.snap new file mode 100644 index 0000000000..a8faa52f15 Binary files /dev/null and b/test/snapshots/no-object-as-default-parameter.js.snap differ diff --git a/test/snapshots/no-process-exit.js.md b/test/snapshots/no-process-exit.js.md new file mode 100644 index 0000000000..0aec16a5b2 --- /dev/null +++ b/test/snapshots/no-process-exit.js.md @@ -0,0 +1,15 @@ +# Snapshot report for `test/no-process-exit.js` + +The actual snapshot is saved in `no-process-exit.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-process-exit - #1 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | process.exit(1);␊ + | ^^^^^^^^^^^^^^^ Only use `process.exit()` in CLI apps. Throw an error instead.␊ + ` diff --git a/test/snapshots/no-process-exit.js.snap b/test/snapshots/no-process-exit.js.snap new file mode 100644 index 0000000000..5fcaacf532 Binary files /dev/null and b/test/snapshots/no-process-exit.js.snap differ diff --git a/test/snapshots/no-unreadable-array-destructuring.js.md b/test/snapshots/no-unreadable-array-destructuring.js.md new file mode 100644 index 0000000000..4df427f049 --- /dev/null +++ b/test/snapshots/no-unreadable-array-destructuring.js.md @@ -0,0 +1,125 @@ +# Snapshot report for `test/no-unreadable-array-destructuring.js` + +The actual snapshot is saved in `no-unreadable-array-destructuring.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-unreadable-array-destructuring - #1 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const [,, foo] = parts;␊ + | ^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #2 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const [foo,,, bar] = parts;␊ + | ^^^^^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #3 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const [foo,,,] = parts;␊ + | ^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #4 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const [foo, bar,, baz ,,, qux] = parts;␊ + | ^^^^^^^^^^^^^^^^^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #5 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | [,, foo] = bar;␊ + | ^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #6 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | ({parts: [,, foo]} = bar);␊ + | ^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #7 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | function foo([,, bar]) {}␊ + | ^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #8 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | function foo([bar,,, baz]) {}␊ + | ^^^^^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #9 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | function foo([bar,,,]) {}␊ + | ^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #10 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | function foo([bar, baz,, qux ,,, quux]) {}␊ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #11 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const [,,...rest] = parts;␊ + | ^^^^^^^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` + +## no-unreadable-array-destructuring - #12 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const [,,,] = parts;␊ + | ^^^^^ Array destructuring may not contain consecutive ignored values.␊ + ` diff --git a/test/snapshots/no-unreadable-array-destructuring.js.snap b/test/snapshots/no-unreadable-array-destructuring.js.snap new file mode 100644 index 0000000000..0aef7d7ed4 Binary files /dev/null and b/test/snapshots/no-unreadable-array-destructuring.js.snap differ diff --git a/test/snapshots/no-unsafe-regex.js.md b/test/snapshots/no-unsafe-regex.js.md new file mode 100644 index 0000000000..df00483a17 --- /dev/null +++ b/test/snapshots/no-unsafe-regex.js.md @@ -0,0 +1,15 @@ +# Snapshot report for `test/no-unsafe-regex.js` + +The actual snapshot is saved in `no-unsafe-regex.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-unsafe-regex - #1 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + > 1 | const foo = /(x+x+)+y/g␊ + | ^^^^^^^^^^^ Unsafe regular expression.␊ + ` diff --git a/test/snapshots/no-unsafe-regex.js.snap b/test/snapshots/no-unsafe-regex.js.snap new file mode 100644 index 0000000000..b288cb42b6 Binary files /dev/null and b/test/snapshots/no-unsafe-regex.js.snap differ diff --git a/test/snapshots/no-unused-properties.js.md b/test/snapshots/no-unused-properties.js.md new file mode 100644 index 0000000000..91244aab09 --- /dev/null +++ b/test/snapshots/no-unused-properties.js.md @@ -0,0 +1,21 @@ +# Snapshot report for `test/no-unused-properties.js` + +The actual snapshot is saved in `no-unused-properties.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-unused-properties - #1 + +> Snapshot 1 + + `␊ + Error 1/1:␊ + 1 | function foo() {␊ + 2 | const bar = {␊ + 3 | b: 2,␊ + > 4 | u: 3␊ + | ^^^^ Property `u` is defined but never used.␊ + 5 | };␊ + 6 | console.log(bar.b);␊ + 7 | }␊ + ` diff --git a/test/snapshots/no-unused-properties.js.snap b/test/snapshots/no-unused-properties.js.snap new file mode 100644 index 0000000000..b8bd496e7c Binary files /dev/null and b/test/snapshots/no-unused-properties.js.snap differ diff --git a/test/snapshots/no-useless-undefined.js.md b/test/snapshots/no-useless-undefined.js.md new file mode 100644 index 0000000000..a287c9ee5d --- /dev/null +++ b/test/snapshots/no-useless-undefined.js.md @@ -0,0 +1,89 @@ +# Snapshot report for `test/no-useless-undefined.js` + +The actual snapshot is saved in `no-useless-undefined.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-useless-undefined - #1 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | foo(␊ + 2 | undefined,␊ + 3 | bar,␊ + 4 | undefined,␊ + 5 | undefined,␊ + 6 | undefined,␊ + 7 | undefined,␊ + 8 | )␊ + ␊ + Output:␊ + 1 | foo(␊ + 2 | undefined,␊ + 3 | bar,␊ + 4 | )␊ + ␊ + Error 1/1:␊ + 1 | foo(␊ + 2 | undefined,␊ + 3 | bar,␊ + > 4 | undefined,␊ + | ^^^^^^^^^^␊ + > 5 | undefined,␊ + | ^^^^^^^^^^^␊ + > 6 | undefined,␊ + | ^^^^^^^^^^^␊ + > 7 | undefined,␊ + | ^^^^^^^^^^^ Do not use useless `undefined`.␊ + 8 | )␊ + ` + +## no-useless-undefined - #2 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | function foo([bar = undefined] = []) {}␊ + ␊ + Output:␊ + 1 | function foo([bar] = []) {}␊ + ␊ + Error 1/1:␊ + > 1 | function foo([bar = undefined] = []) {}␊ + | ^^^^^^^^^ Do not use useless `undefined`.␊ + ` + +## no-useless-undefined - #3 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | foo(bar, undefined, undefined);␊ + ␊ + Output:␊ + 1 | foo(bar);␊ + ␊ + Error 1/1:␊ + > 1 | foo(bar, undefined, undefined);␊ + | ^^^^^^^^^^^^^^^^^^^^ Do not use useless `undefined`.␊ + ` + +## no-useless-undefined - #4 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | let a = undefined, b = 2;␊ + ␊ + Output:␊ + 1 | let a, b = 2;␊ + ␊ + Error 1/1:␊ + > 1 | let a = undefined, b = 2;␊ + | ^^^^^^^^^ Do not use useless `undefined`.␊ + ` diff --git a/test/snapshots/no-useless-undefined.js.snap b/test/snapshots/no-useless-undefined.js.snap new file mode 100644 index 0000000000..6cffbb7350 Binary files /dev/null and b/test/snapshots/no-useless-undefined.js.snap differ diff --git a/test/snapshots/no-zero-fractions.js.md b/test/snapshots/no-zero-fractions.js.md new file mode 100644 index 0000000000..7573b6b3b3 --- /dev/null +++ b/test/snapshots/no-zero-fractions.js.md @@ -0,0 +1,37 @@ +# Snapshot report for `test/no-zero-fractions.js` + +The actual snapshot is saved in `no-zero-fractions.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## no-zero-fractions - #1 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | const foo = 1.0␊ + ␊ + Output:␊ + 1 | const foo = 1␊ + ␊ + Error 1/1:␊ + > 1 | const foo = 1.0␊ + | ^^^ Don't use a zero fraction in the number.␊ + ` + +## no-zero-fractions - #2 + +> Snapshot 1 + + `␊ + Input:␊ + 1 | const foo = (1.).toString()␊ + ␊ + Output:␊ + 1 | const foo = (1).toString()␊ + ␊ + Error 1/1:␊ + > 1 | const foo = (1.).toString()␊ + | ^^ Don't use a dangling dot in the number.␊ + ` diff --git a/test/snapshots/no-zero-fractions.js.snap b/test/snapshots/no-zero-fractions.js.snap new file mode 100644 index 0000000000..be4a950d34 Binary files /dev/null and b/test/snapshots/no-zero-fractions.js.snap differ