prettier / prettier-regression-testing

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

Improve lone argument detection #10672 #55

Closed thorn0 closed 3 years ago

thorn0 commented 3 years ago

run #10672

thorn0 commented 3 years ago

run #10672 vs 2.2.1

github-actions[bot] commented 3 years ago

prettier/prettier#10672 VS prettier/prettier@main

Diff (646 lines) ```diff 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/index.js ALT/babel/packages/babel-core/src/config/index.js index ef331f45..8f16f89c 100644 --- ORI/babel/packages/babel-core/src/config/index.js +++ ALT/babel/packages/babel-core/src/config/index.js @@ -25,10 +25,11 @@ const loadOptionsRunner = gensync<[mixed], Object | null>(function* (opts) { return config?.options ?? null; }); -const createConfigItemRunner = gensync<[PluginTarget, any], Object | null>( - // $FlowIgnore - createConfigItemImpl, -); +const createConfigItemRunner = + gensync<[PluginTarget, any], Object | null>( + // $FlowIgnore + createConfigItemImpl, + ); const maybeErrback = runner => (opts: mixed, callback: Function) => { if (callback === undefined && typeof opts === "function") { 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/test/api.js ALT/babel/packages/babel-core/test/api.js index a180d707..367a03fb 100644 --- ORI/babel/packages/babel-core/test/api.js +++ ALT/babel/packages/babel-core/test/api.js @@ -289,8 +289,9 @@ describe("api", function () { new Plugin({ visitor: { Function: function (path) { - const alias = - path.scope.getProgramParent().path.get("body")[0].node; + const alias = path.scope + .getProgramParent() + .path.get("body")[0].node; if (!babel.types.isTypeAlias(alias)) return; // In case of `passPerPreset` being `false`, the diff --git ORI/babel/packages/babel-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 9dfa320e..39e9e75d 100644 --- ORI/babel/packages/babel-parser/src/plugins/flow/index.js +++ ALT/babel/packages/babel-parser/src/plugins/flow/index.js @@ -379,9 +379,10 @@ export default (superClass: Class): Class => node: N.FlowDeclareVariable, ): N.FlowDeclareVariable { this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier( - /*allowPrimitiveOverride*/ true, - ); + node.id = + this.flowParseTypeAnnotatableIdentifier( + /*allowPrimitiveOverride*/ true, + ); this.scope.declareName(node.id.name, BIND_VAR, node.id.start); this.semicolon(); return this.finishNode(node, "DeclareVariable"); 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-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-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-traverse/test/evaluation.js ALT/babel/packages/babel-traverse/test/evaluation.js index d90ab87f..9056ebc6 100644 --- ORI/babel/packages/babel-traverse/test/evaluation.js +++ ALT/babel/packages/babel-traverse/test/evaluation.js @@ -121,8 +121,9 @@ describe("evaluation", function () { const input = "var a = 5; function x() { var a = 5; var b = a + 1; } var b = a + 2"; expect( - getPath(input).get("body.1.body.body.1.declarations.0.init").evaluate() - .value, + getPath(input) + .get("body.1.body.body.1.declarations.0.init") + .evaluate().value, ).toBe(6); expect( getPath(input).get("body.2.declarations.0.init").evaluate().value, 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/utils/indent-common.js ALT/eslint-plugin-vue/lib/utils/indent-common.js index c4818b4..1281291 100644 --- ORI/eslint-plugin-vue/lib/utils/indent-common.js +++ ALT/eslint-plugin-vue/lib/utils/indent-common.js @@ -1077,8 +1077,9 @@ module.exports.defineVisitor = function create( baseline.add(token) } else if (baseline.has(offsetInfo.baseToken)) { // The base token is a baseline token on this line, so inherit it. - offsetInfo.expectedIndent = - offsets.get(offsetInfo.baseToken).expectedIndent + offsetInfo.expectedIndent = offsets.get( + offsetInfo.baseToken + ).expectedIndent baseline.add(token) } else { // Otherwise, set the expected indent of this line. @@ -1457,8 +1458,8 @@ module.exports.defineVisitor = function create( ExportDefaultDeclaration(node) { const exportToken = tokenStore.getFirstToken(node) const defaultToken = tokenStore.getFirstToken(node, 1) - const declarationToken = - getFirstAndLastTokens(node.declaration).firstToken + const declarationToken = getFirstAndLastTokens(node.declaration) + .firstToken setOffset([defaultToken, declarationToken], 1, exportToken) }, /** @param {ExportNamedDeclaration} node */ diff --git ORI/eslint-plugin-vue/lib/utils/index.js ALT/eslint-plugin-vue/lib/utils/index.js index 055ffb4..e78238e 100644 --- ORI/eslint-plugin-vue/lib/utils/index.js +++ ALT/eslint-plugin-vue/lib/utils/index.js @@ -266,9 +266,8 @@ module.exports = { } if (skipDynamicArgumentsReport) { - context = wrapContextToOverrideReportMethodToSkipDynamicArgument( - context - ) + context = + wrapContextToOverrideReportMethodToSkipDynamicArgument(context) } // Move `Program` handlers to `VElement[parent.type!='VElement']` diff --git ORI/excalidraw/src/actions/actionGroup.tsx ALT/excalidraw/src/actions/actionGroup.tsx index 2e4a8a3..9546cd5 100644 --- ORI/excalidraw/src/actions/actionGroup.tsx +++ ALT/excalidraw/src/actions/actionGroup.tsx @@ -100,9 +100,8 @@ export const actionGroup = register({ // to the z order of the highest element in the layer stack const elementsInGroup = getElementsInGroup(updatedElements, newGroupId); const lastElementInGroup = elementsInGroup[elementsInGroup.length - 1]; - const lastGroupElementIndex = updatedElements.lastIndexOf( - lastElementInGroup, - ); + const lastGroupElementIndex = + updatedElements.lastIndexOf(lastElementInGroup); const elementsAfterGroup = updatedElements.slice(lastGroupElementIndex + 1); const elementsBeforeGroup = updatedElements .slice(0, lastGroupElementIndex) diff --git ORI/excalidraw/src/components/App.tsx ALT/excalidraw/src/components/App.tsx index cf84421..22949b1 100644 --- ORI/excalidraw/src/components/App.tsx +++ ALT/excalidraw/src/components/App.tsx @@ -2239,13 +2239,11 @@ class App extends React.Component { ); } - const onPointerMove = this.onPointerMoveFromPointerDownHandler( - pointerDownState, - ); + const onPointerMove = + this.onPointerMoveFromPointerDownHandler(pointerDownState); - const onPointerUp = this.onPointerUpFromPointerDownHandler( - pointerDownState, - ); + const onPointerUp = + this.onPointerUpFromPointerDownHandler(pointerDownState); const onKeyDown = this.onKeyDownFromPointerDownHandler(pointerDownState); const onKeyUp = this.onKeyUpFromPointerDownHandler(pointerDownState); diff --git ORI/excalidraw/src/components/LayerUI.tsx ALT/excalidraw/src/components/LayerUI.tsx index b976f38..9aba4fe 100644 --- ORI/excalidraw/src/components/LayerUI.tsx +++ ALT/excalidraw/src/components/LayerUI.tsx @@ -254,9 +254,8 @@ const LibraryMenu = ({ const [libraryItems, setLibraryItems] = useState([]); - const [loadingState, setIsLoading] = useState< - "preloading" | "loading" | "ready" - >("preloading"); + const [loadingState, setIsLoading] = + useState<"preloading" | "loading" | "ready">("preloading"); const loadingTimerRef = useRef(null); diff --git ORI/excalidraw/src/components/PasteChartDialog.tsx ALT/excalidraw/src/components/PasteChartDialog.tsx index 43607b3..1659f64 100644 --- ORI/excalidraw/src/components/PasteChartDialog.tsx +++ ALT/excalidraw/src/components/PasteChartDialog.tsx @@ -18,9 +18,8 @@ const ChartPreviewBtn = (props: { onClick: OnInsertChart; }) => { const previewRef = useRef(null); - const [chartElements, setChartElements] = useState( - null, - ); + const [chartElements, setChartElements] = + useState(null); useLayoutEffect(() => { if (!props.spreadsheet) { diff --git ORI/excalidraw/src/packages/excalidraw/webpack.prod.config.js ALT/excalidraw/src/packages/excalidraw/webpack.prod.config.js index e771264..fa3eaef 100644 --- ORI/excalidraw/src/packages/excalidraw/webpack.prod.config.js +++ ALT/excalidraw/src/packages/excalidraw/webpack.prod.config.js @@ -1,7 +1,7 @@ const path = require("path"); const TerserPlugin = require("terser-webpack-plugin"); -const BundleAnalyzerPlugin = - require("webpack-bundle-analyzer").BundleAnalyzerPlugin; +const BundleAnalyzerPlugin = require("webpack-bundle-analyzer") + .BundleAnalyzerPlugin; module.exports = { mode: "production", diff --git ORI/excalidraw/src/packages/utils/webpack.prod.config.js ALT/excalidraw/src/packages/utils/webpack.prod.config.js index 2888753..e9b0b94 100644 --- ORI/excalidraw/src/packages/utils/webpack.prod.config.js +++ ALT/excalidraw/src/packages/utils/webpack.prod.config.js @@ -1,7 +1,7 @@ const webpack = require("webpack"); const path = require("path"); -const BundleAnalyzerPlugin = - require("webpack-bundle-analyzer").BundleAnalyzerPlugin; +const BundleAnalyzerPlugin = require("webpack-bundle-analyzer") + .BundleAnalyzerPlugin; module.exports = { mode: "production", diff --git ORI/excalidraw/src/renderer/renderScene.ts ALT/excalidraw/src/renderer/renderScene.ts index abd32c0..dea43c2 100644 --- ORI/excalidraw/src/renderer/renderScene.ts +++ ALT/excalidraw/src/renderer/renderScene.ts @@ -340,9 +340,8 @@ export const renderScene = ( const addSelectionForGroupId = (groupId: GroupId) => { const groupElements = getElementsInGroup(elements, groupId); - const [elementX1, elementY1, elementX2, elementY2] = getCommonBounds( - groupElements, - ); + const [elementX1, elementY1, elementX2, elementY2] = + getCommonBounds(groupElements); selections.push({ angle: 0, elementX1, diff --git ORI/excalidraw/src/scene/selection.ts ALT/excalidraw/src/scene/selection.ts index 03d7427..3c883d8 100644 --- ORI/excalidraw/src/scene/selection.ts +++ ALT/excalidraw/src/scene/selection.ts @@ -12,9 +12,8 @@ export const getElementsWithinSelection = ( const [selectionX1, selectionY1, selectionX2, selectionY2] = getElementAbsoluteCoords(selection); return elements.filter((element) => { - const [elementX1, elementY1, elementX2, elementY2] = getElementBounds( - element, - ); + const [elementX1, elementY1, elementX2, elementY2] = + getElementBounds(element); return ( element.type !== "selection" && diff --git ORI/typescript-eslint/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts ALT/typescript-eslint/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts index 1fa4470..d5554ec 100644 --- ORI/typescript-eslint/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts +++ ALT/typescript-eslint/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts @@ -53,9 +53,8 @@ export default createRule({ }, defaultOptions: [], create(context) { - const { program, esTreeNodeToTSNodeMap } = ESLintUtils.getParserServices( - context, - ); + const { program, esTreeNodeToTSNodeMap } = + ESLintUtils.getParserServices(context); const checker = program.getTypeChecker(); return { diff --git ORI/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts ALT/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index c38a870..10d7d84 100644 --- ORI/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ ALT/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -55,8 +55,9 @@ function getExpectedIndentForNode( sourceCodeLines: string[], ): number { const lineIdx = node.loc.start.line - 1; - const indent = - START_OF_LINE_WHITESPACE_MATCHER.exec(sourceCodeLines[lineIdx])![1]; + const indent = START_OF_LINE_WHITESPACE_MATCHER.exec( + sourceCodeLines[lineIdx], + )![1]; return indent.length; } function doIndent(line: string, indent: number): string { @@ -332,8 +333,9 @@ export default createRule({ // +2 because we expect the string contents are indented one level const expectedIndent = parentIndent + 2; - const firstLineIndent = - START_OF_LINE_WHITESPACE_MATCHER.exec(lines[0])![1]; + const firstLineIndent = START_OF_LINE_WHITESPACE_MATCHER.exec( + lines[0], + )![1]; const requiresIndent = firstLineIndent.length > 0; if (requiresIndent) { if (firstLineIndent.length !== expectedIndent) { diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts index b1915bc..4d98176 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts @@ -47,15 +47,12 @@ export default createRule({ return; } - const tokenBeforeOpeningCurly = sourceCode.getTokenBefore( - openingCurlyToken, - )!; - const tokenBeforeClosingCurly = sourceCode.getTokenBefore( - closingCurlyToken, - )!; - const tokenAfterOpeningCurly = sourceCode.getTokenAfter( - openingCurlyToken, - )!; + const tokenBeforeOpeningCurly = + sourceCode.getTokenBefore(openingCurlyToken)!; + const tokenBeforeClosingCurly = + sourceCode.getTokenBefore(closingCurlyToken)!; + const tokenAfterOpeningCurly = + sourceCode.getTokenAfter(openingCurlyToken)!; if ( !isAllmanStyle && diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index 23ac958..ece09d8 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -175,9 +175,8 @@ export default util.createRule({ token.type === AST_TOKEN_TYPES.Keyword && token.value === 'public' ) { - const commensAfterPublicKeyword = sourceCode.getCommentsAfter( - token, - ); + const commensAfterPublicKeyword = + sourceCode.getCommentsAfter(token); if (commensAfterPublicKeyword.length) { // public /* Hi there! */ static foo() // ^^^^^^^ diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts index 7b6bf6d..deadf6c 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts @@ -1016,9 +1016,8 @@ export default createRule({ token.type === AST_TOKEN_TYPES.Punctuator && token.value === ':', )!; - const firstConsequentToken = sourceCode.getTokenAfter( - questionMarkToken, - )!; + const firstConsequentToken = + sourceCode.getTokenAfter(questionMarkToken)!; const lastConsequentToken = sourceCode.getTokenBefore(colonToken)!; const firstAlternateToken = sourceCode.getTokenAfter(colonToken)!; @@ -1208,9 +1207,8 @@ export default createRule({ node.property, isNotClosingParenToken, )!; - const secondNonObjectToken = sourceCode.getTokenAfter( - firstNonObjectToken, - )!; + const secondNonObjectToken = + sourceCode.getTokenAfter(firstNonObjectToken)!; const objectParenCount = sourceCode.getTokensBetween( object, @@ -1680,9 +1678,8 @@ export default createRule({ return; } - const firstTokenOfLine = tokenInfo.firstTokensByLineNumber.get( - lineNumber, - )!; + const firstTokenOfLine = + tokenInfo.firstTokensByLineNumber.get(lineNumber)!; if (firstTokenOfLine.loc.start.line !== lineNumber) { // Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice. diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts index adbee1e..399966b 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts @@ -179,9 +179,8 @@ export default util.createRule({ function findVariablesInScope(scope: TSESLint.Scope.Scope): void { for (const variable of scope.variables) { - const [declaration, ...extraDeclarations] = iterateDeclarations( - variable, - ); + const [declaration, ...extraDeclarations] = + iterateDeclarations(variable); if (extraDeclarations.length === 0) { continue; diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts index 566be44..7416124 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts @@ -170,8 +170,8 @@ export default createRule({ ): void { if (isTokenOnSameLine(first, second)) { const firstSpaced = sourceCode.isSpaceBetween!(first, second); - const secondType = - sourceCode.getNodeByRangeIndex(second.range[0])!.type; + const secondType = sourceCode.getNodeByRangeIndex(second.range[0])! + .type; const openingCurlyBraceMustBeSpaced = options.arraysInObjectsException && diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts index 27eb7dc..56ab826 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts @@ -200,9 +200,8 @@ export default util.createRule({ const sourceCode = context.getSourceCode(); for (const violatingNode of finalizedClassScope.finalizeUnmodifiedPrivateNonReadonlys()) { - const { esNode, nameNode } = getEsNodesFromViolatingNode( - violatingNode, - ); + const { esNode, nameNode } = + getEsNodesFromViolatingNode(violatingNode); context.report({ data: { name: sourceCode.getText(nameNode), diff --git ORI/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts ALT/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts index e00663a..e2bf060 100644 --- ORI/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts +++ ALT/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts @@ -388,9 +388,8 @@ function createWatchProgram( function hasTSConfigChanged(tsconfigPath: CanonicalPath): boolean { const stat = fs.statSync(tsconfigPath); const lastModifiedAt = stat.mtimeMs; - const cachedLastModifiedAt = tsconfigLastModifiedTimestampCache.get( - tsconfigPath, - ); + const cachedLastModifiedAt = + tsconfigLastModifiedTimestampCache.get(tsconfigPath); tsconfigLastModifiedTimestampCache.set(tsconfigPath, lastModifiedAt); diff --git ORI/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts ALT/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts index ed7c05c..3d8cb41 100644 --- ORI/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts +++ ALT/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts @@ -152,9 +152,8 @@ describe('semanticInfo', () => { const binaryExpression = ( parseResult.ast.body[0] as TSESTree.VariableDeclaration ).declarations[0].init!; - const tsBinaryExpression = parseResult.services.esTreeNodeToTSNodeMap.get( - binaryExpression, - ); + const tsBinaryExpression = + parseResult.services.esTreeNodeToTSNodeMap.get(binaryExpression); expect(tsBinaryExpression.kind).toEqual(ts.SyntaxKind.BinaryExpression); const computedPropertyString = ( @@ -188,9 +187,8 @@ describe('semanticInfo', () => { expect(arrayBoundName.name).toBe('arr'); expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); - const tsArrayBoundName = parseResult.services.esTreeNodeToTSNodeMap.get( - arrayBoundName, - ); + const tsArrayBoundName = + parseResult.services.esTreeNodeToTSNodeMap.get(arrayBoundName); expect(tsArrayBoundName).toBeDefined(); checkNumberArrayType(checker, tsArrayBoundName); @@ -216,9 +214,8 @@ describe('semanticInfo', () => { .declarations[0].id as TSESTree.Identifier; expect(boundName.name).toBe('x'); - const tsBoundName = parseResult.services.esTreeNodeToTSNodeMap.get( - boundName, - ); + const tsBoundName = + parseResult.services.esTreeNodeToTSNodeMap.get(boundName); expect(tsBoundName).toBeDefined(); expect(parseResult.services.tsNodeToESTreeNodeMap.get(tsBoundName)).toBe( @@ -299,9 +296,8 @@ function testIsolatedFile( expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); // get corresponding TS node - const tsArrayMember = parseResult.services.esTreeNodeToTSNodeMap.get( - arrayMember, - ); + const tsArrayMember = + parseResult.services.esTreeNodeToTSNodeMap.get(arrayMember); expect(tsArrayMember).toBeDefined(); expect(tsArrayMember.kind).toBe(ts.SyntaxKind.NumericLiteral); expect((tsArrayMember as ts.NumericLiteral).text).toBe('3'); diff --git ORI/vega-lite/src/compile/mark/encode/position-range.ts ALT/vega-lite/src/compile/mark/encode/position-range.ts index 14a3b39..3e56093 100644 --- ORI/vega-lite/src/compile/mark/encode/position-range.ts +++ ALT/vega-lite/src/compile/mark/encode/position-range.ts @@ -121,14 +121,13 @@ function pointPosition2OrSize( }) || position2orSize(channel, config[mark]) || position2orSize(channel, config.mark) || { - [vgChannel]: - pointPositionDefaultRef({ - model, - defaultPos, - channel, - scaleName, - scale - })() + [vgChannel]: pointPositionDefaultRef({ + model, + defaultPos, + channel, + scaleName, + scale + })() } ); } ```
github-actions[bot] commented 3 years ago

