From 41d5f1446af1136409929ecd0e4fb84322acc9e3 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 23 Dec 2020 15:42:14 +0800 Subject: [PATCH] Fix tests --- index.js | 11 +- readme.md | 2 +- .../consistent-function-scoping.js.md | 101 ---- .../consistent-function-scoping.js.snap | Bin 534 -> 0 bytes test/snapshots/empty-brace-spaces.js.md | 33 -- test/snapshots/empty-brace-spaces.js.snap | Bin 232 -> 0 bytes test/snapshots/error-message.js.md | 191 ------- test/snapshots/error-message.js.snap | Bin 919 -> 0 bytes test/snapshots/no-console-spaces.js.md | 226 --------- test/snapshots/no-console-spaces.js.snap | Bin 937 -> 0 bytes test/snapshots/no-for-loop.js.md | 162 ------ test/snapshots/no-for-loop.js.snap | Bin 720 -> 0 bytes test/snapshots/no-hex-escape.js.md | 21 - test/snapshots/no-hex-escape.js.snap | Bin 208 -> 0 bytes test/snapshots/no-instanceof-array.js.md | 21 - test/snapshots/no-instanceof-array.js.snap | Bin 203 -> 0 bytes test/snapshots/no-lonely-if.js.md | 477 ------------------ test/snapshots/no-lonely-if.js.snap | Bin 1467 -> 0 bytes test/snapshots/no-nested-ternary.js.md | 78 --- test/snapshots/no-nested-ternary.js.snap | Bin 483 -> 0 bytes test/snapshots/no-new-buffer.js.md | 37 -- test/snapshots/no-new-buffer.js.snap | Bin 279 -> 0 bytes .../no-object-as-default-parameter.js.md | 25 - .../no-object-as-default-parameter.js.snap | Bin 268 -> 0 bytes test/snapshots/no-process-exit.js.md | 15 - test/snapshots/no-process-exit.js.snap | Bin 186 -> 0 bytes .../no-unreadable-array-destructuring.js.md | 125 ----- .../no-unreadable-array-destructuring.js.snap | Bin 643 -> 0 bytes test/snapshots/no-unsafe-regex.js.md | 15 - test/snapshots/no-unsafe-regex.js.snap | Bin 172 -> 0 bytes test/snapshots/no-unused-properties.js.md | 21 - test/snapshots/no-unused-properties.js.snap | Bin 244 -> 0 bytes test/snapshots/no-useless-undefined.js.md | 89 ---- test/snapshots/no-useless-undefined.js.snap | Bin 419 -> 0 bytes test/snapshots/no-zero-fractions.js.md | 37 -- test/snapshots/no-zero-fractions.js.snap | Bin 269 -> 0 bytes ...-map.js.md => prefer-array-flat-map.js.md} | 12 +- test/snapshots/prefer-array-flat-map.js.snap | Bin 0 -> 396 bytes test/snapshots/prefer-dataset.js.snap | Bin 257 -> 0 bytes test/snapshots/prefer-flat-map.js.snap | Bin 396 -> 0 bytes ...ataset.js.md => prefer-node-dataset.js.md} | 6 +- test/snapshots/prefer-node-dataset.js.snap | Bin 0 -> 257 bytes test/snapshots/prefer-replace-all.js.snap | Bin 234 -> 0 bytes ....js.md => prefer-string-replace-all.js.md} | 8 +- .../prefer-string-replace-all.js.snap | Bin 0 -> 234 bytes ....md => prefer-string-trim-start-end.js.md} | 8 +- .../prefer-string-trim-start-end.js.snap | Bin 0 -> 304 bytes test/snapshots/prefer-trim-start-end.js.snap | Bin 303 -> 0 bytes 48 files changed, 26 insertions(+), 1695 deletions(-) delete mode 100644 test/snapshots/consistent-function-scoping.js.md delete mode 100644 test/snapshots/consistent-function-scoping.js.snap delete mode 100644 test/snapshots/empty-brace-spaces.js.md delete mode 100644 test/snapshots/empty-brace-spaces.js.snap delete mode 100644 test/snapshots/error-message.js.md delete mode 100644 test/snapshots/error-message.js.snap delete mode 100644 test/snapshots/no-console-spaces.js.md delete mode 100644 test/snapshots/no-console-spaces.js.snap delete mode 100644 test/snapshots/no-for-loop.js.md delete mode 100644 test/snapshots/no-for-loop.js.snap delete mode 100644 test/snapshots/no-hex-escape.js.md delete mode 100644 test/snapshots/no-hex-escape.js.snap delete mode 100644 test/snapshots/no-instanceof-array.js.md delete mode 100644 test/snapshots/no-instanceof-array.js.snap delete mode 100644 test/snapshots/no-lonely-if.js.md delete mode 100644 test/snapshots/no-lonely-if.js.snap delete mode 100644 test/snapshots/no-nested-ternary.js.md delete mode 100644 test/snapshots/no-nested-ternary.js.snap delete mode 100644 test/snapshots/no-new-buffer.js.md delete mode 100644 test/snapshots/no-new-buffer.js.snap delete mode 100644 test/snapshots/no-object-as-default-parameter.js.md delete mode 100644 test/snapshots/no-object-as-default-parameter.js.snap delete mode 100644 test/snapshots/no-process-exit.js.md delete mode 100644 test/snapshots/no-process-exit.js.snap delete mode 100644 test/snapshots/no-unreadable-array-destructuring.js.md delete mode 100644 test/snapshots/no-unreadable-array-destructuring.js.snap delete mode 100644 test/snapshots/no-unsafe-regex.js.md delete mode 100644 test/snapshots/no-unsafe-regex.js.snap delete mode 100644 test/snapshots/no-unused-properties.js.md delete mode 100644 test/snapshots/no-unused-properties.js.snap delete mode 100644 test/snapshots/no-useless-undefined.js.md delete mode 100644 test/snapshots/no-useless-undefined.js.snap delete mode 100644 test/snapshots/no-zero-fractions.js.md delete mode 100644 test/snapshots/no-zero-fractions.js.snap rename test/snapshots/{prefer-flat-map.js.md => prefer-array-flat-map.js.md} (86%) create mode 100644 test/snapshots/prefer-array-flat-map.js.snap delete mode 100644 test/snapshots/prefer-dataset.js.snap delete mode 100644 test/snapshots/prefer-flat-map.js.snap rename test/snapshots/{prefer-dataset.js.md => prefer-node-dataset.js.md} (80%) create mode 100644 test/snapshots/prefer-node-dataset.js.snap delete mode 100644 test/snapshots/prefer-replace-all.js.snap rename test/snapshots/{prefer-replace-all.js.md => prefer-string-replace-all.js.md} (76%) create mode 100644 test/snapshots/prefer-string-replace-all.js.snap rename test/snapshots/{prefer-trim-start-end.js.md => prefer-string-trim-start-end.js.md} (80%) create mode 100644 test/snapshots/prefer-string-trim-start-end.js.snap delete mode 100644 test/snapshots/prefer-trim-start-end.js.snap diff --git a/index.js b/index.js index 484a22a681..c6eae08eec 100644 --- a/index.js +++ b/index.js @@ -5,11 +5,16 @@ const createDeprecatedRules = require('./rules/utils/create-deprecated-rules'); const deprecatedRules = createDeprecatedRules({ // {ruleId: ReplacementRuleId | ReplacementRuleId[]}, if no replacement, use `{ruleId: []}` + 'no-array-instanceof': 'unicorn/no-instanceof-array', 'no-fn-reference-in-iterator': 'unicorn/no-array-callback-reference', 'no-reduce': 'unicorn/no-array-reduce', 'prefer-exponentiation-operator': 'prefer-exponentiation-operator', 'prefer-dataset': 'unicorn/prefer-node-dataset', 'prefer-flat-map': 'unicorn/prefer-array-flat-map', + 'prefer-replace-all': 'unicorn/prefer-string-replace-all', + 'prefer-starts-ends-with': 'unicorn/prefer-string-starts-ends-with', + 'prefer-text-content': 'unicorn/prefer-node-text-content', + 'prefer-trim-start-end': 'unicorn/prefer-string-trim-start-end', 'regex-shorthand': 'unicorn/better-regex' }); @@ -70,7 +75,7 @@ module.exports = { 'unicorn/prefer-add-event-listener': 'error', 'unicorn/prefer-array-find': 'error', // TODO: Enable this by default when targeting Node.js 12. - 'unicorn/prefer-flat-map': 'off', + 'unicorn/prefer-array-flat-map': 'off', 'unicorn/prefer-date-now': 'error', 'unicorn/prefer-default-parameters': 'error', 'unicorn/prefer-event-key': 'error', @@ -89,9 +94,9 @@ module.exports = { 'unicorn/prefer-set-has': 'error', 'unicorn/prefer-spread': 'error', // TODO: Enable this by default when targeting Node.js 16. - 'unicorn/prefer-starts-replace-all': 'off', - 'unicorn/prefer-starts-starts-ends-with': 'error', + 'unicorn/prefer-string-replace-all': 'off', 'unicorn/prefer-string-slice': 'error', + 'unicorn/prefer-string-starts-ends-with': 'error', 'unicorn/prefer-string-trim-start-end': 'error', 'unicorn/prefer-ternary': 'error', 'unicorn/prefer-type-error': 'error', diff --git a/readme.md b/readme.md index 5fdb1961fe..0531b5e9b0 100644 --- a/readme.md +++ b/readme.md @@ -89,8 +89,8 @@ Configure it in `package.json`. "unicorn/prefer-set-has": "error", "unicorn/prefer-spread": "error", "unicorn/prefer-string-replace-all": "off", - "unicorn/prefer-string-starts-ends-with": "error", "unicorn/prefer-string-slice": "error", + "unicorn/prefer-string-starts-ends-with": "error", "unicorn/prefer-string-trim-start-end": "error", "unicorn/prefer-ternary": "off", "unicorn/prefer-type-error": "error", diff --git a/test/snapshots/consistent-function-scoping.js.md b/test/snapshots/consistent-function-scoping.js.md deleted file mode 100644 index 33f8fd5fbd..0000000000 --- a/test/snapshots/consistent-function-scoping.js.md +++ /dev/null @@ -1,101 +0,0 @@ -# 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 deleted file mode 100644 index ef9f64067322188b2f102650e1651242e62f09ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 534 zcmV+x0_puhRzVH;`T!L~ zJ&nKi;81e*7MIBjwI8oEVFZg_1>z#PeZu;hr+(Hci>|MCUD(YC5oKavXgszQj9}4x76yhdwzV1OCUnkTUvyFZzGM?n1|%xL%D}+Pzz+5SBP)X-Qy&ADYf({t zk%FPVp%s^cf}uio{l?n49_an7M(q#`>G5=#V}h~`kR7RsF4Ku!k1m-Zk| zBiA__@Hq#Z&M?C-CEp1gf-rR&Kr2Ctum&LxXX17sCudP=Noi3YEJ2%q#A-n-Q%vVi YB0onH&d(^b diff --git a/test/snapshots/empty-brace-spaces.js.md b/test/snapshots/empty-brace-spaces.js.md deleted file mode 100644 index 7673525330..0000000000 --- a/test/snapshots/empty-brace-spaces.js.md +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 13ed1185b64ba36be9b46bf384c1be33ad7ada4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232 zcmV3dxBj$r%b7sYONkMVeq$CLmP`5CG(wf|PM_ z`InZEXChFqD~PFJsBef*yB$skDFDSWKpap5noB|I;-CO13voD9SivP 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 deleted file mode 100644 index 17e4826499edb71d95115733a8e81db08e8e0b6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 919 zcmV;I18Dp~RzVW=K^(;r%`2PV40zoqnYvqVPX3Y3EZBh1-yqLJV>lneJ;y?vP zbM$YW&p*V+6qEV!^{F+Hj9}3oAa-%w&L`nE^TDG%+Fhk(VVfAiqH;_O3_*q~19g?< z&+h)jIlW-R5-mos=xQKNG1r~GVgE0F{cSI2OugS?zz7!gVrF2-nZIM9*pZpK$ICSI z!Z&MVU+tIV9~oky!#7FVzW~~%irl8OjqTz zbr`{-6&wr|65iFX; z$-uzOzz&W@Mpgzv#!@cVqN4mF1w(y9D=s?)LxmcJl8mDKa)rFqas{xIMs-?#zLkPO ztsaop&s7L25uW;|z#YurMSjf)ex6Q^D%2v06@CI3P^H7Yy};VAQp)5XIxUPjmKpzwv<3dz@u1}L)ee%>bU)f-EVpMC1C&MDWv8W zlvHBRko!?moC11=^o1H}tKgrMm6}|lmsXUTT9v9%jVx=WU|6fEhb&?Z^n?)>PavzI zK{?BqNJIj~lR8PYj)?q#HJ#8ptt2GSB(31C#fT`MC@i6H6iG}ySkf<|#59B@L;?;Z t+iCbpOCl0uG@e3>)Wk?cGbblAFV(L!Hz~Eq)`&{k4*+^DOOiwj0011~x5WSe diff --git a/test/snapshots/no-console-spaces.js.md b/test/snapshots/no-console-spaces.js.md deleted file mode 100644 index 9d50486a71..0000000000 --- a/test/snapshots/no-console-spaces.js.md +++ /dev/null @@ -1,226 +0,0 @@ -# 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 deleted file mode 100644 index 9952aedd00eafdb4944e8e07439a0d50c4b2d63a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 937 zcmV;a16KS&RzV=IBfCBO#khX9-^dE}|00000000A1 zVPs(7W?+-vzub3*;GRnUXZhm8nCvD{TA-Yn5Z*3MMSac>c z1B1$(_T}rdxNYmWiz=qG`0r%|i)ynnFnD_Fo&T2lGx6f#pUFEnYdJH5MfKSj7?yuj zI@sqLvrh3{?gD+yqca)7qFdM*7*=m><^2`%^@7q`LB60)QF}(Ps0$|p!v@)@FRvfD z<@?4b;S4mkOdKR52 zvhHpLcReFmbRjPT!orU@`GFf*`&!-J8PL6Av^iOVyuptQt_OF_XQe*NI z)Imy3&`kl8zNy8hmcv~&$=j&TKvD;VkPay%tfe8u)iA9OIsU@jJ#d;+8 z8zq5cGGb34Ir-@tO7TiM3Q7ti1M;IW0ZaPC z84qMRhB|o$B}Tq75XuQ~8;H&gFdZ0CVu(96V%S2}P{5xm%W$O1%)GRGSQLTSghBvG zJ%~v-MdGvor{_sYjvy0>OpT;Fg!DMTbPh@+G~z3g6O)p`Zc9l`13N7}BU1@?#fq#2 zr~_F8{=ylDHPk5`NGzjCb_4=ip%i4k)=IRw^fQwJs+bwtAvlz0%WLv>&pQYY9f#cv#L({Q#cu^4EF?ml>9 zk+Kww-DyM>_T`C1d9X+Zu?eMWB=sOB;WUlY0-TA6lmrbjk;wE+xP diff --git a/test/snapshots/no-for-loop.js.md b/test/snapshots/no-for-loop.js.md deleted file mode 100644 index 13fcb9acbf..0000000000 --- a/test/snapshots/no-for-loop.js.md +++ /dev/null @@ -1,162 +0,0 @@ -# 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 deleted file mode 100644 index b3112c7711051c08c635d2aaf3ce87e4c99ea8bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 720 zcmV;>0x$hRRzVD~gH^Gp7?;nc@00000000A9 z#K6G7#=!FD#-rJ1eQL}jJ}l%fx?;)500LD&ilh6>ffu)A^t-z)I`++o>|_LszF}ry z2zwIn=uX^|KbM#I9q3ldzsLv{bzo&+$W%0~yHHx-U)Sor@pPyEB}TC5EH(y)M%iDd zye%{TJ$ z1evlKxjgdJp@tbvq`LSj)-Vx?YAYF>It22ey> zTT`JLsN4vsoU<&k2&g9?s2Hp&Ix|*BAqgmEt6*piRAUTOQ_IEWUs{502TWsr8bl|W znV4p{78L>Y8R{EaaoLgTR0W{&IHG_;XmP4SqCx`DaNYd01cjXZ`~ro{yyBA7#1xQQ zOENNx!Lkr3J(9u!CFGNt5FwB74~PRc5aBV95J*2Kh6h11CSVzDZ4lcO$kqfg%zzAi zeTC%w+}zZ>5(N#Q%fRC1AjRMSu>i5KxEgGxC0G(70rZ51CP>uK03?b%GSNc;7O7C5 zgX}iJ?j%!~i_EauX%4j#CGJrJ3m&x~87v`(7WE)ixC0Z5V&w3}A`K66h#VQoho+H* zlHyz`%&@m*1DniE)3|IW#MG4veM1*WX zPH8&ORy^qyq5`M`suamSPPklhVoq{tPGU)FaDHy8Uut<+Voqr)BqM>dKQMRd>FGgB zE8J-vY97%0P|J|qLX2I;D0Z2U5T7{1f%q7uEU(Zam{C$g266ce5dsR@z^WH5qvhwM z>gD98YXB7j9jHk}HcQP(1sBSYtcJrls3Iiuh|Pppol8QTQIZXD1qJ|%ZFxSy3IG6e CZ$2sj diff --git a/test/snapshots/no-hex-escape.js.md b/test/snapshots/no-hex-escape.js.md deleted file mode 100644 index 9a62f9d512..0000000000 --- a/test/snapshots/no-hex-escape.js.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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 deleted file mode 100644 index 388c6810256b41fdf3686aedf42b8b350ec6a773..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208 zcmV;>05AVRRzVzW@caqvl&?#1evxoaCznxl$Ka=DJU2! z)F>q9=M|SIq~+%;*eWQ+R3sTHadG*Vmf%!TYG43X<62adU!-8DZ)nA3hsz)ZAgED5 z2614Z5L%q75So{noS%}akXoFaSddz*kO|bDnwX-HpQezJT9KHNnw*)Nm;;m6;{pIl KWGpr20002Z%U4wZ diff --git a/test/snapshots/no-instanceof-array.js.md b/test/snapshots/no-instanceof-array.js.md deleted file mode 100644 index c48666a737..0000000000 --- a/test/snapshots/no-instanceof-array.js.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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 deleted file mode 100644 index fb1a9032633d1c7716d793b492520fabdc1a7ded..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 203 zcmV;+05tzWRzV 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 deleted file mode 100644 index b95c2cff4758816131e34ee9af81b367eba2663b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1467 zcmV;s1w{HmRzVz1gtYVdJ;E@gIu_00000000B! zSzTxxRTRF{klI;lijiVdsoWyO-Nfv6vdLym%m#%#sHhJ?qzw(3-JNBZY<9wCVoZ}D z7U_dVB|aGt5ky3#)}Iiig~k*@Q`#bxQ0fmALLcgzf`XA!oVoL}^KWYio!@+CXYzy9TtYfl{-akls-J`E*CVBsu9FY^wQud}Cx72q zZ~TlS)}|c@b^J2<#iy5!{CY9+_Wb?w$8nBWKdeXSnVSzSHVl3<_WkF3SNpD>-r$J! zr=19i7j`8E7CLV{@#DGG{>`ILbHuu57ecwE^S7enmoFaw`bxav=A6h8>n$FkGbh5w z<~rYMIk5NV{Kn*g0!OUZLI^F7ZZ>>$`P}=V;o57b7k;?3czpIex7a>%h9lNj_an5ivKG63a_Px@(|gVNE6<+g zi1qac5xV{E;J54hAD{dEyYg2@-Z=FzN36>jp*nOAVT!9q_w8upLQj>(CY0_F#sZ$f zg&Yox5%QIe;Az#`u3Gt=EQcdKYAdd`W<#OpClq%l+}w;=UHZ#qxr~LF&>c!qroyV# z_zW2z)z>+i=2Lm5k8N7<3nl60F)5=+Sv*|G4P$W}D|rdarQ#GGS42e`l}ZXOl(48j zPZ#CP2%an`d3i#?!%}fv8jgk>1pS6Uf-IQE^8FKJc-r}Jjhuo<)-duz_D?`~%|$zK zPuDqdi{n$J49-oIGD<-%>8o~)z6L97Ovzugx%p2tgt$*I_UN)K|^A~0Qv0! zFdhIvceK(0@ioNb$iy&QqQMGe<+6@r@MttAm;1#`KAaZI5g%nqAJfyXs$x}Bf>`hz zv^9gYF-Yt2&z574qjsl|=9e;~>UhSjd|ct9Pln8hVo!DVSoE-Pjd z%^J0S7Hd>LLe*YPgM+Tg&pc5ek6S(CLFwAgk7`$1x6Mo(E|!`fMI-OwgLnhd zQ9L0EBW=qLWYzOk8^Bjw4_nq!;Ai8V25{)6ES)97r-#Si{cNM1?;*?GwUpw|3*SaOv zm6dr}z2iLo(pHR#F|bjbG_@0g}Sa-i`utX#3Pb4hFfB0kqBFr z0dOGIL4>-J0>MYq&@-)4M6?HnZQ3dorgK>um0yw!cdKAng#z@`%LShSW+d6otINq^ zuqTm5S4D_BCa{e`uvY#X6gp{+2~$Xcib?Rid#tevYN$fQ=tbK>jO}3;q*Iat+fb&$ z&mkH=0+cM Snapshot 1 - - `␊ - Input:␊ - 1 | const foo = i > 5 ? i < 100 ? true : false : i < 100 ? true : false;␊ - ␊ - Output:␊ - 1 | const foo = i > 5 ? (i < 100 ? true : false) : (i < 100 ? true : false);␊ - ␊ - Error 1/2:␊ - > 1 | const foo = i > 5 ? i < 100 ? true : false : i < 100 ? true : false;␊ - | ^^^^^^^^^^^^^^^^^^^^^^ Nest ternary expression should be parenthesized.␊ - Error 2/2:␊ - > 1 | const foo = i > 5 ? i < 100 ? true : false : i < 100 ? true : false;␊ - | ^^^^^^^^^^^^^^^^^^^^^^ Nest ternary expression should be parenthesized.␊ - ` - -## no-nested-ternary - #2 - -> Snapshot 1 - - `␊ - Input:␊ - 1 | const foo = i > 5 ? true : (i < 100 ? true : (i < 1000 ? true : false));␊ - ␊ - Output:␊ - [Same as input]␊ - ␊ - Error 1/1:␊ - > 1 | const foo = i > 5 ? true : (i < 100 ? true : (i < 1000 ? true : false));␊ - | ^^^^^^^^^^^^^^^^^^^^^^^ Do not nest ternary expressions.␊ - ` - -## no-nested-ternary - #3 - -> Snapshot 1 - - `␊ - Input:␊ - 1 | const foo = a ?␊ - 2 | b :␊ - 3 | (␊ - 4 | c ?␊ - 5 | d :␊ - 6 | (␊ - 7 | e ?␊ - 8 | f :␊ - 9 | (g ? h : i)␊ - 10 | )␊ - 11 | )␊ - ␊ - Output:␊ - [Same as input]␊ - ␊ - Error 1/1:␊ - 1 | const foo = a ?␊ - 2 | b :␊ - 3 | (␊ - 4 | c ?␊ - 5 | d :␊ - 6 | (␊ - > 7 | e ?␊ - | ^^^␊ - > 8 | f :␊ - | ^^^^^^^^␊ - > 9 | (g ? h : i)␊ - | ^^^^^^^^^^^^^^^^^ Do not nest ternary expressions.␊ - 10 | )␊ - 11 | )␊ - ` diff --git a/test/snapshots/no-nested-ternary.js.snap b/test/snapshots/no-nested-ternary.js.snap deleted file mode 100644 index 1f01b6923791c6a094d3a48fc921d243439a26bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 483 zcmV<90UZ88RzV~4bq*(GO$L^(ve)Xy`w)HSFfPg!Yx)XopBlr8b8NW8y9`XvCrp^c!m1AaL z__SMJ>o~J^uZQ6CL!afC_A!D*lUPCKv4iz9vN8xVSuk>W<`tBdSaB&R7%J2#BQD_0>a;8C)TEh4m>A-Nw00v5?CMZS?AmU&)$XP%ZQ4vE6 zU)W*zLIKJJhBrtS-BTcGSbTuwad;9%9SISLJ$O)})s%^F?!ZW);N%E$999XWoPpa+ z%w!Kq<5+V9M9LZwe@6H+7Rk=VovCo-96#(Ku27tjUz(Gmkd&%WkXV$OSCWxhoLQBc Zq6c-i5#8KPVp%}ChXDKXKcuz=002bL(TV^7 diff --git a/test/snapshots/no-new-buffer.js.md b/test/snapshots/no-new-buffer.js.md deleted file mode 100644 index 46eae886a1..0000000000 --- a/test/snapshots/no-new-buffer.js.md +++ /dev/null @@ -1,37 +0,0 @@ -# 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 deleted file mode 100644 index 39500f26ecdb92d2e41ce7576cdd3edf3c32efa8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 279 zcmV+y0qFigRzVb0s d9S%eqMr>FSXB__UBnD6t<^Yv|yY7+#004V`aGd}E diff --git a/test/snapshots/no-object-as-default-parameter.js.md b/test/snapshots/no-object-as-default-parameter.js.md deleted file mode 100644 index 34c2b3ce07..0000000000 --- a/test/snapshots/no-object-as-default-parameter.js.md +++ /dev/null @@ -1,25 +0,0 @@ -# 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 deleted file mode 100644 index a8faa52f15de4ea46ce7e183dad271e6aec43371..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmV+n0rUPrRzVd=B=28HH8U+*(7Z<1ClCO}LU!qW2oT`wRr;wkNm6}|lkds-GT9lZh zkXWpclA4xSnp2{X2DGyvu_!S&6)2^U0JJ7Sj|;_VZCIR^R+^Vwl9`_eavhS>42_I| S4y&%EiK76hq>27&0RRB`EOOxh diff --git a/test/snapshots/no-process-exit.js.md b/test/snapshots/no-process-exit.js.md deleted file mode 100644 index 0aec16a5b2..0000000000 --- a/test/snapshots/no-process-exit.js.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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 deleted file mode 100644 index 5fcaacf532e8ac857142cbcc7bcab342ea480231..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 186 zcmZ<^b5sb>!t~b7V_O33}C<>0Mv6=#LVsbFH(so;9m;t5j># zqCZcrJWASorR$6kud{Eq9;?ENzz%0tu78!5Q@NHNUCG6%A!Q;gV)R*LPOXio5I0xX mR}m+pu1}{$g+7Y}9sHK^OmzAZwPh~~85x2SHbyQ3ItT#Zb4UgN diff --git a/test/snapshots/no-unreadable-array-destructuring.js.md b/test/snapshots/no-unreadable-array-destructuring.js.md deleted file mode 100644 index 4df427f049..0000000000 --- a/test/snapshots/no-unreadable-array-destructuring.js.md +++ /dev/null @@ -1,125 +0,0 @@ -# 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 deleted file mode 100644 index 0aef7d7ed4c8c9e08379c9c178c023c1fd7a57e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 643 zcmV-}0(|{JRzVPRbT_1}G00000000BC zV`O09VNkcNtM(SuWllL>cYWr$7YBiYKrju69e5+NJ|(GFWV{Of7sjeGjS(!W1ytZR zPcWmRJVp136+`Qx_0v=s!J;RDxWYSqfv9$os3}7FeV0uO176tH>UjK zko>z`{iWh$5k|1+D;kUX!ML67(-}E2PeCFQS#0VCB3dFanQesMll5ds0F}%VUd5M=1ESkc`z;Ji* z*2yO3+Kk*kt(GPR+*r&A78PP=U|?oo2Zt0RD}x|YI|G+%QBi)8f}y^l6_=fYp+b#9 za(-TMi9&Q*e!h;5jzUsmQLKWkLP26tNwGDT0uaT4`Q#NoIZ?$UPd-K*vA=tSVMhp}H2` zSu_nY#(DzrNFWYrAAeBS=;-L_=@kL3A)KhF>!uDOjAS#Wa0O}^VN<2}FH?`3_TA^haU85CGc7&E*bj*&7g_w>(at1JPV2+?o5}%L1 dj!^*TJ5UOTrtJzM>Km%2YXFP`446;|0059`ABg|} diff --git a/test/snapshots/no-unsafe-regex.js.md b/test/snapshots/no-unsafe-regex.js.md deleted file mode 100644 index df00483a17..0000000000 --- a/test/snapshots/no-unsafe-regex.js.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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 deleted file mode 100644 index b288cb42b63ba9d382e1b9a2e8a37912a6be3aca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 172 zcmZ<^b5sb 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 deleted file mode 100644 index b8bd496e7cbcca5b0e3fd1f2322e975f2e853339..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmV uP0<5tG6iX>wFa`xVAkd5r0V75r)vN$)l1R@NtpwsYPkSUY`7ET0001!J7dHE diff --git a/test/snapshots/no-useless-undefined.js.md b/test/snapshots/no-useless-undefined.js.md deleted file mode 100644 index a287c9ee5d..0000000000 --- a/test/snapshots/no-useless-undefined.js.md +++ /dev/null @@ -1,89 +0,0 @@ -# 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 deleted file mode 100644 index 6cffbb7350c5d50557699fe159fe802e883b7829..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 419 zcmV;U0bKq;RzVlqD=cE=FDRM%pJHM%xrrAUEmN0KEFKVk#K`x?c!E75$LlUkyXh-|rz zLK2W`WR31WutJ0+hL3O?gz5(}-Mtq*mVn^~N`uJu!I_#Eu7@hu#O88BMxn()92P*( NF91kmE((_f003pbxS0R| diff --git a/test/snapshots/no-zero-fractions.js.md b/test/snapshots/no-zero-fractions.js.md deleted file mode 100644 index 7573b6b3b3..0000000000 --- a/test/snapshots/no-zero-fractions.js.md +++ /dev/null @@ -1,37 +0,0 @@ -# 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 deleted file mode 100644 index be4a950d34c293ffe0febad7611ed48ccef2c939..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 269 zcmV+o0rLJqRzVSc#C?x0S6_+Ta<>xEdDrgw$Y3h~a2bUCO=A~ Snapshot 1 @@ -20,7 +20,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `.flatMap(…)` over `.map(…).flat()`.␊ ` -## prefer-flat-map - #2 +## prefer-array-flat-map - #2 > Snapshot 1 @@ -36,7 +36,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `.flatMap(…)` over `.map(…).flat()`.␊ ` -## prefer-flat-map - #3 +## prefer-array-flat-map - #3 > Snapshot 1 @@ -52,7 +52,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `.flatMap(…)` over `.map(…).flat()`.␊ ` -## prefer-flat-map - #4 +## prefer-array-flat-map - #4 > Snapshot 1 diff --git a/test/snapshots/prefer-array-flat-map.js.snap b/test/snapshots/prefer-array-flat-map.js.snap new file mode 100644 index 0000000000000000000000000000000000000000..a497327bc443b0e4402216831d7c7900475a9303 GIT binary patch literal 396 zcmV;70dxLARzVKClH0WW@*aj8PZ+_XIZO-; zk3vf%&K}=h>wY6W=Izb)6O3Tdnam6f@8d3h6r5Xqc@;}?bDCsNEhAWTIST^=GXp!= zWJXp7K_(SOF3-Gz(h@5!1qDNe8inNiyy6mtq{JcxTZQOo!&seYBOo@8jn&IdEYQeQ zu(eZ&&WzR6OUp?t(J<7}+SpONY1y)*qKFGnbdO&V6P@A5f9?%b9vota_L9Wi!)U-wfRdjG- qZmL3Ju|g)utXP}@L8Q4P2Lt{vK(P<#1bCQ$LIVI^%}62@1pok%Fr*;> literal 0 HcmV?d00001 diff --git a/test/snapshots/prefer-dataset.js.snap b/test/snapshots/prefer-dataset.js.snap deleted file mode 100644 index 50527dd7db39bf820a60950e9232e541eb10554e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 257 zcmV+c0sj6$RzV^V6QOyz0#AK*i85|3pRx5SRp{m>Jl?Y(`cFL8fL#F3-Gz(h@5!1qDNe z8imxH)ZEm(620Qo633E~qRgbyl2i?#oDootQ#~cIBvCglKVMx(L0?}XIX@Sq7AR{B zmQ6}5Qb!dx0g7u{b8-2XmSC|1WE#*OJ)nUKwhCbFK(($#MfpVvhWdt9Ty}V!qyUtQ z!v=u*@H-c$POx5Fp24pR>Q$IBg@B^ewA3Pn1eh-q6!ObJd=y_iYFMV3pvMIOu?_`= HvH<`9%phuM diff --git a/test/snapshots/prefer-flat-map.js.snap b/test/snapshots/prefer-flat-map.js.snap deleted file mode 100644 index dced5a00c9838acfd42c699ca377872ef5af7dce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 396 zcmV;70dxLARzVKYgsK)@16otcx_$au9r{=wI&4lG_*Jl? zCNr`!2r_9ga(U(zl$Ka=DJU2!)F>q9=M|SIBqbIp*eXOv8^-EH8v(I#Y^+{xVu41c zf~}oGbY`rkURq9KiH4z`fq^C$mw#yqQ6_-&_#&Ia#pPO5lwYJ^sBdV+Wk;_43P4b! zfDGb@0tx{|scET23JGwBJ!)8{nV^tg1{TbP3P7yVOwi*(2{<`Q0&XA!jl2M(EU;84 zN@Y3&n#Od Snapshot 1 diff --git a/test/snapshots/prefer-node-dataset.js.snap b/test/snapshots/prefer-node-dataset.js.snap new file mode 100644 index 0000000000000000000000000000000000000000..daa0e69d16028a4638bec8a0c462494207c766fd GIT binary patch literal 257 zcmV+c0sj6$RzV8 zuxwIdkvgil2~b?qnv2W7v;>PCAk%>M=m8B>uvGwS2dZ@~D#|ZXFw{4+;bqw3?GXK00000000BC zVqjokVqlWY;fm9_v;N-%k39?PR{UpV0D;>;d|`3)rX4z8ey2`hSc#D5T}*>lLLI Snapshot 1 @@ -20,7 +20,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#replaceAll()` over `String#replace()`.␊ ` -## prefer-replace-all - #2 +## prefer-string-replace-all - #2 > Snapshot 1 diff --git a/test/snapshots/prefer-string-replace-all.js.snap b/test/snapshots/prefer-string-replace-all.js.snap new file mode 100644 index 0000000000000000000000000000000000000000..83c7de5e0632d0b398029d36be2bb73e569a51bd GIT binary patch literal 234 zcmVkdv64s-d5#Uz)C?kd#=Y$;IVg zT7q4fV@{5SdZIc^ooi81evyKqzM&PD9bOX^fS^Vp4m(f?C`wIBEmBAbE-A{)OIJp+ kOEWPx# literal 0 HcmV?d00001 diff --git a/test/snapshots/prefer-trim-start-end.js.md b/test/snapshots/prefer-string-trim-start-end.js.md similarity index 80% rename from test/snapshots/prefer-trim-start-end.js.md rename to test/snapshots/prefer-string-trim-start-end.js.md index e2feba25e8..d85e177a90 100644 --- a/test/snapshots/prefer-trim-start-end.js.md +++ b/test/snapshots/prefer-string-trim-start-end.js.md @@ -1,10 +1,10 @@ -# Snapshot report for `test/prefer-trim-start-end.js` +# Snapshot report for `test/prefer-string-trim-start-end.js` -The actual snapshot is saved in `prefer-trim-start-end.js.snap`. +The actual snapshot is saved in `prefer-string-trim-start-end.js.snap`. Generated by [AVA](https://avajs.dev). -## prefer-trim-start-end - #1 +## prefer-string-trim-start-end - #1 > Snapshot 1 @@ -20,7 +20,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^^^^ Prefer `String#trimStart()` over `String#trimLeft()`.␊ ` -## prefer-trim-start-end - #2 +## prefer-string-trim-start-end - #2 > Snapshot 1 diff --git a/test/snapshots/prefer-string-trim-start-end.js.snap b/test/snapshots/prefer-string-trim-start-end.js.snap new file mode 100644 index 0000000000000000000000000000000000000000..be5d07539044b9de165b45453103f4c10f1c8ab2 GIT binary patch literal 304 zcmV-00nh$HRzVK2wKy$#C;xZ*8%D6GITHf| zGXpzV6(cKyAk#7iF3-Gz(h@5!1qDNe8ilm{e7%yQ%v_(;v=R+XE-wGl5-hU8C5c5~ zY1g8n{2~QIeM2iQJ8b$DfS?9MD8xa5LO@Y!T56F(LNHKSUb-@paS00fWoR-GV-obZ zP#j&%h~a1;%LvHg)Yn%?&d<$F%_{+l7=uK>&I!s)&nVH?g2^dp>1zPxO+fOTD8fKd zQ;;Y&uM@DtH7|uk8<0W|pCxt#Jpu}3PIwSw4P&6|u!b<$KyVNfa4i6=PKzIL0ssJ^ C0C+?I literal 0 HcmV?d00001 diff --git a/test/snapshots/prefer-trim-start-end.js.snap b/test/snapshots/prefer-trim-start-end.js.snap deleted file mode 100644 index 4304e6d7f0fd05373451f9fefee4cc32a31c7ff1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 303 zcmV+~0nq+IRzVZmb`cboO&l0}RRAg~pP6PO-sRm%Q)xkbdtcE{n)Q;c9ybD$Px z26nJ2MpgzvrezFVo_PhOC01Mt3Wf?b3TgTIdL>1fxjw0BB^sJsT>hmcSY(4s5{tmn zu0=)pMGA)chE`m5*z_v^K@Esdh=T%!fTGm2)FOq1V4$+RbY&#t5)|^w&}1OSB36O@^rQKGK}lT*;r*8s|!faEz*gn^=_ zAW>{yCt!zbUJ8jeAcY=2OY8`G1Qf`e@F2z-#z5C$4Pmf>;2<|U000r6 Bfq4J`