prettier / prettier-regression-testing

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

2.3 final regression checking #62

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 :: babel/babel@2ae19d01b132f5222e1d5bee2c83921e2f107d70

Diff (1165 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 e5fc984d..ab813388 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 @@ -67,182 +67,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 }], }, @@ -268,8 +238,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 }], }, ], @@ -309,8 +278,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: [ { @@ -332,8 +300,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: [ { @@ -344,8 +311,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: [ { @@ -356,8 +322,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: [ { @@ -368,8 +333,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: [ { @@ -380,8 +344,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: [ { @@ -392,8 +355,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: [ { @@ -404,8 +366,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: [ { @@ -416,8 +377,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: [ { @@ -428,8 +388,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: [ { @@ -440,8 +399,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: [ { @@ -452,8 +410,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: [ { @@ -464,8 +421,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: [ { @@ -476,8 +432,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: [ { @@ -488,8 +443,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: [ { @@ -500,8 +454,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: [ { @@ -512,8 +465,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: [ { @@ -524,8 +476,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: [ { @@ -536,8 +487,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: [ { @@ -548,8 +498,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: [ { @@ -560,8 +509,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: [ { @@ -572,8 +520,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: [ { @@ -584,8 +531,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: [ { @@ -596,8 +542,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: [ { @@ -608,8 +553,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: [ { @@ -620,8 +564,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: [ { @@ -632,8 +575,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: [ { @@ -644,8 +586,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: [ { @@ -656,8 +597,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: [ { @@ -668,8 +608,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: [ { @@ -680,8 +619,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: [ { @@ -692,8 +630,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: [ { @@ -706,8 +643,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: [ { @@ -718,8 +654,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: [ { @@ -730,8 +665,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 d51a2102..1d5a8d78 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), ); @@ -574,8 +572,12 @@ function makeChainWalker({ // that we don't do extra work loading extended configs if a file is // ignored. if ( - flattenedConfigs.some(({ config: { options: { ignore, only } } }) => - shouldIgnore(context, ignore, only, dirname), + flattenedConfigs.some( + ({ + config: { + options: { ignore, only }, + }, + }) => shouldIgnore(context, ignore, only, dirname), ) ) { return null; @@ -705,10 +707,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 4e2f4ba8..1875185f 100644 --- ORI/babel/packages/babel-core/src/config/files/plugins.js +++ ALT/babel/packages/babel-core/src/config/files/plugins.js @@ -20,8 +20,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/full.js ALT/babel/packages/babel-core/src/config/full.js index 1e185518..f0a2632d 100644 --- ORI/babel/packages/babel-core/src/config/full.js +++ ALT/babel/packages/babel-core/src/config/full.js @@ -270,12 +270,10 @@ const makeDescriptorLoader = ( return { value: item, options, dirname, alias }; }); -const pluginDescriptorLoader = makeDescriptorLoader( - makePluginAPI, -); -const presetDescriptorLoader = makeDescriptorLoader( - makePresetAPI, -); +const pluginDescriptorLoader = + makeDescriptorLoader(makePluginAPI); +const presetDescriptorLoader = + makeDescriptorLoader(makePresetAPI); /** * Instantiate a plugin for the given descriptor, returning the plugin/options pair. diff --git ORI/babel/packages/babel-core/src/config/validation/options.js ALT/babel/packages/babel-core/src/config/validation/options.js index 6289286e..67f9d593 100644 --- ORI/babel/packages/babel-core/src/config/validation/options.js +++ ALT/babel/packages/babel-core/src/config/validation/options.js @@ -426,10 +426,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/file/file.js ALT/babel/packages/babel-core/src/transformation/file/file.js index 70374652..fd5c1dad 100644 --- ORI/babel/packages/babel-core/src/transformation/file/file.js +++ ALT/babel/packages/babel-core/src/transformation/file/file.js @@ -176,9 +176,8 @@ export default class File { // make sure that the helper exists helpers.ensure(name, File); - const uid = (this.declarations[name] = this.scope.generateUidIdentifier( - name, - )); + const uid = (this.declarations[name] = + this.scope.generateUidIdentifier(name)); const dependencies = {}; for (const dep of helpers.getDependencies(name)) { diff --git ORI/babel/packages/babel-core/src/transformation/normalize-file.js ALT/babel/packages/babel-core/src/transformation/normalize-file.js index aca84e1e..8734534c 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/helpers/esm.js ALT/babel/packages/babel-core/test/helpers/esm.js index c485f1fa..8565d61e 100644 --- ORI/babel/packages/babel-core/test/helpers/esm.js +++ ALT/babel/packages/babel-core/test/helpers/esm.js @@ -66,7 +66,8 @@ async function spawn(runner, filename, cwd = process.cwd()) { { cwd, env: process.env }, ); - 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/index.js ALT/babel/packages/babel-helper-create-class-features-plugin/src/index.js index 5aa2db72..47c84171 100644 --- ORI/babel/packages/babel-helper-create-class-features-plugin/src/index.js +++ ALT/babel/packages/babel-helper-create-class-features-plugin/src/index.js @@ -210,21 +210,17 @@ export function createClassFeaturePlugin({ )); } else { keysNodes = extractComputedKeys(ref, path, computedPaths, this.file); - ({ - staticNodes, - pureStaticNodes, - instanceNodes, - wrapClass, - } = buildFieldsInitNodes( - ref, - path.node.superClass, - props, - privateNamesMap, - state, - setPublicClassFields ?? loose, - privateFieldsAsProperties ?? loose, - constantSuper ?? loose, - )); + ({ staticNodes, pureStaticNodes, instanceNodes, wrapClass } = + buildFieldsInitNodes( + ref, + path.node.superClass, + props, + privateNamesMap, + state, + setPublicClassFields ?? loose, + privateFieldsAsProperties ?? loose, + constantSuper ?? loose, + )); } if (instanceNodes.length > 0) { diff --git ORI/babel/packages/babel-helper-module-transforms/src/index.js ALT/babel/packages/babel-helper-module-transforms/src/index.js index 558913a7..53fb1851 100644 --- ORI/babel/packages/babel-helper-module-transforms/src/index.js +++ ALT/babel/packages/babel-helper-module-transforms/src/index.js @@ -249,23 +249,26 @@ function buildESModuleHeader( metadata: ModuleMetadata, enumerableModuleMeta: boolean = false, ) { - return (enumerableModuleMeta - ? template.statement` + return ( + enumerableModuleMeta + ? 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, constantReexports) { - return (constantReexports - ? template.statement` + return ( + constantReexports + ? template.statement` Object.keys(NAMESPACE).forEach(function(key) { if (key === "default" || key === "__esModule") return; VERIFY_NAME_LIST; @@ -274,13 +277,13 @@ function buildNamespaceReexport(metadata, namespace, constantReexports) { 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; @@ -293,7 +296,8 @@ function buildNamespaceReexport(metadata, namespace, constantReexports) { }, }); }); - `)({ + ` + )({ 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 a5de3a24..0f7af46a 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 521b2857..e8473742 100644 --- ORI/babel/packages/babel-parser/src/parser/statement.js +++ ALT/babel/packages/babel-parser/src/parser/statement.js @@ -322,9 +322,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]); @@ -337,9 +336,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); @@ -2002,9 +2000,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/plugin-utils.js ALT/babel/packages/babel-parser/src/plugin-utils.js index 777ee42b..a28f7ef7 100644 --- ORI/babel/packages/babel-parser/src/plugin-utils.js +++ ALT/babel/packages/babel-parser/src/plugin-utils.js @@ -138,6 +138,5 @@ export const mixinPlugins: { [name: string]: MixinPlugin } = { placeholders, }; -export const mixinPluginNames: $ReadOnlyArray = Object.keys( - mixinPlugins, -); +export const mixinPluginNames: $ReadOnlyArray = + Object.keys(mixinPlugins); diff --git ORI/babel/packages/babel-parser/src/plugins/flow/index.js ALT/babel/packages/babel-parser/src/plugins/flow/index.js index 01bf25e2..9dfa320e 100644 --- ORI/babel/packages/babel-parser/src/plugins/flow/index.js +++ ALT/babel/packages/babel-parser/src/plugins/flow/index.js @@ -1350,9 +1350,7 @@ export default (superClass: Class): Class => return this.finishNode(node, "FunctionTypeParam"); } - flowParseFunctionTypeParams( - params: N.FlowFunctionTypeParam[] = [], - ): { + flowParseFunctionTypeParams(params: N.FlowFunctionTypeParam[] = []): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam, _this: ?N.FlowFunctionTypeParam, @@ -3093,7 +3091,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/plugins/typescript/index.js ALT/babel/packages/babel-parser/src/plugins/typescript/index.js index 56e3efc9..a562e8cb 100644 --- ORI/babel/packages/babel-parser/src/plugins/typescript/index.js +++ ALT/babel/packages/babel-parser/src/plugins/typescript/index.js @@ -475,13 +475,11 @@ export default (superClass: Class): Class => this.expect(tt.parenL); signature.parameters = this.tsParseBindingListForSignature(); if (returnTokenRequired) { - signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation( - returnToken, - ); + signature.typeAnnotation = + this.tsParseTypeOrTypePredicateAnnotation(returnToken); } else if (this.match(returnToken)) { - signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation( - returnToken, - ); + signature.typeAnnotation = + this.tsParseTypeOrTypePredicateAnnotation(returnToken); } } diff --git ORI/babel/packages/babel-parser/src/types.js ALT/babel/packages/babel-parser/src/types.js index 3217d453..9dd15b78 100644 --- ORI/babel/packages/babel-parser/src/types.js +++ ALT/babel/packages/babel-parser/src/types.js @@ -1159,9 +1159,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 d860d884..e19a7755 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 b5d232b8..2f353271 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 @@ -371,11 +371,8 @@ export default declare((api, opts) => { path.isObjectPattern(), ); - const [ - impureComputedPropertyDeclarators, - argument, - callExpression, - ] = createObjectRest(objectPatternPath, file, ref); + const [impureComputedPropertyDeclarators, argument, callExpression] = + createObjectRest(objectPatternPath, file, ref); if (pureGetters) { removeUnusedExcludedKeys(objectPatternPath); @@ -454,11 +451,8 @@ export default declare((api, opts) => { ]), ); - const [ - impureComputedPropertyDeclarators, - argument, - callExpression, - ] = createObjectRest(leftPath, file, t.identifier(refName)); + const [impureComputedPropertyDeclarators, argument, callExpression] = + createObjectRest(leftPath, file, t.identifier(refName)); if (impureComputedPropertyDeclarators.length > 0) { nodes.push( diff --git ORI/babel/packages/babel-plugin-proposal-optional-chaining/src/transform.js ALT/babel/packages/babel-plugin-proposal-optional-chaining/src/transform.js index 8bd82a56..656b4ea0 100644 --- ORI/babel/packages/babel-plugin-proposal-optional-chaining/src/transform.js +++ ALT/babel/packages/babel-plugin-proposal-optional-chaining/src/transform.js @@ -169,8 +169,9 @@ export function transform( // i.e. `?.b` in `(a?.b.c)()` if (i === 0 && parentIsCall) { // `(a?.b)()` to `(a == null ? undefined : a.b.bind(a))()` - const object = skipTransparentExprWrappers(replacementPath.get("object")) - .node; + const object = skipTransparentExprWrappers( + replacementPath.get("object"), + ).node; let baseRef; if (!pureGetters || !isSimpleMemberExpression(object)) { // memoize the context object when getters are not always pure diff --git ORI/babel/packages/babel-plugin-transform-classes/src/transformClass.js ALT/babel/packages/babel-plugin-transform-classes/src/transformClass.js index 5244e6b6..ea57e999 100644 --- ORI/babel/packages/babel-plugin-transform-classes/src/transformClass.js +++ ALT/babel/packages/babel-plugin-transform-classes/src/transformClass.js @@ -610,9 +610,8 @@ export default function transformClass( annotateAsPure(arg); } - const param = classState.scope.generateUidIdentifierBasedOnNode( - superName, - ); + const param = + classState.scope.generateUidIdentifierBasedOnNode(superName); closureParams.push(param); closureArgs.push(arg); diff --git ORI/babel/packages/babel-plugin-transform-parameters/src/params.js ALT/babel/packages/babel-plugin-transform-parameters/src/params.js index 335a8e88..aac3e64b 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-react-display-name/src/index.js ALT/babel/packages/babel-plugin-transform-react-display-name/src/index.js index dd4f190d..f19c4dd0 100644 --- ORI/babel/packages/babel-plugin-transform-react-display-name/src/index.js +++ ALT/babel/packages/babel-plugin-transform-react-display-name/src/index.js @@ -25,9 +25,8 @@ export default declare(api => { } } - const isCreateClassCallExpression = t.buildMatchMemberExpression( - "React.createClass", - ); + const isCreateClassCallExpression = + t.buildMatchMemberExpression("React.createClass"); const isCreateClassAddon = callee => callee.name === "createReactClass"; function isCreateClass(node) { diff --git ORI/babel/packages/babel-plugin-transform-react-jsx-source/src/index.js ALT/babel/packages/babel-plugin-transform-react-jsx-source/src/index.js index d6864995..0f5bee8a 100644 --- ORI/babel/packages/babel-plugin-transform-react-jsx-source/src/index.js +++ ALT/babel/packages/babel-plugin-transform-react-jsx-source/src/index.js @@ -68,9 +68,8 @@ export default declare(api => { if (!state.fileNameIdentifier) { const fileName = state.filename || ""; - const fileNameIdentifier = path.scope.generateUidIdentifier( - FILE_NAME_VAR, - ); + const fileNameIdentifier = + path.scope.generateUidIdentifier(FILE_NAME_VAR); const scope = path.hub.getScope(); if (scope) { scope.push({ diff --git ORI/babel/packages/babel-preset-env/src/available-plugins.js ALT/babel/packages/babel-preset-env/src/available-plugins.js index 4da14d52..0d1c9670 100644 --- ORI/babel/packages/babel-preset-env/src/available-plugins.js +++ ALT/babel/packages/babel-preset-env/src/available-plugins.js @@ -74,7 +74,8 @@ export default { "bugfix/transform-safari-block-shadowing": bugfixSafariBlockShadowing, "bugfix/transform-safari-for-shadowing": bugfixSafariForShadowing, "bugfix/transform-tagged-template-caching": bugfixTaggedTemplateCaching, - "bugfix/transform-v8-spread-parameters-in-optional-chaining": bugfixV8SpreadParametersInOptionalChaining, + "bugfix/transform-v8-spread-parameters-in-optional-chaining": + bugfixV8SpreadParametersInOptionalChaining, "proposal-async-generator-functions": proposalAsyncGeneratorFunctions, "proposal-class-properties": proposalClassProperties, "proposal-dynamic-import": proposalDynamicImport, diff --git ORI/babel/packages/babel-standalone/src/generated/plugins.js ALT/babel/packages/babel-standalone/src/generated/plugins.js index bcf2a29f..8d0b9b6c 100644 --- ORI/babel/packages/babel-standalone/src/generated/plugins.js +++ ALT/babel/packages/babel-standalone/src/generated/plugins.js @@ -262,7 +262,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, diff --git ORI/babel/packages/babel-standalone/test/babel.js ALT/babel/packages/babel-standalone/test/babel.js index cfded912..62a8f47e 100644 --- ORI/babel/packages/babel-standalone/test/babel.js +++ ALT/babel/packages/babel-standalone/test/babel.js @@ -58,8 +58,9 @@ const require = createRequire(import.meta.url); ], sourceType: "script", }; - const output = Babel.transformFromAst(ast, "42", { presets: ["es2015"] }) - .code; + const output = Babel.transformFromAst(ast, "42", { + presets: ["es2015"], + }).code; expect(output).toBe("42;"); }); ```
github-actions[bot] commented 3 years ago

prettier/prettier@main VS prettier/prettier@2.2.1 :: vuejs/eslint-plugin-vue@62f577dcfcb859c24c6e0d4615ad880f5e1d4688

Diff (3878 lines) ```diff diff --git ORI/eslint-plugin-vue/lib/rules/attributes-order.js ALT/eslint-plugin-vue/lib/rules/attributes-order.js index 8f2917d..5af387d 100644 --- ORI/eslint-plugin-vue/lib/rules/attributes-order.js +++ ALT/eslint-plugin-vue/lib/rules/attributes-order.js @@ -271,10 +271,8 @@ function create(context) { return } - let { - attr: previousNode, - position: previousPosition - } = attributeAndPositions[0] + let { attr: previousNode, position: previousPosition } = + attributeAndPositions[0] for (let index = 1; index < attributeAndPositions.length; index++) { const { attr, position } = attributeAndPositions[index] 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 e379df4..a6d2045 100644 --- ORI/eslint-plugin-vue/lib/rules/max-attributes-per-line.js +++ ALT/eslint-plugin-vue/lib/rules/max-attributes-per-line.js @@ -158,12 +158,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 c1be361..f0e3aa5 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-scope-attribute.js ALT/eslint-plugin-vue/lib/rules/no-deprecated-scope-attribute.js index e7e22c3..dcb5d62 100644 --- ORI/eslint-plugin-vue/lib/rules/no-deprecated-scope-attribute.js +++ ALT/eslint-plugin-vue/lib/rules/no-deprecated-scope-attribute.js @@ -23,9 +23,8 @@ module.exports = { }, /** @param {RuleContext} context */ create(context) { - const templateBodyVisitor = scopeAttribute.createTemplateBodyVisitor( - context - ) + const templateBodyVisitor = + scopeAttribute.createTemplateBodyVisitor(context) return utils.defineTemplateBodyVisitor(context, templateBodyVisitor) } } 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 cf3b33c..ddd6f38 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 845c42f..8e5a6ce 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 5d4dc00..749a292 100644 --- ORI/eslint-plugin-vue/lib/rules/no-useless-v-bind.js +++ ALT/eslint-plugin-vue/lib/rules/no-useless-v-bind.js @@ -145,7 +145,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 8b43927..d5fa618 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..5f1e236 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 @@ -1215,10 +1214,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 +1294,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 +1389,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 +1416,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 +1458,9 @@ 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 +1475,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 +1511,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 +1608,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 +1731,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 +1763,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 +1853,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..e78238e 100644 --- ORI/eslint-plugin-vue/lib/utils/index.js +++ ALT/eslint-plugin-vue/lib/utils/index.js @@ -266,18 +266,16 @@ module.exports = { } if (skipDynamicArgumentsReport) { - context = wrapContextToOverrideReportMethodToSkipDynamicArgument( - context - ) + context = + wrapContextToOverrideReportMethodToSkipDynamicArgument(context) } // 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 +836,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 +871,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 c956dae..b08ab16 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/attributes-order.js +++ ALT/eslint-plugin-vue/tests/lib/rules/attributes-order.js @@ -194,13 +194,11 @@ tester.run('attributes-order', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', - code: - '', + code: '', options: [ { order: [ @@ -221,8 +219,7 @@ tester.run('attributes-order', rule, { }, { filename: 'test.vue', - code: - '', + code: '', options: [ { order: [ @@ -546,8 +543,7 @@ tester.run('attributes-order', rule, { }, { filename: 'test.vue', - code: - '', + code: '', output: '', errors: [ @@ -559,8 +555,7 @@ tester.run('attributes-order', rule, { }, { filename: 'test.vue', - code: - '', + code: '', options: [ { order: [ @@ -1317,8 +1312,7 @@ tester.run('attributes-order', rule, { ] } ], - code: - '', + code: '', output: '', errors: [ @@ -1348,8 +1342,7 @@ tester.run('attributes-order', rule, { ] } ], - code: - '', + code: '', output: '', errors: [ 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/html-button-has-type.js ALT/eslint-plugin-vue/tests/lib/rules/html-button-has-type.js index d6f4048..cdf8abf 100644 --- ORI/eslint-plugin-vue/tests/lib/rules/html-button-has-type.js +++ ALT/eslint-plugin-vue/tests/lib/rules/html-button-has-type.js @@ -36,8 +36,7 @@ ruleTester.run('html-button-has-type', rule, { }, { filename: 'test.vue', - code: - '' + code: '' }, { filename: 'test.vue', @@ -191,8 +190,7 @@ ruleTester.run('html-button-has-type', rule, { }, { filename: 'test.vue', - code: - '', + code: '', errors: [ { message: 'Missing an explicit type attribute for button.', 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 7899620..69f9f26 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: '' }, // https://github.com/vuejs/eslint-plugin-vue/issues/1439 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 91b7872..2b299f0 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: [ "'