prettier/prettier#10672 VS prettier/prettier@2.2.1 :: babel/babel@2ae19d01b132f5222e1d5bee2c83921e2f107d70

Diff (1168 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..f7be0b3b 100644 --- ORI/babel/packages/babel-core/src/config/config-chain.js +++ ALT/babel/packages/babel-core/src/config/config-chain.js @@ -76,17 +76,15 @@ export function* buildPresetChain( }; } -export const buildPresetChainWalker: ( - arg: PresetInstance, - context: *, -) => * = makeChainWalker({ - root: preset => loadPresetDescriptors(preset), - env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName), - overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index), - overridesEnv: (preset, index, envName) => - loadPresetOverridesEnvDescriptors(preset)(index)(envName), - createLogger: () => () => {}, // Currently we don't support logging how preset is expanded -}); +export const buildPresetChainWalker: (arg: PresetInstance, context: *) => * = + makeChainWalker({ + root: preset => loadPresetDescriptors(preset), + env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName), + overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index), + overridesEnv: (preset, index, envName) => + loadPresetOverridesEnvDescriptors(preset)(index)(envName), + createLogger: () => () => {}, // Currently we don't support logging how preset is expanded + }); const loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) => buildRootDescriptors(preset, preset.alias, createUncachedDescriptors), ); @@ -705,10 +703,8 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions { function dedupDescriptors( items: Array, ): Array { - const map: Map< - Function, - Map, - > = new Map(); + const map: Map> = + new Map(); const descriptors = []; diff --git ORI/babel/packages/babel-core/src/config/files/plugins.js ALT/babel/packages/babel-core/src/config/files/plugins.js index 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/index.js ALT/babel/packages/babel-core/src/config/index.js index ef331f45..8f16f89c 100644 --- ORI/babel/packages/babel-core/src/config/index.js +++ ALT/babel/packages/babel-core/src/config/index.js @@ -25,10 +25,11 @@ const loadOptionsRunner = gensync<[mixed], Object | null>(function* (opts) { return config?.options ?? null; }); -const createConfigItemRunner = gensync<[PluginTarget, any], Object | null>( - // $FlowIgnore - createConfigItemImpl, -); +const createConfigItemRunner = + gensync<[PluginTarget, any], Object | null>( + // $FlowIgnore + createConfigItemImpl, + ); const maybeErrback = runner => (opts: mixed, callback: Function) => { if (callback === undefined && typeof opts === "function") { 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..39e9e75d 100644 --- ORI/babel/packages/babel-parser/src/plugins/flow/index.js +++ ALT/babel/packages/babel-parser/src/plugins/flow/index.js @@ -379,9 +379,10 @@ export default (superClass: Class): Class => node: N.FlowDeclareVariable, ): N.FlowDeclareVariable { this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier( - /*allowPrimitiveOverride*/ true, - ); + node.id = + this.flowParseTypeAnnotatableIdentifier( + /*allowPrimitiveOverride*/ true, + ); this.scope.declareName(node.id.name, BIND_VAR, node.id.start); this.semicolon(); return this.finishNode(node, "DeclareVariable"); @@ -1350,9 +1351,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 +3092,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-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-traverse/test/evaluation.js ALT/babel/packages/babel-traverse/test/evaluation.js index d90ab87f..9056ebc6 100644 --- ORI/babel/packages/babel-traverse/test/evaluation.js +++ ALT/babel/packages/babel-traverse/test/evaluation.js @@ -121,8 +121,9 @@ describe("evaluation", function () { const input = "var a = 5; function x() { var a = 5; var b = a + 1; } var b = a + 2"; expect( - getPath(input).get("body.1.body.body.1.declarations.0.init").evaluate() - .value, + getPath(input) + .get("body.1.body.body.1.declarations.0.init") + .evaluate().value, ).toBe(6); expect( getPath(input).get("body.2.declarations.0.init").evaluate().value, ```
github-actions[bot] commented 3 years ago

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

Diff (3866 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..1281291 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) @@ -1480,10 +1474,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 +1510,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 +1607,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 +1730,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 +1762,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 +1852,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: [ "'