thorn0 / prettier-regression-testing

Automates the prettier/prettier regression checks with GitHub Actions.
0 stars 0 forks source link

test #7

Closed thorn0 closed 3 years ago

thorn0 commented 3 years ago

run prettier/prettier#main vs 2.2.1

github-actions[bot] commented 3 years ago

prettier/prettier@main VS prettier/prettier@2.2.1

Diff (1172 lines) ```diff diff --git ORI/babel/eslint/babel-eslint-plugin-development-internal/test/rules/dry-error-messages.js ALT/babel/eslint/babel-eslint-plugin-development-internal/test/rules/dry-error-messages.js index 7f5ecd284..c00dc7ed7 100644 --- ORI/babel/eslint/babel-eslint-plugin-development-internal/test/rules/dry-error-messages.js +++ ALT/babel/eslint/babel-eslint-plugin-development-internal/test/rules/dry-error-messages.js @@ -64,182 +64,152 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { Errors } from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { Errors } from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import { Errors } from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { Errors } from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import { Errors } from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { Errors } from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { NotErrors, Errors } from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { NotErrors, Errors } from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { NotErrors, Errors } from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], }, { filename: FILENAME, - code: - "import { Errors } from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { Errors } from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import { Errors } from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { Errors } from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import { Errors } from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { Errors } from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { NotErrors, Errors } from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { NotErrors, Errors } from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { NotErrors, Errors } from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], }, { filename: FILENAME, - code: - "import Errors from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import Errors from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import Errors from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors, { NotErrors } from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors, { NotErrors } from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import NotErrors, { Errors } from 'errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import NotErrors, { Errors } from './errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import NotErrors, { Errors } from '../errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], }, { filename: FILENAME, - code: - "import Errors from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import Errors from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import Errors from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors, { NotErrors } from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors, { NotErrors } from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors, { NotErrors } from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import NotErrors, { Errors } from 'errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import NotErrors, { Errors } from './errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import NotErrors, { Errors } from '../errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], }, @@ -265,8 +235,7 @@ ruleTester.run("dry-error-messages", rule, { // Support ternary as second argument { filename: FILENAME, - code: - "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, a ? Errors.someErrorMessage : Errors.someOtherErrorMessage);", + code: "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, a ? Errors.someErrorMessage : Errors.someOtherErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], }, ], @@ -306,8 +275,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "const Errors = { someErrorMessage: 'Uh oh!' }; this.raise(loc, Errors.someErrorMessage);", + code: "const Errors = { someErrorMessage: 'Uh oh!' }; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -329,8 +297,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { Errors } from 'errorsModule'; const msg = 'Uh oh!'; this.raise(loc, msg);", + code: "import { Errors } from 'errorsModule'; const msg = 'Uh oh!'; this.raise(loc, msg);", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -341,8 +308,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { Errors } from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { Errors } from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -353,8 +319,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { Errors } from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { Errors } from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -365,8 +330,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { Errors } from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { Errors } from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -377,8 +341,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { NotErrors, Errors } from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -389,8 +352,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { NotErrors, Errors } from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -401,8 +363,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import { NotErrors, Errors } from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -413,8 +374,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { Errors } from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { Errors } from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -425,8 +385,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { Errors } from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { Errors } from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -437,8 +396,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { Errors } from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { Errors } from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -449,8 +407,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { NotErrors, Errors } from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -461,8 +418,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { NotErrors, Errors } from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -473,8 +429,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import { NotErrors, Errors } from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import { NotErrors, Errors } from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -485,8 +440,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -497,8 +451,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -509,8 +462,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -521,8 +473,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors, { NotErrors } from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -533,8 +484,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors, { NotErrors } from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -545,8 +495,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import Errors, { NotErrors } from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -557,8 +506,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import NotErrors, { Errors } from 'not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -569,8 +517,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import NotErrors, { Errors } from './not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -581,8 +528,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", + code: "import NotErrors, { Errors } from '../not-errorsModule'; this.raise(loc, Errors.someErrorMessage);", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -593,8 +539,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -605,8 +550,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -617,8 +561,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -629,8 +572,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors, { NotErrors } from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -641,8 +583,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors, { NotErrors } from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -653,8 +594,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import Errors, { NotErrors } from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -665,8 +605,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import NotErrors, { Errors } from 'not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -677,8 +616,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import NotErrors, { Errors } from './not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_SAME_DIR }], errors: [ { @@ -689,8 +627,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import NotErrors, { Errors } from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", + code: "import NotErrors, { Errors } from '../not-errorsModule'; function fn() { this.raise(loc, Errors.someErrorMessage); }", options: [{ errorModule: MODULE_PARENT_DIR }], errors: [ { @@ -703,8 +640,7 @@ ruleTester.run("dry-error-messages", rule, { // Should error if either part of a ternary isn't from error module { filename: FILENAME, - code: - "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, a ? Errors.someErrorMessage : 'hello');", + code: "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, a ? Errors.someErrorMessage : 'hello');", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -715,8 +651,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, a ? 'hello' : Errors.someErrorMessage);", + code: "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, a ? 'hello' : Errors.someErrorMessage);", options: [{ errorModule: ERRORS_MODULE }], errors: [ { @@ -727,8 +662,7 @@ ruleTester.run("dry-error-messages", rule, { }, { filename: FILENAME, - code: - "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, a ? 'hello' : 'world');", + code: "import Errors, { NotErrors } from 'errorsModule'; this.raise(loc, a ? 'hello' : 'world');", options: [{ errorModule: ERRORS_MODULE }], errors: [ { diff --git ORI/babel/packages/babel-core/src/config/config-chain.js ALT/babel/packages/babel-core/src/config/config-chain.js index 350111a1a..6e586eeaf 100644 --- ORI/babel/packages/babel-core/src/config/config-chain.js +++ ALT/babel/packages/babel-core/src/config/config-chain.js @@ -76,17 +76,15 @@ export function* buildPresetChain( }; } -export const buildPresetChainWalker: ( - arg: PresetInstance, - context: *, -) => * = makeChainWalker({ - root: preset => loadPresetDescriptors(preset), - env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName), - overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index), - overridesEnv: (preset, index, envName) => - loadPresetOverridesEnvDescriptors(preset)(index)(envName), - createLogger: () => () => {}, // Currently we don't support logging how preset is expanded -}); +export const buildPresetChainWalker: (arg: PresetInstance, context: *) => * = + makeChainWalker({ + root: preset => loadPresetDescriptors(preset), + env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName), + overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index), + overridesEnv: (preset, index, envName) => + loadPresetOverridesEnvDescriptors(preset)(index)(envName), + createLogger: () => () => {}, // Currently we don't support logging how preset is expanded + }); const loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) => buildRootDescriptors(preset, preset.alias, createUncachedDescriptors), ); @@ -705,10 +703,8 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions { function dedupDescriptors( items: Array, ): Array { - const map: Map< - Function, - Map, - > = new Map(); + const map: Map> = + new Map(); const descriptors = []; diff --git ORI/babel/packages/babel-core/src/config/files/plugins.js ALT/babel/packages/babel-core/src/config/files/plugins.js index 298843e2d..fde98cfd3 100644 --- ORI/babel/packages/babel-core/src/config/files/plugins.js +++ ALT/babel/packages/babel-core/src/config/files/plugins.js @@ -14,8 +14,10 @@ const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/; const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/; const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/; const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/; -const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/; -const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/; +const OTHER_PLUGIN_ORG_RE = + /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/; +const OTHER_PRESET_ORG_RE = + /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/; const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/; export function resolvePlugin(name: string, dirname: string): string | null { diff --git ORI/babel/packages/babel-core/src/config/validation/options.js ALT/babel/packages/babel-core/src/config/validation/options.js index 27caf3bcc..529d6606d 100644 --- ORI/babel/packages/babel-core/src/config/validation/options.js +++ ALT/babel/packages/babel-core/src/config/validation/options.js @@ -369,10 +369,8 @@ function throwUnknownError(loc: OptionPath) { const key = loc.name; if (removed[key]) { - const { - message, - version = 5, - }: { message: string, version?: number } = removed[key]; + const { message, version = 5 }: { message: string, version?: number } = + removed[key]; throw new Error( `Using removed Babel ${version} option: ${msg(loc)} - ${message}`, diff --git ORI/babel/packages/babel-core/src/transformation/normalize-file.js ALT/babel/packages/babel-core/src/transformation/normalize-file.js index aca84e1e4..8734534cc 100644 --- ORI/babel/packages/babel-core/src/transformation/normalize-file.js +++ ALT/babel/packages/babel-core/src/transformation/normalize-file.js @@ -98,8 +98,10 @@ export default function* normalizeFile( // but without // or /* at the beginning of the comment. // eslint-disable-next-line max-len -const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/; -const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/; +const INLINE_SOURCEMAP_REGEX = + /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/; +const EXTERNAL_SOURCEMAP_REGEX = + /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/; function extractCommentsFromList(regex, comments, lastComment) { if (comments) { diff --git ORI/babel/packages/babel-core/test/api.js ALT/babel/packages/babel-core/test/api.js index d715b6386..a8aed41cc 100644 --- ORI/babel/packages/babel-core/test/api.js +++ ALT/babel/packages/babel-core/test/api.js @@ -308,9 +308,8 @@ describe("api", function () { new Plugin({ visitor: { Function: function (path) { - const alias = path.scope - .getProgramParent() - .path.get("body")[0].node; + const alias = + path.scope.getProgramParent().path.get("body")[0].node; if (!babel.types.isTypeAlias(alias)) return; // In case of `passPerPreset` being `false`, the diff --git ORI/babel/packages/babel-core/test/config-chain.js ALT/babel/packages/babel-core/test/config-chain.js index 8de2bc99d..4b3c1d10b 100644 --- ORI/babel/packages/babel-core/test/config-chain.js +++ ALT/babel/packages/babel-core/test/config-chain.js @@ -94,7 +94,8 @@ async function loadOptionsAsyncInSpawedProcess({ filename, cwd }) { }, ); - const EXPERIMENTAL_WARNING = /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./; + const EXPERIMENTAL_WARNING = + /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./; if (stderr.replace(EXPERIMENTAL_WARNING, "").trim()) { throw new Error( diff --git ORI/babel/packages/babel-helper-create-class-features-plugin/src/fields.js ALT/babel/packages/babel-helper-create-class-features-plugin/src/fields.js index aca3cfa75..08fb1f6e0 100644 --- ORI/babel/packages/babel-helper-create-class-features-plugin/src/fields.js +++ ALT/babel/packages/babel-helper-create-class-features-plugin/src/fields.js @@ -200,14 +200,8 @@ const privateNameHandlerSpec = { get(member) { const { classRef, privateNamesMap, file } = this; const { name } = member.node.property.id; - const { - id, - static: isStatic, - method: isMethod, - methodId, - getId, - setId, - } = privateNamesMap.get(name); + const { id, static: isStatic, method: isMethod, methodId, getId, setId } = + privateNamesMap.get(name); const isAccessor = getId || setId; if (isStatic) { @@ -264,13 +258,8 @@ const privateNameHandlerSpec = { set(member, value) { const { classRef, privateNamesMap, file } = this; const { name } = member.node.property.id; - const { - id, - static: isStatic, - method: isMethod, - setId, - getId, - } = privateNamesMap.get(name); + const { id, static: isStatic, method: isMethod, setId, getId } = + privateNamesMap.get(name); const isAccessor = getId || setId; if (isStatic) { diff --git ORI/babel/packages/babel-helper-module-transforms/src/index.js ALT/babel/packages/babel-helper-module-transforms/src/index.js index 164462ee0..c1aff14c1 100644 --- ORI/babel/packages/babel-helper-module-transforms/src/index.js +++ ALT/babel/packages/babel-helper-module-transforms/src/index.js @@ -243,23 +243,26 @@ function buildESModuleHeader( metadata: ModuleMetadata, enumerable: boolean = false, ) { - return (enumerable - ? template.statement` + return ( + enumerable + ? template.statement` EXPORTS.__esModule = true; ` - : template.statement` + : template.statement` Object.defineProperty(EXPORTS, "__esModule", { value: true, }); - `)({ EXPORTS: metadata.exportName }); + ` + )({ EXPORTS: metadata.exportName }); } /** * Create a re-export initialization loop for a specific imported namespace. */ function buildNamespaceReexport(metadata, namespace, loose) { - return (loose - ? template.statement` + return ( + loose + ? template.statement` Object.keys(NAMESPACE).forEach(function(key) { if (key === "default" || key === "__esModule") return; VERIFY_NAME_LIST; @@ -268,13 +271,13 @@ function buildNamespaceReexport(metadata, namespace, loose) { EXPORTS[key] = NAMESPACE[key]; }); ` - : // Also skip already assigned bindings if they are strictly equal - // to be somewhat more spec-compliant when a file has multiple - // namespace re-exports that would cause a binding to be exported - // multiple times. However, multiple bindings of the same name that - // export the same primitive value are silently skipped - // (the spec requires an "ambigous bindings" early error here). - template.statement` + : // Also skip already assigned bindings if they are strictly equal + // to be somewhat more spec-compliant when a file has multiple + // namespace re-exports that would cause a binding to be exported + // multiple times. However, multiple bindings of the same name that + // export the same primitive value are silently skipped + // (the spec requires an "ambigous bindings" early error here). + template.statement` Object.keys(NAMESPACE).forEach(function(key) { if (key === "default" || key === "__esModule") return; VERIFY_NAME_LIST; @@ -287,7 +290,8 @@ function buildNamespaceReexport(metadata, namespace, loose) { }, }); }); - `)({ + ` + )({ NAMESPACE: namespace, EXPORTS: metadata.exportName, VERIFY_NAME_LIST: metadata.exportNameListName diff --git ORI/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js ALT/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js index 4f31fd926..706d84efc 100644 --- ORI/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js +++ ALT/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js @@ -165,13 +165,8 @@ const buildImportThrow = localName => { const rewriteReferencesVisitor = { ReferencedIdentifier(path) { - const { - seen, - buildImportReference, - scope, - imported, - requeueInParent, - } = this; + const { seen, buildImportReference, scope, imported, requeueInParent } = + this; if (seen.has(path.node)) return; seen.add(path.node); diff --git ORI/babel/packages/babel-parser/src/parser/statement.js ALT/babel/packages/babel-parser/src/parser/statement.js index 5827e5154..a1b0e5824 100644 --- ORI/babel/packages/babel-parser/src/parser/statement.js +++ ALT/babel/packages/babel-parser/src/parser/statement.js @@ -316,9 +316,8 @@ export default class StatementParser extends ExpressionParser { } takeDecorators(node: N.HasDecorators): void { - const decorators = this.state.decoratorStack[ - this.state.decoratorStack.length - 1 - ]; + const decorators = + this.state.decoratorStack[this.state.decoratorStack.length - 1]; if (decorators.length) { node.decorators = decorators; this.resetStartLocationFromNode(node, decorators[0]); @@ -331,9 +330,8 @@ export default class StatementParser extends ExpressionParser { } parseDecorators(allowExport?: boolean): void { - const currentContextDecorators = this.state.decoratorStack[ - this.state.decoratorStack.length - 1 - ]; + const currentContextDecorators = + this.state.decoratorStack[this.state.decoratorStack.length - 1]; while (this.match(tt.at)) { const decorator = this.parseDecorator(); currentContextDecorators.push(decorator); @@ -2010,9 +2008,8 @@ export default class StatementParser extends ExpressionParser { } } - const currentContextDecorators = this.state.decoratorStack[ - this.state.decoratorStack.length - 1 - ]; + const currentContextDecorators = + this.state.decoratorStack[this.state.decoratorStack.length - 1]; // If node.declaration is a class, it will take all decorators in the current context. // Thus we should throw if we see non-empty decorators here. if (currentContextDecorators.length) { diff --git ORI/babel/packages/babel-parser/src/plugins/flow.js ALT/babel/packages/babel-parser/src/plugins/flow.js index 0e00291fc..6dfbe03ea 100644 --- ORI/babel/packages/babel-parser/src/plugins/flow.js +++ ALT/babel/packages/babel-parser/src/plugins/flow.js @@ -1299,9 +1299,10 @@ export default (superClass: Class): Class => return this.finishNode(node, "FunctionTypeParam"); } - flowParseFunctionTypeParams( - params: N.FlowFunctionTypeParam[] = [], - ): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam } { + flowParseFunctionTypeParams(params: N.FlowFunctionTypeParam[] = []): { + params: N.FlowFunctionTypeParam[], + rest: ?N.FlowFunctionTypeParam, + } { let rest: ?N.FlowFunctionTypeParam = null; while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) { params.push(this.flowParseFunctionTypeParam()); @@ -2962,7 +2963,8 @@ export default (superClass: Class): Class => node.callee = base; const result = this.tryParse(() => { - node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); + node.typeArguments = + this.flowParseTypeParameterInstantiationCallOrNew(); this.expect(tt.parenL); node.arguments = this.parseCallExpressionArguments(tt.parenR, false); if (subscriptState.optionalChainMember) node.optional = false; diff --git ORI/babel/packages/babel-parser/src/types.js ALT/babel/packages/babel-parser/src/types.js index d5a28729d..b75520a79 100644 --- ORI/babel/packages/babel-parser/src/types.js +++ ALT/babel/packages/babel-parser/src/types.js @@ -1137,9 +1137,10 @@ export type TsSignatureDeclarationOrIndexSignatureBase = NodeBase & { typeAnnotation: ?TsTypeAnnotation, }; -export type TsSignatureDeclarationBase = TsSignatureDeclarationOrIndexSignatureBase & { - typeParameters: ?TsTypeParameterDeclaration, -}; +export type TsSignatureDeclarationBase = + TsSignatureDeclarationOrIndexSignatureBase & { + typeParameters: ?TsTypeParameterDeclaration, + }; // ================ // TypeScript type members (for type literal / interface / class) diff --git ORI/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js ALT/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js index d860d884e..e19a77552 100644 --- ORI/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js +++ ALT/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js @@ -33,9 +33,10 @@ const WARNING_CALLS = new WeakSet(); */ function applyEnsureOrdering(path) { // TODO: This should probably also hoist computed properties. - const decorators = (path.isClass() - ? [path].concat(path.get("body.body")) - : path.get("properties") + const decorators = ( + path.isClass() + ? [path].concat(path.get("body.body")) + : path.get("properties") ).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []); const identDecorators = decorators.filter( @@ -47,9 +48,8 @@ function applyEnsureOrdering(path) { identDecorators .map(decorator => { const expression = decorator.expression; - const id = (decorator.expression = path.scope.generateDeclaredUidIdentifier( - "dec", - )); + const id = (decorator.expression = + path.scope.generateDeclaredUidIdentifier("dec")); return t.assignmentExpression("=", id, expression); }) .concat([path.node]), diff --git ORI/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js ALT/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js index e1f9b7d51..387e2634c 100644 --- ORI/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js +++ ALT/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js @@ -357,11 +357,8 @@ export default declare((api, opts) => { path.isObjectPattern(), ); - const [ - impureComputedPropertyDeclarators, - argument, - callExpression, - ] = createObjectSpread(objectPatternPath, file, ref); + const [impureComputedPropertyDeclarators, argument, callExpression] = + createObjectSpread(objectPatternPath, file, ref); if (loose) { removeUnusedExcludedKeys(objectPatternPath); @@ -440,11 +437,8 @@ export default declare((api, opts) => { ]), ); - const [ - impureComputedPropertyDeclarators, - argument, - callExpression, - ] = createObjectSpread(leftPath, file, t.identifier(refName)); + const [impureComputedPropertyDeclarators, argument, callExpression] = + createObjectSpread(leftPath, file, t.identifier(refName)); if (impureComputedPropertyDeclarators.length > 0) { nodes.push( diff --git ORI/babel/packages/babel-plugin-transform-destructuring/src/index.js ALT/babel/packages/babel-plugin-transform-destructuring/src/index.js index cca55d21b..5e8576371 100644 --- ORI/babel/packages/babel-plugin-transform-destructuring/src/index.js +++ ALT/babel/packages/babel-plugin-transform-destructuring/src/index.js @@ -4,11 +4,8 @@ import { types as t } from "@babel/core"; export default declare((api, options) => { api.assertVersion(7); - const { - loose = false, - useBuiltIns = false, - allowArrayLike = false, - } = options; + const { loose = false, useBuiltIns = false, allowArrayLike = false } = + options; if (typeof loose !== "boolean") { throw new Error(`.loose must be a boolean or undefined`); diff --git ORI/babel/packages/babel-plugin-transform-parameters/src/params.js ALT/babel/packages/babel-plugin-transform-parameters/src/params.js index 4608a225a..60989c943 100644 --- ORI/babel/packages/babel-plugin-transform-parameters/src/params.js +++ ALT/babel/packages/babel-plugin-transform-parameters/src/params.js @@ -37,8 +37,8 @@ const iifeVisitor = { } }, // type annotations don't use or introduce "real" bindings - "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration": path => - path.skip(), + "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration": + path => path.skip(), }; // last 2 parameters are optional -- they are used by proposal-object-rest-spread/src/index.js diff --git ORI/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js ALT/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js index 1cdbf6491..2d944d58c 100644 --- ORI/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js +++ ALT/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js @@ -10,8 +10,10 @@ const t = require("@babel/types"); const transformRuntime = require("../"); const runtimeVersion = require("@babel/runtime/package.json").version; -const corejs2Definitions = require("../lib/runtime-corejs2-definitions").default(); -const corejs3Definitions = require("../lib/runtime-corejs3-definitions").default(); +const corejs2Definitions = + require("../lib/runtime-corejs2-definitions").default(); +const corejs3Definitions = + require("../lib/runtime-corejs3-definitions").default(); function outputFile(filePath, data) { fs.mkdirSync(path.dirname(filePath), { recursive: true }); diff --git ORI/babel/packages/babel-plugin-transform-runtime/src/index.js ALT/babel/packages/babel-plugin-transform-runtime/src/index.js index 12c1a20b8..046cbceda 100644 --- ORI/babel/packages/babel-plugin-transform-runtime/src/index.js +++ ALT/babel/packages/babel-plugin-transform-runtime/src/index.js @@ -170,9 +170,9 @@ export default declare((api, options, dirname) => { const corejsRoot = injectCoreJS3 && !proposals ? "core-js-stable" : "core-js"; - const { BuiltIns, StaticProperties, InstanceProperties } = (injectCoreJS2 - ? getCoreJS2Definitions - : getCoreJS3Definitions)(runtimeVersion); + const { BuiltIns, StaticProperties, InstanceProperties } = ( + injectCoreJS2 ? getCoreJS2Definitions : getCoreJS3Definitions + )(runtimeVersion); const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"]; diff --git ORI/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js ALT/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js index 0cd423af1..37370a9b6 100644 --- ORI/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js +++ ALT/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js @@ -39,13 +39,14 @@ const corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills) return memo; }, {}); -const corejs3PolyfillsWithShippedProposals = (corejs3ShippedProposalsList: string[]).reduce( - (memo, key) => { - memo[key] = corejs3Polyfills[key]; - return memo; - }, - { ...corejs3PolyfillsWithoutProposals }, -); +const corejs3PolyfillsWithShippedProposals = + (corejs3ShippedProposalsList: string[]).reduce( + (memo, key) => { + memo[key] = corejs3Polyfills[key]; + return memo; + }, + { ...corejs3PolyfillsWithoutProposals }, + ); export default function ( _: any, diff --git ORI/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js ALT/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js index ea0cd6950..1b9d8c7db 100644 --- ORI/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js +++ ALT/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js @@ -1,7 +1,7 @@ "use strict"; -const getOptionSpecificExcludesFor = require("../lib/get-option-specific-excludes") - .default; +const getOptionSpecificExcludesFor = + require("../lib/get-option-specific-excludes").default; describe("defaults", () => { describe("getOptionSpecificExcludesFor", () => { diff --git ORI/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js ALT/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js index 1958a7fa6..9b3541292 100644 --- ORI/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js +++ ALT/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js @@ -1,17 +1,16 @@ "use strict"; -const getCoreJS2PlatformSpecificDefaultFor = require("../lib/polyfills/corejs2/get-platform-specific-default") - .default; +const getCoreJS2PlatformSpecificDefaultFor = + require("../lib/polyfills/corejs2/get-platform-specific-default").default; describe("defaults", () => { describe("getCoreJS2PlatformSpecificDefaultFor", () => { it("should return web polyfills for non-`node` platform", () => { - const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor( - { + const defaultWebIncludesForChromeAndNode = + getCoreJS2PlatformSpecificDefaultFor({ chrome: "63", node: "8", - }, - ); + }); expect(defaultWebIncludesForChromeAndNode).toEqual([ "web.timers", "web.immediate", @@ -20,11 +19,10 @@ describe("defaults", () => { }); it("shouldn't return web polyfills for node platform", () => { - const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor( - { + const defaultWebIncludesForChromeAndNode = + getCoreJS2PlatformSpecificDefaultFor({ node: "8", - }, - ); + }); expect(defaultWebIncludesForChromeAndNode).toBeNull(); }); }); diff --git ORI/babel/packages/babel-preset-env/test/index.spec.js ALT/babel/packages/babel-preset-env/test/index.spec.js index 291bb26c7..e6a2d00c6 100644 --- ORI/babel/packages/babel-preset-env/test/index.spec.js +++ ALT/babel/packages/babel-preset-env/test/index.spec.js @@ -1,18 +1,18 @@ "use strict"; const babelPresetEnv = require("../lib/index"); -const addCoreJS2UsagePlugin = require("../lib/polyfills/corejs2/usage-plugin") - .default; -const addCoreJS3UsagePlugin = require("../lib/polyfills/corejs3/usage-plugin") - .default; -const addRegeneratorUsagePlugin = require("../lib/polyfills/regenerator/usage-plugin") - .default; -const replaceCoreJS2EntryPlugin = require("../lib/polyfills/corejs2/entry-plugin") - .default; -const replaceCoreJS3EntryPlugin = require("../lib/polyfills/corejs3/entry-plugin") - .default; -const removeRegeneratorEntryPlugin = require("../lib/polyfills/regenerator/entry-plugin") - .default; +const addCoreJS2UsagePlugin = + require("../lib/polyfills/corejs2/usage-plugin").default; +const addCoreJS3UsagePlugin = + require("../lib/polyfills/corejs3/usage-plugin").default; +const addRegeneratorUsagePlugin = + require("../lib/polyfills/regenerator/usage-plugin").default; +const replaceCoreJS2EntryPlugin = + require("../lib/polyfills/corejs2/entry-plugin").default; +const replaceCoreJS3EntryPlugin = + require("../lib/polyfills/corejs3/entry-plugin").default; +const removeRegeneratorEntryPlugin = + require("../lib/polyfills/regenerator/entry-plugin").default; const transformations = require("../lib/module-transformations").default; const compatData = require("@babel/compat-data/plugins"); diff --git ORI/babel/packages/babel-standalone/src/generated/plugins.js ALT/babel/packages/babel-standalone/src/generated/plugins.js index 889f6a494..01a0ae395 100644 --- ORI/babel/packages/babel-standalone/src/generated/plugins.js +++ ALT/babel/packages/babel-standalone/src/generated/plugins.js @@ -259,7 +259,8 @@ export const all = { "transform-new-target": transformNewTarget, "transform-object-assign": transformObjectAssign, "transform-object-super": transformObjectSuper, - "transform-object-set-prototype-of-to-assign": transformObjectSetPrototypeOfToAssign, + "transform-object-set-prototype-of-to-assign": + transformObjectSetPrototypeOfToAssign, "transform-parameters": transformParameters, "transform-property-literals": transformPropertyLiterals, "transform-property-mutators": transformPropertyMutators, ```
github-actions[bot] commented 3 years ago

prettier/prettier@main VS prettier/prettier@2.2.1

Diff (3802 lines) ```diff diff --git ORI/eslint-plugin-vue/lib/rules/component-definition-name-casing.js ALT/eslint-plugin-vue/lib/rules/component-definition-name-casing.js index 1f2e59a..8e192df 100644 --- ORI/eslint-plugin-vue/lib/rules/component-definition-name-casing.js +++ ALT/eslint-plugin-vue/lib/rules/component-definition-name-casing.js @@ -18,8 +18,7 @@ module.exports = { docs: { description: 'enforce specific casing for component definition name', categories: ['vue3-strongly-recommended', 'strongly-recommended'], - url: - 'https://eslint.vuejs.org/rules/component-definition-name-casing.html' + url: 'https://eslint.vuejs.org/rules/component-definition-name-casing.html' }, fixable: 'code', // or "code" or "whitespace" schema: [ diff --git ORI/eslint-plugin-vue/lib/rules/component-name-in-template-casing.js ALT/eslint-plugin-vue/lib/rules/component-name-in-template-casing.js index dffca0c..b2f60a6 100644 --- ORI/eslint-plugin-vue/lib/rules/component-name-in-template-casing.js +++ ALT/eslint-plugin-vue/lib/rules/component-name-in-template-casing.js @@ -30,8 +30,7 @@ module.exports = { description: 'enforce specific casing for the component naming style in template', categories: undefined, - url: - 'https://eslint.vuejs.org/rules/component-name-in-template-casing.html' + url: 'https://eslint.vuejs.org/rules/component-name-in-template-casing.html' }, fixable: 'code', schema: [ diff --git ORI/eslint-plugin-vue/lib/rules/experimental-script-setup-vars.js ALT/eslint-plugin-vue/lib/rules/experimental-script-setup-vars.js index b209376..d215a27 100644 --- ORI/eslint-plugin-vue/lib/rules/experimental-script-setup-vars.js +++ ALT/eslint-plugin-vue/lib/rules/experimental-script-setup-vars.js @@ -161,8 +161,9 @@ function parseSetup(code, espree, eslintScope) { fallback: AST.getFallbackKeys }) - const variables = /** @type {Variable[]} */ (result.globalScope.childScopes[0] - .variables) + const variables = /** @type {Variable[]} */ ( + result.globalScope.childScopes[0].variables + ) return variables.map((v) => v.name) } diff --git ORI/eslint-plugin-vue/lib/rules/html-self-closing.js ALT/eslint-plugin-vue/lib/rules/html-self-closing.js index b54c206..ed4a3dc 100644 --- ORI/eslint-plugin-vue/lib/rules/html-self-closing.js +++ ALT/eslint-plugin-vue/lib/rules/html-self-closing.js @@ -164,7 +164,8 @@ module.exports = { name: node.rawName }, fix(fixer) { - const tokens = context.parserServices.getTemplateBodyTokenStore() + const tokens = + context.parserServices.getTemplateBodyTokenStore() const close = tokens.getLastToken(node.startTag) if (close.type !== 'HTMLTagClose') { return null @@ -188,7 +189,8 @@ module.exports = { name: node.rawName }, fix(fixer) { - const tokens = context.parserServices.getTemplateBodyTokenStore() + const tokens = + context.parserServices.getTemplateBodyTokenStore() const close = tokens.getLastToken(node.startTag) if (close.type !== 'HTMLSelfClosingTagClose') { return null diff --git ORI/eslint-plugin-vue/lib/rules/max-attributes-per-line.js ALT/eslint-plugin-vue/lib/rules/max-attributes-per-line.js index 8cec636..ce03a82 100644 --- ORI/eslint-plugin-vue/lib/rules/max-attributes-per-line.js +++ ALT/eslint-plugin-vue/lib/rules/max-attributes-per-line.js @@ -157,12 +157,11 @@ module.exports = { // Find the closest token before the current prop // that is not a white space - const prevToken = /** @type {Token} */ (template.getTokenBefore( - prop, - { + const prevToken = /** @type {Token} */ ( + template.getTokenBefore(prop, { filter: (token) => token.type !== 'HTMLWhitespace' - } - )) + }) + ) /** @type {Range} */ const range = [prevToken.range[1], prop.range[0]] diff --git ORI/eslint-plugin-vue/lib/rules/max-len.js ALT/eslint-plugin-vue/lib/rules/max-len.js index 6de8f89..773b626 100644 --- ORI/eslint-plugin-vue/lib/rules/max-len.js +++ ALT/eslint-plugin-vue/lib/rules/max-len.js @@ -209,8 +209,7 @@ module.exports = { OPTIONS_SCHEMA ], messages: { - max: - 'This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.', + max: 'This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.', maxComment: 'This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}.' } diff --git ORI/eslint-plugin-vue/lib/rules/multiline-html-element-content-newline.js ALT/eslint-plugin-vue/lib/rules/multiline-html-element-content-newline.js index 49a675c..fa24dd2 100644 --- ORI/eslint-plugin-vue/lib/rules/multiline-html-element-content-newline.js +++ ALT/eslint-plugin-vue/lib/rules/multiline-html-element-content-newline.js @@ -72,8 +72,7 @@ module.exports = { description: 'require a line break before and after the contents of a multiline element', categories: ['vue3-strongly-recommended', 'strongly-recommended'], - url: - 'https://eslint.vuejs.org/rules/multiline-html-element-content-newline.html' + url: 'https://eslint.vuejs.org/rules/multiline-html-element-content-newline.html' }, fixable: 'whitespace', schema: [ @@ -179,14 +178,12 @@ module.exports = { return } - const contentFirst = /** @type {Token} */ (template.getTokenAfter( - element.startTag, - getTokenOption - )) - const contentLast = /** @type {Token} */ (template.getTokenBefore( - element.endTag, - getTokenOption - )) + const contentFirst = /** @type {Token} */ ( + template.getTokenAfter(element.startTag, getTokenOption) + ) + const contentLast = /** @type {Token} */ ( + template.getTokenBefore(element.endTag, getTokenOption) + ) const beforeLineBreaks = contentFirst.loc.start.line - element.startTag.loc.end.line diff --git ORI/eslint-plugin-vue/lib/rules/new-line-between-multi-line-property.js ALT/eslint-plugin-vue/lib/rules/new-line-between-multi-line-property.js index b48d783..90af239 100644 --- ORI/eslint-plugin-vue/lib/rules/new-line-between-multi-line-property.js +++ ALT/eslint-plugin-vue/lib/rules/new-line-between-multi-line-property.js @@ -55,8 +55,7 @@ module.exports = { description: 'enforce new lines between multi-line properties in Vue components', categories: undefined, - url: - 'https://eslint.vuejs.org/rules/new-line-between-multi-line-property.html' + url: 'https://eslint.vuejs.org/rules/new-line-between-multi-line-property.html' }, fixable: 'whitespace', // or "code" or "whitespace" schema: [ diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-data-object-declaration.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-data-object-declaration.js index 37d280e..017e46e 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-data-object-declaration.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-data-object-declaration.js @@ -52,8 +52,7 @@ module.exports = { description: 'disallow using deprecated object declaration on data (in Vue.js 3.0.0+)', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-data-object-declaration.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-data-object-declaration.html' }, fixable: 'code', schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-destroyed-lifecycle.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-destroyed-lifecycle.js index c355608..6176daa 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-destroyed-lifecycle.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-destroyed-lifecycle.js @@ -21,8 +21,7 @@ module.exports = { description: 'disallow using deprecated `destroyed` and `beforeDestroy` lifecycle hooks (in Vue.js 3.0.0+)', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-destroyed-lifecycle.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-destroyed-lifecycle.html' }, fixable: null, schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-dollar-listeners-api.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-dollar-listeners-api.js index 97d9835..64c175b 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-dollar-listeners-api.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-dollar-listeners-api.js @@ -20,8 +20,7 @@ module.exports = { docs: { description: 'disallow using deprecated `$listeners` (in Vue.js 3.0.0+)', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-dollar-listeners-api.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-dollar-listeners-api.html' }, fixable: null, schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-dollar-scopedslots-api.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-dollar-scopedslots-api.js index bdfa0f8..eaa9b33 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-dollar-scopedslots-api.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-dollar-scopedslots-api.js @@ -21,8 +21,7 @@ module.exports = { description: 'disallow using deprecated `$scopedSlots` (in Vue.js 3.0.0+)', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-dollar-scopedslots-api.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-dollar-scopedslots-api.html' }, fixable: 'code', schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-functional-template.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-functional-template.js index e489841..7624ddc 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-functional-template.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-functional-template.js @@ -21,8 +21,7 @@ module.exports = { description: 'disallow using deprecated the `functional` template (in Vue.js 3.0.0+)', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-functional-template.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-functional-template.html' }, fixable: null, schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-props-default-this.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-props-default-this.js index 926476c..b194e79 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-props-default-this.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-props-default-this.js @@ -20,8 +20,7 @@ module.exports = { docs: { description: 'disallow props default function `this` access', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-props-default-this.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-props-default-this.html' }, fixable: null, schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-slot-scope-attribute.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-slot-scope-attribute.js index 793b1ed..c3a08b8 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-slot-scope-attribute.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-slot-scope-attribute.js @@ -14,8 +14,7 @@ module.exports = { description: 'disallow deprecated `slot-scope` attribute (in Vue.js 2.6.0+)', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html' }, fixable: 'code', schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-v-on-native-modifier.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-v-on-native-modifier.js index 4f60210..a37875d 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-v-on-native-modifier.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-v-on-native-modifier.js @@ -21,8 +21,7 @@ module.exports = { description: 'disallow using deprecated `.native` modifiers (in Vue.js 3.0.0+)', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-v-on-native-modifier.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-v-on-native-modifier.html' }, fixable: null, schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-v-on-number-modifiers.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-v-on-number-modifiers.js index 2434158..a7e91a0 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-v-on-number-modifiers.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-v-on-number-modifiers.js @@ -22,8 +22,7 @@ module.exports = { description: 'disallow using deprecated number (keycode) modifiers (in Vue.js 3.0.0+)', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-v-on-number-modifiers.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-v-on-number-modifiers.html' }, fixable: 'code', schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-deprecated-vue-config-keycodes.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-vue-config-keycodes.js index 4db268e..c251e95 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-vue-config-keycodes.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-vue-config-keycodes.js @@ -17,8 +17,7 @@ module.exports = { description: 'disallow using deprecated `Vue.config.keyCodes` (in Vue.js 3.0.0+)', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/no-deprecated-vue-config-keycodes.html' + url: 'https://eslint.vuejs.org/rules/no-deprecated-vue-config-keycodes.html' }, fixable: null, schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/no-extra-parens.js ALT/eslint-plugin-vue/lib/rules/no-extra-parens.js index 3f202fa..20c2593 100644 --- ORI/eslint-plugin-vue/lib/rules/no-extra-parens.js +++ ALT/eslint-plugin-vue/lib/rules/no-extra-parens.js @@ -176,7 +176,8 @@ function createForVueSyntax(context) { } return { - "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer": verify, + "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer": + verify, 'VElement > VExpressionContainer': verify } } diff --git ORI/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js ALT/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js index 7c05083..1cfbd61 100644 --- ORI/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js +++ ALT/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js @@ -15,8 +15,10 @@ const utils = require('../utils') // Constants // ------------------------------------------------------------------------------ -const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u -const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu +const ALL_IRREGULARS = + /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u +const IRREGULAR_WHITESPACE = + /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/gmu // ------------------------------------------------------------------------------ @@ -195,7 +197,8 @@ module.exports = { const bodyVisitor = utils.defineTemplateBodyVisitor(context, { ...(skipHTMLAttributeValues ? { - 'VAttribute[directive=false] > VLiteral': removeInvalidNodeErrorsInHTMLAttributeValue + 'VAttribute[directive=false] > VLiteral': + removeInvalidNodeErrorsInHTMLAttributeValue } : {}), ...(skipHTMLTextContents diff --git ORI/eslint-plugin-vue/lib/rules/no-potential-component-option-typo.js ALT/eslint-plugin-vue/lib/rules/no-potential-component-option-typo.js index f3ac473..91c3ce2 100644 --- ORI/eslint-plugin-vue/lib/rules/no-potential-component-option-typo.js +++ ALT/eslint-plugin-vue/lib/rules/no-potential-component-option-typo.js @@ -17,8 +17,7 @@ module.exports = { description: 'disallow a potential typo in your component property', categories: undefined, recommended: false, - url: - 'https://eslint.vuejs.org/rules/no-potential-component-option-typo.html' + url: 'https://eslint.vuejs.org/rules/no-potential-component-option-typo.html' }, fixable: null, schema: [ diff --git ORI/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js ALT/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js index 02ac6e3..d15bb4c 100644 --- ORI/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js +++ ALT/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js @@ -137,9 +137,8 @@ module.exports = { /** @param {RuleContext} context */ create(context) { /** @type {ParsedOption[]} */ - const options = (context.options.length === 0 - ? DEFAULT_OPTIONS - : context.options + const options = ( + context.options.length === 0 ? DEFAULT_OPTIONS : context.options ).map(parseOption) return utils.defineTemplateBodyVisitor(context, { diff --git ORI/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js ALT/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js index 7c0639b..54ededb 100644 --- ORI/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js +++ ALT/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js @@ -21,8 +21,7 @@ module.exports = { docs: { description: 'disallow side effects in computed properties', categories: ['vue3-essential', 'essential'], - url: - 'https://eslint.vuejs.org/rules/no-side-effects-in-computed-properties.html' + url: 'https://eslint.vuejs.org/rules/no-side-effects-in-computed-properties.html' }, fixable: null, schema: [] @@ -104,9 +103,9 @@ module.exports = { } const targetBody = scopeStack.body - const computedProperty = /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get( - vueNode - )).find((cp) => { + const computedProperty = /** @type {ComponentComputedProperty[]} */ ( + computedPropertiesMap.get(vueNode) + ).find((cp) => { return ( cp.value && node.loc.start.line >= cp.value.loc.start.line && diff --git ORI/eslint-plugin-vue/lib/rules/no-spaces-around-equal-signs-in-attribute.js ALT/eslint-plugin-vue/lib/rules/no-spaces-around-equal-signs-in-attribute.js index 8357fbf..31c2905 100644 --- ORI/eslint-plugin-vue/lib/rules/no-spaces-around-equal-signs-in-attribute.js +++ ALT/eslint-plugin-vue/lib/rules/no-spaces-around-equal-signs-in-attribute.js @@ -20,8 +20,7 @@ module.exports = { docs: { description: 'disallow spaces around equal signs in attribute', categories: ['vue3-strongly-recommended', 'strongly-recommended'], - url: - 'https://eslint.vuejs.org/rules/no-spaces-around-equal-signs-in-attribute.html' + url: 'https://eslint.vuejs.org/rules/no-spaces-around-equal-signs-in-attribute.html' }, fixable: 'whitespace', schema: [] diff --git ORI/eslint-plugin-vue/lib/rules/no-useless-mustaches.js ALT/eslint-plugin-vue/lib/rules/no-useless-mustaches.js index b8a2057..709617e 100644 --- ORI/eslint-plugin-vue/lib/rules/no-useless-mustaches.js +++ ALT/eslint-plugin-vue/lib/rules/no-useless-mustaches.js @@ -19,9 +19,10 @@ function stripQuotesForHTML(text) { return text.slice(1, -1) } - const re = /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec( - text - ) + const re = + /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec( + text + ) if (!re) { return null } diff --git ORI/eslint-plugin-vue/lib/rules/no-useless-v-bind.js ALT/eslint-plugin-vue/lib/rules/no-useless-v-bind.js index 01549ca..c2440da 100644 --- ORI/eslint-plugin-vue/lib/rules/no-useless-v-bind.js +++ ALT/eslint-plugin-vue/lib/rules/no-useless-v-bind.js @@ -144,7 +144,8 @@ module.exports = { } return utils.defineTemplateBodyVisitor(context, { - "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]": verify + "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]": + verify }) } } diff --git ORI/eslint-plugin-vue/lib/rules/require-explicit-emits.js ALT/eslint-plugin-vue/lib/rules/require-explicit-emits.js index ec35636..7974282 100644 --- ORI/eslint-plugin-vue/lib/rules/require-explicit-emits.js +++ ALT/eslint-plugin-vue/lib/rules/require-explicit-emits.js @@ -387,10 +387,9 @@ function buildSuggest(object, emits, nameNode, context) { const sourceCode = context.getSourceCode() const emitsOptionValue = emitsOption.value if (emitsOptionValue.type === 'ArrayExpression') { - const leftBracket = /** @type {Token} */ (sourceCode.getFirstToken( - emitsOptionValue, - isLeftBracket - )) + const leftBracket = /** @type {Token} */ ( + sourceCode.getFirstToken(emitsOptionValue, isLeftBracket) + ) return [ { messageId: 'addOneOption', @@ -406,10 +405,9 @@ function buildSuggest(object, emits, nameNode, context) { } ] } else if (emitsOptionValue.type === 'ObjectExpression') { - const leftBrace = /** @type {Token} */ (sourceCode.getFirstToken( - emitsOptionValue, - isLeftBrace - )) + const leftBrace = /** @type {Token} */ ( + sourceCode.getFirstToken(emitsOptionValue, isLeftBrace) + ) return [ { messageId: 'addOneOption', @@ -451,14 +449,12 @@ function buildSuggest(object, emits, nameNode, context) { `,\nemits: ['${nameNode.value}']` ) } else { - const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken( - object, - isLeftBrace - )) - const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken( - object, - isRightBrace - )) + const objectLeftBrace = /** @type {Token} */ ( + sourceCode.getFirstToken(object, isLeftBrace) + ) + const objectRightBrace = /** @type {Token} */ ( + sourceCode.getLastToken(object, isRightBrace) + ) return fixer.insertTextAfter( objectLeftBrace, `\nemits: ['${nameNode.value}']${ @@ -488,14 +484,12 @@ function buildSuggest(object, emits, nameNode, context) { `,\nemits: {'${nameNode.value}': null}` ) } else { - const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken( - object, - isLeftBrace - )) - const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken( - object, - isRightBrace - )) + const objectLeftBrace = /** @type {Token} */ ( + sourceCode.getFirstToken(object, isLeftBrace) + ) + const objectRightBrace = /** @type {Token} */ ( + sourceCode.getLastToken(object, isRightBrace) + ) return fixer.insertTextAfter( objectLeftBrace, `\nemits: {'${nameNode.value}': null}${ diff --git ORI/eslint-plugin-vue/lib/rules/require-toggle-inside-transition.js ALT/eslint-plugin-vue/lib/rules/require-toggle-inside-transition.js index 12b77d7..223e4f9 100644 --- ORI/eslint-plugin-vue/lib/rules/require-toggle-inside-transition.js +++ ALT/eslint-plugin-vue/lib/rules/require-toggle-inside-transition.js @@ -21,8 +21,7 @@ module.exports = { description: 'require control the display of the content inside ``', categories: ['vue3-essential'], - url: - 'https://eslint.vuejs.org/rules/require-toggle-inside-transition.html' + url: 'https://eslint.vuejs.org/rules/require-toggle-inside-transition.html' }, fixable: null, schema: [], diff --git ORI/eslint-plugin-vue/lib/rules/singleline-html-element-content-newline.js ALT/eslint-plugin-vue/lib/rules/singleline-html-element-content-newline.js index 52b5ed1..2ac1eba 100644 --- ORI/eslint-plugin-vue/lib/rules/singleline-html-element-content-newline.js +++ ALT/eslint-plugin-vue/lib/rules/singleline-html-element-content-newline.js @@ -61,8 +61,7 @@ module.exports = { description: 'require a line break before and after the contents of a singleline element', categories: ['vue3-strongly-recommended', 'strongly-recommended'], - url: - 'https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html' + url: 'https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html' }, fixable: 'whitespace', schema: [ @@ -157,14 +156,12 @@ module.exports = { return } - const contentFirst = /** @type {Token} */ (template.getTokenAfter( - elem.startTag, - getTokenOption - )) - const contentLast = /** @type {Token} */ (template.getTokenBefore( - elem.endTag, - getTokenOption - )) + const contentFirst = /** @type {Token} */ ( + template.getTokenAfter(elem.startTag, getTokenOption) + ) + const contentLast = /** @type {Token} */ ( + template.getTokenBefore(elem.endTag, getTokenOption) + ) context.report({ node: template.getLastToken(elem.startTag), diff --git ORI/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js ALT/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js index 9a790e9..e670fa3 100644 --- ORI/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js +++ ALT/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js @@ -20,7 +20,8 @@ module.exports = { } return { - 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer': reportDynamicArgument + 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer': + reportDynamicArgument } } } diff --git ORI/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js ALT/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js index c356a67..af7dbcd 100644 --- ORI/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js +++ ALT/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js @@ -23,7 +23,8 @@ module.exports = { } return { - "VAttribute[directive=true] > VDirectiveKey[name.name='scope']": reportScope + "VAttribute[directive=true] > VDirectiveKey[name.name='scope']": + reportScope } } } diff --git ORI/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js ALT/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js index 1ce2748..ba59c6e 100644 --- ORI/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js +++ ALT/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js @@ -128,7 +128,8 @@ module.exports = { return { "VAttribute[directive=false][key.name='slot']": reportSlot, - "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']": reportVBindSlot + "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']": + reportVBindSlot } } } diff --git ORI/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js ALT/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js index 219d2b3..5a53a9e 100644 --- ORI/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js +++ ALT/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js @@ -27,7 +27,8 @@ module.exports = { } return { - "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']": reportPropModifierShorthand + "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']": + reportPropModifierShorthand } } } diff --git ORI/eslint-plugin-vue/lib/rules/v-for-delimiter-style.js ALT/eslint-plugin-vue/lib/rules/v-for-delimiter-style.js index ef0086c..a50b6a5 100644 --- ORI/eslint-plugin-vue/lib/rules/v-for-delimiter-style.js +++ ALT/eslint-plugin-vue/lib/rules/v-for-delimiter-style.js @@ -40,12 +40,14 @@ module.exports = { context.parserServices.getTemplateBodyTokenStore && context.parserServices.getTemplateBodyTokenStore() - const delimiterToken = /** @type {Token} */ (tokenStore.getTokenAfter( - node.left.length - ? node.left[node.left.length - 1] - : tokenStore.getFirstToken(node), - (token) => token.type !== 'Punctuator' || token.value !== ')' - )) + const delimiterToken = /** @type {Token} */ ( + tokenStore.getTokenAfter( + node.left.length + ? node.left[node.left.length - 1] + : tokenStore.getFirstToken(node), + (token) => token.type !== 'Punctuator' || token.value !== ')' + ) + ) if (delimiterToken.value === preferredDelimiter) { return diff --git ORI/eslint-plugin-vue/lib/rules/v-slot-style.js ALT/eslint-plugin-vue/lib/rules/v-slot-style.js index f0cbe36..1bb5f57 100644 --- ORI/eslint-plugin-vue/lib/rules/v-slot-style.js +++ ALT/eslint-plugin-vue/lib/rules/v-slot-style.js @@ -28,7 +28,10 @@ function normalizeOptions(options) { } if (typeof options === 'string') { - normalized.atComponent = normalized.default = normalized.named = /** @type {"shorthand" | "longform"} */ (options) + normalized.atComponent = + normalized.default = + normalized.named = + /** @type {"shorthand" | "longform"} */ (options) } else if (options != null) { /** @type {(keyof Options)[]} */ const keys = ['atComponent', 'default', 'named'] diff --git ORI/eslint-plugin-vue/lib/utils/indent-common.js ALT/eslint-plugin-vue/lib/utils/indent-common.js index 9e6bfde..c4818b4 100644 --- ORI/eslint-plugin-vue/lib/utils/indent-common.js +++ ALT/eslint-plugin-vue/lib/utils/indent-common.js @@ -739,10 +739,9 @@ module.exports.defineVisitor = function create( return true } if (parent.type === 'CallExpression' || parent.type === 'NewExpression') { - const openParen = /** @type {Token} */ (tokenStore.getTokenAfter( - parent.callee, - isNotRightParen - )) + const openParen = /** @type {Token} */ ( + tokenStore.getTokenAfter(parent.callee, isNotRightParen) + ) return parent.arguments.some( (param) => getFirstAndLastTokens(param, openParen.range[1]).firstToken @@ -1078,9 +1077,8 @@ module.exports.defineVisitor = function create( baseline.add(token) } else if (baseline.has(offsetInfo.baseToken)) { // The base token is a baseline token on this line, so inherit it. - offsetInfo.expectedIndent = offsets.get( - offsetInfo.baseToken - ).expectedIndent + offsetInfo.expectedIndent = + offsets.get(offsetInfo.baseToken).expectedIndent baseline.add(token) } else { // Otherwise, set the expected indent of this line. @@ -1215,10 +1213,9 @@ module.exports.defineVisitor = function create( VForExpression(node) { const firstToken = tokenStore.getFirstToken(node) const lastOfLeft = last(node.left) || firstToken - const inToken = /** @type {Token} */ (tokenStore.getTokenAfter( - lastOfLeft, - isNotRightParen - )) + const inToken = /** @type {Token} */ ( + tokenStore.getTokenAfter(lastOfLeft, isNotRightParen) + ) const rightToken = tokenStore.getFirstToken(node.right) if (isLeftParen(firstToken)) { @@ -1296,10 +1293,9 @@ module.exports.defineVisitor = function create( node ) { const leftToken = getChainHeadToken(node) - const opToken = /** @type {Token} */ (tokenStore.getTokenAfter( - node.left, - isNotRightParen - )) + const opToken = /** @type {Token} */ ( + tokenStore.getTokenAfter(node.left, isNotRightParen) + ) const rightToken = tokenStore.getTokenAfter(opToken) const prevToken = tokenStore.getTokenBefore(leftToken) const shouldIndent = @@ -1392,15 +1388,13 @@ module.exports.defineVisitor = function create( ConditionalExpression(node) { const prevToken = tokenStore.getTokenBefore(node) const firstToken = tokenStore.getFirstToken(node) - const questionToken = /** @type {Token} */ (tokenStore.getTokenAfter( - node.test, - isNotRightParen - )) + const questionToken = /** @type {Token} */ ( + tokenStore.getTokenAfter(node.test, isNotRightParen) + ) const consequentToken = tokenStore.getTokenAfter(questionToken) - const colonToken = /** @type {Token} */ (tokenStore.getTokenAfter( - node.consequent, - isNotRightParen - )) + const colonToken = /** @type {Token} */ ( + tokenStore.getTokenAfter(node.consequent, isNotRightParen) + ) const alternateToken = tokenStore.getTokenAfter(colonToken) const isFlat = prevToken && @@ -1421,10 +1415,9 @@ module.exports.defineVisitor = function create( /** @param {DoWhileStatement} node */ DoWhileStatement(node) { const doToken = tokenStore.getFirstToken(node) - const whileToken = /** @type {Token} */ (tokenStore.getTokenAfter( - node.body, - isNotRightParen - )) + const whileToken = /** @type {Token} */ ( + tokenStore.getTokenAfter(node.body, isNotRightParen) + ) const leftToken = tokenStore.getTokenAfter(whileToken) const testToken = tokenStore.getTokenAfter(leftToken) const lastToken = tokenStore.getLastToken(node) @@ -1464,8 +1457,8 @@ module.exports.defineVisitor = function create( ExportDefaultDeclaration(node) { const exportToken = tokenStore.getFirstToken(node) const defaultToken = tokenStore.getFirstToken(node, 1) - const declarationToken = getFirstAndLastTokens(node.declaration) - .firstToken + const declarationToken = + getFirstAndLastTokens(node.declaration).firstToken setOffset([defaultToken, declarationToken], 1, exportToken) }, /** @param {ExportNamedDeclaration} node */ @@ -1480,10 +1473,9 @@ module.exports.defineVisitor = function create( if (!firstSpecifier || firstSpecifier.type === 'ExportSpecifier') { // export {foo, bar}; or export {foo, bar} from "mod"; const leftParenToken = tokenStore.getFirstToken(node, 1) - const rightParenToken = /** @type {Token} */ (tokenStore.getLastToken( - node, - isRightBrace - )) + const rightParenToken = /** @type {Token} */ ( + tokenStore.getLastToken(node, isRightBrace) + ) setOffset(leftParenToken, 0, exportToken) processNodeList(node.specifiers, leftParenToken, rightParenToken, 1) @@ -1517,10 +1509,9 @@ module.exports.defineVisitor = function create( null const leftParenToken = tokenStore.getTokenAfter(awaitToken || forToken) const leftToken = tokenStore.getTokenAfter(leftParenToken) - const inToken = /** @type {Token} */ (tokenStore.getTokenAfter( - leftToken, - isNotRightParen - )) + const inToken = /** @type {Token} */ ( + tokenStore.getTokenAfter(leftToken, isNotRightParen) + ) const rightToken = tokenStore.getTokenAfter(inToken) const rightParenToken = tokenStore.getTokenBefore( node.body, @@ -1615,10 +1606,9 @@ module.exports.defineVisitor = function create( processMaybeBlock(node.consequent, ifToken) if (node.alternate != null) { - const elseToken = /** @type {Token} */ (tokenStore.getTokenAfter( - node.consequent, - isNotRightParen - )) + const elseToken = /** @type {Token} */ ( + tokenStore.getTokenAfter(node.consequent, isNotRightParen) + ) setOffset(elseToken, 0, ifToken) processMaybeBlock(node.alternate, elseToken) @@ -1739,10 +1729,9 @@ module.exports.defineVisitor = function create( 'MemberExpression, MetaProperty'(node) { const objectToken = tokenStore.getFirstToken(node) if (node.type === 'MemberExpression' && node.computed) { - const leftBracketToken = /** @type {Token} */ (tokenStore.getTokenBefore( - node.property, - isLeftBracket - )) + const leftBracketToken = /** @type {Token} */ ( + tokenStore.getTokenBefore(node.property, isLeftBracket) + ) const propertyToken = tokenStore.getTokenAfter(leftBracketToken) const rightBracketToken = tokenStore.getTokenAfter( node.property, @@ -1772,15 +1761,13 @@ module.exports.defineVisitor = function create( /** @type {Token} */ let lastKeyToken if (node.computed) { - const keyLeftToken = /** @type {Token} */ (tokenStore.getFirstToken( - node, - isLeftBracket - )) + const keyLeftToken = /** @type {Token} */ ( + tokenStore.getFirstToken(node, isLeftBracket) + ) const keyToken = tokenStore.getTokenAfter(keyLeftToken) - const keyRightToken = (lastKeyToken = /** @type {Token} */ (tokenStore.getTokenAfter( - node.key, - isRightBracket - ))) + const keyRightToken = (lastKeyToken = /** @type {Token} */ ( + tokenStore.getTokenAfter(node.key, isRightBracket) + )) if (hasPrefix) { setOffset(keyLeftToken, 0, /** @type {Token} */ (last(prefixTokens))) @@ -1864,10 +1851,9 @@ module.exports.defineVisitor = function create( const switchToken = tokenStore.getFirstToken(node) const leftParenToken = tokenStore.getTokenAfter(switchToken) const discriminantToken = tokenStore.getTokenAfter(leftParenToken) - const leftBraceToken = /** @type {Token} */ (tokenStore.getTokenAfter( - node.discriminant, - isLeftBrace - )) + const leftBraceToken = /** @type {Token} */ ( + tokenStore.getTokenAfter(node.discriminant, isLeftBrace) + ) const rightParenToken = tokenStore.getTokenBefore(leftBraceToken) const rightBraceToken = tokenStore.getLastToken(node) diff --git ORI/eslint-plugin-vue/lib/utils/index.js ALT/eslint-plugin-vue/lib/utils/index.js index 0bcf801..055ffb4 100644 --- ORI/eslint-plugin-vue/lib/utils/index.js +++ ALT/eslint-plugin-vue/lib/utils/index.js @@ -274,10 +274,9 @@ module.exports = { // Move `Program` handlers to `VElement[parent.type!='VElement']` const coreHandlers = coreRule.create(context) - const handlers = /** @type {TemplateListener} */ (Object.assign( - {}, - coreHandlers - )) + const handlers = /** @type {TemplateListener} */ ( + Object.assign({}, coreHandlers) + ) if (handlers.Program) { handlers["VElement[parent.type!='VElement']"] = handlers.Program delete handlers.Program @@ -838,11 +837,14 @@ module.exports = { if (propValue.type === 'FunctionExpression') { value = propValue.body } else if (propValue.type === 'ObjectExpression') { - const get = /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty( - propValue, - 'get', - (p) => p.value.type === 'FunctionExpression' - )) + const get = + /** @type {(Property & { value: FunctionExpression }) | null} */ ( + findProperty( + propValue, + 'get', + (p) => p.value.type === 'FunctionExpression' + ) + ) value = get ? get.value.body : null } @@ -870,13 +872,16 @@ module.exports = { } if (arg.type === 'ObjectExpression') { - const getProperty = /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty( - arg, - 'get', - (p) => - p.value.type === 'FunctionExpression' || - p.value.type === 'ArrowFunctionExpression' - )) + const getProperty = + /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ ( + findProperty( + arg, + 'get', + (p) => + p.value.type === 'FunctionExpression' || + p.value.type === 'ArrowFunctionExpression' + ) + ) return getProperty ? getProperty.value : null } diff --git ORI/eslint-plugin-vue/tests/lib/rules/attribute-hyphenation.js ALT/eslint-plugin-vue/tests/lib/rules/attribute-hyphenation.js index 284017a..7e7f2ea 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/attribute-hyphenation.js +++ ALT/eslint-plugin-vue/tests/lib/rules/attribute-hyphenation.js @@ -29,26 +29,22 @@ ruleTester.run('attribute-hyphenation', rule, { }, { filename: 'test.vue', - code: - '', + code: '', options: ['always'] }, { filename: 'test.vue', - code: - '', + code: '', options: ['never'] }, { filename: 'test.vue', - code: - '', + code: '', options: ['never'] }, { filename: 'test.vue', - code: - '', + code: '', options: ['never', { ignore: ['custom-hyphen', 'second-custom'] }] }, { @@ -120,8 +116,7 @@ ruleTester.run('attribute-hyphenation', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', options: ['never'], @@ -135,8 +130,7 @@ ruleTester.run('attribute-hyphenation', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', options: ['always'], @@ -150,8 +144,7 @@ ruleTester.run('attribute-hyphenation', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', options: ['always', { ignore: [] }], @@ -165,8 +158,7 @@ ruleTester.run('attribute-hyphenation', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', options: ['never', { ignore: ['my-prop'] }], @@ -180,8 +172,7 @@ ruleTester.run('attribute-hyphenation', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', options: ['always', { ignore: ['secondProp'] }], @@ -195,8 +186,7 @@ ruleTester.run('attribute-hyphenation', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', options: ['always', { ignore: ['secondPropID'] }], diff --git ORI/eslint-plugin-vue/tests/lib/rules/attributes-order.js ALT/eslint-plugin-vue/tests/lib/rules/attributes-order.js index 97c3b6e..2476642 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/attributes-order.js +++ ALT/eslint-plugin-vue/tests/lib/rules/attributes-order.js @@ -171,13 +171,11 @@ tester.run('attributes-order', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '', + code: '', options: [ { order: [ @@ -198,8 +196,7 @@ tester.run('attributes-order', rule, { }, { filename: 'test.vue', - code: - '', + code: '', options: [ { order: [ @@ -509,8 +506,7 @@ tester.run('attributes-order', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -522,8 +518,7 @@ tester.run('attributes-order', rule, { }, { filename: 'test.vue', - code: - '', + code: '', options: [ { order: [ diff --git ORI/eslint-plugin-vue/tests/lib/rules/block-spacing.js ALT/eslint-plugin-vue/tests/lib/rules/block-spacing.js index 1c4c531..c06d54e 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/block-spacing.js +++ ALT/eslint-plugin-vue/tests/lib/rules/block-spacing.js @@ -15,8 +15,7 @@ tester.run('block-spacing', rule, { valid: [ '', { - code: - '', + code: '', options: ['never'] }, '' @@ -114,8 +113,7 @@ tester.run('block-spacing', rule, { ] }, { - code: - '', + code: '', output: '', errors: [ diff --git ORI/eslint-plugin-vue/tests/lib/rules/block-tag-newline.js ALT/eslint-plugin-vue/tests/lib/rules/block-tag-newline.js index 9242787..a727b0b 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/block-tag-newline.js +++ ALT/eslint-plugin-vue/tests/lib/rules/block-tag-newline.js @@ -24,13 +24,11 @@ tester.run('block-tag-newline', rule, { options: [{ singleline: 'never', multiline: 'never' }] }, { - code: - '\n', + code: '\n', options: [{ singleline: 'always', multiline: 'always' }] }, { - code: - '\n', + code: '\n', options: [{ singleline: 'always', multiline: 'always', maxEmptyLines: 1 }] }, { @@ -42,8 +40,7 @@ tester.run('block-tag-newline', rule, { options: [{ multiline: 'never' }] }, { - code: - '\n', + code: '\n', options: [{ singleline: 'never' }] }, // invalid @@ -110,8 +107,7 @@ tester.run('block-tag-newline', rule, { ] }, { - code: - '\n', + code: '\n', output: '\n', options: [{ singleline: 'never', multiline: 'never' }], errors: [ @@ -166,8 +162,7 @@ tester.run('block-tag-newline', rule, { ] }, { - code: - '\n', + code: '\n', output: '\n', options: [{ singleline: 'always', multiline: 'always' }], @@ -199,8 +194,7 @@ tester.run('block-tag-newline', rule, { ] }, { - code: - '\n', + code: '\n', output: '\n', options: [ @@ -222,8 +216,7 @@ tester.run('block-tag-newline', rule, { ] }, { - code: - '\n\n#', + code: '\n\n#', output: '\n\n#\n', options: [ diff --git ORI/eslint-plugin-vue/tests/lib/rules/brace-style.js ALT/eslint-plugin-vue/tests/lib/rules/brace-style.js index 24a41d2..cfea735 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/brace-style.js +++ ALT/eslint-plugin-vue/tests/lib/rules/brace-style.js @@ -69,8 +69,7 @@ tester.run('brace-style', rule, { ] }, { - code: - '', + code: '', output: ``, diff --git ORI/eslint-plugin-vue/tests/lib/rules/component-name-in-template-casing.js ALT/eslint-plugin-vue/tests/lib/rules/component-name-in-template-casing.js index 31c4ae8..baeb664 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/component-name-in-template-casing.js +++ ALT/eslint-plugin-vue/tests/lib/rules/component-name-in-template-casing.js @@ -121,8 +121,7 @@ tester.run('component-name-in-template-casing', rule, { ] }, { - code: - '', + code: '', options: [ 'PascalCase', { ignores: ['custom-element'], registeredComponentsOnly: false } diff --git ORI/eslint-plugin-vue/tests/lib/rules/component-tags-order.js ALT/eslint-plugin-vue/tests/lib/rules/component-tags-order.js index 1630cbe..0c40d49 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/component-tags-order.js +++ ALT/eslint-plugin-vue/tests/lib/rules/component-tags-order.js @@ -73,20 +73,17 @@ tester.run('component-tags-order', rule, { options: [{ order: ['template', 'docs', 'script', 'style'] }] }, { - code: - '', + code: '', output: null, options: [{ order: ['template', 'script', 'style'] }] }, { - code: - '
text

', + code: '
text

', output: null, options: [{ order: ['docs', 'script', 'template', 'style'] }] }, { - code: - '', + code: '', output: null, options: [{ order: [['docs', 'script', 'template'], 'style'] }] }, diff --git ORI/eslint-plugin-vue/tests/lib/rules/mustache-interpolation-spacing.js ALT/eslint-plugin-vue/tests/lib/rules/mustache-interpolation-spacing.js index 45818fe..f010fce 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/mustache-interpolation-spacing.js +++ ALT/eslint-plugin-vue/tests/lib/rules/mustache-interpolation-spacing.js @@ -32,13 +32,11 @@ ruleTester.run('mustache-interpolation-spacing', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-confusing-v-for-v-if.js ALT/eslint-plugin-vue/tests/lib/rules/no-confusing-v-for-v-if.js index c94d1b3..47959ae 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-confusing-v-for-v-if.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-confusing-v-for-v-if.js @@ -29,36 +29,30 @@ tester.run('no-confusing-v-for-v-if', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '' + code: '' } ], invalid: [ { filename: 'test.vue', - code: - '', + code: '', errors: ["This 'v-if' should be moved to the wrapper element."] }, { filename: 'test.vue', - code: - '', + code: '', errors: ["This 'v-if' should be moved to the wrapper element."] } ] diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-deprecated-filter.js ALT/eslint-plugin-vue/tests/lib/rules/no-deprecated-filter.js index a6158ab..e21d2b6 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-deprecated-filter.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-deprecated-filter.js @@ -57,8 +57,7 @@ ruleTester.run('no-deprecated-filter', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: ['Filters are deprecated.'] }, { @@ -73,8 +72,7 @@ ruleTester.run('no-deprecated-filter', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: ['Filters are deprecated.'] } ] diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-deprecated-inline-template.js ALT/eslint-plugin-vue/tests/lib/rules/no-deprecated-inline-template.js index 3ee8e99..e64511a 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-deprecated-inline-template.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-deprecated-inline-template.js @@ -32,21 +32,18 @@ ruleTester.run('no-deprecated-inline-template', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '' + code: '' } ], invalid: [ { filename: 'test.vue', - code: - '', + code: '', errors: [ { line: 1, @@ -59,14 +56,12 @@ ruleTester.run('no-deprecated-inline-template', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] } ] diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-deprecated-v-bind-sync.js ALT/eslint-plugin-vue/tests/lib/rules/no-deprecated-v-bind-sync.js index 469d2f5..6f9d686 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-deprecated-v-bind-sync.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-deprecated-v-bind-sync.js @@ -59,8 +59,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - "", + code: "", output: "", errors: [ "'.sync' modifier on 'v-bind' directive is deprecated. Use 'v-model:propName' instead." @@ -92,8 +91,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -102,8 +100,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -112,8 +109,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -122,8 +118,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -132,8 +127,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -142,8 +136,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -152,8 +145,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -162,8 +154,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -172,8 +163,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -182,8 +172,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -192,8 +181,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -202,8 +190,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-deprecated-v-on-number-modifiers.js ALT/eslint-plugin-vue/tests/lib/rules/no-deprecated-v-on-number-modifiers.js index 9edf2a2..dc7ae65 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-deprecated-v-on-number-modifiers.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-deprecated-v-on-number-modifiers.js @@ -56,8 +56,7 @@ ruleTester.run('no-deprecated-v-on-number-modifiers', rule, { }, { filename: 'test.vue', - code: - "" + code: "" }, { filename: 'test.vue', @@ -111,8 +110,7 @@ ruleTester.run('no-deprecated-v-on-number-modifiers', rule, { }, { filename: 'test.vue', - code: - "", + code: "", output: "", errors: [ @@ -121,8 +119,7 @@ ruleTester.run('no-deprecated-v-on-number-modifiers', rule, { }, { filename: 'test.vue', - code: - "", + code: "", output: "", errors: [ diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-dupe-v-else-if.js ALT/eslint-plugin-vue/tests/lib/rules/no-dupe-v-else-if.js index 0b5698f..214657a 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-dupe-v-else-if.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-dupe-v-else-if.js @@ -370,56 +370,47 @@ tester.run('no-dupe-v-else-if', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }, { messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [ { messageId: 'unexpected' }, { messageId: 'unexpected' }, @@ -428,20 +419,17 @@ tester.run('no-dupe-v-else-if', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { @@ -451,14 +439,12 @@ tester.run('no-dupe-v-else-if', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { @@ -468,14 +454,12 @@ tester.run('no-dupe-v-else-if', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { @@ -485,32 +469,27 @@ tester.run('no-dupe-v-else-if', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }, { messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { @@ -520,110 +499,92 @@ tester.run('no-dupe-v-else-if', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { @@ -633,8 +594,7 @@ tester.run('no-dupe-v-else-if', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { @@ -649,8 +609,7 @@ tester.run('no-dupe-v-else-if', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [{ messageId: 'unexpected' }] }, { diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-duplicate-attributes.js ALT/eslint-plugin-vue/tests/lib/rules/no-duplicate-attributes.js index 661cf1f..baa79dc 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-duplicate-attributes.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-duplicate-attributes.js @@ -33,8 +33,7 @@ tester.run('no-duplicate-attributes', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-extra-parens.js ALT/eslint-plugin-vue/tests/lib/rules/no-extra-parens.js index 9b7ce31..1bb704b 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-extra-parens.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-extra-parens.js @@ -157,15 +157,13 @@ tester.run('no-extra-parens', rule, { errors: [{ messageId: 'unexpected' }] }, { - code: - '', + code: '', output: '', errors: [{ messageId: 'unexpected' }] }, { - code: - '', + code: '', output: '', errors: [{ messageId: 'unexpected' }] diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js ALT/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js index 85a0ad4..9c3a40c 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js @@ -11,9 +11,10 @@ const tester = new RuleTester({ parserOptions: { ecmaVersion: 2018 } }) -const IRREGULAR_WHITESPACES = '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split( - '' -) +const IRREGULAR_WHITESPACES = + '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split( + '' + ) const IRREGULAR_LINE_TERMINATORS = '\u2028\u2029'.split('') const ALL_IRREGULAR_WHITESPACES = [].concat( IRREGULAR_WHITESPACES, diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-multi-spaces.js ALT/eslint-plugin-vue/tests/lib/rules/no-multi-spaces.js index f7772db..3476727 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-multi-spaces.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-multi-spaces.js @@ -198,8 +198,7 @@ ruleTester.run('no-multi-spaces', rule, { ] }, { - code: - '', + code: '', output: '', errors: [ { diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-multiple-template-root.js ALT/eslint-plugin-vue/tests/lib/rules/no-multiple-template-root.js index aefaa1a..f7004b8 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-multiple-template-root.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-multiple-template-root.js @@ -36,13 +36,11 @@ ruleTester.run('no-multiple-template-root', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', @@ -54,8 +52,7 @@ ruleTester.run('no-multiple-template-root', rule, { }, { filename: 'test.vue', - code: - '' + code: '' } ], invalid: [ diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-parsing-error.js ALT/eslint-plugin-vue/tests/lib/rules/no-parsing-error.js index 46733a3..174399d 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-parsing-error.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-parsing-error.js @@ -37,8 +37,7 @@ tester.run('no-parsing-error', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-restricted-static-attribute.js ALT/eslint-plugin-vue/tests/lib/rules/no-restricted-static-attribute.js index 1b57e91..e0c4de1 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-restricted-static-attribute.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-restricted-static-attribute.js @@ -104,8 +104,7 @@ tester.run('no-restricted-static-attribute', rule, { }, { filename: 'test.vue', - code: - '', + code: '', options: [ '/^vv/', { key: 'foo', value: true }, diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-restricted-v-bind.js ALT/eslint-plugin-vue/tests/lib/rules/no-restricted-v-bind.js index 6a7f0a4..e6dd72d 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-restricted-v-bind.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-restricted-v-bind.js @@ -109,8 +109,7 @@ tester.run('no-restricted-v-bind', rule, { }, { filename: 'test.vue', - code: - '', + code: '', options: ['/^v-/', { argument: 'foo', modifiers: ['sync'] }, null], errors: [ 'Using `:v-on` is not allowed.', diff --git ORI/eslint-plugin-vue/tests/lib/rules/no-template-key.js ALT/eslint-plugin-vue/tests/lib/rules/no-template-key.js index 9ec20a7..599e150 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/no-template-key.js +++ ALT/eslint-plugin-vue/tests/lib/rules/no-template-key.js @@ -45,25 +45,21 @@ tester.run('no-template-key', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', // It is probably not valid, but it works as the Vue.js 3.x compiler. // We can prevent it with other rules. e.g. vue/require-v-for-key - code: - '' + code: '' } ], invalid: [ @@ -76,8 +72,7 @@ tester.run('no-template-key', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [ "'