prettier / prettier-regression-testing

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

3.1 #430

Closed sosukesuzuki closed 8 months ago

sosukesuzuki commented 10 months ago

https://github.com/prettier/prettier/issues/15462

liuxingbaoyu commented 10 months ago

image The placement of comments here seems unexpected. (babel repo)

fisker commented 10 months ago

The red one is new, looks better aligned. I think?

liuxingbaoyu commented 10 months ago

image Yes, I mean the first row is not aligned with the below.

fisker commented 10 months ago

3.0.3 https://github.com/babel/babel/blob/6a84bde2115eb574ea99f2fabd996b2802428325/packages/babel-preset-env/src/available-plugins.ts#L113

3.1

https://deploy-preview-15508--prettier.netlify.app/playground/#N4Igxg9gdgLgprEAuEcAeAHCAnGACAEzgDMBDAVwBt9gAdKe+vPJlkAZwE9ZS0BaGBAx9KcAG5xKfUgHdSASxi1keABQBKPAF4AfHi480AFSEAZcZICCcxQBpWAegd4jAC3ns8HvKTwBhACkAZTwMSnIAc3koPBhXUnwiDAQCT2gfUNIwAGtSCLg8YmwIAFtY1wKS6Bw4LFt9CC8lGLwnPAAjbDhSbM9ydmiIvABRIIBZADo8AHF5CRi4hJHxjvJ5SlSfLrwoOBk8BAhI11jG+Ilyj0dnAxheA6hSdtECDs5CEgpqepkCsFIYuxSMRJO92Nl5BgHk9KIMmhNWMpbrw+OQoPJIEQ+Ow4DB2Hwuvk0MokHgAKpBYYAfVGY1YzAA-DsqJR6XhSW0AOp-AFQCD4foFOIFLoARzW23+lEoeBkFRi7TRBFhUAi9XacH+gsunm8AOWY0K6zgCJazDaACEnpJ9HcoARSJRoAVBZ5fFUiNgYhhSNgcdh6uxGgArfr4aJgcJEDLZPkyGJ8oShcJRKCm5jm5xknF4AAG7WiBFzDXKS0UAHJPHzErjNfBXqQ3YRyGEMQkCmFItFZfK8P04Yo2W1BPlhdhZYoTsKXKZLGyAJJBKlBIyWAByABFLKYAPJr4ZspltAACeL46GSYBg5+wxXHyOMZgslGsCnDTeIaKv8nScoQq3tF42WYDRtD0B8TAwcwJBfGwYAmAt7Q0NkOWcOB2BVa8CA8GE4D4XY0GvFUCj5Al0JgbAMXrPgIiddpHXYYC1E0XQ8DFCU4FUZRj3ojVKAcTtU2xbg7n4NEMQgLEcTPQl0GUdR7AYKAAF8QFsEAhBgH8oHYZBQF9YoZAABV9BBdJQR05E4XT1M6LJslxIJSBKOBTGiOBkDISgcVs7B7Mcn0wEGZAKPIOB1JxEp5BC7AwoiwZRAARXIfkPKQLyfJAYN2DQIIErgZLUs8hjwpAcVUqM4oMHMkBG3wuA4CIAg1JACiFBVCI-FKEpSGQWrpRagZVVESwYAo+RFXgIy4GwNzdmK7zStcGASkoTl3HgdhArgIIzMUOZFE4PqwHYGyQDEML53tBAYCCMBKIwGBLHtIIYE4UQFsyjBihxTk-IwPrvvQmaJBa6J-RgSq8h6z7Sp9P0Zr6t7knYe7IRgFrvuiGBOXkAg4mQAAOAAGdT2PkLooYiGH0pK9S7naXH8dcZAACZ1MFIwnnMjLSrgEoNQIJrTABCJyDyOAADEcB6sbgos8hBBAZTlKAA

The red one is new

^^^^^^^^^^^^^^^

liuxingbaoyu commented 10 months ago

Sorry, I get it, yes new is better!

fisker commented 10 months ago

He use the wrong command :)

fisker commented 10 months ago

run prettier/prettier#main vs 3.0.3

github-actions[bot] commented 10 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: babel/babel@134aa1723c6aa01a42713e379142088b30c6cc0d

Diff (554 lines) ```diff diff --git ORI/babel/packages/babel-cli/src/babel/watcher.ts ALT/babel/packages/babel-cli/src/babel/watcher.ts index 7249bda1..4ad07e5f 100644 --- ORI/babel/packages/babel-cli/src/babel/watcher.ts +++ ALT/babel/packages/babel-cli/src/babel/watcher.ts @@ -154,8 +154,8 @@ function requireChokidar(): any { return process.env.BABEL_8_BREAKING ? require("chokidar") : parseInt(process.versions.node) >= 8 - ? require("chokidar") - : require("@nicolo-ribaudo/chokidar-2"); + ? require("chokidar") + : require("@nicolo-ribaudo/chokidar-2"); } catch (err) { console.error( "The optional dependency chokidar failed to install and is required for " + diff --git ORI/babel/packages/babel-generator/src/printer.ts ALT/babel/packages/babel-generator/src/printer.ts index 6283cb13..39bcd800 100644 --- ORI/babel/packages/babel-generator/src/printer.ts +++ ALT/babel/packages/babel-generator/src/printer.ts @@ -1176,8 +1176,8 @@ class Printer { i === 0 ? COMMENT_SKIP_NEWLINE.LEADING : i === len - 1 - ? COMMENT_SKIP_NEWLINE.TRAILING - : COMMENT_SKIP_NEWLINE.DEFAULT, + ? COMMENT_SKIP_NEWLINE.TRAILING + : COMMENT_SKIP_NEWLINE.DEFAULT, ); } else { this._printComment(comment, COMMENT_SKIP_NEWLINE.DEFAULT); diff --git ORI/babel/packages/babel-helper-string-parser/src/index.ts ALT/babel/packages/babel-helper-string-parser/src/index.ts index 1e02846e..b2abe830 100644 --- ORI/babel/packages/babel-helper-string-parser/src/index.ts +++ ALT/babel/packages/babel-helper-string-parser/src/index.ts @@ -338,10 +338,10 @@ export function readInt( radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 - ? isAllowedNumericSeparatorSibling.dec - : radix === 8 - ? isAllowedNumericSeparatorSibling.oct - : isAllowedNumericSeparatorSibling.bin; + ? isAllowedNumericSeparatorSibling.dec + : radix === 8 + ? isAllowedNumericSeparatorSibling.oct + : isAllowedNumericSeparatorSibling.bin; let invalid = false; let total = 0; diff --git ORI/babel/packages/babel-helpers/src/helpers/applyDecs2301.js ALT/babel/packages/babel-helpers/src/helpers/applyDecs2301.js index eabb5362..245d90d2 100644 --- ORI/babel/packages/babel-helpers/src/helpers/applyDecs2301.js +++ ALT/babel/packages/babel-helpers/src/helpers/applyDecs2301.js @@ -136,8 +136,8 @@ function applyDecs2301Factory() { get && set ? { get: get, set: set, has: has } : get - ? { get: get, has: has } - : { set: set, has: has }; + ? { get: get, has: has } + : { set: set, has: has }; try { return dec(value, ctx); diff --git ORI/babel/packages/babel-helpers/src/helpers/applyDecs2305.js ALT/babel/packages/babel-helpers/src/helpers/applyDecs2305.js index a8a48d15..7026823d 100644 --- ORI/babel/packages/babel-helpers/src/helpers/applyDecs2305.js +++ ALT/babel/packages/babel-helpers/src/helpers/applyDecs2305.js @@ -135,8 +135,8 @@ function memberDec( get && set ? { get: get, set: set, has: has } : get - ? { get: get, has: has } - : { set: set, has: has }; + ? { get: get, has: has } + : { set: set, has: has }; try { return dec.call(thisArg, value, ctx); diff --git ORI/babel/packages/babel-parser/src/parse-error.ts ALT/babel/packages/babel-parser/src/parse-error.ts index 88ee87b9..82567d83 100644 --- ORI/babel/packages/babel-parser/src/parse-error.ts +++ ALT/babel/packages/babel-parser/src/parse-error.ts @@ -123,8 +123,8 @@ export function ParseErrorEnum(a: TemplateStringsArray): < ? Parameters[0] : {} : T[K] extends ToMessage - ? Parameters[0] - : {} + ? Parameters[0] + : {} >; }; @@ -138,8 +138,8 @@ export function ParseErrorEnum( ? Parameters[0] : {} : T[K] extends ToMessage - ? Parameters[0] - : {} + ? Parameters[0] + : {} >; }; @@ -184,8 +184,8 @@ export function ParseErrorEnum( typeof template === "string" ? { message: () => template } : typeof template === "function" - ? { message: template } - : template; + ? { message: template } + : template; const toMessage = typeof message === "string" ? () => message : message; ParseErrorConstructors[reasonCode] = toParseErrorConstructor({ diff --git ORI/babel/packages/babel-parser/src/parse-error/credentials.ts ALT/babel/packages/babel-parser/src/parse-error/credentials.ts index bb3bafa2..3134c815 100644 --- ORI/babel/packages/babel-parser/src/parse-error/credentials.ts +++ ALT/babel/packages/babel-parser/src/parse-error/credentials.ts @@ -50,8 +50,8 @@ const instantiate = ( typeof descriptor === "function" ? { value: descriptor, enumerable: false } : typeof descriptor.reflect === "string" - ? { ...descriptor, ...reflect(descriptor.reflect.split(".")) } - : descriptor, + ? { ...descriptor, ...reflect(descriptor.reflect.split(".")) } + : descriptor, ]) .reduce( (instance, [key, descriptor]) => diff --git ORI/babel/packages/babel-parser/src/parser/expression.ts ALT/babel/packages/babel-parser/src/parser/expression.ts index f3a28e87..ae584690 100644 --- ORI/babel/packages/babel-parser/src/parser/expression.ts +++ ALT/babel/packages/babel-parser/src/parser/expression.ts @@ -2805,8 +2805,8 @@ export default abstract class ExpressionParser extends LValParser { const reservedTest = !this.state.strict ? isReservedWord : isBinding - ? isStrictBindReservedWord - : isStrictReservedWord; + ? isStrictBindReservedWord + : isStrictReservedWord; if (reservedTest(word, this.inModule)) { this.raise(Errors.UnexpectedReservedWord, { diff --git ORI/babel/packages/babel-parser/src/parser/statement.ts ALT/babel/packages/babel-parser/src/parser/statement.ts index 4cb28674..81e17bf3 100644 --- ORI/babel/packages/babel-parser/src/parser/statement.ts +++ ALT/babel/packages/babel-parser/src/parser/statement.ts @@ -465,8 +465,8 @@ export default abstract class StatementParser extends ExpressionParser { this.state.strict ? Errors.StrictFunction : this.options.annexB - ? Errors.SloppyFunctionAnnexB - : Errors.SloppyFunction, + ? Errors.SloppyFunctionAnnexB + : Errors.SloppyFunction, { at: this.state.startLoc }, ); } @@ -1289,8 +1289,8 @@ export default abstract class StatementParser extends ExpressionParser { const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(tt._switch) - ? "switch" - : null; + ? "switch" + : null; for (let i = this.state.labels.length - 1; i >= 0; i--) { const label = this.state.labels[i]; if (label.statementStart === node.start) { @@ -1549,8 +1549,8 @@ export default abstract class StatementParser extends ExpressionParser { decl.init = !this.eat(tt.eq) ? null : isFor - ? this.parseMaybeAssignDisallowIn() - : this.parseMaybeAssignAllowIn(); + ? this.parseMaybeAssignDisallowIn() + : this.parseMaybeAssignAllowIn(); if (decl.init === null && !allowMissingInitializer) { if ( @@ -2239,10 +2239,10 @@ export default abstract class StatementParser extends ExpressionParser { ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" - ? node.static - ? CLASS_ELEMENT_STATIC_SETTER - : CLASS_ELEMENT_INSTANCE_SETTER - : CLASS_ELEMENT_OTHER; + ? node.static + ? CLASS_ELEMENT_STATIC_SETTER + : CLASS_ELEMENT_INSTANCE_SETTER + : CLASS_ELEMENT_OTHER; this.declareClassPrivateMethodInScope(node, kind); } diff --git ORI/babel/packages/babel-parser/src/plugins/flow/index.ts ALT/babel/packages/babel-parser/src/plugins/flow/index.ts index c912c0bc..55cceae8 100644 --- ORI/babel/packages/babel-parser/src/plugins/flow/index.ts +++ ALT/babel/packages/babel-parser/src/plugins/flow/index.ts @@ -3399,8 +3399,8 @@ export default (superClass: typeof Parser) => !enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" - ? FlowErrors.EnumInvalidMemberInitializerSymbolType - : FlowErrors.EnumInvalidMemberInitializerPrimaryType, + ? FlowErrors.EnumInvalidMemberInitializerSymbolType + : FlowErrors.EnumInvalidMemberInitializerPrimaryType, { at: loc, ...enumContext, diff --git ORI/babel/packages/babel-parser/src/plugins/typescript/index.ts ALT/babel/packages/babel-parser/src/plugins/typescript/index.ts index 52646232..c61134d6 100644 --- ORI/babel/packages/babel-parser/src/plugins/typescript/index.ts +++ ALT/babel/packages/babel-parser/src/plugins/typescript/index.ts @@ -1309,8 +1309,8 @@ export default (superClass: ClassWithMixin) => type === tt._void ? "TSVoidKeyword" : type === tt._null - ? "TSNullKeyword" - : keywordTypeFromName(this.state.value); + ? "TSNullKeyword" + : keywordTypeFromName(this.state.value); if ( nodeType !== undefined && this.lookaheadCharCode() !== charCodes.dot @@ -1405,10 +1405,10 @@ export default (superClass: ClassWithMixin) => return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(tt._infer) - ? this.tsParseInferType() - : this.tsInAllowConditionalTypesContext(() => - this.tsParseArrayTypeOrHigher(), - ); + ? this.tsParseInferType() + : this.tsInAllowConditionalTypesContext(() => + this.tsParseArrayTypeOrHigher(), + ); } tsParseUnionOrIntersectionType( @@ -2404,8 +2404,8 @@ export default (superClass: ClassWithMixin) => type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" - ? "TSDeclareMethod" - : undefined; + ? "TSDeclareMethod" + : undefined; if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) { return this.finishNode(node, bodilessType); } diff --git ORI/babel/packages/babel-parser/src/tokenizer/state.ts ALT/babel/packages/babel-parser/src/tokenizer/state.ts index 4949f5c9..ca99d2b6 100644 --- ORI/babel/packages/babel-parser/src/tokenizer/state.ts +++ ALT/babel/packages/babel-parser/src/tokenizer/state.ts @@ -39,8 +39,8 @@ export default class State { strictMode === false ? false : strictMode === true - ? true - : sourceType === "module"; + ? true + : sourceType === "module"; this.curLine = startLine; this.lineStart = -startColumn; diff --git ORI/babel/packages/babel-parser/test/helpers/difference.js ALT/babel/packages/babel-parser/test/helpers/difference.js index 60c25672..b83a1ca3 100644 --- ORI/babel/packages/babel-parser/test/helpers/difference.js +++ ALT/babel/packages/babel-parser/test/helpers/difference.js @@ -29,14 +29,14 @@ const toType = value => value === null ? "null" : typeof value !== "object" - ? typeof value - : isArray(value) - ? "Array" - : value instanceof RegExp - ? "RegExp" - : value instanceof Error - ? "Error" - : "Object"; + ? typeof value + : isArray(value) + ? "Array" + : value instanceof RegExp + ? "RegExp" + : value instanceof Error + ? "Error" + : "Object"; function compare(adjust, expected, actual) { // easy. @@ -126,21 +126,21 @@ const toValueString = (value, type = toType(value)) => type === "string" ? JSON.stringify(value) : type === "symbol" - ? value.toString() - : type === "bigint" - ? `${value}n` - : Object.is(value, -0) - ? "-0" - : value + ""; + ? value.toString() + : type === "bigint" + ? `${value}n` + : Object.is(value, -0) + ? "-0" + : value + ""; const toExplanationString = ({ discrepancy, expected, actual, key }) => discrepancy === "length" ? `Array of wrong size, expected length of ${expected}, but got ${actual}` : discrepancy === "unexpected-key" - ? `Did not expect a property ${toValueString(key)}` - : discrepancy === "missing-key" - ? `${toType(actual)} is missing property ${toValueString(key)}` - : `${toValueString(expected)} != ${toValueString(actual)}`; + ? `Did not expect a property ${toValueString(key)}` + : discrepancy === "missing-key" + ? `${toType(actual)} is missing property ${toValueString(key)}` + : `${toValueString(expected)} != ${toValueString(actual)}`; const isInt = key => isInteger(+key); const toAccess = key => diff --git ORI/babel/packages/babel-parser/test/helpers/fixture-error.js ALT/babel/packages/babel-parser/test/helpers/fixture-error.js index 0043cff0..17c56d06 100644 --- ORI/babel/packages/babel-parser/test/helpers/fixture-error.js +++ ALT/babel/packages/babel-parser/test/helpers/fixture-error.js @@ -49,16 +49,20 @@ export default class FixtureError extends Error { return difference === Difference.None ? false : difference.path[0] !== "threw" - ? new FixtureError.DifferentAST(difference) - : !difference.expected - ? new FixtureError.UnexpectedError(difference, { cause: actual.threw }) - : difference.actual - ? new FixtureError.DifferentError(difference, { cause: actual.threw }) - : actual.ast && actual.ast.errors - ? new FixtureError.UnexpectedRecovery(difference, { - cause: actual.ast.errors, - }) - : new FixtureError.UnexpectedSuccess(difference); + ? new FixtureError.DifferentAST(difference) + : !difference.expected + ? new FixtureError.UnexpectedError(difference, { + cause: actual.threw, + }) + : difference.actual + ? new FixtureError.DifferentError(difference, { + cause: actual.threw, + }) + : actual.ast && actual.ast.errors + ? new FixtureError.UnexpectedRecovery(difference, { + cause: actual.ast.errors, + }) + : new FixtureError.UnexpectedSuccess(difference); } } diff --git ORI/babel/packages/babel-parser/test/helpers/serialization.js ALT/babel/packages/babel-parser/test/helpers/serialization.js index 574a1fcd..26245767 100644 --- ORI/babel/packages/babel-parser/test/helpers/serialization.js +++ ALT/babel/packages/babel-parser/test/helpers/serialization.js @@ -35,8 +35,8 @@ export const deserialize = (filename, options, string) => !value[SerializationKey] ? value : value[SerializationKey] === "RegExp" - ? new RegExp(value.source, value.flags) - : toBigInt(value.value)), + ? new RegExp(value.source, value.flags) + : toBigInt(value.value)), ), ); @@ -88,10 +88,10 @@ export function serialize(value) { typeof value === "bigint" ? toExtended("bigint", { value: value + "" }) : value instanceof RegExp - ? toExtended("RegExp", { source: value.source, flags: value.flags }) - : value instanceof Error - ? value + "" - : value; + ? toExtended("RegExp", { source: value.source, flags: value.flags }) + : value instanceof Error + ? value + "" + : value; const serialized = stringify(value, encode, 2).replace( CompactRegExp, // This is safe since none of the values can have spaces in them. diff --git ORI/babel/packages/babel-plugin-transform-block-scoping/src/index.ts ALT/babel/packages/babel-plugin-transform-block-scoping/src/index.ts index 8a8f526a..80195171 100644 --- ORI/babel/packages/babel-plugin-transform-block-scoping/src/index.ts +++ ALT/babel/packages/babel-plugin-transform-block-scoping/src/index.ts @@ -39,8 +39,8 @@ export default declare((api, opts: Options) => { const headPath = isForStatement ? path.get("init") : path.isForXStatement() - ? path.get("left") - : null; + ? path.get("left") + : null; let needsBodyWrap = false; const markNeedsBodyWrap = () => { diff --git ORI/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts ALT/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts index 6c0fa83a..9accb386 100644 --- ORI/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts +++ ALT/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts @@ -47,8 +47,8 @@ export function getUsageInBody(binding: Binding, loopPath: NodePath) { const id = path.isUpdateExpression() ? path.get("argument") : path.isAssignmentExpression() - ? path.get("left") - : null; + ? path.get("left") + : null; if (id) seen.add(id.node); return id as NodePath | null; }); diff --git ORI/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts ALT/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts index 74d42178..65672389 100644 --- ORI/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts +++ ALT/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts @@ -77,8 +77,8 @@ export default function createPlugin({ runtime: RUNTIME_DEFAULT = process.env.BABEL_8_BREAKING ? "automatic" : development - ? "automatic" - : "classic", + ? "automatic" + : "classic", importSource: IMPORT_SOURCE_DEFAULT = DEFAULT.importSource, pragma: PRAGMA_DEFAULT = DEFAULT.pragma, @@ -793,8 +793,8 @@ You can set \`throwIfNamespace: false\` to bypass this warning.`, !t.isObjectExpression(props[0].argument) ? props[0].argument : props.length > 0 - ? t.objectExpression(props) - : t.nullLiteral(); + ? t.objectExpression(props) + : t.nullLiteral(); } }); diff --git ORI/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts ALT/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts index d53a3e9d..b87a2ed7 100644 --- ORI/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts +++ ALT/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts @@ -129,10 +129,10 @@ export function createBasePolyfillsPlugin( createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator), ) : corejsVersion === 3 - ? createCorejsPlugin( - pluginCorejs3, - { version: 3, proposals, ...polyfillOpts }, - createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator), - ) - : createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator); + ? createCorejsPlugin( + pluginCorejs3, + { version: 3, proposals, ...polyfillOpts }, + createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator), + ) + : createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator); } diff --git ORI/babel/packages/babel-plugin-transform-typescript/src/index.ts ALT/babel/packages/babel-plugin-transform-typescript/src/index.ts index ee1262a9..ba31f5bb 100644 --- ORI/babel/packages/babel-plugin-transform-typescript/src/index.ts +++ ALT/babel/packages/babel-plugin-transform-typescript/src/index.ts @@ -661,9 +661,9 @@ export default declare((api, opts: Options) => { but allows loading unbundled plugin (which cannot obviously import the bundled `@babel/core` version). */ - api.types.tsInstantiationExpression - ? "TSNonNullExpression|TSInstantiationExpression" - : "TSNonNullExpression"]( + api.types.tsInstantiationExpression + ? "TSNonNullExpression|TSInstantiationExpression" + : "TSNonNullExpression"]( path: NodePath, ) { path.replaceWith(path.node.expression); diff --git ORI/babel/packages/babel-preset-env/src/available-plugins.ts ALT/babel/packages/babel-preset-env/src/available-plugins.ts index 47bb4cf5..9cd09306 100644 --- ORI/babel/packages/babel-preset-env/src/available-plugins.ts +++ ALT/babel/packages/babel-preset-env/src/available-plugins.ts @@ -111,14 +111,14 @@ export default { "syntax-unicode-sets-regex": USE_ESM ? null : // We cannot use the require call when bundling, because this is an ESM file. - // Babel standalone uses a modern parser, so just include a known noop plugin. - // Use `bind` so that it's not detected as a duplicate plugin when using it - // together with the TLA - IS_STANDALONE - ? // @ts-expect-error syntaxTopLevelAwait is a function when bundled - () => syntaxTopLevelAwait.bind() - : // eslint-disable-next-line no-restricted-globals - () => require("@babel/plugin-syntax-unicode-sets-regex"), + // Babel standalone uses a modern parser, so just include a known noop plugin. + // Use `bind` so that it's not detected as a duplicate plugin when using it + // together with the TLA + IS_STANDALONE + ? // @ts-expect-error syntaxTopLevelAwait is a function when bundled + () => syntaxTopLevelAwait.bind() + : // eslint-disable-next-line no-restricted-globals + () => require("@babel/plugin-syntax-unicode-sets-regex"), "transform-arrow-functions": () => transformArrowFunctions, "transform-async-generator-functions": () => proposalAsyncGeneratorFunctions, "transform-async-to-generator": () => transformAsyncToGenerator, diff --git ORI/babel/packages/babel-traverse/src/path/family.ts ALT/babel/packages/babel-traverse/src/path/family.ts index cf5bba25..0c6f2ab6 100644 --- ORI/babel/packages/babel-traverse/src/path/family.ts +++ ALT/babel/packages/babel-traverse/src/path/family.ts @@ -364,8 +364,8 @@ type Trav< type ToNodePath = T extends Array ? Array> : T extends t.Node | null | undefined - ? NodePath - : never; + ? NodePath + : never; function get( this: NodePath, @@ -374,8 +374,8 @@ function get( ): T[K] extends Array ? Array> : T[K] extends t.Node | null | undefined - ? NodePath - : never; + ? NodePath + : never; function get( this: NodePath, diff --git ORI/babel/packages/babel-types/src/validators/generated/index.ts ALT/babel/packages/babel-types/src/validators/generated/index.ts index 0933f7fa..88372572 100644 --- ORI/babel/packages/babel-types/src/validators/generated/index.ts +++ ALT/babel/packages/babel-types/src/validators/generated/index.ts @@ -13,8 +13,8 @@ type Opts = Partial<{ [Prop in keyof Object]: Object[Prop] extends t.Node ? t.Node | Object[Prop] : Object[Prop] extends t.Node[] - ? t.Node[] | Object[Prop] - : Object[Prop]; + ? t.Node[] | Object[Prop] + : Object[Prop]; }>; export function isArrayExpression( ```
github-actions[bot] commented 10 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: mdn/content@c5dd9c3b9d503a56dc04b6b8f88e89194dc82d7f

Diff (81 lines) ````diff diff --git ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md index 7dc1d6ff..bc85ae8c 100644 --- ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md +++ ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md @@ -477,8 +477,8 @@ We will also use the `Filter` enum in the `Todos.svelte` component. filter === Filter.ACTIVE ? todos.filter((t) => !t.completed) : filter === Filter.COMPLETED - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; $: { if (filter === Filter.ALL) { @@ -551,8 +551,8 @@ We will also use the `Filter` enum in the `Todos.svelte` component. filter === Filter.ACTIVE ? todos.filter((t) => !t.completed) : filter === Filter.COMPLETED - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; $: { if (filter === Filter.ALL) { diff --git ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md index f2866dc1..5fb0a9a6 100644 --- ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md +++ ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md @@ -391,8 +391,8 @@ Finally for this article, let's implement the ability to filter our to-dos by st filter === "active" ? todos.filter((t) => !t.completed) : filter === "completed" - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; ``` We use the `filter` variable to control the active filter: _all_, _active_, or _completed_. Just assigning one of these values to the filter variable will activate the filter and update the list of to-dos. Let's see how to achieve this. diff --git ORI/content/files/en-us/web/api/document/createtreewalker/index.md ALT/content/files/en-us/web/api/document/createtreewalker/index.md index ea16982b..de024164 100644 --- ORI/content/files/en-us/web/api/document/createtreewalker/index.md +++ ALT/content/files/en-us/web/api/document/createtreewalker/index.md @@ -148,8 +148,8 @@ const treeWalker = document.createTreeWalker( node.classList.contains("no-escape") ? NodeFilter.FILTER_REJECT : node.closest(".escape") - ? NodeFilter.FILTER_ACCEPT - : NodeFilter.FILTER_SKIP, + ? NodeFilter.FILTER_ACCEPT + : NodeFilter.FILTER_SKIP, ); let currentNode; diff --git ORI/content/files/en-us/web/api/htmlmarqueeelement/index.md ALT/content/files/en-us/web/api/htmlmarqueeelement/index.md index 6da2a8f0..8477e88b 100644 --- ORI/content/files/en-us/web/api/htmlmarqueeelement/index.md +++ ALT/content/files/en-us/web/api/htmlmarqueeelement/index.md @@ -73,7 +73,7 @@ _Inherits methods from its parent, {{DOMxRef("HTMLElement")}}._ height="200" behavior="alternate" style="border:solid"> - This text will bounce + This text will bounce ``` diff --git ORI/content/files/en-us/web/html/element/marquee/index.md ALT/content/files/en-us/web/html/element/marquee/index.md index 2c30f9cf..4fd0366f 100644 --- ORI/content/files/en-us/web/html/element/marquee/index.md +++ ALT/content/files/en-us/web/html/element/marquee/index.md @@ -65,7 +65,7 @@ The **``** [HTML](/en-US/docs/Web/HTML) element is used to insert a scr height="200" behavior="alternate" style="border:solid"> - This text will bounce + This text will bounce ``` ````
github-actions[bot] commented 10 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: vuejs/eslint-plugin-vue@2aa9ac45a4ea66c293b3e7cbfd6ad076afa39bb5

The diff is empty.

github-actions[bot] commented 10 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: excalidraw/excalidraw@3ddcc48e4c192f525930e503b3e9214627f0043d

Diff (322 lines) ```diff diff --git ORI/excalidraw/src/actions/actionFinalize.tsx ALT/excalidraw/src/actions/actionFinalize.tsx index 3508de0..d7147c5 100644 --- ORI/excalidraw/src/actions/actionFinalize.tsx +++ ALT/excalidraw/src/actions/actionFinalize.tsx @@ -65,8 +65,8 @@ export const actionFinalize = register({ const multiPointElement = appState.multiElement ? appState.multiElement : appState.editingElement?.type === "freedraw" - ? appState.editingElement - : null; + ? appState.editingElement + : null; if (multiPointElement) { // pen and mouse have hover diff --git ORI/excalidraw/src/components/App.tsx ALT/excalidraw/src/components/App.tsx index 4960990..b5abc44 100644 --- ORI/excalidraw/src/components/App.tsx +++ ALT/excalidraw/src/components/App.tsx @@ -1951,14 +1951,14 @@ class App extends React.Component { typeof opts.position === "object" ? opts.position.clientX : opts.position === "cursor" - ? this.lastViewportPosition.x - : this.state.width / 2 + this.state.offsetLeft; + ? this.lastViewportPosition.x + : this.state.width / 2 + this.state.offsetLeft; const clientY = typeof opts.position === "object" ? opts.position.clientY : opts.position === "cursor" - ? this.lastViewportPosition.y - : this.state.height / 2 + this.state.offsetTop; + ? this.lastViewportPosition.y + : this.state.height / 2 + this.state.offsetTop; const { x, y } = viewportCoordsToSceneCoords( { clientX, clientY }, diff --git ORI/excalidraw/src/components/ColorPicker/ColorPicker.tsx ALT/excalidraw/src/components/ColorPicker/ColorPicker.tsx index d2f89c8..818a903 100644 --- ORI/excalidraw/src/components/ColorPicker/ColorPicker.tsx +++ ALT/excalidraw/src/components/ColorPicker/ColorPicker.tsx @@ -38,8 +38,8 @@ export const getColor = (color: string): string | null => { return isValidColor(`#${color}`) ? `#${color}` : isValidColor(color) - ? color - : null; + ? color + : null; }; interface ColorPickerProps { diff --git ORI/excalidraw/src/components/ColorPicker/Picker.tsx ALT/excalidraw/src/components/ColorPicker/Picker.tsx index a2e1752..65152b4 100644 --- ORI/excalidraw/src/components/ColorPicker/Picker.tsx +++ ALT/excalidraw/src/components/ColorPicker/Picker.tsx @@ -74,10 +74,10 @@ export const Picker = ({ isCustomButNotInList ? "hex" : isCustom - ? "custom" - : colorObj?.shade != null - ? "shades" - : "baseColors", + ? "custom" + : colorObj?.shade != null + ? "shades" + : "baseColors", ); } }, [ diff --git ORI/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts ALT/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts index 95ee7be..549154e 100644 --- ORI/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts +++ ALT/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts @@ -181,8 +181,8 @@ export const colorPickerKeyNavHandler = ({ activeSectionIndex + indexOffset > sections.length - 1 ? 0 : activeSectionIndex + indexOffset < 0 - ? sections.length - 1 - : activeSectionIndex + indexOffset; + ? sections.length - 1 + : activeSectionIndex + indexOffset; const nextSection = sections[nextSectionIndex]; diff --git ORI/excalidraw/src/data/encryption.ts ALT/excalidraw/src/data/encryption.ts index 33e6899..25809b4 100644 --- ORI/excalidraw/src/data/encryption.ts +++ ALT/excalidraw/src/data/encryption.ts @@ -57,10 +57,10 @@ export const encryptData = async ( typeof data === "string" ? new TextEncoder().encode(data) : data instanceof Uint8Array - ? data - : data instanceof Blob - ? await blobToArrayBuffer(data) - : data; + ? data + : data instanceof Blob + ? await blobToArrayBuffer(data) + : data; // We use symmetric encryption. AES-GCM is the recommended algorithm and // includes checks that the ciphertext has not been modified by an attacker. diff --git ORI/excalidraw/src/data/restore.ts ALT/excalidraw/src/data/restore.ts index 5f2adc0..d0d903b 100644 --- ORI/excalidraw/src/data/restore.ts +++ ALT/excalidraw/src/data/restore.ts @@ -131,14 +131,14 @@ const restoreElementWithProperties = < roundness: element.roundness ? element.roundness : element.strokeSharpness === "round" - ? { - // for old elements that would now use adaptive radius algo, - // use legacy algo instead - type: isUsingAdaptiveRadius(element.type) - ? ROUNDNESS.LEGACY - : ROUNDNESS.PROPORTIONAL_RADIUS, - } - : null, + ? { + // for old elements that would now use adaptive radius algo, + // use legacy algo instead + type: isUsingAdaptiveRadius(element.type) + ? ROUNDNESS.LEGACY + : ROUNDNESS.PROPORTIONAL_RADIUS, + } + : null, boundElements: element.boundElementIds ? element.boundElementIds.map((id) => ({ type: "arrow", id })) : element.boundElements ?? [], @@ -510,8 +510,8 @@ export const restoreAppState = ( suppliedValue !== undefined ? suppliedValue : localValue !== undefined - ? localValue - : defaultValue; + ? localValue + : defaultValue; } return { @@ -539,8 +539,8 @@ export const restoreAppState = ( value: appState.zoom as NormalizedZoomValue, } : appState.zoom?.value - ? appState.zoom - : defaultAppState.zoom, + ? appState.zoom + : defaultAppState.zoom, openSidebar: // string (legacy) typeof (appState.openSidebar as any as string) === "string" diff --git ORI/excalidraw/src/element/binding.ts ALT/excalidraw/src/element/binding.ts index b175f14..fbe22e0 100644 --- ORI/excalidraw/src/element/binding.ts +++ ALT/excalidraw/src/element/binding.ts @@ -486,10 +486,10 @@ export const getEligibleElementsForBinding = ( (element) => !includedElementIds.has(element.id), ) as SuggestedBinding[]) : isBindableElement(element, false) - ? getElligibleElementsForBindableElementAndWhere(element).filter( - (binding) => !includedElementIds.has(binding[0].id), - ) - : [], + ? getElligibleElementsForBindableElementAndWhere(element).filter( + (binding) => !includedElementIds.has(binding[0].id), + ) + : [], ); }; diff --git ORI/excalidraw/src/element/collision.ts ALT/excalidraw/src/element/collision.ts index f160783..48e1be8 100644 --- ORI/excalidraw/src/element/collision.ts +++ ALT/excalidraw/src/element/collision.ts @@ -153,8 +153,8 @@ export const isHittingElementNotConsideringBoundingBox = ( const check = isTextElement(element) ? isStrictlyInside : isElementDraggableFromInside(element) - ? isInsideCheck - : isNearCheck; + ? isInsideCheck + : isNearCheck; return hitTestPointAgainstElement({ element, point, diff --git ORI/excalidraw/src/element/linearElementEditor.ts ALT/excalidraw/src/element/linearElementEditor.ts index 74275f4..d39cecb 100644 --- ORI/excalidraw/src/element/linearElementEditor.ts +++ ALT/excalidraw/src/element/linearElementEditor.ts @@ -389,8 +389,8 @@ export class LinearElementEditor { ) : selectedPointsIndices : selectedPointsIndices?.includes(pointerDownState.lastClickedPoint) - ? [pointerDownState.lastClickedPoint] - : selectedPointsIndices, + ? [pointerDownState.lastClickedPoint] + : selectedPointsIndices, isDragging: false, pointerOffset: { x: 0, y: 0 }, }; diff --git ORI/excalidraw/src/element/newElement.ts ALT/excalidraw/src/element/newElement.ts index 848a6af..a3b08d7 100644 --- ORI/excalidraw/src/element/newElement.ts +++ ALT/excalidraw/src/element/newElement.ts @@ -161,8 +161,8 @@ const getTextElementPositionOffsets = ( opts.textAlign === "center" ? metrics.width / 2 : opts.textAlign === "right" - ? metrics.width - : 0, + ? metrics.width + : 0, y: opts.verticalAlign === "middle" ? metrics.height / 2 : 0, }; }; diff --git ORI/excalidraw/src/renderer/renderElement.ts ALT/excalidraw/src/renderer/renderElement.ts index 0efe5df..3f12394 100644 --- ORI/excalidraw/src/renderer/renderElement.ts +++ ALT/excalidraw/src/renderer/renderElement.ts @@ -336,8 +336,8 @@ const drawElementOnCanvas = ( element.textAlign === "center" ? element.width / 2 : element.textAlign === "right" - ? element.width - : 0; + ? element.width + : 0; const lineHeightPx = getLineHeightInPx( element.fontSize, element.lineHeight, @@ -404,8 +404,8 @@ export const generateRoughOptions = ( element.strokeStyle === "dashed" ? getDashArrayDashed(element.strokeWidth) : element.strokeStyle === "dotted" - ? getDashArrayDotted(element.strokeWidth) - : undefined, + ? getDashArrayDotted(element.strokeWidth) + : undefined, // for non-solid strokes, disable multiStroke because it tends to make // dashes/dots overlay each other disableMultiStroke: element.strokeStyle !== "solid", @@ -1470,15 +1470,15 @@ export const renderElementToSvg = ( element.textAlign === "center" ? element.width / 2 : element.textAlign === "right" - ? element.width - : 0; + ? element.width + : 0; const direction = isRTL(element.text) ? "rtl" : "ltr"; const textAnchor = element.textAlign === "center" ? "middle" : element.textAlign === "right" || direction === "rtl" - ? "end" - : "start"; + ? "end" + : "start"; for (let i = 0; i < lines.length; i++) { const text = svgRoot.ownerDocument!.createElementNS(SVG_NS, "text"); text.textContent = lines[i]; @@ -1528,8 +1528,8 @@ export function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) { const inputPoints = element.simulatePressure ? element.points : element.points.length - ? element.points.map(([x, y], i) => [x, y, element.pressures[i]]) - : [[0, 0, 0.5]]; + ? element.points.map(([x, y], i) => [x, y, element.pressures[i]]) + : [[0, 0, 0.5]]; // Consider changing the options for simulated pressure vs real pressure const options: StrokeOptions = { diff --git ORI/excalidraw/src/tests/helpers/api.ts ALT/excalidraw/src/tests/helpers/api.ts index 9edb595..7e8abec 100644 --- ORI/excalidraw/src/tests/helpers/api.ts +++ ALT/excalidraw/src/tests/helpers/api.ts @@ -127,12 +127,12 @@ export class API { }): T extends "arrow" | "line" ? ExcalidrawLinearElement : T extends "freedraw" - ? ExcalidrawFreeDrawElement - : T extends "text" - ? ExcalidrawTextElement - : T extends "image" - ? ExcalidrawImageElement - : ExcalidrawGenericElement => { + ? ExcalidrawFreeDrawElement + : T extends "text" + ? ExcalidrawTextElement + : T extends "image" + ? ExcalidrawImageElement + : ExcalidrawGenericElement => { let element: Mutable = null!; const appState = h?.state || getDefaultAppState(); diff --git ORI/excalidraw/src/tests/helpers/ui.ts ALT/excalidraw/src/tests/helpers/ui.ts index c882011..fb7b818 100644 --- ORI/excalidraw/src/tests/helpers/ui.ts +++ ALT/excalidraw/src/tests/helpers/ui.ts @@ -277,15 +277,15 @@ export class UI { ): (T extends "arrow" | "line" | "freedraw" ? ExcalidrawLinearElement : T extends "text" - ? ExcalidrawTextElement - : ExcalidrawElement) & { + ? ExcalidrawTextElement + : ExcalidrawElement) & { /** Returns the actual, current element from the elements array, instead of the proxy */ get(): T extends "arrow" | "line" | "freedraw" ? ExcalidrawLinearElement : T extends "text" - ? ExcalidrawTextElement - : ExcalidrawElement; + ? ExcalidrawTextElement + : ExcalidrawElement; } { UI.clickTool(type); mouse.reset(); ```
github-actions[bot] commented 10 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: prettier/prettier@2bd131fbd29e94e989e64904f1a628877d38ae3d

Diff (875 lines) ```diff diff --git ORI/prettier/scripts/utils/changelog.js ALT/prettier/scripts/utils/changelog.js index 1b70543..a5d0798 100644 --- ORI/prettier/scripts/utils/changelog.js +++ ALT/prettier/scripts/utils/changelog.js @@ -31,10 +31,10 @@ export function getEntries(dirPath) { const section = title.includes("[HIGHLIGHT]") ? "highlight" : title.includes("[BREAKING]") - ? "breaking" - : improvement - ? "improvement" - : undefined; + ? "breaking" + : improvement + ? "improvement" + : undefined; const order = section === "improvement" && improvement[2] !== undefined diff --git ORI/prettier/src/cli/options/normalize-cli-options.js ALT/prettier/src/cli/options/normalize-cli-options.js index 38371f0..cd2bc03 100644 --- ORI/prettier/src/cli/options/normalize-cli-options.js +++ ALT/prettier/src/cli/options/normalize-cli-options.js @@ -9,10 +9,10 @@ const descriptor = { value === false ? `--no-${key}` : value === true - ? descriptor.key(key) - : value === "" - ? `${descriptor.key(key)} without an argument` - : `${descriptor.key(key)}=${value}`, + ? descriptor.key(key) + : value === "" + ? `${descriptor.key(key)} without an argument` + : `${descriptor.key(key)}=${value}`, }; class FlagSchema extends vnopts.ChoiceSchema { diff --git ORI/prettier/src/document/debug.js ALT/prettier/src/document/debug.js index 2f52e2c..8261eb7 100644 --- ORI/prettier/src/document/debug.js +++ ALT/prettier/src/document/debug.js @@ -114,14 +114,14 @@ function printDocToDebug(doc) { return doc.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + printDoc(doc.contents) + ")" : doc.n < 0 - ? "dedent(" + printDoc(doc.contents) + ")" - : doc.n.type === "root" - ? "markAsRoot(" + printDoc(doc.contents) + ")" - : "align(" + - JSON.stringify(doc.n) + - ", " + - printDoc(doc.contents) + - ")"; + ? "dedent(" + printDoc(doc.contents) + ")" + : doc.n.type === "root" + ? "markAsRoot(" + printDoc(doc.contents) + ")" + : "align(" + + JSON.stringify(doc.n) + + ", " + + printDoc(doc.contents) + + ")"; } if (doc.type === DOC_TYPE_IF_BREAK) { diff --git ORI/prettier/src/document/printer.js ALT/prettier/src/document/printer.js index c14e724..fc3a650 100644 --- ORI/prettier/src/document/printer.js +++ ALT/prettier/src/document/printer.js @@ -538,8 +538,8 @@ function printDocToString(doc, options) { doc.type === DOC_TYPE_IF_BREAK ? doc.breakContents : doc.negate - ? doc.contents - : indent(doc.contents); + ? doc.contents + : indent(doc.contents); if (breakContents) { cmds.push({ ind, mode, doc: breakContents }); } @@ -549,8 +549,8 @@ function printDocToString(doc, options) { doc.type === DOC_TYPE_IF_BREAK ? doc.flatContents : doc.negate - ? indent(doc.contents) - : doc.contents; + ? indent(doc.contents) + : doc.contents; if (flatContents) { cmds.push({ ind, mode, doc: flatContents }); } diff --git ORI/prettier/src/index.d.ts ALT/prettier/src/index.d.ts index 0b0c989..628825d 100644 --- ORI/prettier/src/index.d.ts +++ ALT/prettier/src/index.d.ts @@ -50,8 +50,8 @@ type IndexValue = T extends any[] ? T[P] : never : P extends keyof T - ? T[P] - : never; + ? T[P] + : never; // Determines if an object T is an array like string[] (in which case this // evaluates to false) or a tuple like [string] (in which case this evaluates to @@ -60,8 +60,8 @@ type IndexValue = T extends any[] type IsTuple = T extends [] ? true : T extends [infer First, ...infer Remain] - ? IsTuple - : false; + ? IsTuple + : false; type CallProperties = T extends any[] ? IndexProperties : keyof T; type IterProperties = T extends any[] diff --git ORI/prettier/src/language-css/printer-postcss.js ALT/prettier/src/language-css/printer-postcss.js index 472b606..229c7aa 100644 --- ORI/prettier/src/language-css/printer-postcss.js +++ ALT/prettier/src/language-css/printer-postcss.js @@ -87,8 +87,8 @@ function genericPrint(path, options, print) { lastLineHasInlineComment(node.selector.value) ? line : node.selector - ? " " - : "", + ? " " + : "", "{", node.nodes.length > 0 ? indent([hardline, printSequence(path, options, print)]) @@ -140,18 +140,18 @@ function genericPrint(path, options, print) { node.raws.important ? node.raws.important.replace(/\s*!\s*important/i, " !important") : node.important - ? " !important" - : "", + ? " !important" + : "", node.raws.scssDefault ? node.raws.scssDefault.replace(/\s*!default/i, " !default") : node.scssDefault - ? " !default" - : "", + ? " !default" + : "", node.raws.scssGlobal ? node.raws.scssGlobal.replace(/\s*!global/i, " !global") : node.scssGlobal - ? " !global" - : "", + ? " !global" + : "", node.nodes ? [ " {", @@ -160,12 +160,12 @@ function genericPrint(path, options, print) { "}", ] : isTemplatePropNode(node) && - !parentNode.raws.semicolon && - options.originalText[locEnd(node) - 1] !== ";" - ? "" - : options.__isHTMLStyleAttribute && isLastNode(path, node) - ? ifBreak(";") - : ";", + !parentNode.raws.semicolon && + options.originalText[locEnd(node) - 1] !== ";" + ? "" + : options.__isHTMLStyleAttribute && isLastNode(path, node) + ? ifBreak(";") + : ";", ]; } case "css-atrule": { @@ -232,16 +232,16 @@ function genericPrint(path, options, print) { isDetachedRulesetCallNode(node) ? "" : isTemplatePlaceholderNode(node) - ? node.raws.afterName === "" - ? "" - : node.name.endsWith(":") - ? " " - : /^\s*\n\s*\n/.test(node.raws.afterName) - ? [hardline, hardline] - : /^\s*\n/.test(node.raws.afterName) - ? hardline - : " " - : " ", + ? node.raws.afterName === "" + ? "" + : node.name.endsWith(":") + ? " " + : /^\s*\n\s*\n/.test(node.raws.afterName) + ? [hardline, hardline] + : /^\s*\n/.test(node.raws.afterName) + ? hardline + : " " + : " ", typeof node.params === "string" ? node.params : print("params"), ] : "", @@ -257,21 +257,21 @@ function genericPrint(path, options, print) { : "", ]) : node.name === "else" - ? " " - : "", + ? " " + : "", node.nodes ? [ isSCSSControlDirectiveNode(node, options) ? "" : (node.selector && - !node.selector.nodes && - typeof node.selector.value === "string" && - lastLineHasInlineComment(node.selector.value)) || - (!node.selector && - typeof node.params === "string" && - lastLineHasInlineComment(node.params)) - ? line - : " ", + !node.selector.nodes && + typeof node.selector.value === "string" && + lastLineHasInlineComment(node.selector.value)) || + (!node.selector && + typeof node.params === "string" && + lastLineHasInlineComment(node.params)) + ? line + : " ", "{", indent([ node.nodes.length > 0 ? softline : "", @@ -281,9 +281,9 @@ function genericPrint(path, options, print) { "}", ] : isTemplatePlaceholderNodeWithoutSemiColon || - isImportUnknownValueEndsWithSemiColon - ? "" - : ";", + isImportUnknownValueEndsWithSemiColon + ? "" + : ";", ]; } // postcss-media-query-parser diff --git ORI/prettier/src/language-handlebars/printer-glimmer.js ALT/prettier/src/language-handlebars/printer-glimmer.js index 1b317fd..d9ca862 100644 --- ORI/prettier/src/language-handlebars/printer-glimmer.js +++ ALT/prettier/src/language-handlebars/printer-glimmer.js @@ -127,13 +127,13 @@ function print(path, options, print) { const quote = isText ? getPreferredQuote(value.chars, options.singleQuote) : value.type === "ConcatStatement" - ? getPreferredQuote( - value.parts - .map((part) => (part.type === "TextNode" ? part.chars : "")) - .join(""), - options.singleQuote, - ) - : ""; + ? getPreferredQuote( + value.parts + .map((part) => (part.type === "TextNode" ? part.chars : "")) + .join(""), + options.singleQuote, + ) + : ""; const valueDoc = print("value"); diff --git ORI/prettier/src/language-html/embed/utils.js ALT/prettier/src/language-html/embed/utils.js index 1c51e85..7d313ed 100644 --- ORI/prettier/src/language-html/embed/utils.js +++ ALT/prettier/src/language-html/embed/utils.js @@ -17,8 +17,8 @@ function shouldHugJsExpression(ast, options) { ? ast.node.body[0].expression : ast.node : ast.type === "JsExpressionRoot" - ? ast.node - : ast; + ? ast.node + : ast; return ( rootNode && (rootNode.type === "ObjectExpression" || diff --git ORI/prettier/src/language-html/print/children.js ALT/prettier/src/language-html/print/children.js index dd31bed..1b44b83 100644 --- ORI/prettier/src/language-html/print/children.js +++ ALT/prettier/src/language-html/print/children.js @@ -59,55 +59,57 @@ function printBetweenLine(prevNode, nextNode) { : line : "" : preferHardlineAsLeadingSpaces(nextNode) - ? hardline - : softline + ? hardline + : softline : (needsToBorrowNextOpeningTagStartMarker(prevNode) && - (hasPrettierIgnore(nextNode) || + (hasPrettierIgnore(nextNode) || + /** + * 123 + */ + nextNode.firstChild || + /** + * 123 + */ + nextNode.isSelfClosing || + /** + * 123 0))) || + /** + * 123 + */ + (prevNode.type === "element" && + prevNode.isSelfClosing && + needsToBorrowPrevClosingTagEndMarker(nextNode)) + ? "" + : !nextNode.isLeadingSpaceSensitive || + preferHardlineAsLeadingSpaces(nextNode) || /** - * 123 + * Want to write us a letter? Use ourmailing address. */ - nextNode.firstChild || - /** - * 123 - */ - nextNode.isSelfClosing || - /** - * 123 0))) || - /** - * 123 - */ - (prevNode.type === "element" && - prevNode.isSelfClosing && - needsToBorrowPrevClosingTagEndMarker(nextNode)) - ? "" - : !nextNode.isLeadingSpaceSensitive || - preferHardlineAsLeadingSpaces(nextNode) || - /** - * Want to write us a letter? Use ourmailing address. - */ - (needsToBorrowPrevClosingTagEndMarker(nextNode) && - prevNode.lastChild && - needsToBorrowParentClosingTagStartMarker(prevNode.lastChild) && - prevNode.lastChild.lastChild && - needsToBorrowParentClosingTagStartMarker(prevNode.lastChild.lastChild)) - ? hardline - : nextNode.hasLeadingSpaces - ? line - : softline; + (needsToBorrowPrevClosingTagEndMarker(nextNode) && + prevNode.lastChild && + needsToBorrowParentClosingTagStartMarker(prevNode.lastChild) && + prevNode.lastChild.lastChild && + needsToBorrowParentClosingTagStartMarker( + prevNode.lastChild.lastChild, + )) + ? hardline + : nextNode.hasLeadingSpaces + ? line + : softline; } function printChildren(path, options, print) { diff --git ORI/prettier/src/language-html/print/tag.js ALT/prettier/src/language-html/print/tag.js index 9258095..ac9f231 100644 --- ORI/prettier/src/language-html/print/tag.js +++ ALT/prettier/src/language-html/print/tag.js @@ -62,8 +62,8 @@ function printClosingTagSuffix(node, options) { return needsToBorrowParentClosingTagStartMarker(node) ? printClosingTagStartMarker(node.parent, options) : needsToBorrowNextOpeningTagStartMarker(node) - ? printOpeningTagStartMarker(node.next) - : ""; + ? printOpeningTagStartMarker(node.next) + : ""; } function printClosingTagStartMarker(node, options) { @@ -233,8 +233,8 @@ function printAttributes(path, options, print) { typeof ignoreAttributeData === "boolean" ? () => ignoreAttributeData : Array.isArray(ignoreAttributeData) - ? (attribute) => ignoreAttributeData.includes(attribute.rawName) - : () => false; + ? (attribute) => ignoreAttributeData.includes(attribute.rawName) + : () => false; const printedAttributes = path.map( ({ node: attribute }) => @@ -294,8 +294,8 @@ function printAttributes(path, options, print) { ? " " : "" : node.isSelfClosing - ? line - : softline, + ? line + : softline, ); } @@ -329,8 +329,8 @@ function printOpeningTagPrefix(node, options) { return needsToBorrowParentOpeningTagEndMarker(node) ? printOpeningTagEndMarker(node.parent) : needsToBorrowPrevClosingTagEndMarker(node) - ? printClosingTagEndMarker(node.prev, options) - : ""; + ? printClosingTagEndMarker(node.prev, options) + : ""; } function printOpeningTagStartMarker(node) { diff --git ORI/prettier/src/language-js/embed/html.js ALT/prettier/src/language-js/embed/html.js index 8d301dc..b15b6a1 100644 --- ORI/prettier/src/language-js/embed/html.js +++ ALT/prettier/src/language-js/embed/html.js @@ -77,8 +77,8 @@ async function printEmbedHtmlLike(parser, textToDoc, print, path, options) { options.htmlWhitespaceSensitivity === "ignore" ? hardline : leadingWhitespace && trailingWhitespace - ? line - : null; + ? line + : null; if (linebreak) { return group(["`", indent([linebreak, group(contentDoc)]), linebreak, "`"]); diff --git ORI/prettier/src/language-js/needs-parens.js ALT/prettier/src/language-js/needs-parens.js index 0fccfdd..5253ad0 100644 --- ORI/prettier/src/language-js/needs-parens.js +++ ALT/prettier/src/language-js/needs-parens.js @@ -95,10 +95,10 @@ function needsParens(path, options) { const expression = !statement ? undefined : statement.type === "ExpressionStatement" - ? statement.expression - : statement.type === "ForStatement" - ? statement.init - : statement.left; + ? statement.expression + : statement.type === "ForStatement" + ? statement.init + : statement.left; if ( expression && startsWithNoLookaheadToken( diff --git ORI/prettier/src/language-js/print/array.js ALT/prettier/src/language-js/print/array.js index cd99d7c..dec3523 100644 --- ORI/prettier/src/language-js/print/array.js +++ ALT/prettier/src/language-js/print/array.js @@ -60,8 +60,8 @@ function printArray(path, options, print) { node.type === "TupleTypeAnnotation" && node.types ? "types" : node.type === "TSTupleType" || node.type === "TupleTypeAnnotation" - ? "elementTypes" - : "elements"; + ? "elementTypes" + : "elements"; const elements = node[elementsProperty]; if (elements.length === 0) { parts.push( @@ -114,12 +114,12 @@ function printArray(path, options, print) { const trailingComma = !canHaveTrailingComma ? "" : needsForcedTrailingComma - ? "," - : !shouldPrintComma(options) - ? "" - : shouldUseConciseFormatting - ? ifBreak(",", "", { groupId }) - : ifBreak(","); + ? "," + : !shouldPrintComma(options) + ? "" + : shouldUseConciseFormatting + ? ifBreak(",", "", { groupId }) + : ifBreak(","); parts.push( group( @@ -213,8 +213,8 @@ function printArrayElementsConcisely(path, options, print, trailingComma) { isLineAfterElementEmpty(path, options) ? [hardline, hardline] : hasComment(next, CommentCheckFlags.Leading | CommentCheckFlags.Line) - ? hardline - : line, + ? hardline + : line, ); } }, "elements"); diff --git ORI/prettier/src/language-js/print/assignment.js ALT/prettier/src/language-js/print/assignment.js index 8e8d032..feaf363 100644 --- ORI/prettier/src/language-js/print/assignment.js +++ ALT/prettier/src/language-js/print/assignment.js @@ -121,9 +121,9 @@ function chooseLayout(path, options, print, leftDoc, rightPropertyName) { return !isTail ? "chain" : rightNode.type === "ArrowFunctionExpression" && - rightNode.body.type === "ArrowFunctionExpression" - ? "chain-tail-arrow-chain" - : "chain-tail"; + rightNode.body.type === "ArrowFunctionExpression" + ? "chain-tail-arrow-chain" + : "chain-tail"; } const isHeadOfLongChain = !isTail && isAssignment(rightNode.right); diff --git ORI/prettier/src/language-js/print/decorators.js ALT/prettier/src/language-js/print/decorators.js index 634c57c..b766eab 100644 --- ORI/prettier/src/language-js/print/decorators.js +++ ALT/prettier/src/language-js/print/decorators.js @@ -59,8 +59,8 @@ function printDecorators(path, options, print) { path.key === "declaration" && isExportDeclaration(parent) ? hardline : shouldBreak - ? breakParent - : "", + ? breakParent + : "", join(line, path.map(print, "decorators")), line, ]; diff --git ORI/prettier/src/language-js/print/flow.js ALT/prettier/src/language-js/print/flow.js index 8c5f0eb..2bd0744 100644 --- ORI/prettier/src/language-js/print/flow.js +++ ALT/prettier/src/language-js/print/flow.js @@ -153,8 +153,8 @@ function printFlow(path, options, print) { const name = node.name ? print("name") : path.parent.this === node - ? "this" - : ""; + ? "this" + : ""; return [ name, printOptionalToken(path), diff --git ORI/prettier/src/language-js/print/function.js ALT/prettier/src/language-js/print/function.js index c668e82..9d00d84 100644 --- ORI/prettier/src/language-js/print/function.js +++ ALT/prettier/src/language-js/print/function.js @@ -168,8 +168,8 @@ function printMethodValue(path, options, print) { shouldBreakParameters ? group(parametersDoc, { shouldBreak: true }) : shouldGroupParameters - ? group(parametersDoc) - : parametersDoc, + ? group(parametersDoc) + : parametersDoc, returnTypeDoc, ]), ]; diff --git ORI/prettier/src/language-js/print/jsx.js ALT/prettier/src/language-js/print/jsx.js index be90185..fac4bfc 100644 --- ORI/prettier/src/language-js/print/jsx.js +++ ALT/prettier/src/language-js/print/jsx.js @@ -690,8 +690,8 @@ function printJsxOpeningClosingFragment(path, options /*, print*/) { hasOwnLineComment ? hardline : nodeHasComment && !isOpeningFragment - ? " " - : "", + ? " " + : "", printDanglingComments(path, options), ]), hasOwnLineComment ? hardline : "", diff --git ORI/prettier/src/language-js/print/module.js ALT/prettier/src/language-js/print/module.js index fdae117..f086f4f 100644 --- ORI/prettier/src/language-js/print/module.js +++ ALT/prettier/src/language-js/print/module.js @@ -256,8 +256,8 @@ function printImportAttributes(path, options, print) { const property = isNonEmptyArray(node.attributes) ? "attributes" : isNonEmptyArray(node.assertions) - ? "assertions" - : undefined; + ? "assertions" + : undefined; if (!property) { return ""; diff --git ORI/prettier/src/language-js/print/object.js ALT/prettier/src/language-js/print/object.js index 44ddd3f..db3a6c3 100644 --- ORI/prettier/src/language-js/print/object.js +++ ALT/prettier/src/language-js/print/object.js @@ -42,8 +42,8 @@ function printObject(path, options, print) { node.type === "TSTypeLiteral" || isEnumBody ? "members" : node.type === "TSInterfaceBody" - ? "body" - : "properties", + ? "body" + : "properties", ]; if (isTypeAnnotation) { fields.push("indexers", "callProperties", "internalSlots"); @@ -104,8 +104,8 @@ function printObject(path, options, print) { const separator = isFlowInterfaceLikeBody ? ";" : node.type === "TSInterfaceBody" || node.type === "TSTypeLiteral" - ? ifBreak(semi, ";") - : ","; + ? ifBreak(semi, ";") + : ","; const leftBrace = node.type === "RecordExpression" ? "#{" : node.exact ? "{|" : "{"; const rightBrace = node.exact ? "|}" : "}"; diff --git ORI/prettier/src/language-js/print/ternary.js ALT/prettier/src/language-js/print/ternary.js index 8fecc3d..b96863b 100644 --- ORI/prettier/src/language-js/print/ternary.js +++ ALT/prettier/src/language-js/print/ternary.js @@ -293,8 +293,8 @@ function printTernary(path, options, print) { isParentTest ? part : options.useTabs - ? dedent(indent(part)) - : align(Math.max(0, options.tabWidth - 2), part), + ? dedent(indent(part)) + : align(Math.max(0, options.tabWidth - 2), part), ); } @@ -321,8 +321,8 @@ function printTernary(path, options, print) { parent === firstNonConditionalParent ? group(doc, { shouldBreak }) : shouldBreak - ? [doc, breakParent] - : doc; + ? [doc, breakParent] + : doc; // Break the closing paren to keep the chain right after it: // (a diff --git ORI/prettier/src/language-js/print/type-parameters.js ALT/prettier/src/language-js/print/type-parameters.js index 688b6ec..4a77ec2 100644 --- ORI/prettier/src/language-js/print/type-parameters.js +++ ALT/prettier/src/language-js/print/type-parameters.js @@ -87,10 +87,10 @@ function printTypeParameters(path, options, print, paramsKey) { node.type === "TSTypeParameterInstantiation" // https://github.com/microsoft/TypeScript/issues/21984 ? "" : shouldForceTrailingComma(path, options, paramsKey) - ? "," - : shouldPrintComma(options) - ? ifBreak(",") - : ""; + ? "," + : shouldPrintComma(options) + ? ifBreak(",") + : ""; return group( [ diff --git ORI/prettier/src/language-markdown/printer-markdown.js ALT/prettier/src/language-markdown/printer-markdown.js index d9d6462..9deaa3e 100644 --- ORI/prettier/src/language-markdown/printer-markdown.js +++ ALT/prettier/src/language-markdown/printer-markdown.js @@ -305,12 +305,12 @@ function genericPrint(path, options, print) { ? (childPath.isFirst ? node.start : isGitDiffFriendlyOrderedList - ? 1 - : node.start + childPath.index) + + ? 1 + : node.start + childPath.index) + (nthSiblingIndex % 2 === 0 ? ". " : ") ") : nthSiblingIndex % 2 === 0 - ? "- " - : "* "; + ? "- " + : "* "; return node.isAligned || /* workaround for https://github.com/remarkjs/remark/issues/315 */ node.hasIndentedCodeblock @@ -340,8 +340,8 @@ function genericPrint(path, options, print) { node.referenceType === "full" ? printLinkReference(node) : node.referenceType === "collapsed" - ? "[]" - : "", + ? "[]" + : "", ]; case "imageReference": switch (node.referenceType) { diff --git ORI/prettier/src/language-yaml/utils.js ALT/prettier/src/language-yaml/utils.js index c2f8c1e..6530041 100644 --- ORI/prettier/src/language-yaml/utils.js +++ ALT/prettier/src/language-yaml/utils.js @@ -182,10 +182,10 @@ function getFlowScalarLineContents(nodeType, content, options) { index === 0 && index === lineContents.length - 1 ? lineContent : index !== 0 && index !== lineContents.length - 1 - ? lineContent.trim() - : index === 0 - ? lineContent.trimEnd() - : lineContent.trimStart(), + ? lineContent.trim() + : index === 0 + ? lineContent.trimEnd() + : lineContent.trimStart(), ); if (options.proseWrap === "preserve") { @@ -307,9 +307,9 @@ function getBlockValueLineContents( return trailingNewlineCount === 0 ? lineContents : trailingNewlineCount >= 2 && !isLastDescendant - ? // next empty line - lineContents.slice(0, -(trailingNewlineCount - 1)) - : lineContents.slice(0, -trailingNewlineCount); + ? // next empty line + lineContents.slice(0, -(trailingNewlineCount - 1)) + : lineContents.slice(0, -trailingNewlineCount); } } diff --git ORI/prettier/src/main/normalize-options.js ALT/prettier/src/main/normalize-options.js index c4e7e80..fdab515 100644 --- ORI/prettier/src/main/normalize-options.js +++ ALT/prettier/src/main/normalize-options.js @@ -47,9 +47,9 @@ function normalizeOptions( }); } : Array.isArray(passThrough) - ? (key, value) => - !passThrough.includes(key) ? undefined : { [key]: value } - : (key, value) => ({ [key]: value }); + ? (key, value) => + !passThrough.includes(key) ? undefined : { [key]: value } + : (key, value) => ({ [key]: value }); const schemas = optionInfosToSchemas(optionInfos, { isCLI, FlagSchema }); const normalizer = new vnopts.Normalizer(schemas, { diff --git ORI/prettier/src/utils/print-string.js ALT/prettier/src/utils/print-string.js index 8cbe600..310698b 100644 --- ORI/prettier/src/utils/print-string.js +++ ALT/prettier/src/utils/print-string.js @@ -16,8 +16,8 @@ function printString(raw, options) { !options.singleQuote) ? '"' : options.__isInHtmlAttribute - ? "'" - : getPreferredQuote(rawContent, options.singleQuote); + ? "'" + : getPreferredQuote(rawContent, options.singleQuote); // It might sound unnecessary to use `makeString` even if the string already // is enclosed with `enclosingQuote`, but it isn't. The string could contain diff --git ORI/prettier/tests/config/utils/create-snapshot.js ALT/prettier/tests/config/utils/create-snapshot.js index d404999..ed5f2ea 100644 --- ORI/prettier/tests/config/utils/create-snapshot.js +++ ALT/prettier/tests/config/utils/create-snapshot.js @@ -13,8 +13,8 @@ function stringify(value) { return value === Number.POSITIVE_INFINITY ? "Infinity" : Array.isArray(value) - ? `[${value.map((v) => JSON.stringify(v)).join(", ")}]` - : JSON.stringify(value); + ? `[${value.map((v) => JSON.stringify(v)).join(", ")}]` + : JSON.stringify(value); } function printOptions(options) { diff --git ORI/prettier/tests/config/utils/stringify-options-for-title.js ALT/prettier/tests/config/utils/stringify-options-for-title.js index 11e92ee..d25c671 100644 --- ORI/prettier/tests/config/utils/stringify-options-for-title.js +++ ALT/prettier/tests/config/utils/stringify-options-for-title.js @@ -3,8 +3,8 @@ function stringifyOptions(options) { key === "plugins" || key === "errors" ? undefined : value === Number.POSITIVE_INFINITY - ? "Infinity" - : value, + ? "Infinity" + : value, ); return string === "{}" ? "" : string; diff --git ORI/prettier/tests/integration/__tests__/support-info.js ALT/prettier/tests/integration/__tests__/support-info.js index 849c919..3a354aa 100644 --- ORI/prettier/tests/integration/__tests__/support-info.js +++ ALT/prettier/tests/integration/__tests__/support-info.js @@ -23,8 +23,8 @@ async function getCoreInfo() { ...(option.type === "int" ? { range: option.range } : option.type === "choice" - ? { choices: option.choices.map((choice) => choice.value) } - : null), + ? { choices: option.choices.map((choice) => choice.value) } + : null), }, ]), ); diff --git ORI/prettier/tests/integration/cli-worker.js ALT/prettier/tests/integration/cli-worker.js index 7c8743a..99f460d 100644 --- ORI/prettier/tests/integration/cli-worker.js +++ ALT/prettier/tests/integration/cli-worker.js @@ -47,8 +47,8 @@ async function run() { stream === process.stdout ? "process.stdout" : stream === process.stderr - ? "process.stderr" - : "unknown stream" + ? "process.stderr" + : "unknown stream" })]]\n`, ); }; diff --git ORI/prettier/website/playground/Playground.js ALT/prettier/website/playground/Playground.js index 845b9ed..7ff2c15 100644 --- ORI/prettier/website/playground/Playground.js +++ ALT/prettier/website/playground/Playground.js @@ -514,8 +514,8 @@ function getSecondFormat(formatted, reformatted) { return formatted === "" ? "" : formatted === reformatted - ? "✓ Second format is unchanged." - : reformatted; + ? "✓ Second format is unchanged." + : reformatted; } export default Playground; diff --git ORI/prettier/website/static/worker.js ALT/prettier/website/static/worker.js index c8b2389..b56c5f2 100644 --- ORI/prettier/website/static/worker.js +++ ALT/prettier/website/static/worker.js @@ -45,10 +45,10 @@ function serializeAst(ast) { value instanceof Error ? { name: value.name, message: value.message, ...value } : typeof value === "bigint" - ? `BigInt('${String(value)}')` - : typeof value === "symbol" - ? String(value) - : value, + ? `BigInt('${String(value)}')` + : typeof value === "symbol" + ? String(value) + : value, 2, ); } ```
github-actions[bot] commented 10 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: marmelab/react-admin@fbf280286c715d6ef0c38d7111eab249aa929dc1

Diff (868 lines) ```diff diff --git ORI/react-admin/examples/crm/src/misc/Status.tsx ALT/react-admin/examples/crm/src/misc/Status.tsx index a63a357..b61e3cf 100644 --- ORI/react-admin/examples/crm/src/misc/Status.tsx +++ ALT/react-admin/examples/crm/src/misc/Status.tsx @@ -5,12 +5,12 @@ const getColorFromStatus = (status: string) => status === 'cold' ? '#7dbde8' : status === 'warm' - ? '#e8cb7d' - : status === 'hot' - ? '#e88b7d' - : status === 'in-contract' - ? '#a4e87d' - : '#000'; + ? '#e8cb7d' + : status === 'hot' + ? '#e88b7d' + : status === 'in-contract' + ? '#a4e87d' + : '#000'; export const Status = ({ status }: { status: string }) => ( { typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? 'ra.auth.sign_in_error' - : error.message, + ? 'ra.auth.sign_in_error' + : error.message, { type: 'error', messageArgs: { @@ -50,8 +50,8 @@ const Login = () => { typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-core/src/auth/useAuthState.ts ALT/react-admin/packages/ra-core/src/auth/useAuthState.ts index 8f2f4ff..33157e5 100644 --- ORI/react-admin/packages/ra-core/src/auth/useAuthState.ts +++ ALT/react-admin/packages/ra-core/src/auth/useAuthState.ts @@ -108,5 +108,5 @@ const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? defaultMessage - : error.message; + ? defaultMessage + : error.message; diff --git ORI/react-admin/packages/ra-core/src/auth/useCheckAuth.ts ALT/react-admin/packages/ra-core/src/auth/useCheckAuth.ts index 2db6a45..ac96be2 100644 --- ORI/react-admin/packages/ra-core/src/auth/useCheckAuth.ts +++ ALT/react-admin/packages/ra-core/src/auth/useCheckAuth.ts @@ -108,5 +108,5 @@ const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? defaultMessage - : error.message; + ? defaultMessage + : error.message; diff --git ORI/react-admin/packages/ra-core/src/auth/useGetIdentity.ts ALT/react-admin/packages/ra-core/src/auth/useGetIdentity.ts index 667f772..0dea5f6 100644 --- ORI/react-admin/packages/ra-core/src/auth/useGetIdentity.ts +++ ALT/react-admin/packages/ra-core/src/auth/useGetIdentity.ts @@ -63,13 +63,13 @@ export const useGetIdentity = ( result.isLoading ? { isLoading: true } : result.error - ? { error: result.error, isLoading: false } - : { - data: result.data, - identity: result.data, - refetch: result.refetch, - isLoading: false, - }, + ? { error: result.error, isLoading: false } + : { + data: result.data, + identity: result.data, + refetch: result.refetch, + isLoading: false, + }, [result] ); diff --git ORI/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts ALT/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts index 361b522..04ec2cc 100644 --- ORI/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts +++ ALT/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts @@ -64,8 +64,8 @@ const useLogoutIfAccessDenied = (): LogoutIfAccessDenied => { e && e.redirectTo != null ? e.redirectTo : error && error.redirectTo - ? error.redirectTo - : undefined; + ? error.redirectTo + : undefined; const shouldNotify = !( disableNotification || @@ -141,7 +141,7 @@ const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? defaultMessage - : error.message; + ? defaultMessage + : error.message; export default useLogoutIfAccessDenied; diff --git ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx index 3be0661..dc9fab4 100644 --- ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx +++ ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx @@ -126,8 +126,8 @@ const useDeleteWithConfirmController = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx index 59630dd..3502b4f 100644 --- ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx +++ ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx @@ -91,8 +91,8 @@ const useDeleteWithUndoController = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-core/src/controller/create/useCreateController.ts ALT/react-admin/packages/ra-core/src/controller/create/useCreateController.ts index f08ad5d..690e686 100644 --- ORI/react-admin/packages/ra-core/src/controller/create/useCreateController.ts +++ ALT/react-admin/packages/ra-core/src/controller/create/useCreateController.ts @@ -96,8 +96,8 @@ export const useCreateController = < transformFromSave ? transformFromSave(data) : transform - ? transform(data) - : data + ? transform(data) + : data ).then(async (data: Partial) => { const mutate = getMutateWithMiddlewares(create); try { @@ -131,27 +131,28 @@ export const useCreateController = < onError: onErrorFromSave ? onErrorFromSave : onError - ? onError - : (error: Error) => { - notify( - typeof error === 'string' - ? error - : error.message || - 'ra.notification.http_error', - { - type: 'error', - messageArgs: { - _: - typeof error === 'string' - ? error - : error && - error.message - ? error.message - : undefined, - }, - } - ); - }, + ? onError + : (error: Error) => { + notify( + typeof error === 'string' + ? error + : error.message || + 'ra.notification.http_error', + { + type: 'error', + messageArgs: { + _: + typeof error === + 'string' + ? error + : error && + error.message + ? error.message + : undefined, + }, + } + ); + }, } ); } catch (error) { diff --git ORI/react-admin/packages/ra-core/src/controller/edit/useEditController.ts ALT/react-admin/packages/ra-core/src/controller/edit/useEditController.ts index 0a46165..880513c 100644 --- ORI/react-admin/packages/ra-core/src/controller/edit/useEditController.ts +++ ALT/react-admin/packages/ra-core/src/controller/edit/useEditController.ts @@ -150,10 +150,10 @@ export const useEditController = < previousData: recordCached.previousData, }) : transform - ? transform(data, { - previousData: recordCached.previousData, - }) - : data + ? transform(data, { + previousData: recordCached.previousData, + }) + : data ).then(async (data: Partial) => { const mutate = getMutateWithMiddlewares(update); @@ -185,27 +185,28 @@ export const useEditController = < onError: onErrorFromSave ? onErrorFromSave : onError - ? onError - : (error: Error | string) => { - notify( - typeof error === 'string' - ? error - : error.message || - 'ra.notification.http_error', - { - type: 'error', - messageArgs: { - _: - typeof error === 'string' - ? error - : error && - error.message - ? error.message - : undefined, - }, - } - ); - }, + ? onError + : (error: Error | string) => { + notify( + typeof error === 'string' + ? error + : error.message || + 'ra.notification.http_error', + { + type: 'error', + messageArgs: { + _: + typeof error === + 'string' + ? error + : error && + error.message + ? error.message + : undefined, + }, + } + ); + }, } ); } catch (error) { diff --git ORI/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts ALT/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts index 5027fca..fa25351 100644 --- ORI/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts +++ ALT/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts @@ -86,8 +86,8 @@ export const useReferenceArrayFieldController = < typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ), diff --git ORI/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts ALT/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts index 0f9ebe7..04de0d2 100644 --- ORI/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts +++ ALT/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts @@ -168,8 +168,8 @@ export const useReferenceManyFieldController = < typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ), @@ -200,8 +200,8 @@ export const useReferenceManyFieldController = < hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? page * perPage < total - : undefined, + ? page * perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : page > 1, setSort, showFilter, diff --git ORI/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx ALT/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx index b76df91..889d34e 100644 --- ORI/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx +++ ALT/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx @@ -86,8 +86,8 @@ export const useReferenceOneFieldController = < typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ), diff --git ORI/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts ALT/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts index 6a630bb..7364ea1 100644 --- ORI/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts +++ ALT/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts @@ -65,8 +65,8 @@ export const getSelectedReferencesStatus = ( !field.value || field.value.length === referenceRecords.length ? REFERENCES_STATUS_READY : referenceRecords.length > 0 - ? REFERENCES_STATUS_INCOMPLETE - : REFERENCES_STATUS_EMPTY; + ? REFERENCES_STATUS_INCOMPLETE + : REFERENCES_STATUS_EMPTY; interface GetStatusForArrayInputParams { field: ControllerRenderProps; diff --git ORI/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts ALT/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts index d4b7074..d91c802 100644 --- ORI/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts +++ ALT/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts @@ -122,8 +122,8 @@ export const useReferenceArrayInputController = < matchingReferences && matchingReferences.length > 0 ? mergeReferences(matchingReferences, finalReferenceRecords) : finalReferenceRecords.length > 0 - ? finalReferenceRecords - : matchingReferences; + ? finalReferenceRecords + : matchingReferences; const refetch = useCallback(() => { refetchGetMany(); @@ -163,8 +163,8 @@ export const useReferenceArrayInputController = < hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? params.page * params.perPage < total - : undefined, + ? params.page * params.perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : params.page > 1, isFromReference: true, }; diff --git ORI/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts ALT/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts index 694be2c..a280fa9 100644 --- ORI/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts +++ ALT/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts @@ -179,8 +179,8 @@ export const useReferenceInputController = ( hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? params.page * params.perPage < total - : undefined, + ? params.page * params.perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : params.page > 1, isFromReference: true, }; diff --git ORI/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx ALT/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx index 4c985fe..f33ffa7 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx +++ ALT/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx @@ -42,8 +42,8 @@ export const useExpanded = ( ? [] : [...ids.slice(0, index), ...ids.slice(index + 1)] : single - ? [id] - : [...ids, id]; + ? [id] + : [...ids, id]; }); }, [setExpandedIds, id, single]); diff --git ORI/react-admin/packages/ra-core/src/controller/list/useList.ts ALT/react-admin/packages/ra-core/src/controller/list/useList.ts index b454ffd..30ca424 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useList.ts +++ ALT/react-admin/packages/ra-core/src/controller/list/useList.ts @@ -177,8 +177,8 @@ export const useList = ( ) : recordValue.includes(filterValue) : Array.isArray(filterValue) - ? filterValue.includes(recordValue) - : filterValue == recordValue; // eslint-disable-line eqeqeq + ? filterValue.includes(recordValue) + : filterValue == recordValue; // eslint-disable-line eqeqeq return result; } ) diff --git ORI/react-admin/packages/ra-core/src/controller/list/useListController.ts ALT/react-admin/packages/ra-core/src/controller/list/useListController.ts index da04fcf..a640c04 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useListController.ts +++ ALT/react-admin/packages/ra-core/src/controller/list/useListController.ts @@ -165,8 +165,8 @@ export const useListController = ( hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? query.page * query.perPage < total - : undefined, + ? query.page * query.perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : query.page > 1, }; }; diff --git ORI/react-admin/packages/ra-core/src/controller/list/useListParams.ts ALT/react-admin/packages/ra-core/src/controller/list/useListParams.ts index 674de5a..c14ea79 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useListParams.ts +++ ALT/react-admin/packages/ra-core/src/controller/list/useListParams.ts @@ -334,8 +334,8 @@ export const getQuery = ({ Object.keys(queryFromLocation).length > 0 ? queryFromLocation : hasCustomParams(params) - ? { ...params } - : { filter: filterDefaultValues || {} }; + ? { ...params } + : { filter: filterDefaultValues || {} }; if (!query.sort) { query.sort = sort.field; diff --git ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx index c044598..aab68a7 100644 --- ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx +++ ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx @@ -52,8 +52,8 @@ const TestedComponent = ({ role }) => { role === 'admin' ? [, ] : role === 'user' - ? [] - : [] + ? [] + : [] } @@ -76,8 +76,8 @@ const TestedComponentReturningNull = ({ role }) => { role === 'admin' ? [, ] : role === 'user' - ? [] - : null + ? [] + : null } diff --git ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx index 179e5b6..c6eadca 100644 --- ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx +++ ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx @@ -125,10 +125,12 @@ const useRoutesAndResourcesFromChildren = ( !!functionChild ? 'loading' : newRoutesAndResources.resources.length > 0 || - newRoutesAndResources.customRoutesWithLayout.length > 0 || - newRoutesAndResources.customRoutesWithoutLayout.length > 0 - ? 'ready' - : 'empty' + newRoutesAndResources.customRoutesWithLayout.length > + 0 || + newRoutesAndResources.customRoutesWithoutLayout.length > + 0 + ? 'ready' + : 'empty' ); if (functionChild) { @@ -248,10 +250,10 @@ const getStatus = ({ return getSingleChildFunction(children) ? 'loading' : resources.length > 0 || - customRoutesWithLayout.length > 0 || - customRoutesWithoutLayout.length > 0 - ? 'ready' - : 'empty'; + customRoutesWithLayout.length > 0 || + customRoutesWithoutLayout.length > 0 + ? 'ready' + : 'empty'; }; /** diff --git ORI/react-admin/packages/ra-core/src/form/useAugmentedForm.ts ALT/react-admin/packages/ra-core/src/form/useAugmentedForm.ts index 19218f0..6992cf8 100644 --- ORI/react-admin/packages/ra-core/src/form/useAugmentedForm.ts +++ ALT/react-admin/packages/ra-core/src/form/useAugmentedForm.ts @@ -64,8 +64,8 @@ export const useAugmentedForm = (props: UseAugmentedFormProps) => { const finalResolver = resolver ? resolver : validate - ? getSimpleValidationResolver(validate) - : undefined; + ? getSimpleValidationResolver(validate) + : undefined; const form = useForm({ criteriaMode, diff --git ORI/react-admin/packages/ra-core/src/form/useChoices.tsx ALT/react-admin/packages/ra-core/src/form/useChoices.tsx index 1ed535e..44a8e55 100644 --- ORI/react-admin/packages/ra-core/src/form/useChoices.tsx +++ ALT/react-admin/packages/ra-core/src/form/useChoices.tsx @@ -64,8 +64,8 @@ export const useChoices = ({ return isValidElement(choiceName) ? choiceName : translateChoice - ? translate(String(choiceName), { _: choiceName }) - : String(choiceName); + ? translate(String(choiceName), { _: choiceName }) + : String(choiceName); }, [optionText, translate, translateChoice] ); diff --git ORI/react-admin/packages/ra-core/src/form/useInput.spec.tsx ALT/react-admin/packages/ra-core/src/form/useInput.spec.tsx index a989b5b..80dbc45 100644 --- ORI/react-admin/packages/ra-core/src/form/useInput.spec.tsx +++ ALT/react-admin/packages/ra-core/src/form/useInput.spec.tsx @@ -179,8 +179,8 @@ describe('useInput', () => { {typeof values[source] === 'undefined' ? 'undefined' : values[source] - ? 'true' - : 'false'} + ? 'true' + : 'false'} ); }; diff --git ORI/react-admin/packages/ra-core/src/form/validate.ts ALT/react-admin/packages/ra-core/src/form/validate.ts index df494bb..575b734 100644 --- ORI/react-admin/packages/ra-core/src/form/validate.ts +++ ALT/react-admin/packages/ra-core/src/form/validate.ts @@ -58,11 +58,11 @@ const getMessage = ( values, }) : messageArgs - ? { - message, - args: messageArgs, - } - : message; + ? { + message, + args: messageArgs, + } + : message; type Memoize = any>( func: T, diff --git ORI/react-admin/packages/ra-core/src/store/useStore.stories.tsx ALT/react-admin/packages/ra-core/src/store/useStore.stories.tsx index 66bb59c..f1bb3e2 100644 --- ORI/react-admin/packages/ra-core/src/store/useStore.stories.tsx +++ ALT/react-admin/packages/ra-core/src/store/useStore.stories.tsx @@ -58,10 +58,10 @@ const StoreRaw = ({ name }) => { {value === undefined ? 'undefined' : value === null - ? 'null' - : value === '' - ? "''" - : value} + ? 'null' + : value === '' + ? "''" + : value} ); }; diff --git ORI/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx ALT/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx index 6166b93..4755a54 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx @@ -31,8 +31,8 @@ export const LoginForm = (props: LoginFormProps) => { typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? 'ra.auth.sign_in_error' - : error.message, + ? 'ra.auth.sign_in_error' + : error.message, { type: 'error', messageArgs: { @@ -40,8 +40,8 @@ export const LoginForm = (props: LoginFormProps) => { typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx index 7d3d5f1..5285439 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx @@ -68,8 +68,8 @@ export const BulkDeleteWithConfirmButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx index 963304d..8c22bbf 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx @@ -61,8 +61,8 @@ export const BulkDeleteWithUndoButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx index 7be7e89..707668d 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx @@ -60,8 +60,8 @@ export const BulkUpdateWithConfirmButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx index 70e224d..35fc447 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx @@ -52,8 +52,8 @@ export const BulkUpdateWithUndoButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx index c232df9..06226fb 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx @@ -63,8 +63,8 @@ export const DeleteButton = ( const finalMutationMode = mutationMode ? mutationMode : saveContext?.mutationMode - ? saveContext.mutationMode - : 'undoable'; + ? saveContext.mutationMode + : 'undoable'; return finalMutationMode === 'undoable' ? ( // @ts-ignore I looked for the error for one hour without finding it diff --git ORI/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx ALT/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx index f5d0eb3..f42df99 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx @@ -78,8 +78,8 @@ const DateFieldImpl = < value instanceof Date ? value : typeof value === 'string' || typeof value === 'number' - ? new Date(value) - : undefined; + ? new Date(value) + : undefined; let dateOptions = options; if ( diff --git ORI/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx ALT/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx index e6fc0c7..904f2fa 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx @@ -97,8 +97,8 @@ export const NumberInput = ({ ? parse(target.valueAsNumber) : target.valueAsNumber : parse - ? parse(target.value) - : convertStringToNumber(target.value); + ? parse(target.value) + : convertStringToNumber(target.value); field.onChange(newValue); }; diff --git ORI/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx ALT/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx index 21da8b1..b0e942b 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx @@ -253,8 +253,8 @@ export const SelectArrayInput = (props: SelectArrayInputProps) => { const finalValue = Array.isArray(field.value ?? []) ? field.value : field.value - ? [field.value] - : []; + ? [field.value] + : []; const outlinedInputProps = variant === 'outlined' diff --git ORI/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx ALT/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx index a37e8c1..607027b 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx @@ -207,8 +207,8 @@ export const SelectInput = (props: SelectInputProps) => { return isElement(emptyText) ? emptyText : emptyText === '' - ? ' ' // em space, forces the display of an empty line of normal height - : translate(emptyText, { _: emptyText }); + ? ' ' // em space, forces the display of an empty line of normal height + : translate(emptyText, { _: emptyText }); }, [emptyText, translate]); const renderMenuItemOption = useCallback( diff --git ORI/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx ALT/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx index 243f802..c851ebf 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx @@ -48,8 +48,8 @@ export const ThemeProvider = ({ typeof mode === 'object' ? mode // FIXME: legacy useTheme, to be removed in v5 : mode === 'dark' - ? darkTheme - : lightTheme || themeOverride + ? darkTheme + : lightTheme || themeOverride ); } catch (e) { console.warn('Failed to reuse custom theme from store', e); diff --git ORI/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx ALT/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx index b1e4199..5e3c01a 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx @@ -160,8 +160,8 @@ export const SimpleList = ( _: primaryText, }) : isElement(primaryText) - ? primaryText - : primaryText(record, record.id)} + ? primaryText + : primaryText(record, record.id)} {!!tertiaryText && (isValidElement(tertiaryText) ? ( @@ -182,13 +182,13 @@ export const SimpleList = ( } ) : isElement( - tertiaryText - ) - ? tertiaryText - : tertiaryText( - record, - record.id - )} + tertiaryText + ) + ? tertiaryText + : tertiaryText( + record, + record.id + )} ))}
@@ -201,8 +201,8 @@ export const SimpleList = ( _: secondaryText, }) : isElement(secondaryText) - ? secondaryText - : secondaryText(record, record.id)) + ? secondaryText + : secondaryText(record, record.id)) } /> {(rightAvatar || rightIcon) && ( diff --git ORI/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx ALT/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx index f9824c6..3742fa0 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx @@ -67,13 +67,13 @@ export const DatagridConfigurable = ({ child.props.label && typeof child.props.label === 'string' // this list is serializable, so we can't store ReactElement in it ? child.props.label : child.props.source - ? // force the label to be the source - undefined - : // no source or label, generate a label - translate('ra.configurable.Datagrid.unlabeled', { - column: index, - _: `Unlabeled column #%{column}`, - }), + ? // force the label to be the source + undefined + : // no source or label, generate a label + translate('ra.configurable.Datagrid.unlabeled', { + column: index, + _: `Unlabeled column #%{column}`, + }), })); if (columns.length !== availableColumns.length) { setAvailableColumns(columns); diff --git ORI/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx ALT/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx index 07bdfef..a9982be 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx @@ -122,8 +122,8 @@ export const Pagination: FC = memo(props => { const ActionsComponent = actions ? actions // overridden by caller : !isLoading && total != null - ? PaginationActions // regular navigation - : undefined; // partial navigation (uses default TablePaginationActions) + ? PaginationActions // regular navigation + : undefined; // partial navigation (uses default TablePaginationActions) return (
github-actions[bot] commented 10 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: typescript-eslint/typescript-eslint@4bf2d7360eaf74c9ef87b196ff4c459b8f50800b

Diff (410 lines) ```diff diff --git ORI/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts ALT/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts index dad8feb..212e3bc 100644 --- ORI/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts +++ ALT/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts @@ -177,11 +177,11 @@ export default createRule({ ), ) : replacements !== undefined - ? fixer.replaceTextRange( - [replacements.start, replacements.end], - replacements.text, - ) - : []; + ? fixer.replaceTextRange( + [replacements.start, replacements.end], + replacements.text, + ) + : []; }, }); }); diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts index 2d4d3f5..1cb6945 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts @@ -244,35 +244,35 @@ export default util.createRule({ (typeof options.align === 'object' ? options.align.on : typeof options.multiLine?.align === 'object' - ? options.multiLine.align.on - : options.multiLine?.align ?? options.align) ?? 'colon'; + ? options.multiLine.align.on + : options.multiLine?.align ?? options.align) ?? 'colon'; const beforeColon = (typeof options.align === 'object' ? options.align.beforeColon : options.multiLine - ? typeof options.multiLine.align === 'object' - ? options.multiLine.align.beforeColon - : options.multiLine.beforeColon - : options.beforeColon) ?? false; + ? typeof options.multiLine.align === 'object' + ? options.multiLine.align.beforeColon + : options.multiLine.beforeColon + : options.beforeColon) ?? false; const expectedWhitespaceBeforeColon = beforeColon ? 1 : 0; const afterColon = (typeof options.align === 'object' ? options.align.afterColon : options.multiLine - ? typeof options.multiLine.align === 'object' - ? options.multiLine.align.afterColon - : options.multiLine.afterColon - : options.afterColon) ?? true; + ? typeof options.multiLine.align === 'object' + ? options.multiLine.align.afterColon + : options.multiLine.afterColon + : options.afterColon) ?? true; const expectedWhitespaceAfterColon = afterColon ? 1 : 0; const mode = (typeof options.align === 'object' ? options.align.mode : options.multiLine - ? typeof options.multiLine.align === 'object' - ? // same behavior as in original rule - options.multiLine.align.mode ?? options.multiLine.mode - : options.multiLine.mode - : options.mode) ?? 'strict'; + ? typeof options.multiLine.align === 'object' + ? // same behavior as in original rule + options.multiLine.align.mode ?? options.multiLine.mode + : options.multiLine.mode + : options.mode) ?? 'strict'; for (const node of group) { if (isKeyTypeNode(node)) { @@ -307,8 +307,8 @@ export default util.createRule({ ? 'extraKey' : 'extraValue' : align === 'colon' - ? 'missingKey' - : 'missingValue', + ? 'missingKey' + : 'missingValue', fix: fixer => { if (difference > 0) { return fixer.removeRange([ @@ -344,8 +344,8 @@ export default util.createRule({ ? options.singleLine.beforeColon : options.beforeColon : options.multiLine - ? options.multiLine.beforeColon - : options.beforeColon) ?? false; + ? options.multiLine.beforeColon + : options.beforeColon) ?? false; const expectedWhitespaceBeforeColon = beforeColon ? 1 : 0; const afterColon = (singleLine @@ -353,8 +353,8 @@ export default util.createRule({ ? options.singleLine.afterColon : options.afterColon : options.multiLine - ? options.multiLine.afterColon - : options.afterColon) ?? true; + ? options.multiLine.afterColon + : options.afterColon) ?? true; const expectedWhitespaceAfterColon = afterColon ? 1 : 0; const mode = (singleLine @@ -362,8 +362,8 @@ export default util.createRule({ ? options.singleLine.mode : options.mode : options.multiLine - ? options.multiLine.mode - : options.mode) ?? 'strict'; + ? options.multiLine.mode + : options.mode) ?? 'strict'; if (isApplicable(node)) { checkBeforeColon(node, expectedWhitespaceBeforeColon, mode); diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts index cadd102..a9bbbdc 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts @@ -361,8 +361,8 @@ function getNodeType(node: Member): MemberKind | null { return node.value && functionExpressions.includes(node.value.type) ? 'method' : node.readonly - ? 'readonly-field' - : 'field'; + ? 'readonly-field' + : 'field'; case AST_NODE_TYPES.TSPropertySignature: return node.readonly ? 'readonly-field' : 'field'; case AST_NODE_TYPES.TSIndexSignature: @@ -520,8 +520,8 @@ function getRank( 'static' in node && node.static ? 'static' : abstract - ? 'abstract' - : 'instance'; + ? 'abstract' + : 'instance'; const accessibility = getAccessibility(node); // Collect all existing member groups that apply to this node... diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts index 93b2140..5bfc146 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts @@ -126,8 +126,8 @@ export default util.createRule({ parent?.type === AST_NODE_TYPES.TSInterfaceBody ? parent.body : parent?.type === AST_NODE_TYPES.TSTypeLiteral - ? parent.members - : []; + ? parent.members + : []; const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] = members.filter( diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts index c2b87cc..00d656f 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts @@ -172,8 +172,8 @@ function createValidator( custom?.match === true ? 'match' : custom?.match === false - ? 'not match' - : null, + ? 'not match' + : null, }; } diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts index d740341..725f260 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -98,15 +98,15 @@ export default util.createRule({ ...(useAutoFix ? { fix } : !mergedWithClassDeclaration - ? { - suggest: [ - { - messageId: 'noEmptyWithSuper', - fix, - }, - ], - } - : null), + ? { + suggest: [ + { + messageId: 'noEmptyWithSuper', + fix, + }, + ], + } + : null), }); } } diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index 9f938ac..6ad8a81 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -221,10 +221,10 @@ export default util.createRule<[Options], MessageIds>({ allowInGenericTypeArguments && allowAsThisParameter ? 'invalidVoidNotReturnOrThisParamOrGeneric' : allowInGenericTypeArguments - ? getNotReturnOrGenericMessageId(node) - : allowAsThisParameter - ? 'invalidVoidNotReturnOrThisParam' - : 'invalidVoidNotReturn', + ? getNotReturnOrGenericMessageId(node) + : allowAsThisParameter + ? 'invalidVoidNotReturnOrThisParam' + : 'invalidVoidNotReturn', node, }); }, diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts index ae6c56e..f3398a6 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts @@ -266,8 +266,8 @@ export default util.createRule({ : 'comparingNullableToTrueDirect' : 'comparingNullableToFalse' : comparison.negated - ? 'negated' - : 'direct', + ? 'negated' + : 'direct', node, }); }, diff --git ORI/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts ALT/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts index 30132f9..eddf23b 100644 --- ORI/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts +++ ALT/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts @@ -103,10 +103,10 @@ function reducer( const usedSetting = settings.errorLevel ? settings.errorLevel : !recommendation - ? DEFAULT_RULE_SETTING - : recommendation === 'strict' - ? 'warn' - : recommendation; + ? DEFAULT_RULE_SETTING + : recommendation === 'strict' + ? 'warn' + : recommendation; if (BASE_RULES_TO_BE_OVERRIDDEN.has(key)) { const baseRuleName = BASE_RULES_TO_BE_OVERRIDDEN.get(key)!; diff --git ORI/typescript-eslint/packages/typescript-estree/src/convert.ts ALT/typescript-eslint/packages/typescript-estree/src/convert.ts index 71fe614..882f40a 100644 --- ORI/typescript-eslint/packages/typescript-estree/src/convert.ts +++ ALT/typescript-eslint/packages/typescript-estree/src/convert.ts @@ -2643,8 +2643,8 @@ export class Converter { node.kind === SyntaxKind.ConstructSignature ? AST_NODE_TYPES.TSConstructSignatureDeclaration : node.kind === SyntaxKind.CallSignature - ? AST_NODE_TYPES.TSCallSignatureDeclaration - : AST_NODE_TYPES.TSFunctionType; + ? AST_NODE_TYPES.TSCallSignatureDeclaration + : AST_NODE_TYPES.TSFunctionType; const result = this.createNode< | TSESTree.TSFunctionType | TSESTree.TSCallSignatureDeclaration @@ -2672,8 +2672,8 @@ export class Converter { parentKind === SyntaxKind.InterfaceDeclaration ? AST_NODE_TYPES.TSInterfaceHeritage : parentKind === SyntaxKind.HeritageClause - ? AST_NODE_TYPES.TSClassImplements - : AST_NODE_TYPES.TSInstantiationExpression; + ? AST_NODE_TYPES.TSClassImplements + : AST_NODE_TYPES.TSInstantiationExpression; const result = this.createNode< | TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements diff --git ORI/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts ALT/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts index 7518b0b..a7d862a 100644 --- ORI/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ ALT/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -36,8 +36,8 @@ export function createParseSettings( options.debugLevel === true ? new Set(['typescript-eslint']) : Array.isArray(options.debugLevel) - ? new Set(options.debugLevel) - : new Set(), + ? new Set(options.debugLevel) + : new Set(), errorOnTypeScriptSyntacticAndSemanticIssues: false, errorOnUnknownASTType: options.errorOnUnknownASTType === true, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: @@ -59,8 +59,8 @@ export function createParseSettings( typeof options.loggerFn === 'function' ? options.loggerFn : options.loggerFn === false - ? (): void => {} - : console.log, // eslint-disable-line no-console + ? (): void => {} + : console.log, // eslint-disable-line no-console moduleResolver: options.moduleResolver ?? '', preserveNodeMaps: options.preserveNodeMaps !== false, programs: Array.isArray(options.programs) ? options.programs : null, diff --git ORI/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts ALT/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts index 0f286ef..7f3e7e8 100644 --- ORI/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts +++ ALT/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts @@ -405,8 +405,8 @@ describe('parseAndGenerateServices', () => { ext === '.json' ? '{ "x": 1 }' : jsxContent - ? 'const x =
;' - : 'const x = 1'; + ? 'const x =
;' + : 'const x = 1'; it(`should parse ${ext} file - ${ jsxContent ? 'with' : 'without' } JSX content - parserOptions.jsx = ${jsxSetting}`, () => { diff --git ORI/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts ALT/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts index bcb80ec..4aca4b0 100644 --- ORI/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts +++ ALT/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts @@ -9,8 +9,8 @@ type InferOptionsTypeFromRule = T extends RuleModule< > ? TOptions : T extends RuleCreateFunction - ? TOptions - : unknown; + ? TOptions + : unknown; /** * Uses type inference to fetch the TMessageIds type from the given RuleModule @@ -21,7 +21,7 @@ type InferMessageIdsTypeFromRule = T extends RuleModule< > ? TMessageIds : T extends RuleCreateFunction - ? TMessageIds - : unknown; + ? TMessageIds + : unknown; export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule }; diff --git ORI/typescript-eslint/packages/website/plugins/generated-rule-docs.ts ALT/typescript-eslint/packages/website/plugins/generated-rule-docs.ts index 2e5a325..cdc39d6 100644 --- ORI/typescript-eslint/packages/website/plugins/generated-rule-docs.ts +++ ALT/typescript-eslint/packages/website/plugins/generated-rule-docs.ts @@ -258,16 +258,16 @@ export const generatedRuleDocs: Plugin = () => { meta.schema instanceof Array ? meta.schema[0] : meta.schema.type === 'array' - ? { - ...(meta.schema.definitions - ? { definitions: meta.schema.definitions } - : {}), - ...(meta.schema.$defs - ? { $defs: (meta.schema as JSONSchema7).$defs } - : {}), - ...(meta.schema.prefixItems as [JSONSchema])[0], - } - : meta.schema; + ? { + ...(meta.schema.definitions + ? { definitions: meta.schema.definitions } + : {}), + ...(meta.schema.$defs + ? { $defs: (meta.schema as JSONSchema7).$defs } + : {}), + ...(meta.schema.prefixItems as [JSONSchema])[0], + } + : meta.schema; children.splice( optionsH2Index + 1, diff --git ORI/typescript-eslint/packages/website/src/components/ast/utils.ts ALT/typescript-eslint/packages/website/src/components/ast/utils.ts index de55a5c..936e647 100644 --- ORI/typescript-eslint/packages/website/src/components/ast/utils.ts +++ ALT/typescript-eslint/packages/website/src/components/ast/utils.ts @@ -60,8 +60,8 @@ export function hasChildInRange( item.model.type === 'object' ? isInRange(position, item.model) : item.model.type === 'array' - ? isArrayInRange(position, item.model) - : false, + ? isArrayInRange(position, item.model) + : false, ), ); } diff --git ORI/typescript-eslint/packages/website/src/components/linter/utils.ts ALT/typescript-eslint/packages/website/src/components/linter/utils.ts index e2a4b3e..ff90ded 100644 --- ORI/typescript-eslint/packages/website/src/components/linter/utils.ts +++ ALT/typescript-eslint/packages/website/src/components/linter/utils.ts @@ -89,8 +89,8 @@ export function parseMarkers( marker.owner === 'eslint' ? code.value : marker.owner === 'typescript' - ? 'TypeScript' - : marker.owner; + ? 'TypeScript' + : marker.owner; if (!result[group]) { result[group] = { ```
github-actions[bot] commented 10 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: vega/vega-lite@c9659206602eda1d894702a2a1f5b526b9832f9f

Diff (321 lines) ```diff diff --git ORI/vega-lite/src/channel.ts ALT/vega-lite/src/channel.ts index 289cc69..a359383 100644 --- ORI/vega-lite/src/channel.ts +++ ALT/vega-lite/src/channel.ts @@ -219,16 +219,16 @@ export function isSecondaryRangeChannel(c: ExtendedChannel): c is SecondaryRange export type MainChannelOf = C extends 'x2' ? 'x' : C extends 'y2' - ? 'y' - : C extends 'latitude2' - ? 'latitude' - : C extends 'longitude2' - ? 'longitude' - : C extends 'theta2' - ? 'theta' - : C extends 'radius2' - ? 'radius' - : C; + ? 'y' + : C extends 'latitude2' + ? 'latitude' + : C extends 'longitude2' + ? 'longitude' + : C extends 'theta2' + ? 'theta' + : C extends 'radius2' + ? 'radius' + : C; /** * Get the main channel for a range channel. E.g. `x` for `x2`. @@ -254,16 +254,16 @@ export function getMainRangeChannel(channel: C): Main export type SecondaryChannelOf = C extends 'x' ? 'x2' : C extends 'y' - ? 'y2' - : C extends 'latitude' - ? 'latitude2' - : C extends 'longitude' - ? 'longitude2' - : C extends 'theta' - ? 'theta2' - : C extends 'radius' - ? 'radius2' - : undefined; + ? 'y2' + : C extends 'latitude' + ? 'latitude2' + : C extends 'longitude' + ? 'longitude2' + : C extends 'theta' + ? 'theta2' + : C extends 'radius' + ? 'radius2' + : undefined; export function getVgPositionChannel(channel: PolarPositionChannel | PositionChannel) { if (isPolarPositionChannel(channel)) { diff --git ORI/vega-lite/src/channeldef.ts ALT/vega-lite/src/channeldef.ts index 77ed5a2..3cfd86f 100644 --- ORI/vega-lite/src/channeldef.ts +++ ALT/vega-lite/src/channeldef.ts @@ -1097,10 +1097,10 @@ export function initFieldOrDatumDef( const guideType = isPositionFieldOrDatumDef(fd) ? 'axis' : isMarkPropFieldOrDatumDef(fd) - ? 'legend' - : isFacetFieldDef(fd) - ? 'header' - : null; + ? 'legend' + : isFacetFieldDef(fd) + ? 'header' + : null; if (guideType && fd[guideType]) { const {format, formatType, ...newGuide} = fd[guideType]; if (isCustomFormatType(formatType) && !config.customFormatTypes) { diff --git ORI/vega-lite/src/compile/axis/config.ts ALT/vega-lite/src/compile/axis/config.ts index ee6b002..2f242bb 100644 --- ORI/vega-lite/src/compile/axis/config.ts +++ ALT/vega-lite/src/compile/axis/config.ts @@ -55,12 +55,12 @@ export function getAxisConfigs( scaleType === 'band' ? ['axisDiscrete', 'axisBand'] : scaleType === 'point' - ? ['axisDiscrete', 'axisPoint'] - : isQuantitative(scaleType) - ? ['axisQuantitative'] - : scaleType === 'time' || scaleType === 'utc' - ? ['axisTemporal'] - : []; + ? ['axisDiscrete', 'axisPoint'] + : isQuantitative(scaleType) + ? ['axisQuantitative'] + : scaleType === 'time' || scaleType === 'utc' + ? ['axisTemporal'] + : []; const axisChannel = channel === 'x' ? 'axisX' : 'axisY'; const axisOrient = isSignalRef(orient) ? 'axisOrient' : `axis${titleCase(orient)}`; // axisTop, axisBottom, ... diff --git ORI/vega-lite/src/compile/data/facet.ts ALT/vega-lite/src/compile/data/facet.ts index 4c3e581..a501aa4 100644 --- ORI/vega-lite/src/compile/data/facet.ts +++ ALT/vega-lite/src/compile/data/facet.ts @@ -63,8 +63,8 @@ export class FacetNode extends DataFlowNode { ...(isSortField(sort) ? {sortField: sort} : isArray(sort) - ? {sortIndexField: sortArrayIndexField(fieldDef, channel)} - : {}) + ? {sortIndexField: sortArrayIndexField(fieldDef, channel)} + : {}) }; } } @@ -231,8 +231,8 @@ export class FacetNode extends DataFlowNode { ? {signal: `ceil(${cardinality} / ${columns})`} : 1 : columns - ? {signal: `min(${cardinality}, ${columns})`} - : {signal: cardinality}; + ? {signal: `min(${cardinality}, ${columns})`} + : {signal: cardinality}; data.push({ name: `${this.facet.name}_${headerChannel}`, diff --git ORI/vega-lite/src/compile/data/geojson.ts ALT/vega-lite/src/compile/data/geojson.ts index d60f5d5..6e47d59 100644 --- ORI/vega-lite/src/compile/data/geojson.ts +++ ALT/vega-lite/src/compile/data/geojson.ts @@ -29,10 +29,10 @@ export class GeoJSONNode extends DataFlowNode { return isFieldDef(def) ? def.field : isDatumDef(def) - ? {expr: `${def.datum}`} - : isValueDef(def) - ? {expr: `${def['value']}`} - : undefined; + ? {expr: `${def.datum}`} + : isValueDef(def) + ? {expr: `${def['value']}`} + : undefined; }) as [GeoPositionChannel, GeoPositionChannel]; if (pair[0] || pair[1]) { diff --git ORI/vega-lite/src/compile/data/geopoint.ts ALT/vega-lite/src/compile/data/geopoint.ts index 282e4a7..a885913 100644 --- ORI/vega-lite/src/compile/data/geopoint.ts +++ ALT/vega-lite/src/compile/data/geopoint.ts @@ -35,10 +35,10 @@ export class GeoPointNode extends DataFlowNode { return isFieldDef(def) ? def.field : isDatumDef(def) - ? {expr: `${def.datum}`} - : isValueDef(def) - ? {expr: `${def['value']}`} - : undefined; + ? {expr: `${def.datum}`} + : isValueDef(def) + ? {expr: `${def['value']}`} + : undefined; }) as [GeoPositionChannel, GeoPositionChannel]; const suffix = coordinates[0] === LONGITUDE2 ? '2' : ''; diff --git ORI/vega-lite/src/compile/mark/encode/position-rect.ts ALT/vega-lite/src/compile/mark/encode/position-rect.ts index 72cc218..f1b09d5 100644 --- ORI/vega-lite/src/compile/mark/encode/position-rect.ts +++ ALT/vega-lite/src/compile/mark/encode/position-rect.ts @@ -210,10 +210,10 @@ function positionAndSize( ? 0 : 0.5 : isSignalRef(bandSize) - ? {signal: `(1-${bandSize})/2`} - : isRelativeBandSize(bandSize) - ? (1 - bandSize.band) / 2 - : 0 + ? {signal: `(1-${bandSize})/2`} + : isRelativeBandSize(bandSize) + ? (1 - bandSize.band) / 2 + : 0 }); if (vgSizeChannel) { @@ -328,8 +328,8 @@ function rectBinPosition({ const bandPosition = isSignalRef(bandSize) ? {signal: `(1-${bandSize.signal})/2`} : isRelativeBandSize(bandSize) - ? (1 - bandSize.band) / 2 - : 0.5; + ? (1 - bandSize.band) / 2 + : 0.5; if (isBinning(fieldDef.bin) || fieldDef.timeUnit) { return { diff --git ORI/vega-lite/src/compile/selection/project.ts ALT/vega-lite/src/compile/selection/project.ts index 0cd9136..0fee2a1 100644 --- ORI/vega-lite/src/compile/selection/project.ts +++ ALT/vega-lite/src/compile/selection/project.ts @@ -157,8 +157,8 @@ const project: SelectionCompiler = { hasContinuousDomain(model.getScaleComponent(channel).get('type')) ? 'R' : fieldDef.bin - ? 'R-RE' - : 'E'; + ? 'R-RE' + : 'E'; const p: SelectionProjection = {field, channel, type: tplType, index: proj.items.length}; p.signals = {...signalName(p, 'data'), ...signalName(p, 'visual')}; diff --git ORI/vega-lite/src/compile/selection/translate.ts ALT/vega-lite/src/compile/selection/translate.ts index 0c2602c..25cce1a 100644 --- ORI/vega-lite/src/compile/selection/translate.ts +++ ALT/vega-lite/src/compile/selection/translate.ts @@ -92,19 +92,19 @@ function onDelta( !boundScales || !scaleCmpt ? 'panLinear' : scaleType === 'log' - ? 'panLog' - : scaleType === 'symlog' - ? 'panSymlog' - : scaleType === 'pow' - ? 'panPow' - : 'panLinear'; + ? 'panLog' + : scaleType === 'symlog' + ? 'panSymlog' + : scaleType === 'pow' + ? 'panPow' + : 'panLinear'; const arg = !boundScales ? '' : scaleType === 'pow' - ? `, ${scaleCmpt.get('exponent') ?? 1}` - : scaleType === 'symlog' - ? `, ${scaleCmpt.get('constant') ?? 1}` - : ''; + ? `, ${scaleCmpt.get('exponent') ?? 1}` + : scaleType === 'symlog' + ? `, ${scaleCmpt.get('constant') ?? 1}` + : ''; const update = `${panFn}(${extent}, ${offset}${arg})`; signal.on.push({ diff --git ORI/vega-lite/src/compile/selection/zoom.ts ALT/vega-lite/src/compile/selection/zoom.ts index b839130..a75a370 100644 --- ORI/vega-lite/src/compile/selection/zoom.ts +++ ALT/vega-lite/src/compile/selection/zoom.ts @@ -93,19 +93,19 @@ function onDelta( !boundScales || !scaleCmpt ? 'zoomLinear' : scaleType === 'log' - ? 'zoomLog' - : scaleType === 'symlog' - ? 'zoomSymlog' - : scaleType === 'pow' - ? 'zoomPow' - : 'zoomLinear'; + ? 'zoomLog' + : scaleType === 'symlog' + ? 'zoomSymlog' + : scaleType === 'pow' + ? 'zoomPow' + : 'zoomLinear'; const arg = !boundScales ? '' : scaleType === 'pow' - ? `, ${scaleCmpt.get('exponent') ?? 1}` - : scaleType === 'symlog' - ? `, ${scaleCmpt.get('constant') ?? 1}` - : ''; + ? `, ${scaleCmpt.get('exponent') ?? 1}` + : scaleType === 'symlog' + ? `, ${scaleCmpt.get('constant') ?? 1}` + : ''; const update = `${zoomFn}(${base}, ${anchor}, ${delta}${arg})`; signal.on.push({ diff --git ORI/vega-lite/src/compositemark/errorbar.ts ALT/vega-lite/src/compositemark/errorbar.ts index 13e0e12..527efd4 100644 --- ORI/vega-lite/src/compositemark/errorbar.ts +++ ALT/vega-lite/src/compositemark/errorbar.ts @@ -446,10 +446,10 @@ function errorBarAggregationAndCalculation< const center: ErrorBarCenter = markDef.center ? markDef.center : markDef.extent - ? markDef.extent === 'iqr' - ? 'median' - : 'mean' - : config.errorbar.center; + ? markDef.extent === 'iqr' + ? 'median' + : 'mean' + : config.errorbar.center; const extent: ErrorBarExtent = markDef.extent ? markDef.extent : center === 'mean' ? 'stderr' : 'iqr'; if ((center === 'median') !== (extent === 'iqr')) { diff --git ORI/vega-lite/src/selection.ts ALT/vega-lite/src/selection.ts index f0f8590..7a6f7af 100644 --- ORI/vega-lite/src/selection.ts +++ ALT/vega-lite/src/selection.ts @@ -222,8 +222,8 @@ export interface SelectionParameter { value?: T extends 'point' ? SelectionInit | SelectionInitMapping[] : T extends 'interval' - ? SelectionInitIntervalMapping - : never; + ? SelectionInitIntervalMapping + : never; /** * When set, a selection is populated by input elements (also known as dynamic query widgets) @@ -240,8 +240,8 @@ export interface SelectionParameter { bind?: T extends 'point' ? Binding | Record | LegendBinding : T extends 'interval' - ? 'scales' - : never; + ? 'scales' + : never; } export type TopLevelSelectionParameter = SelectionParameter & { ```
sosukesuzuki commented 9 months ago

run prettier/prettier#main vs 3.0.3

fisker commented 9 months ago

Not running?

fisker commented 9 months ago

run prettier/prettier#main vs 3.0.3

github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: babel/babel@134aa1723c6aa01a42713e379142088b30c6cc0d

Diff (554 lines) ```diff diff --git ORI/babel/packages/babel-cli/src/babel/watcher.ts ALT/babel/packages/babel-cli/src/babel/watcher.ts index 7249bda1..4ad07e5f 100644 --- ORI/babel/packages/babel-cli/src/babel/watcher.ts +++ ALT/babel/packages/babel-cli/src/babel/watcher.ts @@ -154,8 +154,8 @@ function requireChokidar(): any { return process.env.BABEL_8_BREAKING ? require("chokidar") : parseInt(process.versions.node) >= 8 - ? require("chokidar") - : require("@nicolo-ribaudo/chokidar-2"); + ? require("chokidar") + : require("@nicolo-ribaudo/chokidar-2"); } catch (err) { console.error( "The optional dependency chokidar failed to install and is required for " + diff --git ORI/babel/packages/babel-generator/src/printer.ts ALT/babel/packages/babel-generator/src/printer.ts index 6283cb13..39bcd800 100644 --- ORI/babel/packages/babel-generator/src/printer.ts +++ ALT/babel/packages/babel-generator/src/printer.ts @@ -1176,8 +1176,8 @@ class Printer { i === 0 ? COMMENT_SKIP_NEWLINE.LEADING : i === len - 1 - ? COMMENT_SKIP_NEWLINE.TRAILING - : COMMENT_SKIP_NEWLINE.DEFAULT, + ? COMMENT_SKIP_NEWLINE.TRAILING + : COMMENT_SKIP_NEWLINE.DEFAULT, ); } else { this._printComment(comment, COMMENT_SKIP_NEWLINE.DEFAULT); diff --git ORI/babel/packages/babel-helper-string-parser/src/index.ts ALT/babel/packages/babel-helper-string-parser/src/index.ts index 1e02846e..b2abe830 100644 --- ORI/babel/packages/babel-helper-string-parser/src/index.ts +++ ALT/babel/packages/babel-helper-string-parser/src/index.ts @@ -338,10 +338,10 @@ export function readInt( radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 - ? isAllowedNumericSeparatorSibling.dec - : radix === 8 - ? isAllowedNumericSeparatorSibling.oct - : isAllowedNumericSeparatorSibling.bin; + ? isAllowedNumericSeparatorSibling.dec + : radix === 8 + ? isAllowedNumericSeparatorSibling.oct + : isAllowedNumericSeparatorSibling.bin; let invalid = false; let total = 0; diff --git ORI/babel/packages/babel-helpers/src/helpers/applyDecs2301.js ALT/babel/packages/babel-helpers/src/helpers/applyDecs2301.js index eabb5362..245d90d2 100644 --- ORI/babel/packages/babel-helpers/src/helpers/applyDecs2301.js +++ ALT/babel/packages/babel-helpers/src/helpers/applyDecs2301.js @@ -136,8 +136,8 @@ function applyDecs2301Factory() { get && set ? { get: get, set: set, has: has } : get - ? { get: get, has: has } - : { set: set, has: has }; + ? { get: get, has: has } + : { set: set, has: has }; try { return dec(value, ctx); diff --git ORI/babel/packages/babel-helpers/src/helpers/applyDecs2305.js ALT/babel/packages/babel-helpers/src/helpers/applyDecs2305.js index a8a48d15..7026823d 100644 --- ORI/babel/packages/babel-helpers/src/helpers/applyDecs2305.js +++ ALT/babel/packages/babel-helpers/src/helpers/applyDecs2305.js @@ -135,8 +135,8 @@ function memberDec( get && set ? { get: get, set: set, has: has } : get - ? { get: get, has: has } - : { set: set, has: has }; + ? { get: get, has: has } + : { set: set, has: has }; try { return dec.call(thisArg, value, ctx); diff --git ORI/babel/packages/babel-parser/src/parse-error.ts ALT/babel/packages/babel-parser/src/parse-error.ts index 88ee87b9..82567d83 100644 --- ORI/babel/packages/babel-parser/src/parse-error.ts +++ ALT/babel/packages/babel-parser/src/parse-error.ts @@ -123,8 +123,8 @@ export function ParseErrorEnum(a: TemplateStringsArray): < ? Parameters[0] : {} : T[K] extends ToMessage - ? Parameters[0] - : {} + ? Parameters[0] + : {} >; }; @@ -138,8 +138,8 @@ export function ParseErrorEnum( ? Parameters[0] : {} : T[K] extends ToMessage - ? Parameters[0] - : {} + ? Parameters[0] + : {} >; }; @@ -184,8 +184,8 @@ export function ParseErrorEnum( typeof template === "string" ? { message: () => template } : typeof template === "function" - ? { message: template } - : template; + ? { message: template } + : template; const toMessage = typeof message === "string" ? () => message : message; ParseErrorConstructors[reasonCode] = toParseErrorConstructor({ diff --git ORI/babel/packages/babel-parser/src/parse-error/credentials.ts ALT/babel/packages/babel-parser/src/parse-error/credentials.ts index bb3bafa2..3134c815 100644 --- ORI/babel/packages/babel-parser/src/parse-error/credentials.ts +++ ALT/babel/packages/babel-parser/src/parse-error/credentials.ts @@ -50,8 +50,8 @@ const instantiate = ( typeof descriptor === "function" ? { value: descriptor, enumerable: false } : typeof descriptor.reflect === "string" - ? { ...descriptor, ...reflect(descriptor.reflect.split(".")) } - : descriptor, + ? { ...descriptor, ...reflect(descriptor.reflect.split(".")) } + : descriptor, ]) .reduce( (instance, [key, descriptor]) => diff --git ORI/babel/packages/babel-parser/src/parser/expression.ts ALT/babel/packages/babel-parser/src/parser/expression.ts index f3a28e87..ae584690 100644 --- ORI/babel/packages/babel-parser/src/parser/expression.ts +++ ALT/babel/packages/babel-parser/src/parser/expression.ts @@ -2805,8 +2805,8 @@ export default abstract class ExpressionParser extends LValParser { const reservedTest = !this.state.strict ? isReservedWord : isBinding - ? isStrictBindReservedWord - : isStrictReservedWord; + ? isStrictBindReservedWord + : isStrictReservedWord; if (reservedTest(word, this.inModule)) { this.raise(Errors.UnexpectedReservedWord, { diff --git ORI/babel/packages/babel-parser/src/parser/statement.ts ALT/babel/packages/babel-parser/src/parser/statement.ts index 4cb28674..81e17bf3 100644 --- ORI/babel/packages/babel-parser/src/parser/statement.ts +++ ALT/babel/packages/babel-parser/src/parser/statement.ts @@ -465,8 +465,8 @@ export default abstract class StatementParser extends ExpressionParser { this.state.strict ? Errors.StrictFunction : this.options.annexB - ? Errors.SloppyFunctionAnnexB - : Errors.SloppyFunction, + ? Errors.SloppyFunctionAnnexB + : Errors.SloppyFunction, { at: this.state.startLoc }, ); } @@ -1289,8 +1289,8 @@ export default abstract class StatementParser extends ExpressionParser { const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(tt._switch) - ? "switch" - : null; + ? "switch" + : null; for (let i = this.state.labels.length - 1; i >= 0; i--) { const label = this.state.labels[i]; if (label.statementStart === node.start) { @@ -1549,8 +1549,8 @@ export default abstract class StatementParser extends ExpressionParser { decl.init = !this.eat(tt.eq) ? null : isFor - ? this.parseMaybeAssignDisallowIn() - : this.parseMaybeAssignAllowIn(); + ? this.parseMaybeAssignDisallowIn() + : this.parseMaybeAssignAllowIn(); if (decl.init === null && !allowMissingInitializer) { if ( @@ -2239,10 +2239,10 @@ export default abstract class StatementParser extends ExpressionParser { ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" - ? node.static - ? CLASS_ELEMENT_STATIC_SETTER - : CLASS_ELEMENT_INSTANCE_SETTER - : CLASS_ELEMENT_OTHER; + ? node.static + ? CLASS_ELEMENT_STATIC_SETTER + : CLASS_ELEMENT_INSTANCE_SETTER + : CLASS_ELEMENT_OTHER; this.declareClassPrivateMethodInScope(node, kind); } diff --git ORI/babel/packages/babel-parser/src/plugins/flow/index.ts ALT/babel/packages/babel-parser/src/plugins/flow/index.ts index c912c0bc..55cceae8 100644 --- ORI/babel/packages/babel-parser/src/plugins/flow/index.ts +++ ALT/babel/packages/babel-parser/src/plugins/flow/index.ts @@ -3399,8 +3399,8 @@ export default (superClass: typeof Parser) => !enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" - ? FlowErrors.EnumInvalidMemberInitializerSymbolType - : FlowErrors.EnumInvalidMemberInitializerPrimaryType, + ? FlowErrors.EnumInvalidMemberInitializerSymbolType + : FlowErrors.EnumInvalidMemberInitializerPrimaryType, { at: loc, ...enumContext, diff --git ORI/babel/packages/babel-parser/src/plugins/typescript/index.ts ALT/babel/packages/babel-parser/src/plugins/typescript/index.ts index 52646232..c61134d6 100644 --- ORI/babel/packages/babel-parser/src/plugins/typescript/index.ts +++ ALT/babel/packages/babel-parser/src/plugins/typescript/index.ts @@ -1309,8 +1309,8 @@ export default (superClass: ClassWithMixin) => type === tt._void ? "TSVoidKeyword" : type === tt._null - ? "TSNullKeyword" - : keywordTypeFromName(this.state.value); + ? "TSNullKeyword" + : keywordTypeFromName(this.state.value); if ( nodeType !== undefined && this.lookaheadCharCode() !== charCodes.dot @@ -1405,10 +1405,10 @@ export default (superClass: ClassWithMixin) => return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(tt._infer) - ? this.tsParseInferType() - : this.tsInAllowConditionalTypesContext(() => - this.tsParseArrayTypeOrHigher(), - ); + ? this.tsParseInferType() + : this.tsInAllowConditionalTypesContext(() => + this.tsParseArrayTypeOrHigher(), + ); } tsParseUnionOrIntersectionType( @@ -2404,8 +2404,8 @@ export default (superClass: ClassWithMixin) => type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" - ? "TSDeclareMethod" - : undefined; + ? "TSDeclareMethod" + : undefined; if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) { return this.finishNode(node, bodilessType); } diff --git ORI/babel/packages/babel-parser/src/tokenizer/state.ts ALT/babel/packages/babel-parser/src/tokenizer/state.ts index 4949f5c9..ca99d2b6 100644 --- ORI/babel/packages/babel-parser/src/tokenizer/state.ts +++ ALT/babel/packages/babel-parser/src/tokenizer/state.ts @@ -39,8 +39,8 @@ export default class State { strictMode === false ? false : strictMode === true - ? true - : sourceType === "module"; + ? true + : sourceType === "module"; this.curLine = startLine; this.lineStart = -startColumn; diff --git ORI/babel/packages/babel-parser/test/helpers/difference.js ALT/babel/packages/babel-parser/test/helpers/difference.js index 60c25672..b83a1ca3 100644 --- ORI/babel/packages/babel-parser/test/helpers/difference.js +++ ALT/babel/packages/babel-parser/test/helpers/difference.js @@ -29,14 +29,14 @@ const toType = value => value === null ? "null" : typeof value !== "object" - ? typeof value - : isArray(value) - ? "Array" - : value instanceof RegExp - ? "RegExp" - : value instanceof Error - ? "Error" - : "Object"; + ? typeof value + : isArray(value) + ? "Array" + : value instanceof RegExp + ? "RegExp" + : value instanceof Error + ? "Error" + : "Object"; function compare(adjust, expected, actual) { // easy. @@ -126,21 +126,21 @@ const toValueString = (value, type = toType(value)) => type === "string" ? JSON.stringify(value) : type === "symbol" - ? value.toString() - : type === "bigint" - ? `${value}n` - : Object.is(value, -0) - ? "-0" - : value + ""; + ? value.toString() + : type === "bigint" + ? `${value}n` + : Object.is(value, -0) + ? "-0" + : value + ""; const toExplanationString = ({ discrepancy, expected, actual, key }) => discrepancy === "length" ? `Array of wrong size, expected length of ${expected}, but got ${actual}` : discrepancy === "unexpected-key" - ? `Did not expect a property ${toValueString(key)}` - : discrepancy === "missing-key" - ? `${toType(actual)} is missing property ${toValueString(key)}` - : `${toValueString(expected)} != ${toValueString(actual)}`; + ? `Did not expect a property ${toValueString(key)}` + : discrepancy === "missing-key" + ? `${toType(actual)} is missing property ${toValueString(key)}` + : `${toValueString(expected)} != ${toValueString(actual)}`; const isInt = key => isInteger(+key); const toAccess = key => diff --git ORI/babel/packages/babel-parser/test/helpers/fixture-error.js ALT/babel/packages/babel-parser/test/helpers/fixture-error.js index 0043cff0..17c56d06 100644 --- ORI/babel/packages/babel-parser/test/helpers/fixture-error.js +++ ALT/babel/packages/babel-parser/test/helpers/fixture-error.js @@ -49,16 +49,20 @@ export default class FixtureError extends Error { return difference === Difference.None ? false : difference.path[0] !== "threw" - ? new FixtureError.DifferentAST(difference) - : !difference.expected - ? new FixtureError.UnexpectedError(difference, { cause: actual.threw }) - : difference.actual - ? new FixtureError.DifferentError(difference, { cause: actual.threw }) - : actual.ast && actual.ast.errors - ? new FixtureError.UnexpectedRecovery(difference, { - cause: actual.ast.errors, - }) - : new FixtureError.UnexpectedSuccess(difference); + ? new FixtureError.DifferentAST(difference) + : !difference.expected + ? new FixtureError.UnexpectedError(difference, { + cause: actual.threw, + }) + : difference.actual + ? new FixtureError.DifferentError(difference, { + cause: actual.threw, + }) + : actual.ast && actual.ast.errors + ? new FixtureError.UnexpectedRecovery(difference, { + cause: actual.ast.errors, + }) + : new FixtureError.UnexpectedSuccess(difference); } } diff --git ORI/babel/packages/babel-parser/test/helpers/serialization.js ALT/babel/packages/babel-parser/test/helpers/serialization.js index 574a1fcd..26245767 100644 --- ORI/babel/packages/babel-parser/test/helpers/serialization.js +++ ALT/babel/packages/babel-parser/test/helpers/serialization.js @@ -35,8 +35,8 @@ export const deserialize = (filename, options, string) => !value[SerializationKey] ? value : value[SerializationKey] === "RegExp" - ? new RegExp(value.source, value.flags) - : toBigInt(value.value)), + ? new RegExp(value.source, value.flags) + : toBigInt(value.value)), ), ); @@ -88,10 +88,10 @@ export function serialize(value) { typeof value === "bigint" ? toExtended("bigint", { value: value + "" }) : value instanceof RegExp - ? toExtended("RegExp", { source: value.source, flags: value.flags }) - : value instanceof Error - ? value + "" - : value; + ? toExtended("RegExp", { source: value.source, flags: value.flags }) + : value instanceof Error + ? value + "" + : value; const serialized = stringify(value, encode, 2).replace( CompactRegExp, // This is safe since none of the values can have spaces in them. diff --git ORI/babel/packages/babel-plugin-transform-block-scoping/src/index.ts ALT/babel/packages/babel-plugin-transform-block-scoping/src/index.ts index 8a8f526a..80195171 100644 --- ORI/babel/packages/babel-plugin-transform-block-scoping/src/index.ts +++ ALT/babel/packages/babel-plugin-transform-block-scoping/src/index.ts @@ -39,8 +39,8 @@ export default declare((api, opts: Options) => { const headPath = isForStatement ? path.get("init") : path.isForXStatement() - ? path.get("left") - : null; + ? path.get("left") + : null; let needsBodyWrap = false; const markNeedsBodyWrap = () => { diff --git ORI/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts ALT/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts index 6c0fa83a..9accb386 100644 --- ORI/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts +++ ALT/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts @@ -47,8 +47,8 @@ export function getUsageInBody(binding: Binding, loopPath: NodePath) { const id = path.isUpdateExpression() ? path.get("argument") : path.isAssignmentExpression() - ? path.get("left") - : null; + ? path.get("left") + : null; if (id) seen.add(id.node); return id as NodePath | null; }); diff --git ORI/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts ALT/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts index 74d42178..65672389 100644 --- ORI/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts +++ ALT/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts @@ -77,8 +77,8 @@ export default function createPlugin({ runtime: RUNTIME_DEFAULT = process.env.BABEL_8_BREAKING ? "automatic" : development - ? "automatic" - : "classic", + ? "automatic" + : "classic", importSource: IMPORT_SOURCE_DEFAULT = DEFAULT.importSource, pragma: PRAGMA_DEFAULT = DEFAULT.pragma, @@ -793,8 +793,8 @@ You can set \`throwIfNamespace: false\` to bypass this warning.`, !t.isObjectExpression(props[0].argument) ? props[0].argument : props.length > 0 - ? t.objectExpression(props) - : t.nullLiteral(); + ? t.objectExpression(props) + : t.nullLiteral(); } }); diff --git ORI/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts ALT/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts index d53a3e9d..b87a2ed7 100644 --- ORI/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts +++ ALT/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts @@ -129,10 +129,10 @@ export function createBasePolyfillsPlugin( createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator), ) : corejsVersion === 3 - ? createCorejsPlugin( - pluginCorejs3, - { version: 3, proposals, ...polyfillOpts }, - createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator), - ) - : createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator); + ? createCorejsPlugin( + pluginCorejs3, + { version: 3, proposals, ...polyfillOpts }, + createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator), + ) + : createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator); } diff --git ORI/babel/packages/babel-plugin-transform-typescript/src/index.ts ALT/babel/packages/babel-plugin-transform-typescript/src/index.ts index ee1262a9..ba31f5bb 100644 --- ORI/babel/packages/babel-plugin-transform-typescript/src/index.ts +++ ALT/babel/packages/babel-plugin-transform-typescript/src/index.ts @@ -661,9 +661,9 @@ export default declare((api, opts: Options) => { but allows loading unbundled plugin (which cannot obviously import the bundled `@babel/core` version). */ - api.types.tsInstantiationExpression - ? "TSNonNullExpression|TSInstantiationExpression" - : "TSNonNullExpression"]( + api.types.tsInstantiationExpression + ? "TSNonNullExpression|TSInstantiationExpression" + : "TSNonNullExpression"]( path: NodePath, ) { path.replaceWith(path.node.expression); diff --git ORI/babel/packages/babel-preset-env/src/available-plugins.ts ALT/babel/packages/babel-preset-env/src/available-plugins.ts index 47bb4cf5..9cd09306 100644 --- ORI/babel/packages/babel-preset-env/src/available-plugins.ts +++ ALT/babel/packages/babel-preset-env/src/available-plugins.ts @@ -111,14 +111,14 @@ export default { "syntax-unicode-sets-regex": USE_ESM ? null : // We cannot use the require call when bundling, because this is an ESM file. - // Babel standalone uses a modern parser, so just include a known noop plugin. - // Use `bind` so that it's not detected as a duplicate plugin when using it - // together with the TLA - IS_STANDALONE - ? // @ts-expect-error syntaxTopLevelAwait is a function when bundled - () => syntaxTopLevelAwait.bind() - : // eslint-disable-next-line no-restricted-globals - () => require("@babel/plugin-syntax-unicode-sets-regex"), + // Babel standalone uses a modern parser, so just include a known noop plugin. + // Use `bind` so that it's not detected as a duplicate plugin when using it + // together with the TLA + IS_STANDALONE + ? // @ts-expect-error syntaxTopLevelAwait is a function when bundled + () => syntaxTopLevelAwait.bind() + : // eslint-disable-next-line no-restricted-globals + () => require("@babel/plugin-syntax-unicode-sets-regex"), "transform-arrow-functions": () => transformArrowFunctions, "transform-async-generator-functions": () => proposalAsyncGeneratorFunctions, "transform-async-to-generator": () => transformAsyncToGenerator, diff --git ORI/babel/packages/babel-traverse/src/path/family.ts ALT/babel/packages/babel-traverse/src/path/family.ts index cf5bba25..0c6f2ab6 100644 --- ORI/babel/packages/babel-traverse/src/path/family.ts +++ ALT/babel/packages/babel-traverse/src/path/family.ts @@ -364,8 +364,8 @@ type Trav< type ToNodePath = T extends Array ? Array> : T extends t.Node | null | undefined - ? NodePath - : never; + ? NodePath + : never; function get( this: NodePath, @@ -374,8 +374,8 @@ function get( ): T[K] extends Array ? Array> : T[K] extends t.Node | null | undefined - ? NodePath - : never; + ? NodePath + : never; function get( this: NodePath, diff --git ORI/babel/packages/babel-types/src/validators/generated/index.ts ALT/babel/packages/babel-types/src/validators/generated/index.ts index 0933f7fa..88372572 100644 --- ORI/babel/packages/babel-types/src/validators/generated/index.ts +++ ALT/babel/packages/babel-types/src/validators/generated/index.ts @@ -13,8 +13,8 @@ type Opts = Partial<{ [Prop in keyof Object]: Object[Prop] extends t.Node ? t.Node | Object[Prop] : Object[Prop] extends t.Node[] - ? t.Node[] | Object[Prop] - : Object[Prop]; + ? t.Node[] | Object[Prop] + : Object[Prop]; }>; export function isArrayExpression( ```
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: babel/babel@134aa1723c6aa01a42713e379142088b30c6cc0d

Diff (554 lines) ```diff diff --git ORI/babel/packages/babel-cli/src/babel/watcher.ts ALT/babel/packages/babel-cli/src/babel/watcher.ts index 7249bda1..4ad07e5f 100644 --- ORI/babel/packages/babel-cli/src/babel/watcher.ts +++ ALT/babel/packages/babel-cli/src/babel/watcher.ts @@ -154,8 +154,8 @@ function requireChokidar(): any { return process.env.BABEL_8_BREAKING ? require("chokidar") : parseInt(process.versions.node) >= 8 - ? require("chokidar") - : require("@nicolo-ribaudo/chokidar-2"); + ? require("chokidar") + : require("@nicolo-ribaudo/chokidar-2"); } catch (err) { console.error( "The optional dependency chokidar failed to install and is required for " + diff --git ORI/babel/packages/babel-generator/src/printer.ts ALT/babel/packages/babel-generator/src/printer.ts index 6283cb13..39bcd800 100644 --- ORI/babel/packages/babel-generator/src/printer.ts +++ ALT/babel/packages/babel-generator/src/printer.ts @@ -1176,8 +1176,8 @@ class Printer { i === 0 ? COMMENT_SKIP_NEWLINE.LEADING : i === len - 1 - ? COMMENT_SKIP_NEWLINE.TRAILING - : COMMENT_SKIP_NEWLINE.DEFAULT, + ? COMMENT_SKIP_NEWLINE.TRAILING + : COMMENT_SKIP_NEWLINE.DEFAULT, ); } else { this._printComment(comment, COMMENT_SKIP_NEWLINE.DEFAULT); diff --git ORI/babel/packages/babel-helper-string-parser/src/index.ts ALT/babel/packages/babel-helper-string-parser/src/index.ts index 1e02846e..b2abe830 100644 --- ORI/babel/packages/babel-helper-string-parser/src/index.ts +++ ALT/babel/packages/babel-helper-string-parser/src/index.ts @@ -338,10 +338,10 @@ export function readInt( radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 - ? isAllowedNumericSeparatorSibling.dec - : radix === 8 - ? isAllowedNumericSeparatorSibling.oct - : isAllowedNumericSeparatorSibling.bin; + ? isAllowedNumericSeparatorSibling.dec + : radix === 8 + ? isAllowedNumericSeparatorSibling.oct + : isAllowedNumericSeparatorSibling.bin; let invalid = false; let total = 0; diff --git ORI/babel/packages/babel-helpers/src/helpers/applyDecs2301.js ALT/babel/packages/babel-helpers/src/helpers/applyDecs2301.js index eabb5362..245d90d2 100644 --- ORI/babel/packages/babel-helpers/src/helpers/applyDecs2301.js +++ ALT/babel/packages/babel-helpers/src/helpers/applyDecs2301.js @@ -136,8 +136,8 @@ function applyDecs2301Factory() { get && set ? { get: get, set: set, has: has } : get - ? { get: get, has: has } - : { set: set, has: has }; + ? { get: get, has: has } + : { set: set, has: has }; try { return dec(value, ctx); diff --git ORI/babel/packages/babel-helpers/src/helpers/applyDecs2305.js ALT/babel/packages/babel-helpers/src/helpers/applyDecs2305.js index a8a48d15..7026823d 100644 --- ORI/babel/packages/babel-helpers/src/helpers/applyDecs2305.js +++ ALT/babel/packages/babel-helpers/src/helpers/applyDecs2305.js @@ -135,8 +135,8 @@ function memberDec( get && set ? { get: get, set: set, has: has } : get - ? { get: get, has: has } - : { set: set, has: has }; + ? { get: get, has: has } + : { set: set, has: has }; try { return dec.call(thisArg, value, ctx); diff --git ORI/babel/packages/babel-parser/src/parse-error.ts ALT/babel/packages/babel-parser/src/parse-error.ts index 88ee87b9..82567d83 100644 --- ORI/babel/packages/babel-parser/src/parse-error.ts +++ ALT/babel/packages/babel-parser/src/parse-error.ts @@ -123,8 +123,8 @@ export function ParseErrorEnum(a: TemplateStringsArray): < ? Parameters[0] : {} : T[K] extends ToMessage - ? Parameters[0] - : {} + ? Parameters[0] + : {} >; }; @@ -138,8 +138,8 @@ export function ParseErrorEnum( ? Parameters[0] : {} : T[K] extends ToMessage - ? Parameters[0] - : {} + ? Parameters[0] + : {} >; }; @@ -184,8 +184,8 @@ export function ParseErrorEnum( typeof template === "string" ? { message: () => template } : typeof template === "function" - ? { message: template } - : template; + ? { message: template } + : template; const toMessage = typeof message === "string" ? () => message : message; ParseErrorConstructors[reasonCode] = toParseErrorConstructor({ diff --git ORI/babel/packages/babel-parser/src/parse-error/credentials.ts ALT/babel/packages/babel-parser/src/parse-error/credentials.ts index bb3bafa2..3134c815 100644 --- ORI/babel/packages/babel-parser/src/parse-error/credentials.ts +++ ALT/babel/packages/babel-parser/src/parse-error/credentials.ts @@ -50,8 +50,8 @@ const instantiate = ( typeof descriptor === "function" ? { value: descriptor, enumerable: false } : typeof descriptor.reflect === "string" - ? { ...descriptor, ...reflect(descriptor.reflect.split(".")) } - : descriptor, + ? { ...descriptor, ...reflect(descriptor.reflect.split(".")) } + : descriptor, ]) .reduce( (instance, [key, descriptor]) => diff --git ORI/babel/packages/babel-parser/src/parser/expression.ts ALT/babel/packages/babel-parser/src/parser/expression.ts index f3a28e87..ae584690 100644 --- ORI/babel/packages/babel-parser/src/parser/expression.ts +++ ALT/babel/packages/babel-parser/src/parser/expression.ts @@ -2805,8 +2805,8 @@ export default abstract class ExpressionParser extends LValParser { const reservedTest = !this.state.strict ? isReservedWord : isBinding - ? isStrictBindReservedWord - : isStrictReservedWord; + ? isStrictBindReservedWord + : isStrictReservedWord; if (reservedTest(word, this.inModule)) { this.raise(Errors.UnexpectedReservedWord, { diff --git ORI/babel/packages/babel-parser/src/parser/statement.ts ALT/babel/packages/babel-parser/src/parser/statement.ts index 4cb28674..81e17bf3 100644 --- ORI/babel/packages/babel-parser/src/parser/statement.ts +++ ALT/babel/packages/babel-parser/src/parser/statement.ts @@ -465,8 +465,8 @@ export default abstract class StatementParser extends ExpressionParser { this.state.strict ? Errors.StrictFunction : this.options.annexB - ? Errors.SloppyFunctionAnnexB - : Errors.SloppyFunction, + ? Errors.SloppyFunctionAnnexB + : Errors.SloppyFunction, { at: this.state.startLoc }, ); } @@ -1289,8 +1289,8 @@ export default abstract class StatementParser extends ExpressionParser { const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(tt._switch) - ? "switch" - : null; + ? "switch" + : null; for (let i = this.state.labels.length - 1; i >= 0; i--) { const label = this.state.labels[i]; if (label.statementStart === node.start) { @@ -1549,8 +1549,8 @@ export default abstract class StatementParser extends ExpressionParser { decl.init = !this.eat(tt.eq) ? null : isFor - ? this.parseMaybeAssignDisallowIn() - : this.parseMaybeAssignAllowIn(); + ? this.parseMaybeAssignDisallowIn() + : this.parseMaybeAssignAllowIn(); if (decl.init === null && !allowMissingInitializer) { if ( @@ -2239,10 +2239,10 @@ export default abstract class StatementParser extends ExpressionParser { ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" - ? node.static - ? CLASS_ELEMENT_STATIC_SETTER - : CLASS_ELEMENT_INSTANCE_SETTER - : CLASS_ELEMENT_OTHER; + ? node.static + ? CLASS_ELEMENT_STATIC_SETTER + : CLASS_ELEMENT_INSTANCE_SETTER + : CLASS_ELEMENT_OTHER; this.declareClassPrivateMethodInScope(node, kind); } diff --git ORI/babel/packages/babel-parser/src/plugins/flow/index.ts ALT/babel/packages/babel-parser/src/plugins/flow/index.ts index c912c0bc..55cceae8 100644 --- ORI/babel/packages/babel-parser/src/plugins/flow/index.ts +++ ALT/babel/packages/babel-parser/src/plugins/flow/index.ts @@ -3399,8 +3399,8 @@ export default (superClass: typeof Parser) => !enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" - ? FlowErrors.EnumInvalidMemberInitializerSymbolType - : FlowErrors.EnumInvalidMemberInitializerPrimaryType, + ? FlowErrors.EnumInvalidMemberInitializerSymbolType + : FlowErrors.EnumInvalidMemberInitializerPrimaryType, { at: loc, ...enumContext, diff --git ORI/babel/packages/babel-parser/src/plugins/typescript/index.ts ALT/babel/packages/babel-parser/src/plugins/typescript/index.ts index 52646232..c61134d6 100644 --- ORI/babel/packages/babel-parser/src/plugins/typescript/index.ts +++ ALT/babel/packages/babel-parser/src/plugins/typescript/index.ts @@ -1309,8 +1309,8 @@ export default (superClass: ClassWithMixin) => type === tt._void ? "TSVoidKeyword" : type === tt._null - ? "TSNullKeyword" - : keywordTypeFromName(this.state.value); + ? "TSNullKeyword" + : keywordTypeFromName(this.state.value); if ( nodeType !== undefined && this.lookaheadCharCode() !== charCodes.dot @@ -1405,10 +1405,10 @@ export default (superClass: ClassWithMixin) => return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(tt._infer) - ? this.tsParseInferType() - : this.tsInAllowConditionalTypesContext(() => - this.tsParseArrayTypeOrHigher(), - ); + ? this.tsParseInferType() + : this.tsInAllowConditionalTypesContext(() => + this.tsParseArrayTypeOrHigher(), + ); } tsParseUnionOrIntersectionType( @@ -2404,8 +2404,8 @@ export default (superClass: ClassWithMixin) => type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" - ? "TSDeclareMethod" - : undefined; + ? "TSDeclareMethod" + : undefined; if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) { return this.finishNode(node, bodilessType); } diff --git ORI/babel/packages/babel-parser/src/tokenizer/state.ts ALT/babel/packages/babel-parser/src/tokenizer/state.ts index 4949f5c9..ca99d2b6 100644 --- ORI/babel/packages/babel-parser/src/tokenizer/state.ts +++ ALT/babel/packages/babel-parser/src/tokenizer/state.ts @@ -39,8 +39,8 @@ export default class State { strictMode === false ? false : strictMode === true - ? true - : sourceType === "module"; + ? true + : sourceType === "module"; this.curLine = startLine; this.lineStart = -startColumn; diff --git ORI/babel/packages/babel-parser/test/helpers/difference.js ALT/babel/packages/babel-parser/test/helpers/difference.js index 60c25672..b83a1ca3 100644 --- ORI/babel/packages/babel-parser/test/helpers/difference.js +++ ALT/babel/packages/babel-parser/test/helpers/difference.js @@ -29,14 +29,14 @@ const toType = value => value === null ? "null" : typeof value !== "object" - ? typeof value - : isArray(value) - ? "Array" - : value instanceof RegExp - ? "RegExp" - : value instanceof Error - ? "Error" - : "Object"; + ? typeof value + : isArray(value) + ? "Array" + : value instanceof RegExp + ? "RegExp" + : value instanceof Error + ? "Error" + : "Object"; function compare(adjust, expected, actual) { // easy. @@ -126,21 +126,21 @@ const toValueString = (value, type = toType(value)) => type === "string" ? JSON.stringify(value) : type === "symbol" - ? value.toString() - : type === "bigint" - ? `${value}n` - : Object.is(value, -0) - ? "-0" - : value + ""; + ? value.toString() + : type === "bigint" + ? `${value}n` + : Object.is(value, -0) + ? "-0" + : value + ""; const toExplanationString = ({ discrepancy, expected, actual, key }) => discrepancy === "length" ? `Array of wrong size, expected length of ${expected}, but got ${actual}` : discrepancy === "unexpected-key" - ? `Did not expect a property ${toValueString(key)}` - : discrepancy === "missing-key" - ? `${toType(actual)} is missing property ${toValueString(key)}` - : `${toValueString(expected)} != ${toValueString(actual)}`; + ? `Did not expect a property ${toValueString(key)}` + : discrepancy === "missing-key" + ? `${toType(actual)} is missing property ${toValueString(key)}` + : `${toValueString(expected)} != ${toValueString(actual)}`; const isInt = key => isInteger(+key); const toAccess = key => diff --git ORI/babel/packages/babel-parser/test/helpers/fixture-error.js ALT/babel/packages/babel-parser/test/helpers/fixture-error.js index 0043cff0..17c56d06 100644 --- ORI/babel/packages/babel-parser/test/helpers/fixture-error.js +++ ALT/babel/packages/babel-parser/test/helpers/fixture-error.js @@ -49,16 +49,20 @@ export default class FixtureError extends Error { return difference === Difference.None ? false : difference.path[0] !== "threw" - ? new FixtureError.DifferentAST(difference) - : !difference.expected - ? new FixtureError.UnexpectedError(difference, { cause: actual.threw }) - : difference.actual - ? new FixtureError.DifferentError(difference, { cause: actual.threw }) - : actual.ast && actual.ast.errors - ? new FixtureError.UnexpectedRecovery(difference, { - cause: actual.ast.errors, - }) - : new FixtureError.UnexpectedSuccess(difference); + ? new FixtureError.DifferentAST(difference) + : !difference.expected + ? new FixtureError.UnexpectedError(difference, { + cause: actual.threw, + }) + : difference.actual + ? new FixtureError.DifferentError(difference, { + cause: actual.threw, + }) + : actual.ast && actual.ast.errors + ? new FixtureError.UnexpectedRecovery(difference, { + cause: actual.ast.errors, + }) + : new FixtureError.UnexpectedSuccess(difference); } } diff --git ORI/babel/packages/babel-parser/test/helpers/serialization.js ALT/babel/packages/babel-parser/test/helpers/serialization.js index 574a1fcd..26245767 100644 --- ORI/babel/packages/babel-parser/test/helpers/serialization.js +++ ALT/babel/packages/babel-parser/test/helpers/serialization.js @@ -35,8 +35,8 @@ export const deserialize = (filename, options, string) => !value[SerializationKey] ? value : value[SerializationKey] === "RegExp" - ? new RegExp(value.source, value.flags) - : toBigInt(value.value)), + ? new RegExp(value.source, value.flags) + : toBigInt(value.value)), ), ); @@ -88,10 +88,10 @@ export function serialize(value) { typeof value === "bigint" ? toExtended("bigint", { value: value + "" }) : value instanceof RegExp - ? toExtended("RegExp", { source: value.source, flags: value.flags }) - : value instanceof Error - ? value + "" - : value; + ? toExtended("RegExp", { source: value.source, flags: value.flags }) + : value instanceof Error + ? value + "" + : value; const serialized = stringify(value, encode, 2).replace( CompactRegExp, // This is safe since none of the values can have spaces in them. diff --git ORI/babel/packages/babel-plugin-transform-block-scoping/src/index.ts ALT/babel/packages/babel-plugin-transform-block-scoping/src/index.ts index 8a8f526a..80195171 100644 --- ORI/babel/packages/babel-plugin-transform-block-scoping/src/index.ts +++ ALT/babel/packages/babel-plugin-transform-block-scoping/src/index.ts @@ -39,8 +39,8 @@ export default declare((api, opts: Options) => { const headPath = isForStatement ? path.get("init") : path.isForXStatement() - ? path.get("left") - : null; + ? path.get("left") + : null; let needsBodyWrap = false; const markNeedsBodyWrap = () => { diff --git ORI/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts ALT/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts index 6c0fa83a..9accb386 100644 --- ORI/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts +++ ALT/babel/packages/babel-plugin-transform-block-scoping/src/loop.ts @@ -47,8 +47,8 @@ export function getUsageInBody(binding: Binding, loopPath: NodePath) { const id = path.isUpdateExpression() ? path.get("argument") : path.isAssignmentExpression() - ? path.get("left") - : null; + ? path.get("left") + : null; if (id) seen.add(id.node); return id as NodePath | null; }); diff --git ORI/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts ALT/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts index 74d42178..65672389 100644 --- ORI/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts +++ ALT/babel/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts @@ -77,8 +77,8 @@ export default function createPlugin({ runtime: RUNTIME_DEFAULT = process.env.BABEL_8_BREAKING ? "automatic" : development - ? "automatic" - : "classic", + ? "automatic" + : "classic", importSource: IMPORT_SOURCE_DEFAULT = DEFAULT.importSource, pragma: PRAGMA_DEFAULT = DEFAULT.pragma, @@ -793,8 +793,8 @@ You can set \`throwIfNamespace: false\` to bypass this warning.`, !t.isObjectExpression(props[0].argument) ? props[0].argument : props.length > 0 - ? t.objectExpression(props) - : t.nullLiteral(); + ? t.objectExpression(props) + : t.nullLiteral(); } }); diff --git ORI/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts ALT/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts index d53a3e9d..b87a2ed7 100644 --- ORI/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts +++ ALT/babel/packages/babel-plugin-transform-runtime/src/polyfills.ts @@ -129,10 +129,10 @@ export function createBasePolyfillsPlugin( createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator), ) : corejsVersion === 3 - ? createCorejsPlugin( - pluginCorejs3, - { version: 3, proposals, ...polyfillOpts }, - createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator), - ) - : createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator); + ? createCorejsPlugin( + pluginCorejs3, + { version: 3, proposals, ...polyfillOpts }, + createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator), + ) + : createRegeneratorPlugin(polyfillOpts, useRuntimeRegenerator); } diff --git ORI/babel/packages/babel-plugin-transform-typescript/src/index.ts ALT/babel/packages/babel-plugin-transform-typescript/src/index.ts index ee1262a9..ba31f5bb 100644 --- ORI/babel/packages/babel-plugin-transform-typescript/src/index.ts +++ ALT/babel/packages/babel-plugin-transform-typescript/src/index.ts @@ -661,9 +661,9 @@ export default declare((api, opts: Options) => { but allows loading unbundled plugin (which cannot obviously import the bundled `@babel/core` version). */ - api.types.tsInstantiationExpression - ? "TSNonNullExpression|TSInstantiationExpression" - : "TSNonNullExpression"]( + api.types.tsInstantiationExpression + ? "TSNonNullExpression|TSInstantiationExpression" + : "TSNonNullExpression"]( path: NodePath, ) { path.replaceWith(path.node.expression); diff --git ORI/babel/packages/babel-preset-env/src/available-plugins.ts ALT/babel/packages/babel-preset-env/src/available-plugins.ts index 47bb4cf5..9cd09306 100644 --- ORI/babel/packages/babel-preset-env/src/available-plugins.ts +++ ALT/babel/packages/babel-preset-env/src/available-plugins.ts @@ -111,14 +111,14 @@ export default { "syntax-unicode-sets-regex": USE_ESM ? null : // We cannot use the require call when bundling, because this is an ESM file. - // Babel standalone uses a modern parser, so just include a known noop plugin. - // Use `bind` so that it's not detected as a duplicate plugin when using it - // together with the TLA - IS_STANDALONE - ? // @ts-expect-error syntaxTopLevelAwait is a function when bundled - () => syntaxTopLevelAwait.bind() - : // eslint-disable-next-line no-restricted-globals - () => require("@babel/plugin-syntax-unicode-sets-regex"), + // Babel standalone uses a modern parser, so just include a known noop plugin. + // Use `bind` so that it's not detected as a duplicate plugin when using it + // together with the TLA + IS_STANDALONE + ? // @ts-expect-error syntaxTopLevelAwait is a function when bundled + () => syntaxTopLevelAwait.bind() + : // eslint-disable-next-line no-restricted-globals + () => require("@babel/plugin-syntax-unicode-sets-regex"), "transform-arrow-functions": () => transformArrowFunctions, "transform-async-generator-functions": () => proposalAsyncGeneratorFunctions, "transform-async-to-generator": () => transformAsyncToGenerator, diff --git ORI/babel/packages/babel-traverse/src/path/family.ts ALT/babel/packages/babel-traverse/src/path/family.ts index cf5bba25..0c6f2ab6 100644 --- ORI/babel/packages/babel-traverse/src/path/family.ts +++ ALT/babel/packages/babel-traverse/src/path/family.ts @@ -364,8 +364,8 @@ type Trav< type ToNodePath = T extends Array ? Array> : T extends t.Node | null | undefined - ? NodePath - : never; + ? NodePath + : never; function get( this: NodePath, @@ -374,8 +374,8 @@ function get( ): T[K] extends Array ? Array> : T[K] extends t.Node | null | undefined - ? NodePath - : never; + ? NodePath + : never; function get( this: NodePath, diff --git ORI/babel/packages/babel-types/src/validators/generated/index.ts ALT/babel/packages/babel-types/src/validators/generated/index.ts index 0933f7fa..88372572 100644 --- ORI/babel/packages/babel-types/src/validators/generated/index.ts +++ ALT/babel/packages/babel-types/src/validators/generated/index.ts @@ -13,8 +13,8 @@ type Opts = Partial<{ [Prop in keyof Object]: Object[Prop] extends t.Node ? t.Node | Object[Prop] : Object[Prop] extends t.Node[] - ? t.Node[] | Object[Prop] - : Object[Prop]; + ? t.Node[] | Object[Prop] + : Object[Prop]; }>; export function isArrayExpression( ```
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: mdn/content@c5dd9c3b9d503a56dc04b6b8f88e89194dc82d7f

Diff (253 lines) ````diff diff --git ORI/content/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md ALT/content/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md index ba7c4182..d152c391 100644 --- ORI/content/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md +++ ALT/content/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md @@ -74,9 +74,8 @@ function generatePrimes(quota) { document.querySelector("#generate").addEventListener("click", () => { const quota = document.querySelector("#quota").value; const primes = generatePrimes(quota); - document.querySelector( - "#output", - ).textContent = `Finished generating ${quota} primes!`; + document.querySelector("#output").textContent = + `Finished generating ${quota} primes!`; }); document.querySelector("#reload").addEventListener("click", () => { @@ -158,9 +157,8 @@ document.querySelector("#generate").addEventListener("click", () => { // update the output box with a message for the user, including the number of // primes that were generated, taken from the message data. worker.addEventListener("message", (message) => { - document.querySelector( - "#output", - ).textContent = `Finished generating ${message.data} primes!`; + document.querySelector("#output").textContent = + `Finished generating ${message.data} primes!`; }); document.querySelector("#reload").addEventListener("click", () => { diff --git ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md index 7dc1d6ff..bc85ae8c 100644 --- ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md +++ ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md @@ -477,8 +477,8 @@ We will also use the `Filter` enum in the `Todos.svelte` component. filter === Filter.ACTIVE ? todos.filter((t) => !t.completed) : filter === Filter.COMPLETED - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; $: { if (filter === Filter.ALL) { @@ -551,8 +551,8 @@ We will also use the `Filter` enum in the `Todos.svelte` component. filter === Filter.ACTIVE ? todos.filter((t) => !t.completed) : filter === Filter.COMPLETED - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; $: { if (filter === Filter.ALL) { diff --git ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md index f2866dc1..5fb0a9a6 100644 --- ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md +++ ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md @@ -391,8 +391,8 @@ Finally for this article, let's implement the ability to filter our to-dos by st filter === "active" ? todos.filter((t) => !t.completed) : filter === "completed" - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; ``` We use the `filter` variable to control the active filter: _all_, _active_, or _completed_. Just assigning one of these values to the filter variable will activate the filter and update the list of to-dos. Let's see how to achieve this. diff --git ORI/content/files/en-us/web/api/batterymanager/chargingtime/index.md ALT/content/files/en-us/web/api/batterymanager/chargingtime/index.md index 61ce789f..7be36c3f 100644 --- ORI/content/files/en-us/web/api/batterymanager/chargingtime/index.md +++ ALT/content/files/en-us/web/api/batterymanager/chargingtime/index.md @@ -34,9 +34,8 @@ A number. navigator.getBattery().then((battery) => { const time = battery.chargingTime; - document.querySelector( - "#chargingTime", - ).textContent = `Time to fully charge the battery: ${time}s`; + document.querySelector("#chargingTime").textContent = + `Time to fully charge the battery: ${time}s`; }); ``` diff --git ORI/content/files/en-us/web/api/batterymanager/dischargingtime/index.md ALT/content/files/en-us/web/api/batterymanager/dischargingtime/index.md index 011eacb5..ae0883f0 100644 --- ORI/content/files/en-us/web/api/batterymanager/dischargingtime/index.md +++ ALT/content/files/en-us/web/api/batterymanager/dischargingtime/index.md @@ -36,9 +36,8 @@ A number. navigator.getBattery().then((battery) => { const time = battery.dischargingTime; - document.querySelector( - "#dischargingTime", - ).textContent = `Remaining time to fully discharge the battery: ${time}`; + document.querySelector("#dischargingTime").textContent = + `Remaining time to fully discharge the battery: ${time}`; }); ``` diff --git ORI/content/files/en-us/web/api/batterymanager/levelchange_event/index.md ALT/content/files/en-us/web/api/batterymanager/levelchange_event/index.md index c7b43a83..1ae9271c 100644 --- ORI/content/files/en-us/web/api/batterymanager/levelchange_event/index.md +++ ALT/content/files/en-us/web/api/batterymanager/levelchange_event/index.md @@ -45,9 +45,8 @@ navigator.getBattery().then((battery) => { battery.chargingTime / 60 }`; } else { - document.querySelector( - "#stateBattery", - ).textContent = `Discharging time: ${battery.dischargingTime / 60}`; + document.querySelector("#stateBattery").textContent = + `Discharging time: ${battery.dischargingTime / 60}`; } }; }); diff --git ORI/content/files/en-us/web/api/document/createtreewalker/index.md ALT/content/files/en-us/web/api/document/createtreewalker/index.md index ea16982b..de024164 100644 --- ORI/content/files/en-us/web/api/document/createtreewalker/index.md +++ ALT/content/files/en-us/web/api/document/createtreewalker/index.md @@ -148,8 +148,8 @@ const treeWalker = document.createTreeWalker( node.classList.contains("no-escape") ? NodeFilter.FILTER_REJECT : node.closest(".escape") - ? NodeFilter.FILTER_ACCEPT - : NodeFilter.FILTER_SKIP, + ? NodeFilter.FILTER_ACCEPT + : NodeFilter.FILTER_SKIP, ); let currentNode; diff --git ORI/content/files/en-us/web/api/htmlmarqueeelement/index.md ALT/content/files/en-us/web/api/htmlmarqueeelement/index.md index 6da2a8f0..8477e88b 100644 --- ORI/content/files/en-us/web/api/htmlmarqueeelement/index.md +++ ALT/content/files/en-us/web/api/htmlmarqueeelement/index.md @@ -73,7 +73,7 @@ _Inherits methods from its parent, {{DOMxRef("HTMLElement")}}._ height="200" behavior="alternate" style="border:solid"> - This text will bounce + This text will bounce ``` diff --git ORI/content/files/en-us/web/api/keyboardevent/metakey/index.md ALT/content/files/en-us/web/api/keyboardevent/metakey/index.md index 6d3ca5fd..5ac693fd 100644 --- ORI/content/files/en-us/web/api/keyboardevent/metakey/index.md +++ ALT/content/files/en-us/web/api/keyboardevent/metakey/index.md @@ -33,9 +33,8 @@ A boolean value. ```js function ismetaKey(e) { - document.querySelector( - "#output", - ).textContent = `metaKey pressed? ${e.metaKey}`; + document.querySelector("#output").textContent = + `metaKey pressed? ${e.metaKey}`; } ``` diff --git ORI/content/files/en-us/web/api/response/json/index.md ALT/content/files/en-us/web/api/response/json/index.md index d610ce0e..44312c06 100644 --- ORI/content/files/en-us/web/api/response/json/index.md +++ ALT/content/files/en-us/web/api/response/json/index.md @@ -49,9 +49,8 @@ fetch(myRequest) listItem.appendChild(document.createElement("strong")).textContent = product.Name; listItem.append(` can be found in ${product.Location}. Cost: `); - listItem.appendChild( - document.createElement("strong"), - ).textContent = `£${product.Price}`; + listItem.appendChild(document.createElement("strong")).textContent = + `£${product.Price}`; myList.appendChild(listItem); } }) diff --git ORI/content/files/en-us/web/api/rtcdatachannel/label/index.md ALT/content/files/en-us/web/api/rtcdatachannel/label/index.md index ac15fa0f..9dfe3a30 100644 --- ORI/content/files/en-us/web/api/rtcdatachannel/label/index.md +++ ALT/content/files/en-us/web/api/rtcdatachannel/label/index.md @@ -39,9 +39,8 @@ const dc = pc.createDataChannel("my channel"); // … -document.getElementById( - "channel-name", -).innerHTML = `${dc.label}`; +document.getElementById("channel-name").innerHTML = + `${dc.label}`; ``` ## Specifications diff --git ORI/content/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md ALT/content/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md index 1f472756..0c53c0ae 100644 --- ORI/content/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md +++ ALT/content/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md @@ -97,9 +97,8 @@ function setupWebGL(evt) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { const linkErrLog = gl.getProgramInfoLog(program); cleanup(); - document.querySelector( - "p", - ).textContent = `Shader program did not link successfully. Error log: ${linkErrLog}`; + document.querySelector("p").textContent = + `Shader program did not link successfully. Error log: ${linkErrLog}`; return; } diff --git ORI/content/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md ALT/content/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md index ad7acf56..b193e111 100644 --- ORI/content/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md +++ ALT/content/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md @@ -102,9 +102,8 @@ function setupWebGL(evt) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { const linkErrLog = gl.getProgramInfoLog(program); cleanup(); - document.querySelector( - "p", - ).textContent = `Shader program did not link successfully. Error log: ${linkErrLog}`; + document.querySelector("p").textContent = + `Shader program did not link successfully. Error log: ${linkErrLog}`; return; } diff --git ORI/content/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md ALT/content/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md index bbdbe999..4fe34fe6 100644 --- ORI/content/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md +++ ALT/content/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md @@ -108,9 +108,8 @@ function setupWebGL(evt) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { const linkErrLog = gl.getProgramInfoLog(program); cleanup(); - document.querySelector( - "p", - ).textContent = `Shader program did not link successfully. Error log: ${linkErrLog}`; + document.querySelector("p").textContent = + `Shader program did not link successfully. Error log: ${linkErrLog}`; return; } initializeAttributes(); diff --git ORI/content/files/en-us/web/html/element/marquee/index.md ALT/content/files/en-us/web/html/element/marquee/index.md index 2c30f9cf..4fd0366f 100644 --- ORI/content/files/en-us/web/html/element/marquee/index.md +++ ALT/content/files/en-us/web/html/element/marquee/index.md @@ -65,7 +65,7 @@ The **``** [HTML](/en-US/docs/Web/HTML) element is used to insert a scr height="200" behavior="alternate" style="border:solid"> - This text will bounce + This text will bounce ``` ````
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: vuejs/eslint-plugin-vue@2aa9ac45a4ea66c293b3e7cbfd6ad076afa39bb5

The diff is empty.

github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: excalidraw/excalidraw@3ddcc48e4c192f525930e503b3e9214627f0043d

Diff (322 lines) ```diff diff --git ORI/excalidraw/src/actions/actionFinalize.tsx ALT/excalidraw/src/actions/actionFinalize.tsx index 3508de0..d7147c5 100644 --- ORI/excalidraw/src/actions/actionFinalize.tsx +++ ALT/excalidraw/src/actions/actionFinalize.tsx @@ -65,8 +65,8 @@ export const actionFinalize = register({ const multiPointElement = appState.multiElement ? appState.multiElement : appState.editingElement?.type === "freedraw" - ? appState.editingElement - : null; + ? appState.editingElement + : null; if (multiPointElement) { // pen and mouse have hover diff --git ORI/excalidraw/src/components/App.tsx ALT/excalidraw/src/components/App.tsx index 4960990..b5abc44 100644 --- ORI/excalidraw/src/components/App.tsx +++ ALT/excalidraw/src/components/App.tsx @@ -1951,14 +1951,14 @@ class App extends React.Component { typeof opts.position === "object" ? opts.position.clientX : opts.position === "cursor" - ? this.lastViewportPosition.x - : this.state.width / 2 + this.state.offsetLeft; + ? this.lastViewportPosition.x + : this.state.width / 2 + this.state.offsetLeft; const clientY = typeof opts.position === "object" ? opts.position.clientY : opts.position === "cursor" - ? this.lastViewportPosition.y - : this.state.height / 2 + this.state.offsetTop; + ? this.lastViewportPosition.y + : this.state.height / 2 + this.state.offsetTop; const { x, y } = viewportCoordsToSceneCoords( { clientX, clientY }, diff --git ORI/excalidraw/src/components/ColorPicker/ColorPicker.tsx ALT/excalidraw/src/components/ColorPicker/ColorPicker.tsx index d2f89c8..818a903 100644 --- ORI/excalidraw/src/components/ColorPicker/ColorPicker.tsx +++ ALT/excalidraw/src/components/ColorPicker/ColorPicker.tsx @@ -38,8 +38,8 @@ export const getColor = (color: string): string | null => { return isValidColor(`#${color}`) ? `#${color}` : isValidColor(color) - ? color - : null; + ? color + : null; }; interface ColorPickerProps { diff --git ORI/excalidraw/src/components/ColorPicker/Picker.tsx ALT/excalidraw/src/components/ColorPicker/Picker.tsx index a2e1752..65152b4 100644 --- ORI/excalidraw/src/components/ColorPicker/Picker.tsx +++ ALT/excalidraw/src/components/ColorPicker/Picker.tsx @@ -74,10 +74,10 @@ export const Picker = ({ isCustomButNotInList ? "hex" : isCustom - ? "custom" - : colorObj?.shade != null - ? "shades" - : "baseColors", + ? "custom" + : colorObj?.shade != null + ? "shades" + : "baseColors", ); } }, [ diff --git ORI/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts ALT/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts index 95ee7be..549154e 100644 --- ORI/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts +++ ALT/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts @@ -181,8 +181,8 @@ export const colorPickerKeyNavHandler = ({ activeSectionIndex + indexOffset > sections.length - 1 ? 0 : activeSectionIndex + indexOffset < 0 - ? sections.length - 1 - : activeSectionIndex + indexOffset; + ? sections.length - 1 + : activeSectionIndex + indexOffset; const nextSection = sections[nextSectionIndex]; diff --git ORI/excalidraw/src/data/encryption.ts ALT/excalidraw/src/data/encryption.ts index 33e6899..25809b4 100644 --- ORI/excalidraw/src/data/encryption.ts +++ ALT/excalidraw/src/data/encryption.ts @@ -57,10 +57,10 @@ export const encryptData = async ( typeof data === "string" ? new TextEncoder().encode(data) : data instanceof Uint8Array - ? data - : data instanceof Blob - ? await blobToArrayBuffer(data) - : data; + ? data + : data instanceof Blob + ? await blobToArrayBuffer(data) + : data; // We use symmetric encryption. AES-GCM is the recommended algorithm and // includes checks that the ciphertext has not been modified by an attacker. diff --git ORI/excalidraw/src/data/restore.ts ALT/excalidraw/src/data/restore.ts index 5f2adc0..d0d903b 100644 --- ORI/excalidraw/src/data/restore.ts +++ ALT/excalidraw/src/data/restore.ts @@ -131,14 +131,14 @@ const restoreElementWithProperties = < roundness: element.roundness ? element.roundness : element.strokeSharpness === "round" - ? { - // for old elements that would now use adaptive radius algo, - // use legacy algo instead - type: isUsingAdaptiveRadius(element.type) - ? ROUNDNESS.LEGACY - : ROUNDNESS.PROPORTIONAL_RADIUS, - } - : null, + ? { + // for old elements that would now use adaptive radius algo, + // use legacy algo instead + type: isUsingAdaptiveRadius(element.type) + ? ROUNDNESS.LEGACY + : ROUNDNESS.PROPORTIONAL_RADIUS, + } + : null, boundElements: element.boundElementIds ? element.boundElementIds.map((id) => ({ type: "arrow", id })) : element.boundElements ?? [], @@ -510,8 +510,8 @@ export const restoreAppState = ( suppliedValue !== undefined ? suppliedValue : localValue !== undefined - ? localValue - : defaultValue; + ? localValue + : defaultValue; } return { @@ -539,8 +539,8 @@ export const restoreAppState = ( value: appState.zoom as NormalizedZoomValue, } : appState.zoom?.value - ? appState.zoom - : defaultAppState.zoom, + ? appState.zoom + : defaultAppState.zoom, openSidebar: // string (legacy) typeof (appState.openSidebar as any as string) === "string" diff --git ORI/excalidraw/src/element/binding.ts ALT/excalidraw/src/element/binding.ts index b175f14..fbe22e0 100644 --- ORI/excalidraw/src/element/binding.ts +++ ALT/excalidraw/src/element/binding.ts @@ -486,10 +486,10 @@ export const getEligibleElementsForBinding = ( (element) => !includedElementIds.has(element.id), ) as SuggestedBinding[]) : isBindableElement(element, false) - ? getElligibleElementsForBindableElementAndWhere(element).filter( - (binding) => !includedElementIds.has(binding[0].id), - ) - : [], + ? getElligibleElementsForBindableElementAndWhere(element).filter( + (binding) => !includedElementIds.has(binding[0].id), + ) + : [], ); }; diff --git ORI/excalidraw/src/element/collision.ts ALT/excalidraw/src/element/collision.ts index f160783..48e1be8 100644 --- ORI/excalidraw/src/element/collision.ts +++ ALT/excalidraw/src/element/collision.ts @@ -153,8 +153,8 @@ export const isHittingElementNotConsideringBoundingBox = ( const check = isTextElement(element) ? isStrictlyInside : isElementDraggableFromInside(element) - ? isInsideCheck - : isNearCheck; + ? isInsideCheck + : isNearCheck; return hitTestPointAgainstElement({ element, point, diff --git ORI/excalidraw/src/element/linearElementEditor.ts ALT/excalidraw/src/element/linearElementEditor.ts index 74275f4..d39cecb 100644 --- ORI/excalidraw/src/element/linearElementEditor.ts +++ ALT/excalidraw/src/element/linearElementEditor.ts @@ -389,8 +389,8 @@ export class LinearElementEditor { ) : selectedPointsIndices : selectedPointsIndices?.includes(pointerDownState.lastClickedPoint) - ? [pointerDownState.lastClickedPoint] - : selectedPointsIndices, + ? [pointerDownState.lastClickedPoint] + : selectedPointsIndices, isDragging: false, pointerOffset: { x: 0, y: 0 }, }; diff --git ORI/excalidraw/src/element/newElement.ts ALT/excalidraw/src/element/newElement.ts index 848a6af..a3b08d7 100644 --- ORI/excalidraw/src/element/newElement.ts +++ ALT/excalidraw/src/element/newElement.ts @@ -161,8 +161,8 @@ const getTextElementPositionOffsets = ( opts.textAlign === "center" ? metrics.width / 2 : opts.textAlign === "right" - ? metrics.width - : 0, + ? metrics.width + : 0, y: opts.verticalAlign === "middle" ? metrics.height / 2 : 0, }; }; diff --git ORI/excalidraw/src/renderer/renderElement.ts ALT/excalidraw/src/renderer/renderElement.ts index 0efe5df..3f12394 100644 --- ORI/excalidraw/src/renderer/renderElement.ts +++ ALT/excalidraw/src/renderer/renderElement.ts @@ -336,8 +336,8 @@ const drawElementOnCanvas = ( element.textAlign === "center" ? element.width / 2 : element.textAlign === "right" - ? element.width - : 0; + ? element.width + : 0; const lineHeightPx = getLineHeightInPx( element.fontSize, element.lineHeight, @@ -404,8 +404,8 @@ export const generateRoughOptions = ( element.strokeStyle === "dashed" ? getDashArrayDashed(element.strokeWidth) : element.strokeStyle === "dotted" - ? getDashArrayDotted(element.strokeWidth) - : undefined, + ? getDashArrayDotted(element.strokeWidth) + : undefined, // for non-solid strokes, disable multiStroke because it tends to make // dashes/dots overlay each other disableMultiStroke: element.strokeStyle !== "solid", @@ -1470,15 +1470,15 @@ export const renderElementToSvg = ( element.textAlign === "center" ? element.width / 2 : element.textAlign === "right" - ? element.width - : 0; + ? element.width + : 0; const direction = isRTL(element.text) ? "rtl" : "ltr"; const textAnchor = element.textAlign === "center" ? "middle" : element.textAlign === "right" || direction === "rtl" - ? "end" - : "start"; + ? "end" + : "start"; for (let i = 0; i < lines.length; i++) { const text = svgRoot.ownerDocument!.createElementNS(SVG_NS, "text"); text.textContent = lines[i]; @@ -1528,8 +1528,8 @@ export function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) { const inputPoints = element.simulatePressure ? element.points : element.points.length - ? element.points.map(([x, y], i) => [x, y, element.pressures[i]]) - : [[0, 0, 0.5]]; + ? element.points.map(([x, y], i) => [x, y, element.pressures[i]]) + : [[0, 0, 0.5]]; // Consider changing the options for simulated pressure vs real pressure const options: StrokeOptions = { diff --git ORI/excalidraw/src/tests/helpers/api.ts ALT/excalidraw/src/tests/helpers/api.ts index 9edb595..7e8abec 100644 --- ORI/excalidraw/src/tests/helpers/api.ts +++ ALT/excalidraw/src/tests/helpers/api.ts @@ -127,12 +127,12 @@ export class API { }): T extends "arrow" | "line" ? ExcalidrawLinearElement : T extends "freedraw" - ? ExcalidrawFreeDrawElement - : T extends "text" - ? ExcalidrawTextElement - : T extends "image" - ? ExcalidrawImageElement - : ExcalidrawGenericElement => { + ? ExcalidrawFreeDrawElement + : T extends "text" + ? ExcalidrawTextElement + : T extends "image" + ? ExcalidrawImageElement + : ExcalidrawGenericElement => { let element: Mutable = null!; const appState = h?.state || getDefaultAppState(); diff --git ORI/excalidraw/src/tests/helpers/ui.ts ALT/excalidraw/src/tests/helpers/ui.ts index c882011..fb7b818 100644 --- ORI/excalidraw/src/tests/helpers/ui.ts +++ ALT/excalidraw/src/tests/helpers/ui.ts @@ -277,15 +277,15 @@ export class UI { ): (T extends "arrow" | "line" | "freedraw" ? ExcalidrawLinearElement : T extends "text" - ? ExcalidrawTextElement - : ExcalidrawElement) & { + ? ExcalidrawTextElement + : ExcalidrawElement) & { /** Returns the actual, current element from the elements array, instead of the proxy */ get(): T extends "arrow" | "line" | "freedraw" ? ExcalidrawLinearElement : T extends "text" - ? ExcalidrawTextElement - : ExcalidrawElement; + ? ExcalidrawTextElement + : ExcalidrawElement; } { UI.clickTool(type); mouse.reset(); ```
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: prettier/prettier@2bd131fbd29e94e989e64904f1a628877d38ae3d

Diff (875 lines) ```diff diff --git ORI/prettier/scripts/utils/changelog.js ALT/prettier/scripts/utils/changelog.js index 1b70543..a5d0798 100644 --- ORI/prettier/scripts/utils/changelog.js +++ ALT/prettier/scripts/utils/changelog.js @@ -31,10 +31,10 @@ export function getEntries(dirPath) { const section = title.includes("[HIGHLIGHT]") ? "highlight" : title.includes("[BREAKING]") - ? "breaking" - : improvement - ? "improvement" - : undefined; + ? "breaking" + : improvement + ? "improvement" + : undefined; const order = section === "improvement" && improvement[2] !== undefined diff --git ORI/prettier/src/cli/options/normalize-cli-options.js ALT/prettier/src/cli/options/normalize-cli-options.js index 38371f0..cd2bc03 100644 --- ORI/prettier/src/cli/options/normalize-cli-options.js +++ ALT/prettier/src/cli/options/normalize-cli-options.js @@ -9,10 +9,10 @@ const descriptor = { value === false ? `--no-${key}` : value === true - ? descriptor.key(key) - : value === "" - ? `${descriptor.key(key)} without an argument` - : `${descriptor.key(key)}=${value}`, + ? descriptor.key(key) + : value === "" + ? `${descriptor.key(key)} without an argument` + : `${descriptor.key(key)}=${value}`, }; class FlagSchema extends vnopts.ChoiceSchema { diff --git ORI/prettier/src/document/debug.js ALT/prettier/src/document/debug.js index 2f52e2c..8261eb7 100644 --- ORI/prettier/src/document/debug.js +++ ALT/prettier/src/document/debug.js @@ -114,14 +114,14 @@ function printDocToDebug(doc) { return doc.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + printDoc(doc.contents) + ")" : doc.n < 0 - ? "dedent(" + printDoc(doc.contents) + ")" - : doc.n.type === "root" - ? "markAsRoot(" + printDoc(doc.contents) + ")" - : "align(" + - JSON.stringify(doc.n) + - ", " + - printDoc(doc.contents) + - ")"; + ? "dedent(" + printDoc(doc.contents) + ")" + : doc.n.type === "root" + ? "markAsRoot(" + printDoc(doc.contents) + ")" + : "align(" + + JSON.stringify(doc.n) + + ", " + + printDoc(doc.contents) + + ")"; } if (doc.type === DOC_TYPE_IF_BREAK) { diff --git ORI/prettier/src/document/printer.js ALT/prettier/src/document/printer.js index c14e724..fc3a650 100644 --- ORI/prettier/src/document/printer.js +++ ALT/prettier/src/document/printer.js @@ -538,8 +538,8 @@ function printDocToString(doc, options) { doc.type === DOC_TYPE_IF_BREAK ? doc.breakContents : doc.negate - ? doc.contents - : indent(doc.contents); + ? doc.contents + : indent(doc.contents); if (breakContents) { cmds.push({ ind, mode, doc: breakContents }); } @@ -549,8 +549,8 @@ function printDocToString(doc, options) { doc.type === DOC_TYPE_IF_BREAK ? doc.flatContents : doc.negate - ? indent(doc.contents) - : doc.contents; + ? indent(doc.contents) + : doc.contents; if (flatContents) { cmds.push({ ind, mode, doc: flatContents }); } diff --git ORI/prettier/src/index.d.ts ALT/prettier/src/index.d.ts index 0b0c989..628825d 100644 --- ORI/prettier/src/index.d.ts +++ ALT/prettier/src/index.d.ts @@ -50,8 +50,8 @@ type IndexValue = T extends any[] ? T[P] : never : P extends keyof T - ? T[P] - : never; + ? T[P] + : never; // Determines if an object T is an array like string[] (in which case this // evaluates to false) or a tuple like [string] (in which case this evaluates to @@ -60,8 +60,8 @@ type IndexValue = T extends any[] type IsTuple = T extends [] ? true : T extends [infer First, ...infer Remain] - ? IsTuple - : false; + ? IsTuple + : false; type CallProperties = T extends any[] ? IndexProperties : keyof T; type IterProperties = T extends any[] diff --git ORI/prettier/src/language-css/printer-postcss.js ALT/prettier/src/language-css/printer-postcss.js index 472b606..229c7aa 100644 --- ORI/prettier/src/language-css/printer-postcss.js +++ ALT/prettier/src/language-css/printer-postcss.js @@ -87,8 +87,8 @@ function genericPrint(path, options, print) { lastLineHasInlineComment(node.selector.value) ? line : node.selector - ? " " - : "", + ? " " + : "", "{", node.nodes.length > 0 ? indent([hardline, printSequence(path, options, print)]) @@ -140,18 +140,18 @@ function genericPrint(path, options, print) { node.raws.important ? node.raws.important.replace(/\s*!\s*important/i, " !important") : node.important - ? " !important" - : "", + ? " !important" + : "", node.raws.scssDefault ? node.raws.scssDefault.replace(/\s*!default/i, " !default") : node.scssDefault - ? " !default" - : "", + ? " !default" + : "", node.raws.scssGlobal ? node.raws.scssGlobal.replace(/\s*!global/i, " !global") : node.scssGlobal - ? " !global" - : "", + ? " !global" + : "", node.nodes ? [ " {", @@ -160,12 +160,12 @@ function genericPrint(path, options, print) { "}", ] : isTemplatePropNode(node) && - !parentNode.raws.semicolon && - options.originalText[locEnd(node) - 1] !== ";" - ? "" - : options.__isHTMLStyleAttribute && isLastNode(path, node) - ? ifBreak(";") - : ";", + !parentNode.raws.semicolon && + options.originalText[locEnd(node) - 1] !== ";" + ? "" + : options.__isHTMLStyleAttribute && isLastNode(path, node) + ? ifBreak(";") + : ";", ]; } case "css-atrule": { @@ -232,16 +232,16 @@ function genericPrint(path, options, print) { isDetachedRulesetCallNode(node) ? "" : isTemplatePlaceholderNode(node) - ? node.raws.afterName === "" - ? "" - : node.name.endsWith(":") - ? " " - : /^\s*\n\s*\n/.test(node.raws.afterName) - ? [hardline, hardline] - : /^\s*\n/.test(node.raws.afterName) - ? hardline - : " " - : " ", + ? node.raws.afterName === "" + ? "" + : node.name.endsWith(":") + ? " " + : /^\s*\n\s*\n/.test(node.raws.afterName) + ? [hardline, hardline] + : /^\s*\n/.test(node.raws.afterName) + ? hardline + : " " + : " ", typeof node.params === "string" ? node.params : print("params"), ] : "", @@ -257,21 +257,21 @@ function genericPrint(path, options, print) { : "", ]) : node.name === "else" - ? " " - : "", + ? " " + : "", node.nodes ? [ isSCSSControlDirectiveNode(node, options) ? "" : (node.selector && - !node.selector.nodes && - typeof node.selector.value === "string" && - lastLineHasInlineComment(node.selector.value)) || - (!node.selector && - typeof node.params === "string" && - lastLineHasInlineComment(node.params)) - ? line - : " ", + !node.selector.nodes && + typeof node.selector.value === "string" && + lastLineHasInlineComment(node.selector.value)) || + (!node.selector && + typeof node.params === "string" && + lastLineHasInlineComment(node.params)) + ? line + : " ", "{", indent([ node.nodes.length > 0 ? softline : "", @@ -281,9 +281,9 @@ function genericPrint(path, options, print) { "}", ] : isTemplatePlaceholderNodeWithoutSemiColon || - isImportUnknownValueEndsWithSemiColon - ? "" - : ";", + isImportUnknownValueEndsWithSemiColon + ? "" + : ";", ]; } // postcss-media-query-parser diff --git ORI/prettier/src/language-handlebars/printer-glimmer.js ALT/prettier/src/language-handlebars/printer-glimmer.js index 1b317fd..d9ca862 100644 --- ORI/prettier/src/language-handlebars/printer-glimmer.js +++ ALT/prettier/src/language-handlebars/printer-glimmer.js @@ -127,13 +127,13 @@ function print(path, options, print) { const quote = isText ? getPreferredQuote(value.chars, options.singleQuote) : value.type === "ConcatStatement" - ? getPreferredQuote( - value.parts - .map((part) => (part.type === "TextNode" ? part.chars : "")) - .join(""), - options.singleQuote, - ) - : ""; + ? getPreferredQuote( + value.parts + .map((part) => (part.type === "TextNode" ? part.chars : "")) + .join(""), + options.singleQuote, + ) + : ""; const valueDoc = print("value"); diff --git ORI/prettier/src/language-html/embed/utils.js ALT/prettier/src/language-html/embed/utils.js index 1c51e85..7d313ed 100644 --- ORI/prettier/src/language-html/embed/utils.js +++ ALT/prettier/src/language-html/embed/utils.js @@ -17,8 +17,8 @@ function shouldHugJsExpression(ast, options) { ? ast.node.body[0].expression : ast.node : ast.type === "JsExpressionRoot" - ? ast.node - : ast; + ? ast.node + : ast; return ( rootNode && (rootNode.type === "ObjectExpression" || diff --git ORI/prettier/src/language-html/print/children.js ALT/prettier/src/language-html/print/children.js index dd31bed..1b44b83 100644 --- ORI/prettier/src/language-html/print/children.js +++ ALT/prettier/src/language-html/print/children.js @@ -59,55 +59,57 @@ function printBetweenLine(prevNode, nextNode) { : line : "" : preferHardlineAsLeadingSpaces(nextNode) - ? hardline - : softline + ? hardline + : softline : (needsToBorrowNextOpeningTagStartMarker(prevNode) && - (hasPrettierIgnore(nextNode) || + (hasPrettierIgnore(nextNode) || + /** + * 123 + */ + nextNode.firstChild || + /** + * 123 + */ + nextNode.isSelfClosing || + /** + * 123 0))) || + /** + * 123 + */ + (prevNode.type === "element" && + prevNode.isSelfClosing && + needsToBorrowPrevClosingTagEndMarker(nextNode)) + ? "" + : !nextNode.isLeadingSpaceSensitive || + preferHardlineAsLeadingSpaces(nextNode) || /** - * 123 + * Want to write us a letter? Use ourmailing address. */ - nextNode.firstChild || - /** - * 123 - */ - nextNode.isSelfClosing || - /** - * 123 0))) || - /** - * 123 - */ - (prevNode.type === "element" && - prevNode.isSelfClosing && - needsToBorrowPrevClosingTagEndMarker(nextNode)) - ? "" - : !nextNode.isLeadingSpaceSensitive || - preferHardlineAsLeadingSpaces(nextNode) || - /** - * Want to write us a letter? Use ourmailing address. - */ - (needsToBorrowPrevClosingTagEndMarker(nextNode) && - prevNode.lastChild && - needsToBorrowParentClosingTagStartMarker(prevNode.lastChild) && - prevNode.lastChild.lastChild && - needsToBorrowParentClosingTagStartMarker(prevNode.lastChild.lastChild)) - ? hardline - : nextNode.hasLeadingSpaces - ? line - : softline; + (needsToBorrowPrevClosingTagEndMarker(nextNode) && + prevNode.lastChild && + needsToBorrowParentClosingTagStartMarker(prevNode.lastChild) && + prevNode.lastChild.lastChild && + needsToBorrowParentClosingTagStartMarker( + prevNode.lastChild.lastChild, + )) + ? hardline + : nextNode.hasLeadingSpaces + ? line + : softline; } function printChildren(path, options, print) { diff --git ORI/prettier/src/language-html/print/tag.js ALT/prettier/src/language-html/print/tag.js index 9258095..ac9f231 100644 --- ORI/prettier/src/language-html/print/tag.js +++ ALT/prettier/src/language-html/print/tag.js @@ -62,8 +62,8 @@ function printClosingTagSuffix(node, options) { return needsToBorrowParentClosingTagStartMarker(node) ? printClosingTagStartMarker(node.parent, options) : needsToBorrowNextOpeningTagStartMarker(node) - ? printOpeningTagStartMarker(node.next) - : ""; + ? printOpeningTagStartMarker(node.next) + : ""; } function printClosingTagStartMarker(node, options) { @@ -233,8 +233,8 @@ function printAttributes(path, options, print) { typeof ignoreAttributeData === "boolean" ? () => ignoreAttributeData : Array.isArray(ignoreAttributeData) - ? (attribute) => ignoreAttributeData.includes(attribute.rawName) - : () => false; + ? (attribute) => ignoreAttributeData.includes(attribute.rawName) + : () => false; const printedAttributes = path.map( ({ node: attribute }) => @@ -294,8 +294,8 @@ function printAttributes(path, options, print) { ? " " : "" : node.isSelfClosing - ? line - : softline, + ? line + : softline, ); } @@ -329,8 +329,8 @@ function printOpeningTagPrefix(node, options) { return needsToBorrowParentOpeningTagEndMarker(node) ? printOpeningTagEndMarker(node.parent) : needsToBorrowPrevClosingTagEndMarker(node) - ? printClosingTagEndMarker(node.prev, options) - : ""; + ? printClosingTagEndMarker(node.prev, options) + : ""; } function printOpeningTagStartMarker(node) { diff --git ORI/prettier/src/language-js/embed/html.js ALT/prettier/src/language-js/embed/html.js index 8d301dc..b15b6a1 100644 --- ORI/prettier/src/language-js/embed/html.js +++ ALT/prettier/src/language-js/embed/html.js @@ -77,8 +77,8 @@ async function printEmbedHtmlLike(parser, textToDoc, print, path, options) { options.htmlWhitespaceSensitivity === "ignore" ? hardline : leadingWhitespace && trailingWhitespace - ? line - : null; + ? line + : null; if (linebreak) { return group(["`", indent([linebreak, group(contentDoc)]), linebreak, "`"]); diff --git ORI/prettier/src/language-js/needs-parens.js ALT/prettier/src/language-js/needs-parens.js index 0fccfdd..5253ad0 100644 --- ORI/prettier/src/language-js/needs-parens.js +++ ALT/prettier/src/language-js/needs-parens.js @@ -95,10 +95,10 @@ function needsParens(path, options) { const expression = !statement ? undefined : statement.type === "ExpressionStatement" - ? statement.expression - : statement.type === "ForStatement" - ? statement.init - : statement.left; + ? statement.expression + : statement.type === "ForStatement" + ? statement.init + : statement.left; if ( expression && startsWithNoLookaheadToken( diff --git ORI/prettier/src/language-js/print/array.js ALT/prettier/src/language-js/print/array.js index cd99d7c..dec3523 100644 --- ORI/prettier/src/language-js/print/array.js +++ ALT/prettier/src/language-js/print/array.js @@ -60,8 +60,8 @@ function printArray(path, options, print) { node.type === "TupleTypeAnnotation" && node.types ? "types" : node.type === "TSTupleType" || node.type === "TupleTypeAnnotation" - ? "elementTypes" - : "elements"; + ? "elementTypes" + : "elements"; const elements = node[elementsProperty]; if (elements.length === 0) { parts.push( @@ -114,12 +114,12 @@ function printArray(path, options, print) { const trailingComma = !canHaveTrailingComma ? "" : needsForcedTrailingComma - ? "," - : !shouldPrintComma(options) - ? "" - : shouldUseConciseFormatting - ? ifBreak(",", "", { groupId }) - : ifBreak(","); + ? "," + : !shouldPrintComma(options) + ? "" + : shouldUseConciseFormatting + ? ifBreak(",", "", { groupId }) + : ifBreak(","); parts.push( group( @@ -213,8 +213,8 @@ function printArrayElementsConcisely(path, options, print, trailingComma) { isLineAfterElementEmpty(path, options) ? [hardline, hardline] : hasComment(next, CommentCheckFlags.Leading | CommentCheckFlags.Line) - ? hardline - : line, + ? hardline + : line, ); } }, "elements"); diff --git ORI/prettier/src/language-js/print/assignment.js ALT/prettier/src/language-js/print/assignment.js index 8e8d032..feaf363 100644 --- ORI/prettier/src/language-js/print/assignment.js +++ ALT/prettier/src/language-js/print/assignment.js @@ -121,9 +121,9 @@ function chooseLayout(path, options, print, leftDoc, rightPropertyName) { return !isTail ? "chain" : rightNode.type === "ArrowFunctionExpression" && - rightNode.body.type === "ArrowFunctionExpression" - ? "chain-tail-arrow-chain" - : "chain-tail"; + rightNode.body.type === "ArrowFunctionExpression" + ? "chain-tail-arrow-chain" + : "chain-tail"; } const isHeadOfLongChain = !isTail && isAssignment(rightNode.right); diff --git ORI/prettier/src/language-js/print/decorators.js ALT/prettier/src/language-js/print/decorators.js index 634c57c..b766eab 100644 --- ORI/prettier/src/language-js/print/decorators.js +++ ALT/prettier/src/language-js/print/decorators.js @@ -59,8 +59,8 @@ function printDecorators(path, options, print) { path.key === "declaration" && isExportDeclaration(parent) ? hardline : shouldBreak - ? breakParent - : "", + ? breakParent + : "", join(line, path.map(print, "decorators")), line, ]; diff --git ORI/prettier/src/language-js/print/flow.js ALT/prettier/src/language-js/print/flow.js index 8c5f0eb..2bd0744 100644 --- ORI/prettier/src/language-js/print/flow.js +++ ALT/prettier/src/language-js/print/flow.js @@ -153,8 +153,8 @@ function printFlow(path, options, print) { const name = node.name ? print("name") : path.parent.this === node - ? "this" - : ""; + ? "this" + : ""; return [ name, printOptionalToken(path), diff --git ORI/prettier/src/language-js/print/function.js ALT/prettier/src/language-js/print/function.js index c668e82..9d00d84 100644 --- ORI/prettier/src/language-js/print/function.js +++ ALT/prettier/src/language-js/print/function.js @@ -168,8 +168,8 @@ function printMethodValue(path, options, print) { shouldBreakParameters ? group(parametersDoc, { shouldBreak: true }) : shouldGroupParameters - ? group(parametersDoc) - : parametersDoc, + ? group(parametersDoc) + : parametersDoc, returnTypeDoc, ]), ]; diff --git ORI/prettier/src/language-js/print/jsx.js ALT/prettier/src/language-js/print/jsx.js index be90185..fac4bfc 100644 --- ORI/prettier/src/language-js/print/jsx.js +++ ALT/prettier/src/language-js/print/jsx.js @@ -690,8 +690,8 @@ function printJsxOpeningClosingFragment(path, options /*, print*/) { hasOwnLineComment ? hardline : nodeHasComment && !isOpeningFragment - ? " " - : "", + ? " " + : "", printDanglingComments(path, options), ]), hasOwnLineComment ? hardline : "", diff --git ORI/prettier/src/language-js/print/module.js ALT/prettier/src/language-js/print/module.js index fdae117..f086f4f 100644 --- ORI/prettier/src/language-js/print/module.js +++ ALT/prettier/src/language-js/print/module.js @@ -256,8 +256,8 @@ function printImportAttributes(path, options, print) { const property = isNonEmptyArray(node.attributes) ? "attributes" : isNonEmptyArray(node.assertions) - ? "assertions" - : undefined; + ? "assertions" + : undefined; if (!property) { return ""; diff --git ORI/prettier/src/language-js/print/object.js ALT/prettier/src/language-js/print/object.js index 44ddd3f..db3a6c3 100644 --- ORI/prettier/src/language-js/print/object.js +++ ALT/prettier/src/language-js/print/object.js @@ -42,8 +42,8 @@ function printObject(path, options, print) { node.type === "TSTypeLiteral" || isEnumBody ? "members" : node.type === "TSInterfaceBody" - ? "body" - : "properties", + ? "body" + : "properties", ]; if (isTypeAnnotation) { fields.push("indexers", "callProperties", "internalSlots"); @@ -104,8 +104,8 @@ function printObject(path, options, print) { const separator = isFlowInterfaceLikeBody ? ";" : node.type === "TSInterfaceBody" || node.type === "TSTypeLiteral" - ? ifBreak(semi, ";") - : ","; + ? ifBreak(semi, ";") + : ","; const leftBrace = node.type === "RecordExpression" ? "#{" : node.exact ? "{|" : "{"; const rightBrace = node.exact ? "|}" : "}"; diff --git ORI/prettier/src/language-js/print/ternary.js ALT/prettier/src/language-js/print/ternary.js index 8fecc3d..b96863b 100644 --- ORI/prettier/src/language-js/print/ternary.js +++ ALT/prettier/src/language-js/print/ternary.js @@ -293,8 +293,8 @@ function printTernary(path, options, print) { isParentTest ? part : options.useTabs - ? dedent(indent(part)) - : align(Math.max(0, options.tabWidth - 2), part), + ? dedent(indent(part)) + : align(Math.max(0, options.tabWidth - 2), part), ); } @@ -321,8 +321,8 @@ function printTernary(path, options, print) { parent === firstNonConditionalParent ? group(doc, { shouldBreak }) : shouldBreak - ? [doc, breakParent] - : doc; + ? [doc, breakParent] + : doc; // Break the closing paren to keep the chain right after it: // (a diff --git ORI/prettier/src/language-js/print/type-parameters.js ALT/prettier/src/language-js/print/type-parameters.js index 688b6ec..4a77ec2 100644 --- ORI/prettier/src/language-js/print/type-parameters.js +++ ALT/prettier/src/language-js/print/type-parameters.js @@ -87,10 +87,10 @@ function printTypeParameters(path, options, print, paramsKey) { node.type === "TSTypeParameterInstantiation" // https://github.com/microsoft/TypeScript/issues/21984 ? "" : shouldForceTrailingComma(path, options, paramsKey) - ? "," - : shouldPrintComma(options) - ? ifBreak(",") - : ""; + ? "," + : shouldPrintComma(options) + ? ifBreak(",") + : ""; return group( [ diff --git ORI/prettier/src/language-markdown/printer-markdown.js ALT/prettier/src/language-markdown/printer-markdown.js index d9d6462..9deaa3e 100644 --- ORI/prettier/src/language-markdown/printer-markdown.js +++ ALT/prettier/src/language-markdown/printer-markdown.js @@ -305,12 +305,12 @@ function genericPrint(path, options, print) { ? (childPath.isFirst ? node.start : isGitDiffFriendlyOrderedList - ? 1 - : node.start + childPath.index) + + ? 1 + : node.start + childPath.index) + (nthSiblingIndex % 2 === 0 ? ". " : ") ") : nthSiblingIndex % 2 === 0 - ? "- " - : "* "; + ? "- " + : "* "; return node.isAligned || /* workaround for https://github.com/remarkjs/remark/issues/315 */ node.hasIndentedCodeblock @@ -340,8 +340,8 @@ function genericPrint(path, options, print) { node.referenceType === "full" ? printLinkReference(node) : node.referenceType === "collapsed" - ? "[]" - : "", + ? "[]" + : "", ]; case "imageReference": switch (node.referenceType) { diff --git ORI/prettier/src/language-yaml/utils.js ALT/prettier/src/language-yaml/utils.js index c2f8c1e..6530041 100644 --- ORI/prettier/src/language-yaml/utils.js +++ ALT/prettier/src/language-yaml/utils.js @@ -182,10 +182,10 @@ function getFlowScalarLineContents(nodeType, content, options) { index === 0 && index === lineContents.length - 1 ? lineContent : index !== 0 && index !== lineContents.length - 1 - ? lineContent.trim() - : index === 0 - ? lineContent.trimEnd() - : lineContent.trimStart(), + ? lineContent.trim() + : index === 0 + ? lineContent.trimEnd() + : lineContent.trimStart(), ); if (options.proseWrap === "preserve") { @@ -307,9 +307,9 @@ function getBlockValueLineContents( return trailingNewlineCount === 0 ? lineContents : trailingNewlineCount >= 2 && !isLastDescendant - ? // next empty line - lineContents.slice(0, -(trailingNewlineCount - 1)) - : lineContents.slice(0, -trailingNewlineCount); + ? // next empty line + lineContents.slice(0, -(trailingNewlineCount - 1)) + : lineContents.slice(0, -trailingNewlineCount); } } diff --git ORI/prettier/src/main/normalize-options.js ALT/prettier/src/main/normalize-options.js index c4e7e80..fdab515 100644 --- ORI/prettier/src/main/normalize-options.js +++ ALT/prettier/src/main/normalize-options.js @@ -47,9 +47,9 @@ function normalizeOptions( }); } : Array.isArray(passThrough) - ? (key, value) => - !passThrough.includes(key) ? undefined : { [key]: value } - : (key, value) => ({ [key]: value }); + ? (key, value) => + !passThrough.includes(key) ? undefined : { [key]: value } + : (key, value) => ({ [key]: value }); const schemas = optionInfosToSchemas(optionInfos, { isCLI, FlagSchema }); const normalizer = new vnopts.Normalizer(schemas, { diff --git ORI/prettier/src/utils/print-string.js ALT/prettier/src/utils/print-string.js index 8cbe600..310698b 100644 --- ORI/prettier/src/utils/print-string.js +++ ALT/prettier/src/utils/print-string.js @@ -16,8 +16,8 @@ function printString(raw, options) { !options.singleQuote) ? '"' : options.__isInHtmlAttribute - ? "'" - : getPreferredQuote(rawContent, options.singleQuote); + ? "'" + : getPreferredQuote(rawContent, options.singleQuote); // It might sound unnecessary to use `makeString` even if the string already // is enclosed with `enclosingQuote`, but it isn't. The string could contain diff --git ORI/prettier/tests/config/utils/create-snapshot.js ALT/prettier/tests/config/utils/create-snapshot.js index d404999..ed5f2ea 100644 --- ORI/prettier/tests/config/utils/create-snapshot.js +++ ALT/prettier/tests/config/utils/create-snapshot.js @@ -13,8 +13,8 @@ function stringify(value) { return value === Number.POSITIVE_INFINITY ? "Infinity" : Array.isArray(value) - ? `[${value.map((v) => JSON.stringify(v)).join(", ")}]` - : JSON.stringify(value); + ? `[${value.map((v) => JSON.stringify(v)).join(", ")}]` + : JSON.stringify(value); } function printOptions(options) { diff --git ORI/prettier/tests/config/utils/stringify-options-for-title.js ALT/prettier/tests/config/utils/stringify-options-for-title.js index 11e92ee..d25c671 100644 --- ORI/prettier/tests/config/utils/stringify-options-for-title.js +++ ALT/prettier/tests/config/utils/stringify-options-for-title.js @@ -3,8 +3,8 @@ function stringifyOptions(options) { key === "plugins" || key === "errors" ? undefined : value === Number.POSITIVE_INFINITY - ? "Infinity" - : value, + ? "Infinity" + : value, ); return string === "{}" ? "" : string; diff --git ORI/prettier/tests/integration/__tests__/support-info.js ALT/prettier/tests/integration/__tests__/support-info.js index 849c919..3a354aa 100644 --- ORI/prettier/tests/integration/__tests__/support-info.js +++ ALT/prettier/tests/integration/__tests__/support-info.js @@ -23,8 +23,8 @@ async function getCoreInfo() { ...(option.type === "int" ? { range: option.range } : option.type === "choice" - ? { choices: option.choices.map((choice) => choice.value) } - : null), + ? { choices: option.choices.map((choice) => choice.value) } + : null), }, ]), ); diff --git ORI/prettier/tests/integration/cli-worker.js ALT/prettier/tests/integration/cli-worker.js index 7c8743a..99f460d 100644 --- ORI/prettier/tests/integration/cli-worker.js +++ ALT/prettier/tests/integration/cli-worker.js @@ -47,8 +47,8 @@ async function run() { stream === process.stdout ? "process.stdout" : stream === process.stderr - ? "process.stderr" - : "unknown stream" + ? "process.stderr" + : "unknown stream" })]]\n`, ); }; diff --git ORI/prettier/website/playground/Playground.js ALT/prettier/website/playground/Playground.js index 845b9ed..7ff2c15 100644 --- ORI/prettier/website/playground/Playground.js +++ ALT/prettier/website/playground/Playground.js @@ -514,8 +514,8 @@ function getSecondFormat(formatted, reformatted) { return formatted === "" ? "" : formatted === reformatted - ? "✓ Second format is unchanged." - : reformatted; + ? "✓ Second format is unchanged." + : reformatted; } export default Playground; diff --git ORI/prettier/website/static/worker.js ALT/prettier/website/static/worker.js index c8b2389..b56c5f2 100644 --- ORI/prettier/website/static/worker.js +++ ALT/prettier/website/static/worker.js @@ -45,10 +45,10 @@ function serializeAst(ast) { value instanceof Error ? { name: value.name, message: value.message, ...value } : typeof value === "bigint" - ? `BigInt('${String(value)}')` - : typeof value === "symbol" - ? String(value) - : value, + ? `BigInt('${String(value)}')` + : typeof value === "symbol" + ? String(value) + : value, 2, ); } ```
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: marmelab/react-admin@fbf280286c715d6ef0c38d7111eab249aa929dc1

Diff (868 lines) ```diff diff --git ORI/react-admin/examples/crm/src/misc/Status.tsx ALT/react-admin/examples/crm/src/misc/Status.tsx index a63a357..b61e3cf 100644 --- ORI/react-admin/examples/crm/src/misc/Status.tsx +++ ALT/react-admin/examples/crm/src/misc/Status.tsx @@ -5,12 +5,12 @@ const getColorFromStatus = (status: string) => status === 'cold' ? '#7dbde8' : status === 'warm' - ? '#e8cb7d' - : status === 'hot' - ? '#e88b7d' - : status === 'in-contract' - ? '#a4e87d' - : '#000'; + ? '#e8cb7d' + : status === 'hot' + ? '#e88b7d' + : status === 'in-contract' + ? '#a4e87d' + : '#000'; export const Status = ({ status }: { status: string }) => ( { typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? 'ra.auth.sign_in_error' - : error.message, + ? 'ra.auth.sign_in_error' + : error.message, { type: 'error', messageArgs: { @@ -50,8 +50,8 @@ const Login = () => { typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-core/src/auth/useAuthState.ts ALT/react-admin/packages/ra-core/src/auth/useAuthState.ts index 8f2f4ff..33157e5 100644 --- ORI/react-admin/packages/ra-core/src/auth/useAuthState.ts +++ ALT/react-admin/packages/ra-core/src/auth/useAuthState.ts @@ -108,5 +108,5 @@ const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? defaultMessage - : error.message; + ? defaultMessage + : error.message; diff --git ORI/react-admin/packages/ra-core/src/auth/useCheckAuth.ts ALT/react-admin/packages/ra-core/src/auth/useCheckAuth.ts index 2db6a45..ac96be2 100644 --- ORI/react-admin/packages/ra-core/src/auth/useCheckAuth.ts +++ ALT/react-admin/packages/ra-core/src/auth/useCheckAuth.ts @@ -108,5 +108,5 @@ const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? defaultMessage - : error.message; + ? defaultMessage + : error.message; diff --git ORI/react-admin/packages/ra-core/src/auth/useGetIdentity.ts ALT/react-admin/packages/ra-core/src/auth/useGetIdentity.ts index 667f772..0dea5f6 100644 --- ORI/react-admin/packages/ra-core/src/auth/useGetIdentity.ts +++ ALT/react-admin/packages/ra-core/src/auth/useGetIdentity.ts @@ -63,13 +63,13 @@ export const useGetIdentity = ( result.isLoading ? { isLoading: true } : result.error - ? { error: result.error, isLoading: false } - : { - data: result.data, - identity: result.data, - refetch: result.refetch, - isLoading: false, - }, + ? { error: result.error, isLoading: false } + : { + data: result.data, + identity: result.data, + refetch: result.refetch, + isLoading: false, + }, [result] ); diff --git ORI/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts ALT/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts index 361b522..04ec2cc 100644 --- ORI/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts +++ ALT/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts @@ -64,8 +64,8 @@ const useLogoutIfAccessDenied = (): LogoutIfAccessDenied => { e && e.redirectTo != null ? e.redirectTo : error && error.redirectTo - ? error.redirectTo - : undefined; + ? error.redirectTo + : undefined; const shouldNotify = !( disableNotification || @@ -141,7 +141,7 @@ const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? defaultMessage - : error.message; + ? defaultMessage + : error.message; export default useLogoutIfAccessDenied; diff --git ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx index 3be0661..dc9fab4 100644 --- ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx +++ ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx @@ -126,8 +126,8 @@ const useDeleteWithConfirmController = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx index 59630dd..3502b4f 100644 --- ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx +++ ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx @@ -91,8 +91,8 @@ const useDeleteWithUndoController = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-core/src/controller/create/useCreateController.ts ALT/react-admin/packages/ra-core/src/controller/create/useCreateController.ts index f08ad5d..690e686 100644 --- ORI/react-admin/packages/ra-core/src/controller/create/useCreateController.ts +++ ALT/react-admin/packages/ra-core/src/controller/create/useCreateController.ts @@ -96,8 +96,8 @@ export const useCreateController = < transformFromSave ? transformFromSave(data) : transform - ? transform(data) - : data + ? transform(data) + : data ).then(async (data: Partial) => { const mutate = getMutateWithMiddlewares(create); try { @@ -131,27 +131,28 @@ export const useCreateController = < onError: onErrorFromSave ? onErrorFromSave : onError - ? onError - : (error: Error) => { - notify( - typeof error === 'string' - ? error - : error.message || - 'ra.notification.http_error', - { - type: 'error', - messageArgs: { - _: - typeof error === 'string' - ? error - : error && - error.message - ? error.message - : undefined, - }, - } - ); - }, + ? onError + : (error: Error) => { + notify( + typeof error === 'string' + ? error + : error.message || + 'ra.notification.http_error', + { + type: 'error', + messageArgs: { + _: + typeof error === + 'string' + ? error + : error && + error.message + ? error.message + : undefined, + }, + } + ); + }, } ); } catch (error) { diff --git ORI/react-admin/packages/ra-core/src/controller/edit/useEditController.ts ALT/react-admin/packages/ra-core/src/controller/edit/useEditController.ts index 0a46165..880513c 100644 --- ORI/react-admin/packages/ra-core/src/controller/edit/useEditController.ts +++ ALT/react-admin/packages/ra-core/src/controller/edit/useEditController.ts @@ -150,10 +150,10 @@ export const useEditController = < previousData: recordCached.previousData, }) : transform - ? transform(data, { - previousData: recordCached.previousData, - }) - : data + ? transform(data, { + previousData: recordCached.previousData, + }) + : data ).then(async (data: Partial) => { const mutate = getMutateWithMiddlewares(update); @@ -185,27 +185,28 @@ export const useEditController = < onError: onErrorFromSave ? onErrorFromSave : onError - ? onError - : (error: Error | string) => { - notify( - typeof error === 'string' - ? error - : error.message || - 'ra.notification.http_error', - { - type: 'error', - messageArgs: { - _: - typeof error === 'string' - ? error - : error && - error.message - ? error.message - : undefined, - }, - } - ); - }, + ? onError + : (error: Error | string) => { + notify( + typeof error === 'string' + ? error + : error.message || + 'ra.notification.http_error', + { + type: 'error', + messageArgs: { + _: + typeof error === + 'string' + ? error + : error && + error.message + ? error.message + : undefined, + }, + } + ); + }, } ); } catch (error) { diff --git ORI/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts ALT/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts index 5027fca..fa25351 100644 --- ORI/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts +++ ALT/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts @@ -86,8 +86,8 @@ export const useReferenceArrayFieldController = < typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ), diff --git ORI/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts ALT/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts index 0f9ebe7..04de0d2 100644 --- ORI/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts +++ ALT/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts @@ -168,8 +168,8 @@ export const useReferenceManyFieldController = < typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ), @@ -200,8 +200,8 @@ export const useReferenceManyFieldController = < hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? page * perPage < total - : undefined, + ? page * perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : page > 1, setSort, showFilter, diff --git ORI/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx ALT/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx index b76df91..889d34e 100644 --- ORI/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx +++ ALT/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx @@ -86,8 +86,8 @@ export const useReferenceOneFieldController = < typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ), diff --git ORI/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts ALT/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts index 6a630bb..7364ea1 100644 --- ORI/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts +++ ALT/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts @@ -65,8 +65,8 @@ export const getSelectedReferencesStatus = ( !field.value || field.value.length === referenceRecords.length ? REFERENCES_STATUS_READY : referenceRecords.length > 0 - ? REFERENCES_STATUS_INCOMPLETE - : REFERENCES_STATUS_EMPTY; + ? REFERENCES_STATUS_INCOMPLETE + : REFERENCES_STATUS_EMPTY; interface GetStatusForArrayInputParams { field: ControllerRenderProps; diff --git ORI/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts ALT/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts index d4b7074..d91c802 100644 --- ORI/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts +++ ALT/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts @@ -122,8 +122,8 @@ export const useReferenceArrayInputController = < matchingReferences && matchingReferences.length > 0 ? mergeReferences(matchingReferences, finalReferenceRecords) : finalReferenceRecords.length > 0 - ? finalReferenceRecords - : matchingReferences; + ? finalReferenceRecords + : matchingReferences; const refetch = useCallback(() => { refetchGetMany(); @@ -163,8 +163,8 @@ export const useReferenceArrayInputController = < hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? params.page * params.perPage < total - : undefined, + ? params.page * params.perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : params.page > 1, isFromReference: true, }; diff --git ORI/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts ALT/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts index 694be2c..a280fa9 100644 --- ORI/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts +++ ALT/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts @@ -179,8 +179,8 @@ export const useReferenceInputController = ( hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? params.page * params.perPage < total - : undefined, + ? params.page * params.perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : params.page > 1, isFromReference: true, }; diff --git ORI/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx ALT/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx index 4c985fe..f33ffa7 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx +++ ALT/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx @@ -42,8 +42,8 @@ export const useExpanded = ( ? [] : [...ids.slice(0, index), ...ids.slice(index + 1)] : single - ? [id] - : [...ids, id]; + ? [id] + : [...ids, id]; }); }, [setExpandedIds, id, single]); diff --git ORI/react-admin/packages/ra-core/src/controller/list/useList.ts ALT/react-admin/packages/ra-core/src/controller/list/useList.ts index b454ffd..30ca424 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useList.ts +++ ALT/react-admin/packages/ra-core/src/controller/list/useList.ts @@ -177,8 +177,8 @@ export const useList = ( ) : recordValue.includes(filterValue) : Array.isArray(filterValue) - ? filterValue.includes(recordValue) - : filterValue == recordValue; // eslint-disable-line eqeqeq + ? filterValue.includes(recordValue) + : filterValue == recordValue; // eslint-disable-line eqeqeq return result; } ) diff --git ORI/react-admin/packages/ra-core/src/controller/list/useListController.ts ALT/react-admin/packages/ra-core/src/controller/list/useListController.ts index da04fcf..a640c04 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useListController.ts +++ ALT/react-admin/packages/ra-core/src/controller/list/useListController.ts @@ -165,8 +165,8 @@ export const useListController = ( hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? query.page * query.perPage < total - : undefined, + ? query.page * query.perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : query.page > 1, }; }; diff --git ORI/react-admin/packages/ra-core/src/controller/list/useListParams.ts ALT/react-admin/packages/ra-core/src/controller/list/useListParams.ts index 674de5a..c14ea79 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useListParams.ts +++ ALT/react-admin/packages/ra-core/src/controller/list/useListParams.ts @@ -334,8 +334,8 @@ export const getQuery = ({ Object.keys(queryFromLocation).length > 0 ? queryFromLocation : hasCustomParams(params) - ? { ...params } - : { filter: filterDefaultValues || {} }; + ? { ...params } + : { filter: filterDefaultValues || {} }; if (!query.sort) { query.sort = sort.field; diff --git ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx index c044598..aab68a7 100644 --- ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx +++ ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx @@ -52,8 +52,8 @@ const TestedComponent = ({ role }) => { role === 'admin' ? [, ] : role === 'user' - ? [] - : [] + ? [] + : [] } @@ -76,8 +76,8 @@ const TestedComponentReturningNull = ({ role }) => { role === 'admin' ? [, ] : role === 'user' - ? [] - : null + ? [] + : null } diff --git ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx index 179e5b6..c6eadca 100644 --- ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx +++ ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx @@ -125,10 +125,12 @@ const useRoutesAndResourcesFromChildren = ( !!functionChild ? 'loading' : newRoutesAndResources.resources.length > 0 || - newRoutesAndResources.customRoutesWithLayout.length > 0 || - newRoutesAndResources.customRoutesWithoutLayout.length > 0 - ? 'ready' - : 'empty' + newRoutesAndResources.customRoutesWithLayout.length > + 0 || + newRoutesAndResources.customRoutesWithoutLayout.length > + 0 + ? 'ready' + : 'empty' ); if (functionChild) { @@ -248,10 +250,10 @@ const getStatus = ({ return getSingleChildFunction(children) ? 'loading' : resources.length > 0 || - customRoutesWithLayout.length > 0 || - customRoutesWithoutLayout.length > 0 - ? 'ready' - : 'empty'; + customRoutesWithLayout.length > 0 || + customRoutesWithoutLayout.length > 0 + ? 'ready' + : 'empty'; }; /** diff --git ORI/react-admin/packages/ra-core/src/form/useAugmentedForm.ts ALT/react-admin/packages/ra-core/src/form/useAugmentedForm.ts index 19218f0..6992cf8 100644 --- ORI/react-admin/packages/ra-core/src/form/useAugmentedForm.ts +++ ALT/react-admin/packages/ra-core/src/form/useAugmentedForm.ts @@ -64,8 +64,8 @@ export const useAugmentedForm = (props: UseAugmentedFormProps) => { const finalResolver = resolver ? resolver : validate - ? getSimpleValidationResolver(validate) - : undefined; + ? getSimpleValidationResolver(validate) + : undefined; const form = useForm({ criteriaMode, diff --git ORI/react-admin/packages/ra-core/src/form/useChoices.tsx ALT/react-admin/packages/ra-core/src/form/useChoices.tsx index 1ed535e..44a8e55 100644 --- ORI/react-admin/packages/ra-core/src/form/useChoices.tsx +++ ALT/react-admin/packages/ra-core/src/form/useChoices.tsx @@ -64,8 +64,8 @@ export const useChoices = ({ return isValidElement(choiceName) ? choiceName : translateChoice - ? translate(String(choiceName), { _: choiceName }) - : String(choiceName); + ? translate(String(choiceName), { _: choiceName }) + : String(choiceName); }, [optionText, translate, translateChoice] ); diff --git ORI/react-admin/packages/ra-core/src/form/useInput.spec.tsx ALT/react-admin/packages/ra-core/src/form/useInput.spec.tsx index a989b5b..80dbc45 100644 --- ORI/react-admin/packages/ra-core/src/form/useInput.spec.tsx +++ ALT/react-admin/packages/ra-core/src/form/useInput.spec.tsx @@ -179,8 +179,8 @@ describe('useInput', () => { {typeof values[source] === 'undefined' ? 'undefined' : values[source] - ? 'true' - : 'false'} + ? 'true' + : 'false'} ); }; diff --git ORI/react-admin/packages/ra-core/src/form/validate.ts ALT/react-admin/packages/ra-core/src/form/validate.ts index df494bb..575b734 100644 --- ORI/react-admin/packages/ra-core/src/form/validate.ts +++ ALT/react-admin/packages/ra-core/src/form/validate.ts @@ -58,11 +58,11 @@ const getMessage = ( values, }) : messageArgs - ? { - message, - args: messageArgs, - } - : message; + ? { + message, + args: messageArgs, + } + : message; type Memoize = any>( func: T, diff --git ORI/react-admin/packages/ra-core/src/store/useStore.stories.tsx ALT/react-admin/packages/ra-core/src/store/useStore.stories.tsx index 66bb59c..f1bb3e2 100644 --- ORI/react-admin/packages/ra-core/src/store/useStore.stories.tsx +++ ALT/react-admin/packages/ra-core/src/store/useStore.stories.tsx @@ -58,10 +58,10 @@ const StoreRaw = ({ name }) => { {value === undefined ? 'undefined' : value === null - ? 'null' - : value === '' - ? "''" - : value} + ? 'null' + : value === '' + ? "''" + : value} ); }; diff --git ORI/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx ALT/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx index 6166b93..4755a54 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx @@ -31,8 +31,8 @@ export const LoginForm = (props: LoginFormProps) => { typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? 'ra.auth.sign_in_error' - : error.message, + ? 'ra.auth.sign_in_error' + : error.message, { type: 'error', messageArgs: { @@ -40,8 +40,8 @@ export const LoginForm = (props: LoginFormProps) => { typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx index 7d3d5f1..5285439 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx @@ -68,8 +68,8 @@ export const BulkDeleteWithConfirmButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx index 963304d..8c22bbf 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx @@ -61,8 +61,8 @@ export const BulkDeleteWithUndoButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx index 7be7e89..707668d 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx @@ -60,8 +60,8 @@ export const BulkUpdateWithConfirmButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx index 70e224d..35fc447 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx @@ -52,8 +52,8 @@ export const BulkUpdateWithUndoButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx index c232df9..06226fb 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx @@ -63,8 +63,8 @@ export const DeleteButton = ( const finalMutationMode = mutationMode ? mutationMode : saveContext?.mutationMode - ? saveContext.mutationMode - : 'undoable'; + ? saveContext.mutationMode + : 'undoable'; return finalMutationMode === 'undoable' ? ( // @ts-ignore I looked for the error for one hour without finding it diff --git ORI/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx ALT/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx index f5d0eb3..f42df99 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx @@ -78,8 +78,8 @@ const DateFieldImpl = < value instanceof Date ? value : typeof value === 'string' || typeof value === 'number' - ? new Date(value) - : undefined; + ? new Date(value) + : undefined; let dateOptions = options; if ( diff --git ORI/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx ALT/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx index e6fc0c7..904f2fa 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx @@ -97,8 +97,8 @@ export const NumberInput = ({ ? parse(target.valueAsNumber) : target.valueAsNumber : parse - ? parse(target.value) - : convertStringToNumber(target.value); + ? parse(target.value) + : convertStringToNumber(target.value); field.onChange(newValue); }; diff --git ORI/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx ALT/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx index 21da8b1..b0e942b 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx @@ -253,8 +253,8 @@ export const SelectArrayInput = (props: SelectArrayInputProps) => { const finalValue = Array.isArray(field.value ?? []) ? field.value : field.value - ? [field.value] - : []; + ? [field.value] + : []; const outlinedInputProps = variant === 'outlined' diff --git ORI/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx ALT/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx index a37e8c1..607027b 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx @@ -207,8 +207,8 @@ export const SelectInput = (props: SelectInputProps) => { return isElement(emptyText) ? emptyText : emptyText === '' - ? ' ' // em space, forces the display of an empty line of normal height - : translate(emptyText, { _: emptyText }); + ? ' ' // em space, forces the display of an empty line of normal height + : translate(emptyText, { _: emptyText }); }, [emptyText, translate]); const renderMenuItemOption = useCallback( diff --git ORI/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx ALT/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx index 243f802..c851ebf 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx @@ -48,8 +48,8 @@ export const ThemeProvider = ({ typeof mode === 'object' ? mode // FIXME: legacy useTheme, to be removed in v5 : mode === 'dark' - ? darkTheme - : lightTheme || themeOverride + ? darkTheme + : lightTheme || themeOverride ); } catch (e) { console.warn('Failed to reuse custom theme from store', e); diff --git ORI/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx ALT/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx index b1e4199..5e3c01a 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx @@ -160,8 +160,8 @@ export const SimpleList = ( _: primaryText, }) : isElement(primaryText) - ? primaryText - : primaryText(record, record.id)} + ? primaryText + : primaryText(record, record.id)} {!!tertiaryText && (isValidElement(tertiaryText) ? ( @@ -182,13 +182,13 @@ export const SimpleList = ( } ) : isElement( - tertiaryText - ) - ? tertiaryText - : tertiaryText( - record, - record.id - )} + tertiaryText + ) + ? tertiaryText + : tertiaryText( + record, + record.id + )} ))}
@@ -201,8 +201,8 @@ export const SimpleList = ( _: secondaryText, }) : isElement(secondaryText) - ? secondaryText - : secondaryText(record, record.id)) + ? secondaryText + : secondaryText(record, record.id)) } /> {(rightAvatar || rightIcon) && ( diff --git ORI/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx ALT/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx index f9824c6..3742fa0 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx @@ -67,13 +67,13 @@ export const DatagridConfigurable = ({ child.props.label && typeof child.props.label === 'string' // this list is serializable, so we can't store ReactElement in it ? child.props.label : child.props.source - ? // force the label to be the source - undefined - : // no source or label, generate a label - translate('ra.configurable.Datagrid.unlabeled', { - column: index, - _: `Unlabeled column #%{column}`, - }), + ? // force the label to be the source + undefined + : // no source or label, generate a label + translate('ra.configurable.Datagrid.unlabeled', { + column: index, + _: `Unlabeled column #%{column}`, + }), })); if (columns.length !== availableColumns.length) { setAvailableColumns(columns); diff --git ORI/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx ALT/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx index 07bdfef..a9982be 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx @@ -122,8 +122,8 @@ export const Pagination: FC = memo(props => { const ActionsComponent = actions ? actions // overridden by caller : !isLoading && total != null - ? PaginationActions // regular navigation - : undefined; // partial navigation (uses default TablePaginationActions) + ? PaginationActions // regular navigation + : undefined; // partial navigation (uses default TablePaginationActions) return (
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: typescript-eslint/typescript-eslint@4bf2d7360eaf74c9ef87b196ff4c459b8f50800b

Diff (410 lines) ```diff diff --git ORI/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts ALT/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts index dad8feb..212e3bc 100644 --- ORI/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts +++ ALT/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts @@ -177,11 +177,11 @@ export default createRule({ ), ) : replacements !== undefined - ? fixer.replaceTextRange( - [replacements.start, replacements.end], - replacements.text, - ) - : []; + ? fixer.replaceTextRange( + [replacements.start, replacements.end], + replacements.text, + ) + : []; }, }); }); diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts index 2d4d3f5..1cb6945 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts @@ -244,35 +244,35 @@ export default util.createRule({ (typeof options.align === 'object' ? options.align.on : typeof options.multiLine?.align === 'object' - ? options.multiLine.align.on - : options.multiLine?.align ?? options.align) ?? 'colon'; + ? options.multiLine.align.on + : options.multiLine?.align ?? options.align) ?? 'colon'; const beforeColon = (typeof options.align === 'object' ? options.align.beforeColon : options.multiLine - ? typeof options.multiLine.align === 'object' - ? options.multiLine.align.beforeColon - : options.multiLine.beforeColon - : options.beforeColon) ?? false; + ? typeof options.multiLine.align === 'object' + ? options.multiLine.align.beforeColon + : options.multiLine.beforeColon + : options.beforeColon) ?? false; const expectedWhitespaceBeforeColon = beforeColon ? 1 : 0; const afterColon = (typeof options.align === 'object' ? options.align.afterColon : options.multiLine - ? typeof options.multiLine.align === 'object' - ? options.multiLine.align.afterColon - : options.multiLine.afterColon - : options.afterColon) ?? true; + ? typeof options.multiLine.align === 'object' + ? options.multiLine.align.afterColon + : options.multiLine.afterColon + : options.afterColon) ?? true; const expectedWhitespaceAfterColon = afterColon ? 1 : 0; const mode = (typeof options.align === 'object' ? options.align.mode : options.multiLine - ? typeof options.multiLine.align === 'object' - ? // same behavior as in original rule - options.multiLine.align.mode ?? options.multiLine.mode - : options.multiLine.mode - : options.mode) ?? 'strict'; + ? typeof options.multiLine.align === 'object' + ? // same behavior as in original rule + options.multiLine.align.mode ?? options.multiLine.mode + : options.multiLine.mode + : options.mode) ?? 'strict'; for (const node of group) { if (isKeyTypeNode(node)) { @@ -307,8 +307,8 @@ export default util.createRule({ ? 'extraKey' : 'extraValue' : align === 'colon' - ? 'missingKey' - : 'missingValue', + ? 'missingKey' + : 'missingValue', fix: fixer => { if (difference > 0) { return fixer.removeRange([ @@ -344,8 +344,8 @@ export default util.createRule({ ? options.singleLine.beforeColon : options.beforeColon : options.multiLine - ? options.multiLine.beforeColon - : options.beforeColon) ?? false; + ? options.multiLine.beforeColon + : options.beforeColon) ?? false; const expectedWhitespaceBeforeColon = beforeColon ? 1 : 0; const afterColon = (singleLine @@ -353,8 +353,8 @@ export default util.createRule({ ? options.singleLine.afterColon : options.afterColon : options.multiLine - ? options.multiLine.afterColon - : options.afterColon) ?? true; + ? options.multiLine.afterColon + : options.afterColon) ?? true; const expectedWhitespaceAfterColon = afterColon ? 1 : 0; const mode = (singleLine @@ -362,8 +362,8 @@ export default util.createRule({ ? options.singleLine.mode : options.mode : options.multiLine - ? options.multiLine.mode - : options.mode) ?? 'strict'; + ? options.multiLine.mode + : options.mode) ?? 'strict'; if (isApplicable(node)) { checkBeforeColon(node, expectedWhitespaceBeforeColon, mode); diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts index cadd102..a9bbbdc 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts @@ -361,8 +361,8 @@ function getNodeType(node: Member): MemberKind | null { return node.value && functionExpressions.includes(node.value.type) ? 'method' : node.readonly - ? 'readonly-field' - : 'field'; + ? 'readonly-field' + : 'field'; case AST_NODE_TYPES.TSPropertySignature: return node.readonly ? 'readonly-field' : 'field'; case AST_NODE_TYPES.TSIndexSignature: @@ -520,8 +520,8 @@ function getRank( 'static' in node && node.static ? 'static' : abstract - ? 'abstract' - : 'instance'; + ? 'abstract' + : 'instance'; const accessibility = getAccessibility(node); // Collect all existing member groups that apply to this node... diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts index 93b2140..5bfc146 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts @@ -126,8 +126,8 @@ export default util.createRule({ parent?.type === AST_NODE_TYPES.TSInterfaceBody ? parent.body : parent?.type === AST_NODE_TYPES.TSTypeLiteral - ? parent.members - : []; + ? parent.members + : []; const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] = members.filter( diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts index c2b87cc..00d656f 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts @@ -172,8 +172,8 @@ function createValidator( custom?.match === true ? 'match' : custom?.match === false - ? 'not match' - : null, + ? 'not match' + : null, }; } diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts index d740341..725f260 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -98,15 +98,15 @@ export default util.createRule({ ...(useAutoFix ? { fix } : !mergedWithClassDeclaration - ? { - suggest: [ - { - messageId: 'noEmptyWithSuper', - fix, - }, - ], - } - : null), + ? { + suggest: [ + { + messageId: 'noEmptyWithSuper', + fix, + }, + ], + } + : null), }); } } diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index 9f938ac..6ad8a81 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -221,10 +221,10 @@ export default util.createRule<[Options], MessageIds>({ allowInGenericTypeArguments && allowAsThisParameter ? 'invalidVoidNotReturnOrThisParamOrGeneric' : allowInGenericTypeArguments - ? getNotReturnOrGenericMessageId(node) - : allowAsThisParameter - ? 'invalidVoidNotReturnOrThisParam' - : 'invalidVoidNotReturn', + ? getNotReturnOrGenericMessageId(node) + : allowAsThisParameter + ? 'invalidVoidNotReturnOrThisParam' + : 'invalidVoidNotReturn', node, }); }, diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts index ae6c56e..f3398a6 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts @@ -266,8 +266,8 @@ export default util.createRule({ : 'comparingNullableToTrueDirect' : 'comparingNullableToFalse' : comparison.negated - ? 'negated' - : 'direct', + ? 'negated' + : 'direct', node, }); }, diff --git ORI/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts ALT/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts index 30132f9..eddf23b 100644 --- ORI/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts +++ ALT/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts @@ -103,10 +103,10 @@ function reducer( const usedSetting = settings.errorLevel ? settings.errorLevel : !recommendation - ? DEFAULT_RULE_SETTING - : recommendation === 'strict' - ? 'warn' - : recommendation; + ? DEFAULT_RULE_SETTING + : recommendation === 'strict' + ? 'warn' + : recommendation; if (BASE_RULES_TO_BE_OVERRIDDEN.has(key)) { const baseRuleName = BASE_RULES_TO_BE_OVERRIDDEN.get(key)!; diff --git ORI/typescript-eslint/packages/typescript-estree/src/convert.ts ALT/typescript-eslint/packages/typescript-estree/src/convert.ts index 71fe614..882f40a 100644 --- ORI/typescript-eslint/packages/typescript-estree/src/convert.ts +++ ALT/typescript-eslint/packages/typescript-estree/src/convert.ts @@ -2643,8 +2643,8 @@ export class Converter { node.kind === SyntaxKind.ConstructSignature ? AST_NODE_TYPES.TSConstructSignatureDeclaration : node.kind === SyntaxKind.CallSignature - ? AST_NODE_TYPES.TSCallSignatureDeclaration - : AST_NODE_TYPES.TSFunctionType; + ? AST_NODE_TYPES.TSCallSignatureDeclaration + : AST_NODE_TYPES.TSFunctionType; const result = this.createNode< | TSESTree.TSFunctionType | TSESTree.TSCallSignatureDeclaration @@ -2672,8 +2672,8 @@ export class Converter { parentKind === SyntaxKind.InterfaceDeclaration ? AST_NODE_TYPES.TSInterfaceHeritage : parentKind === SyntaxKind.HeritageClause - ? AST_NODE_TYPES.TSClassImplements - : AST_NODE_TYPES.TSInstantiationExpression; + ? AST_NODE_TYPES.TSClassImplements + : AST_NODE_TYPES.TSInstantiationExpression; const result = this.createNode< | TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements diff --git ORI/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts ALT/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts index 7518b0b..a7d862a 100644 --- ORI/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ ALT/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -36,8 +36,8 @@ export function createParseSettings( options.debugLevel === true ? new Set(['typescript-eslint']) : Array.isArray(options.debugLevel) - ? new Set(options.debugLevel) - : new Set(), + ? new Set(options.debugLevel) + : new Set(), errorOnTypeScriptSyntacticAndSemanticIssues: false, errorOnUnknownASTType: options.errorOnUnknownASTType === true, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: @@ -59,8 +59,8 @@ export function createParseSettings( typeof options.loggerFn === 'function' ? options.loggerFn : options.loggerFn === false - ? (): void => {} - : console.log, // eslint-disable-line no-console + ? (): void => {} + : console.log, // eslint-disable-line no-console moduleResolver: options.moduleResolver ?? '', preserveNodeMaps: options.preserveNodeMaps !== false, programs: Array.isArray(options.programs) ? options.programs : null, diff --git ORI/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts ALT/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts index 0f286ef..7f3e7e8 100644 --- ORI/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts +++ ALT/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts @@ -405,8 +405,8 @@ describe('parseAndGenerateServices', () => { ext === '.json' ? '{ "x": 1 }' : jsxContent - ? 'const x =
;' - : 'const x = 1'; + ? 'const x =
;' + : 'const x = 1'; it(`should parse ${ext} file - ${ jsxContent ? 'with' : 'without' } JSX content - parserOptions.jsx = ${jsxSetting}`, () => { diff --git ORI/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts ALT/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts index bcb80ec..4aca4b0 100644 --- ORI/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts +++ ALT/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts @@ -9,8 +9,8 @@ type InferOptionsTypeFromRule = T extends RuleModule< > ? TOptions : T extends RuleCreateFunction - ? TOptions - : unknown; + ? TOptions + : unknown; /** * Uses type inference to fetch the TMessageIds type from the given RuleModule @@ -21,7 +21,7 @@ type InferMessageIdsTypeFromRule = T extends RuleModule< > ? TMessageIds : T extends RuleCreateFunction - ? TMessageIds - : unknown; + ? TMessageIds + : unknown; export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule }; diff --git ORI/typescript-eslint/packages/website/plugins/generated-rule-docs.ts ALT/typescript-eslint/packages/website/plugins/generated-rule-docs.ts index 2e5a325..cdc39d6 100644 --- ORI/typescript-eslint/packages/website/plugins/generated-rule-docs.ts +++ ALT/typescript-eslint/packages/website/plugins/generated-rule-docs.ts @@ -258,16 +258,16 @@ export const generatedRuleDocs: Plugin = () => { meta.schema instanceof Array ? meta.schema[0] : meta.schema.type === 'array' - ? { - ...(meta.schema.definitions - ? { definitions: meta.schema.definitions } - : {}), - ...(meta.schema.$defs - ? { $defs: (meta.schema as JSONSchema7).$defs } - : {}), - ...(meta.schema.prefixItems as [JSONSchema])[0], - } - : meta.schema; + ? { + ...(meta.schema.definitions + ? { definitions: meta.schema.definitions } + : {}), + ...(meta.schema.$defs + ? { $defs: (meta.schema as JSONSchema7).$defs } + : {}), + ...(meta.schema.prefixItems as [JSONSchema])[0], + } + : meta.schema; children.splice( optionsH2Index + 1, diff --git ORI/typescript-eslint/packages/website/src/components/ast/utils.ts ALT/typescript-eslint/packages/website/src/components/ast/utils.ts index de55a5c..936e647 100644 --- ORI/typescript-eslint/packages/website/src/components/ast/utils.ts +++ ALT/typescript-eslint/packages/website/src/components/ast/utils.ts @@ -60,8 +60,8 @@ export function hasChildInRange( item.model.type === 'object' ? isInRange(position, item.model) : item.model.type === 'array' - ? isArrayInRange(position, item.model) - : false, + ? isArrayInRange(position, item.model) + : false, ), ); } diff --git ORI/typescript-eslint/packages/website/src/components/linter/utils.ts ALT/typescript-eslint/packages/website/src/components/linter/utils.ts index e2a4b3e..ff90ded 100644 --- ORI/typescript-eslint/packages/website/src/components/linter/utils.ts +++ ALT/typescript-eslint/packages/website/src/components/linter/utils.ts @@ -89,8 +89,8 @@ export function parseMarkers( marker.owner === 'eslint' ? code.value : marker.owner === 'typescript' - ? 'TypeScript' - : marker.owner; + ? 'TypeScript' + : marker.owner; if (!result[group]) { result[group] = { ```
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: vega/vega-lite@c9659206602eda1d894702a2a1f5b526b9832f9f

Diff (321 lines) ```diff diff --git ORI/vega-lite/src/channel.ts ALT/vega-lite/src/channel.ts index 289cc69..a359383 100644 --- ORI/vega-lite/src/channel.ts +++ ALT/vega-lite/src/channel.ts @@ -219,16 +219,16 @@ export function isSecondaryRangeChannel(c: ExtendedChannel): c is SecondaryRange export type MainChannelOf = C extends 'x2' ? 'x' : C extends 'y2' - ? 'y' - : C extends 'latitude2' - ? 'latitude' - : C extends 'longitude2' - ? 'longitude' - : C extends 'theta2' - ? 'theta' - : C extends 'radius2' - ? 'radius' - : C; + ? 'y' + : C extends 'latitude2' + ? 'latitude' + : C extends 'longitude2' + ? 'longitude' + : C extends 'theta2' + ? 'theta' + : C extends 'radius2' + ? 'radius' + : C; /** * Get the main channel for a range channel. E.g. `x` for `x2`. @@ -254,16 +254,16 @@ export function getMainRangeChannel(channel: C): Main export type SecondaryChannelOf = C extends 'x' ? 'x2' : C extends 'y' - ? 'y2' - : C extends 'latitude' - ? 'latitude2' - : C extends 'longitude' - ? 'longitude2' - : C extends 'theta' - ? 'theta2' - : C extends 'radius' - ? 'radius2' - : undefined; + ? 'y2' + : C extends 'latitude' + ? 'latitude2' + : C extends 'longitude' + ? 'longitude2' + : C extends 'theta' + ? 'theta2' + : C extends 'radius' + ? 'radius2' + : undefined; export function getVgPositionChannel(channel: PolarPositionChannel | PositionChannel) { if (isPolarPositionChannel(channel)) { diff --git ORI/vega-lite/src/channeldef.ts ALT/vega-lite/src/channeldef.ts index 77ed5a2..3cfd86f 100644 --- ORI/vega-lite/src/channeldef.ts +++ ALT/vega-lite/src/channeldef.ts @@ -1097,10 +1097,10 @@ export function initFieldOrDatumDef( const guideType = isPositionFieldOrDatumDef(fd) ? 'axis' : isMarkPropFieldOrDatumDef(fd) - ? 'legend' - : isFacetFieldDef(fd) - ? 'header' - : null; + ? 'legend' + : isFacetFieldDef(fd) + ? 'header' + : null; if (guideType && fd[guideType]) { const {format, formatType, ...newGuide} = fd[guideType]; if (isCustomFormatType(formatType) && !config.customFormatTypes) { diff --git ORI/vega-lite/src/compile/axis/config.ts ALT/vega-lite/src/compile/axis/config.ts index ee6b002..2f242bb 100644 --- ORI/vega-lite/src/compile/axis/config.ts +++ ALT/vega-lite/src/compile/axis/config.ts @@ -55,12 +55,12 @@ export function getAxisConfigs( scaleType === 'band' ? ['axisDiscrete', 'axisBand'] : scaleType === 'point' - ? ['axisDiscrete', 'axisPoint'] - : isQuantitative(scaleType) - ? ['axisQuantitative'] - : scaleType === 'time' || scaleType === 'utc' - ? ['axisTemporal'] - : []; + ? ['axisDiscrete', 'axisPoint'] + : isQuantitative(scaleType) + ? ['axisQuantitative'] + : scaleType === 'time' || scaleType === 'utc' + ? ['axisTemporal'] + : []; const axisChannel = channel === 'x' ? 'axisX' : 'axisY'; const axisOrient = isSignalRef(orient) ? 'axisOrient' : `axis${titleCase(orient)}`; // axisTop, axisBottom, ... diff --git ORI/vega-lite/src/compile/data/facet.ts ALT/vega-lite/src/compile/data/facet.ts index 4c3e581..a501aa4 100644 --- ORI/vega-lite/src/compile/data/facet.ts +++ ALT/vega-lite/src/compile/data/facet.ts @@ -63,8 +63,8 @@ export class FacetNode extends DataFlowNode { ...(isSortField(sort) ? {sortField: sort} : isArray(sort) - ? {sortIndexField: sortArrayIndexField(fieldDef, channel)} - : {}) + ? {sortIndexField: sortArrayIndexField(fieldDef, channel)} + : {}) }; } } @@ -231,8 +231,8 @@ export class FacetNode extends DataFlowNode { ? {signal: `ceil(${cardinality} / ${columns})`} : 1 : columns - ? {signal: `min(${cardinality}, ${columns})`} - : {signal: cardinality}; + ? {signal: `min(${cardinality}, ${columns})`} + : {signal: cardinality}; data.push({ name: `${this.facet.name}_${headerChannel}`, diff --git ORI/vega-lite/src/compile/data/geojson.ts ALT/vega-lite/src/compile/data/geojson.ts index d60f5d5..6e47d59 100644 --- ORI/vega-lite/src/compile/data/geojson.ts +++ ALT/vega-lite/src/compile/data/geojson.ts @@ -29,10 +29,10 @@ export class GeoJSONNode extends DataFlowNode { return isFieldDef(def) ? def.field : isDatumDef(def) - ? {expr: `${def.datum}`} - : isValueDef(def) - ? {expr: `${def['value']}`} - : undefined; + ? {expr: `${def.datum}`} + : isValueDef(def) + ? {expr: `${def['value']}`} + : undefined; }) as [GeoPositionChannel, GeoPositionChannel]; if (pair[0] || pair[1]) { diff --git ORI/vega-lite/src/compile/data/geopoint.ts ALT/vega-lite/src/compile/data/geopoint.ts index 282e4a7..a885913 100644 --- ORI/vega-lite/src/compile/data/geopoint.ts +++ ALT/vega-lite/src/compile/data/geopoint.ts @@ -35,10 +35,10 @@ export class GeoPointNode extends DataFlowNode { return isFieldDef(def) ? def.field : isDatumDef(def) - ? {expr: `${def.datum}`} - : isValueDef(def) - ? {expr: `${def['value']}`} - : undefined; + ? {expr: `${def.datum}`} + : isValueDef(def) + ? {expr: `${def['value']}`} + : undefined; }) as [GeoPositionChannel, GeoPositionChannel]; const suffix = coordinates[0] === LONGITUDE2 ? '2' : ''; diff --git ORI/vega-lite/src/compile/mark/encode/position-rect.ts ALT/vega-lite/src/compile/mark/encode/position-rect.ts index 72cc218..f1b09d5 100644 --- ORI/vega-lite/src/compile/mark/encode/position-rect.ts +++ ALT/vega-lite/src/compile/mark/encode/position-rect.ts @@ -210,10 +210,10 @@ function positionAndSize( ? 0 : 0.5 : isSignalRef(bandSize) - ? {signal: `(1-${bandSize})/2`} - : isRelativeBandSize(bandSize) - ? (1 - bandSize.band) / 2 - : 0 + ? {signal: `(1-${bandSize})/2`} + : isRelativeBandSize(bandSize) + ? (1 - bandSize.band) / 2 + : 0 }); if (vgSizeChannel) { @@ -328,8 +328,8 @@ function rectBinPosition({ const bandPosition = isSignalRef(bandSize) ? {signal: `(1-${bandSize.signal})/2`} : isRelativeBandSize(bandSize) - ? (1 - bandSize.band) / 2 - : 0.5; + ? (1 - bandSize.band) / 2 + : 0.5; if (isBinning(fieldDef.bin) || fieldDef.timeUnit) { return { diff --git ORI/vega-lite/src/compile/selection/project.ts ALT/vega-lite/src/compile/selection/project.ts index 0cd9136..0fee2a1 100644 --- ORI/vega-lite/src/compile/selection/project.ts +++ ALT/vega-lite/src/compile/selection/project.ts @@ -157,8 +157,8 @@ const project: SelectionCompiler = { hasContinuousDomain(model.getScaleComponent(channel).get('type')) ? 'R' : fieldDef.bin - ? 'R-RE' - : 'E'; + ? 'R-RE' + : 'E'; const p: SelectionProjection = {field, channel, type: tplType, index: proj.items.length}; p.signals = {...signalName(p, 'data'), ...signalName(p, 'visual')}; diff --git ORI/vega-lite/src/compile/selection/translate.ts ALT/vega-lite/src/compile/selection/translate.ts index 0c2602c..25cce1a 100644 --- ORI/vega-lite/src/compile/selection/translate.ts +++ ALT/vega-lite/src/compile/selection/translate.ts @@ -92,19 +92,19 @@ function onDelta( !boundScales || !scaleCmpt ? 'panLinear' : scaleType === 'log' - ? 'panLog' - : scaleType === 'symlog' - ? 'panSymlog' - : scaleType === 'pow' - ? 'panPow' - : 'panLinear'; + ? 'panLog' + : scaleType === 'symlog' + ? 'panSymlog' + : scaleType === 'pow' + ? 'panPow' + : 'panLinear'; const arg = !boundScales ? '' : scaleType === 'pow' - ? `, ${scaleCmpt.get('exponent') ?? 1}` - : scaleType === 'symlog' - ? `, ${scaleCmpt.get('constant') ?? 1}` - : ''; + ? `, ${scaleCmpt.get('exponent') ?? 1}` + : scaleType === 'symlog' + ? `, ${scaleCmpt.get('constant') ?? 1}` + : ''; const update = `${panFn}(${extent}, ${offset}${arg})`; signal.on.push({ diff --git ORI/vega-lite/src/compile/selection/zoom.ts ALT/vega-lite/src/compile/selection/zoom.ts index b839130..a75a370 100644 --- ORI/vega-lite/src/compile/selection/zoom.ts +++ ALT/vega-lite/src/compile/selection/zoom.ts @@ -93,19 +93,19 @@ function onDelta( !boundScales || !scaleCmpt ? 'zoomLinear' : scaleType === 'log' - ? 'zoomLog' - : scaleType === 'symlog' - ? 'zoomSymlog' - : scaleType === 'pow' - ? 'zoomPow' - : 'zoomLinear'; + ? 'zoomLog' + : scaleType === 'symlog' + ? 'zoomSymlog' + : scaleType === 'pow' + ? 'zoomPow' + : 'zoomLinear'; const arg = !boundScales ? '' : scaleType === 'pow' - ? `, ${scaleCmpt.get('exponent') ?? 1}` - : scaleType === 'symlog' - ? `, ${scaleCmpt.get('constant') ?? 1}` - : ''; + ? `, ${scaleCmpt.get('exponent') ?? 1}` + : scaleType === 'symlog' + ? `, ${scaleCmpt.get('constant') ?? 1}` + : ''; const update = `${zoomFn}(${base}, ${anchor}, ${delta}${arg})`; signal.on.push({ diff --git ORI/vega-lite/src/compositemark/errorbar.ts ALT/vega-lite/src/compositemark/errorbar.ts index 13e0e12..527efd4 100644 --- ORI/vega-lite/src/compositemark/errorbar.ts +++ ALT/vega-lite/src/compositemark/errorbar.ts @@ -446,10 +446,10 @@ function errorBarAggregationAndCalculation< const center: ErrorBarCenter = markDef.center ? markDef.center : markDef.extent - ? markDef.extent === 'iqr' - ? 'median' - : 'mean' - : config.errorbar.center; + ? markDef.extent === 'iqr' + ? 'median' + : 'mean' + : config.errorbar.center; const extent: ErrorBarExtent = markDef.extent ? markDef.extent : center === 'mean' ? 'stderr' : 'iqr'; if ((center === 'median') !== (extent === 'iqr')) { diff --git ORI/vega-lite/src/selection.ts ALT/vega-lite/src/selection.ts index f0f8590..7a6f7af 100644 --- ORI/vega-lite/src/selection.ts +++ ALT/vega-lite/src/selection.ts @@ -222,8 +222,8 @@ export interface SelectionParameter { value?: T extends 'point' ? SelectionInit | SelectionInitMapping[] : T extends 'interval' - ? SelectionInitIntervalMapping - : never; + ? SelectionInitIntervalMapping + : never; /** * When set, a selection is populated by input elements (also known as dynamic query widgets) @@ -240,8 +240,8 @@ export interface SelectionParameter { bind?: T extends 'point' ? Binding | Record | LegendBinding : T extends 'interval' - ? 'scales' - : never; + ? 'scales' + : never; } export type TopLevelSelectionParameter = SelectionParameter & { ```
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: mdn/content@c5dd9c3b9d503a56dc04b6b8f88e89194dc82d7f

Diff (253 lines) ````diff diff --git ORI/content/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md ALT/content/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md index ba7c4182..d152c391 100644 --- ORI/content/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md +++ ALT/content/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md @@ -74,9 +74,8 @@ function generatePrimes(quota) { document.querySelector("#generate").addEventListener("click", () => { const quota = document.querySelector("#quota").value; const primes = generatePrimes(quota); - document.querySelector( - "#output", - ).textContent = `Finished generating ${quota} primes!`; + document.querySelector("#output").textContent = + `Finished generating ${quota} primes!`; }); document.querySelector("#reload").addEventListener("click", () => { @@ -158,9 +157,8 @@ document.querySelector("#generate").addEventListener("click", () => { // update the output box with a message for the user, including the number of // primes that were generated, taken from the message data. worker.addEventListener("message", (message) => { - document.querySelector( - "#output", - ).textContent = `Finished generating ${message.data} primes!`; + document.querySelector("#output").textContent = + `Finished generating ${message.data} primes!`; }); document.querySelector("#reload").addEventListener("click", () => { diff --git ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md index 7dc1d6ff..bc85ae8c 100644 --- ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md +++ ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md @@ -477,8 +477,8 @@ We will also use the `Filter` enum in the `Todos.svelte` component. filter === Filter.ACTIVE ? todos.filter((t) => !t.completed) : filter === Filter.COMPLETED - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; $: { if (filter === Filter.ALL) { @@ -551,8 +551,8 @@ We will also use the `Filter` enum in the `Todos.svelte` component. filter === Filter.ACTIVE ? todos.filter((t) => !t.completed) : filter === Filter.COMPLETED - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; $: { if (filter === Filter.ALL) { diff --git ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md index f2866dc1..5fb0a9a6 100644 --- ORI/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md +++ ALT/content/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md @@ -391,8 +391,8 @@ Finally for this article, let's implement the ability to filter our to-dos by st filter === "active" ? todos.filter((t) => !t.completed) : filter === "completed" - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; ``` We use the `filter` variable to control the active filter: _all_, _active_, or _completed_. Just assigning one of these values to the filter variable will activate the filter and update the list of to-dos. Let's see how to achieve this. diff --git ORI/content/files/en-us/web/api/batterymanager/chargingtime/index.md ALT/content/files/en-us/web/api/batterymanager/chargingtime/index.md index 61ce789f..7be36c3f 100644 --- ORI/content/files/en-us/web/api/batterymanager/chargingtime/index.md +++ ALT/content/files/en-us/web/api/batterymanager/chargingtime/index.md @@ -34,9 +34,8 @@ A number. navigator.getBattery().then((battery) => { const time = battery.chargingTime; - document.querySelector( - "#chargingTime", - ).textContent = `Time to fully charge the battery: ${time}s`; + document.querySelector("#chargingTime").textContent = + `Time to fully charge the battery: ${time}s`; }); ``` diff --git ORI/content/files/en-us/web/api/batterymanager/dischargingtime/index.md ALT/content/files/en-us/web/api/batterymanager/dischargingtime/index.md index 011eacb5..ae0883f0 100644 --- ORI/content/files/en-us/web/api/batterymanager/dischargingtime/index.md +++ ALT/content/files/en-us/web/api/batterymanager/dischargingtime/index.md @@ -36,9 +36,8 @@ A number. navigator.getBattery().then((battery) => { const time = battery.dischargingTime; - document.querySelector( - "#dischargingTime", - ).textContent = `Remaining time to fully discharge the battery: ${time}`; + document.querySelector("#dischargingTime").textContent = + `Remaining time to fully discharge the battery: ${time}`; }); ``` diff --git ORI/content/files/en-us/web/api/batterymanager/levelchange_event/index.md ALT/content/files/en-us/web/api/batterymanager/levelchange_event/index.md index c7b43a83..1ae9271c 100644 --- ORI/content/files/en-us/web/api/batterymanager/levelchange_event/index.md +++ ALT/content/files/en-us/web/api/batterymanager/levelchange_event/index.md @@ -45,9 +45,8 @@ navigator.getBattery().then((battery) => { battery.chargingTime / 60 }`; } else { - document.querySelector( - "#stateBattery", - ).textContent = `Discharging time: ${battery.dischargingTime / 60}`; + document.querySelector("#stateBattery").textContent = + `Discharging time: ${battery.dischargingTime / 60}`; } }; }); diff --git ORI/content/files/en-us/web/api/document/createtreewalker/index.md ALT/content/files/en-us/web/api/document/createtreewalker/index.md index ea16982b..de024164 100644 --- ORI/content/files/en-us/web/api/document/createtreewalker/index.md +++ ALT/content/files/en-us/web/api/document/createtreewalker/index.md @@ -148,8 +148,8 @@ const treeWalker = document.createTreeWalker( node.classList.contains("no-escape") ? NodeFilter.FILTER_REJECT : node.closest(".escape") - ? NodeFilter.FILTER_ACCEPT - : NodeFilter.FILTER_SKIP, + ? NodeFilter.FILTER_ACCEPT + : NodeFilter.FILTER_SKIP, ); let currentNode; diff --git ORI/content/files/en-us/web/api/htmlmarqueeelement/index.md ALT/content/files/en-us/web/api/htmlmarqueeelement/index.md index 6da2a8f0..8477e88b 100644 --- ORI/content/files/en-us/web/api/htmlmarqueeelement/index.md +++ ALT/content/files/en-us/web/api/htmlmarqueeelement/index.md @@ -73,7 +73,7 @@ _Inherits methods from its parent, {{DOMxRef("HTMLElement")}}._ height="200" behavior="alternate" style="border:solid"> - This text will bounce + This text will bounce ``` diff --git ORI/content/files/en-us/web/api/keyboardevent/metakey/index.md ALT/content/files/en-us/web/api/keyboardevent/metakey/index.md index 6d3ca5fd..5ac693fd 100644 --- ORI/content/files/en-us/web/api/keyboardevent/metakey/index.md +++ ALT/content/files/en-us/web/api/keyboardevent/metakey/index.md @@ -33,9 +33,8 @@ A boolean value. ```js function ismetaKey(e) { - document.querySelector( - "#output", - ).textContent = `metaKey pressed? ${e.metaKey}`; + document.querySelector("#output").textContent = + `metaKey pressed? ${e.metaKey}`; } ``` diff --git ORI/content/files/en-us/web/api/response/json/index.md ALT/content/files/en-us/web/api/response/json/index.md index d610ce0e..44312c06 100644 --- ORI/content/files/en-us/web/api/response/json/index.md +++ ALT/content/files/en-us/web/api/response/json/index.md @@ -49,9 +49,8 @@ fetch(myRequest) listItem.appendChild(document.createElement("strong")).textContent = product.Name; listItem.append(` can be found in ${product.Location}. Cost: `); - listItem.appendChild( - document.createElement("strong"), - ).textContent = `£${product.Price}`; + listItem.appendChild(document.createElement("strong")).textContent = + `£${product.Price}`; myList.appendChild(listItem); } }) diff --git ORI/content/files/en-us/web/api/rtcdatachannel/label/index.md ALT/content/files/en-us/web/api/rtcdatachannel/label/index.md index ac15fa0f..9dfe3a30 100644 --- ORI/content/files/en-us/web/api/rtcdatachannel/label/index.md +++ ALT/content/files/en-us/web/api/rtcdatachannel/label/index.md @@ -39,9 +39,8 @@ const dc = pc.createDataChannel("my channel"); // … -document.getElementById( - "channel-name", -).innerHTML = `${dc.label}`; +document.getElementById("channel-name").innerHTML = + `${dc.label}`; ``` ## Specifications diff --git ORI/content/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md ALT/content/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md index 1f472756..0c53c0ae 100644 --- ORI/content/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md +++ ALT/content/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md @@ -97,9 +97,8 @@ function setupWebGL(evt) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { const linkErrLog = gl.getProgramInfoLog(program); cleanup(); - document.querySelector( - "p", - ).textContent = `Shader program did not link successfully. Error log: ${linkErrLog}`; + document.querySelector("p").textContent = + `Shader program did not link successfully. Error log: ${linkErrLog}`; return; } diff --git ORI/content/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md ALT/content/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md index ad7acf56..b193e111 100644 --- ORI/content/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md +++ ALT/content/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md @@ -102,9 +102,8 @@ function setupWebGL(evt) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { const linkErrLog = gl.getProgramInfoLog(program); cleanup(); - document.querySelector( - "p", - ).textContent = `Shader program did not link successfully. Error log: ${linkErrLog}`; + document.querySelector("p").textContent = + `Shader program did not link successfully. Error log: ${linkErrLog}`; return; } diff --git ORI/content/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md ALT/content/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md index bbdbe999..4fe34fe6 100644 --- ORI/content/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md +++ ALT/content/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md @@ -108,9 +108,8 @@ function setupWebGL(evt) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { const linkErrLog = gl.getProgramInfoLog(program); cleanup(); - document.querySelector( - "p", - ).textContent = `Shader program did not link successfully. Error log: ${linkErrLog}`; + document.querySelector("p").textContent = + `Shader program did not link successfully. Error log: ${linkErrLog}`; return; } initializeAttributes(); diff --git ORI/content/files/en-us/web/html/element/marquee/index.md ALT/content/files/en-us/web/html/element/marquee/index.md index 2c30f9cf..4fd0366f 100644 --- ORI/content/files/en-us/web/html/element/marquee/index.md +++ ALT/content/files/en-us/web/html/element/marquee/index.md @@ -65,7 +65,7 @@ The **``** [HTML](/en-US/docs/Web/HTML) element is used to insert a scr height="200" behavior="alternate" style="border:solid"> - This text will bounce + This text will bounce ``` ````
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: vuejs/eslint-plugin-vue@2aa9ac45a4ea66c293b3e7cbfd6ad076afa39bb5

The diff is empty.

github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: excalidraw/excalidraw@3ddcc48e4c192f525930e503b3e9214627f0043d

Diff (322 lines) ```diff diff --git ORI/excalidraw/src/actions/actionFinalize.tsx ALT/excalidraw/src/actions/actionFinalize.tsx index 3508de0..d7147c5 100644 --- ORI/excalidraw/src/actions/actionFinalize.tsx +++ ALT/excalidraw/src/actions/actionFinalize.tsx @@ -65,8 +65,8 @@ export const actionFinalize = register({ const multiPointElement = appState.multiElement ? appState.multiElement : appState.editingElement?.type === "freedraw" - ? appState.editingElement - : null; + ? appState.editingElement + : null; if (multiPointElement) { // pen and mouse have hover diff --git ORI/excalidraw/src/components/App.tsx ALT/excalidraw/src/components/App.tsx index 4960990..b5abc44 100644 --- ORI/excalidraw/src/components/App.tsx +++ ALT/excalidraw/src/components/App.tsx @@ -1951,14 +1951,14 @@ class App extends React.Component { typeof opts.position === "object" ? opts.position.clientX : opts.position === "cursor" - ? this.lastViewportPosition.x - : this.state.width / 2 + this.state.offsetLeft; + ? this.lastViewportPosition.x + : this.state.width / 2 + this.state.offsetLeft; const clientY = typeof opts.position === "object" ? opts.position.clientY : opts.position === "cursor" - ? this.lastViewportPosition.y - : this.state.height / 2 + this.state.offsetTop; + ? this.lastViewportPosition.y + : this.state.height / 2 + this.state.offsetTop; const { x, y } = viewportCoordsToSceneCoords( { clientX, clientY }, diff --git ORI/excalidraw/src/components/ColorPicker/ColorPicker.tsx ALT/excalidraw/src/components/ColorPicker/ColorPicker.tsx index d2f89c8..818a903 100644 --- ORI/excalidraw/src/components/ColorPicker/ColorPicker.tsx +++ ALT/excalidraw/src/components/ColorPicker/ColorPicker.tsx @@ -38,8 +38,8 @@ export const getColor = (color: string): string | null => { return isValidColor(`#${color}`) ? `#${color}` : isValidColor(color) - ? color - : null; + ? color + : null; }; interface ColorPickerProps { diff --git ORI/excalidraw/src/components/ColorPicker/Picker.tsx ALT/excalidraw/src/components/ColorPicker/Picker.tsx index a2e1752..65152b4 100644 --- ORI/excalidraw/src/components/ColorPicker/Picker.tsx +++ ALT/excalidraw/src/components/ColorPicker/Picker.tsx @@ -74,10 +74,10 @@ export const Picker = ({ isCustomButNotInList ? "hex" : isCustom - ? "custom" - : colorObj?.shade != null - ? "shades" - : "baseColors", + ? "custom" + : colorObj?.shade != null + ? "shades" + : "baseColors", ); } }, [ diff --git ORI/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts ALT/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts index 95ee7be..549154e 100644 --- ORI/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts +++ ALT/excalidraw/src/components/ColorPicker/keyboardNavHandlers.ts @@ -181,8 +181,8 @@ export const colorPickerKeyNavHandler = ({ activeSectionIndex + indexOffset > sections.length - 1 ? 0 : activeSectionIndex + indexOffset < 0 - ? sections.length - 1 - : activeSectionIndex + indexOffset; + ? sections.length - 1 + : activeSectionIndex + indexOffset; const nextSection = sections[nextSectionIndex]; diff --git ORI/excalidraw/src/data/encryption.ts ALT/excalidraw/src/data/encryption.ts index 33e6899..25809b4 100644 --- ORI/excalidraw/src/data/encryption.ts +++ ALT/excalidraw/src/data/encryption.ts @@ -57,10 +57,10 @@ export const encryptData = async ( typeof data === "string" ? new TextEncoder().encode(data) : data instanceof Uint8Array - ? data - : data instanceof Blob - ? await blobToArrayBuffer(data) - : data; + ? data + : data instanceof Blob + ? await blobToArrayBuffer(data) + : data; // We use symmetric encryption. AES-GCM is the recommended algorithm and // includes checks that the ciphertext has not been modified by an attacker. diff --git ORI/excalidraw/src/data/restore.ts ALT/excalidraw/src/data/restore.ts index 5f2adc0..d0d903b 100644 --- ORI/excalidraw/src/data/restore.ts +++ ALT/excalidraw/src/data/restore.ts @@ -131,14 +131,14 @@ const restoreElementWithProperties = < roundness: element.roundness ? element.roundness : element.strokeSharpness === "round" - ? { - // for old elements that would now use adaptive radius algo, - // use legacy algo instead - type: isUsingAdaptiveRadius(element.type) - ? ROUNDNESS.LEGACY - : ROUNDNESS.PROPORTIONAL_RADIUS, - } - : null, + ? { + // for old elements that would now use adaptive radius algo, + // use legacy algo instead + type: isUsingAdaptiveRadius(element.type) + ? ROUNDNESS.LEGACY + : ROUNDNESS.PROPORTIONAL_RADIUS, + } + : null, boundElements: element.boundElementIds ? element.boundElementIds.map((id) => ({ type: "arrow", id })) : element.boundElements ?? [], @@ -510,8 +510,8 @@ export const restoreAppState = ( suppliedValue !== undefined ? suppliedValue : localValue !== undefined - ? localValue - : defaultValue; + ? localValue + : defaultValue; } return { @@ -539,8 +539,8 @@ export const restoreAppState = ( value: appState.zoom as NormalizedZoomValue, } : appState.zoom?.value - ? appState.zoom - : defaultAppState.zoom, + ? appState.zoom + : defaultAppState.zoom, openSidebar: // string (legacy) typeof (appState.openSidebar as any as string) === "string" diff --git ORI/excalidraw/src/element/binding.ts ALT/excalidraw/src/element/binding.ts index b175f14..fbe22e0 100644 --- ORI/excalidraw/src/element/binding.ts +++ ALT/excalidraw/src/element/binding.ts @@ -486,10 +486,10 @@ export const getEligibleElementsForBinding = ( (element) => !includedElementIds.has(element.id), ) as SuggestedBinding[]) : isBindableElement(element, false) - ? getElligibleElementsForBindableElementAndWhere(element).filter( - (binding) => !includedElementIds.has(binding[0].id), - ) - : [], + ? getElligibleElementsForBindableElementAndWhere(element).filter( + (binding) => !includedElementIds.has(binding[0].id), + ) + : [], ); }; diff --git ORI/excalidraw/src/element/collision.ts ALT/excalidraw/src/element/collision.ts index f160783..48e1be8 100644 --- ORI/excalidraw/src/element/collision.ts +++ ALT/excalidraw/src/element/collision.ts @@ -153,8 +153,8 @@ export const isHittingElementNotConsideringBoundingBox = ( const check = isTextElement(element) ? isStrictlyInside : isElementDraggableFromInside(element) - ? isInsideCheck - : isNearCheck; + ? isInsideCheck + : isNearCheck; return hitTestPointAgainstElement({ element, point, diff --git ORI/excalidraw/src/element/linearElementEditor.ts ALT/excalidraw/src/element/linearElementEditor.ts index 74275f4..d39cecb 100644 --- ORI/excalidraw/src/element/linearElementEditor.ts +++ ALT/excalidraw/src/element/linearElementEditor.ts @@ -389,8 +389,8 @@ export class LinearElementEditor { ) : selectedPointsIndices : selectedPointsIndices?.includes(pointerDownState.lastClickedPoint) - ? [pointerDownState.lastClickedPoint] - : selectedPointsIndices, + ? [pointerDownState.lastClickedPoint] + : selectedPointsIndices, isDragging: false, pointerOffset: { x: 0, y: 0 }, }; diff --git ORI/excalidraw/src/element/newElement.ts ALT/excalidraw/src/element/newElement.ts index 848a6af..a3b08d7 100644 --- ORI/excalidraw/src/element/newElement.ts +++ ALT/excalidraw/src/element/newElement.ts @@ -161,8 +161,8 @@ const getTextElementPositionOffsets = ( opts.textAlign === "center" ? metrics.width / 2 : opts.textAlign === "right" - ? metrics.width - : 0, + ? metrics.width + : 0, y: opts.verticalAlign === "middle" ? metrics.height / 2 : 0, }; }; diff --git ORI/excalidraw/src/renderer/renderElement.ts ALT/excalidraw/src/renderer/renderElement.ts index 0efe5df..3f12394 100644 --- ORI/excalidraw/src/renderer/renderElement.ts +++ ALT/excalidraw/src/renderer/renderElement.ts @@ -336,8 +336,8 @@ const drawElementOnCanvas = ( element.textAlign === "center" ? element.width / 2 : element.textAlign === "right" - ? element.width - : 0; + ? element.width + : 0; const lineHeightPx = getLineHeightInPx( element.fontSize, element.lineHeight, @@ -404,8 +404,8 @@ export const generateRoughOptions = ( element.strokeStyle === "dashed" ? getDashArrayDashed(element.strokeWidth) : element.strokeStyle === "dotted" - ? getDashArrayDotted(element.strokeWidth) - : undefined, + ? getDashArrayDotted(element.strokeWidth) + : undefined, // for non-solid strokes, disable multiStroke because it tends to make // dashes/dots overlay each other disableMultiStroke: element.strokeStyle !== "solid", @@ -1470,15 +1470,15 @@ export const renderElementToSvg = ( element.textAlign === "center" ? element.width / 2 : element.textAlign === "right" - ? element.width - : 0; + ? element.width + : 0; const direction = isRTL(element.text) ? "rtl" : "ltr"; const textAnchor = element.textAlign === "center" ? "middle" : element.textAlign === "right" || direction === "rtl" - ? "end" - : "start"; + ? "end" + : "start"; for (let i = 0; i < lines.length; i++) { const text = svgRoot.ownerDocument!.createElementNS(SVG_NS, "text"); text.textContent = lines[i]; @@ -1528,8 +1528,8 @@ export function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) { const inputPoints = element.simulatePressure ? element.points : element.points.length - ? element.points.map(([x, y], i) => [x, y, element.pressures[i]]) - : [[0, 0, 0.5]]; + ? element.points.map(([x, y], i) => [x, y, element.pressures[i]]) + : [[0, 0, 0.5]]; // Consider changing the options for simulated pressure vs real pressure const options: StrokeOptions = { diff --git ORI/excalidraw/src/tests/helpers/api.ts ALT/excalidraw/src/tests/helpers/api.ts index 9edb595..7e8abec 100644 --- ORI/excalidraw/src/tests/helpers/api.ts +++ ALT/excalidraw/src/tests/helpers/api.ts @@ -127,12 +127,12 @@ export class API { }): T extends "arrow" | "line" ? ExcalidrawLinearElement : T extends "freedraw" - ? ExcalidrawFreeDrawElement - : T extends "text" - ? ExcalidrawTextElement - : T extends "image" - ? ExcalidrawImageElement - : ExcalidrawGenericElement => { + ? ExcalidrawFreeDrawElement + : T extends "text" + ? ExcalidrawTextElement + : T extends "image" + ? ExcalidrawImageElement + : ExcalidrawGenericElement => { let element: Mutable = null!; const appState = h?.state || getDefaultAppState(); diff --git ORI/excalidraw/src/tests/helpers/ui.ts ALT/excalidraw/src/tests/helpers/ui.ts index c882011..fb7b818 100644 --- ORI/excalidraw/src/tests/helpers/ui.ts +++ ALT/excalidraw/src/tests/helpers/ui.ts @@ -277,15 +277,15 @@ export class UI { ): (T extends "arrow" | "line" | "freedraw" ? ExcalidrawLinearElement : T extends "text" - ? ExcalidrawTextElement - : ExcalidrawElement) & { + ? ExcalidrawTextElement + : ExcalidrawElement) & { /** Returns the actual, current element from the elements array, instead of the proxy */ get(): T extends "arrow" | "line" | "freedraw" ? ExcalidrawLinearElement : T extends "text" - ? ExcalidrawTextElement - : ExcalidrawElement; + ? ExcalidrawTextElement + : ExcalidrawElement; } { UI.clickTool(type); mouse.reset(); ```
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: prettier/prettier@2bd131fbd29e94e989e64904f1a628877d38ae3d

Diff (875 lines) ```diff diff --git ORI/prettier/scripts/utils/changelog.js ALT/prettier/scripts/utils/changelog.js index 1b70543..a5d0798 100644 --- ORI/prettier/scripts/utils/changelog.js +++ ALT/prettier/scripts/utils/changelog.js @@ -31,10 +31,10 @@ export function getEntries(dirPath) { const section = title.includes("[HIGHLIGHT]") ? "highlight" : title.includes("[BREAKING]") - ? "breaking" - : improvement - ? "improvement" - : undefined; + ? "breaking" + : improvement + ? "improvement" + : undefined; const order = section === "improvement" && improvement[2] !== undefined diff --git ORI/prettier/src/cli/options/normalize-cli-options.js ALT/prettier/src/cli/options/normalize-cli-options.js index 38371f0..cd2bc03 100644 --- ORI/prettier/src/cli/options/normalize-cli-options.js +++ ALT/prettier/src/cli/options/normalize-cli-options.js @@ -9,10 +9,10 @@ const descriptor = { value === false ? `--no-${key}` : value === true - ? descriptor.key(key) - : value === "" - ? `${descriptor.key(key)} without an argument` - : `${descriptor.key(key)}=${value}`, + ? descriptor.key(key) + : value === "" + ? `${descriptor.key(key)} without an argument` + : `${descriptor.key(key)}=${value}`, }; class FlagSchema extends vnopts.ChoiceSchema { diff --git ORI/prettier/src/document/debug.js ALT/prettier/src/document/debug.js index 2f52e2c..8261eb7 100644 --- ORI/prettier/src/document/debug.js +++ ALT/prettier/src/document/debug.js @@ -114,14 +114,14 @@ function printDocToDebug(doc) { return doc.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + printDoc(doc.contents) + ")" : doc.n < 0 - ? "dedent(" + printDoc(doc.contents) + ")" - : doc.n.type === "root" - ? "markAsRoot(" + printDoc(doc.contents) + ")" - : "align(" + - JSON.stringify(doc.n) + - ", " + - printDoc(doc.contents) + - ")"; + ? "dedent(" + printDoc(doc.contents) + ")" + : doc.n.type === "root" + ? "markAsRoot(" + printDoc(doc.contents) + ")" + : "align(" + + JSON.stringify(doc.n) + + ", " + + printDoc(doc.contents) + + ")"; } if (doc.type === DOC_TYPE_IF_BREAK) { diff --git ORI/prettier/src/document/printer.js ALT/prettier/src/document/printer.js index c14e724..fc3a650 100644 --- ORI/prettier/src/document/printer.js +++ ALT/prettier/src/document/printer.js @@ -538,8 +538,8 @@ function printDocToString(doc, options) { doc.type === DOC_TYPE_IF_BREAK ? doc.breakContents : doc.negate - ? doc.contents - : indent(doc.contents); + ? doc.contents + : indent(doc.contents); if (breakContents) { cmds.push({ ind, mode, doc: breakContents }); } @@ -549,8 +549,8 @@ function printDocToString(doc, options) { doc.type === DOC_TYPE_IF_BREAK ? doc.flatContents : doc.negate - ? indent(doc.contents) - : doc.contents; + ? indent(doc.contents) + : doc.contents; if (flatContents) { cmds.push({ ind, mode, doc: flatContents }); } diff --git ORI/prettier/src/index.d.ts ALT/prettier/src/index.d.ts index 0b0c989..628825d 100644 --- ORI/prettier/src/index.d.ts +++ ALT/prettier/src/index.d.ts @@ -50,8 +50,8 @@ type IndexValue = T extends any[] ? T[P] : never : P extends keyof T - ? T[P] - : never; + ? T[P] + : never; // Determines if an object T is an array like string[] (in which case this // evaluates to false) or a tuple like [string] (in which case this evaluates to @@ -60,8 +60,8 @@ type IndexValue = T extends any[] type IsTuple = T extends [] ? true : T extends [infer First, ...infer Remain] - ? IsTuple - : false; + ? IsTuple + : false; type CallProperties = T extends any[] ? IndexProperties : keyof T; type IterProperties = T extends any[] diff --git ORI/prettier/src/language-css/printer-postcss.js ALT/prettier/src/language-css/printer-postcss.js index 472b606..229c7aa 100644 --- ORI/prettier/src/language-css/printer-postcss.js +++ ALT/prettier/src/language-css/printer-postcss.js @@ -87,8 +87,8 @@ function genericPrint(path, options, print) { lastLineHasInlineComment(node.selector.value) ? line : node.selector - ? " " - : "", + ? " " + : "", "{", node.nodes.length > 0 ? indent([hardline, printSequence(path, options, print)]) @@ -140,18 +140,18 @@ function genericPrint(path, options, print) { node.raws.important ? node.raws.important.replace(/\s*!\s*important/i, " !important") : node.important - ? " !important" - : "", + ? " !important" + : "", node.raws.scssDefault ? node.raws.scssDefault.replace(/\s*!default/i, " !default") : node.scssDefault - ? " !default" - : "", + ? " !default" + : "", node.raws.scssGlobal ? node.raws.scssGlobal.replace(/\s*!global/i, " !global") : node.scssGlobal - ? " !global" - : "", + ? " !global" + : "", node.nodes ? [ " {", @@ -160,12 +160,12 @@ function genericPrint(path, options, print) { "}", ] : isTemplatePropNode(node) && - !parentNode.raws.semicolon && - options.originalText[locEnd(node) - 1] !== ";" - ? "" - : options.__isHTMLStyleAttribute && isLastNode(path, node) - ? ifBreak(";") - : ";", + !parentNode.raws.semicolon && + options.originalText[locEnd(node) - 1] !== ";" + ? "" + : options.__isHTMLStyleAttribute && isLastNode(path, node) + ? ifBreak(";") + : ";", ]; } case "css-atrule": { @@ -232,16 +232,16 @@ function genericPrint(path, options, print) { isDetachedRulesetCallNode(node) ? "" : isTemplatePlaceholderNode(node) - ? node.raws.afterName === "" - ? "" - : node.name.endsWith(":") - ? " " - : /^\s*\n\s*\n/.test(node.raws.afterName) - ? [hardline, hardline] - : /^\s*\n/.test(node.raws.afterName) - ? hardline - : " " - : " ", + ? node.raws.afterName === "" + ? "" + : node.name.endsWith(":") + ? " " + : /^\s*\n\s*\n/.test(node.raws.afterName) + ? [hardline, hardline] + : /^\s*\n/.test(node.raws.afterName) + ? hardline + : " " + : " ", typeof node.params === "string" ? node.params : print("params"), ] : "", @@ -257,21 +257,21 @@ function genericPrint(path, options, print) { : "", ]) : node.name === "else" - ? " " - : "", + ? " " + : "", node.nodes ? [ isSCSSControlDirectiveNode(node, options) ? "" : (node.selector && - !node.selector.nodes && - typeof node.selector.value === "string" && - lastLineHasInlineComment(node.selector.value)) || - (!node.selector && - typeof node.params === "string" && - lastLineHasInlineComment(node.params)) - ? line - : " ", + !node.selector.nodes && + typeof node.selector.value === "string" && + lastLineHasInlineComment(node.selector.value)) || + (!node.selector && + typeof node.params === "string" && + lastLineHasInlineComment(node.params)) + ? line + : " ", "{", indent([ node.nodes.length > 0 ? softline : "", @@ -281,9 +281,9 @@ function genericPrint(path, options, print) { "}", ] : isTemplatePlaceholderNodeWithoutSemiColon || - isImportUnknownValueEndsWithSemiColon - ? "" - : ";", + isImportUnknownValueEndsWithSemiColon + ? "" + : ";", ]; } // postcss-media-query-parser diff --git ORI/prettier/src/language-handlebars/printer-glimmer.js ALT/prettier/src/language-handlebars/printer-glimmer.js index 1b317fd..d9ca862 100644 --- ORI/prettier/src/language-handlebars/printer-glimmer.js +++ ALT/prettier/src/language-handlebars/printer-glimmer.js @@ -127,13 +127,13 @@ function print(path, options, print) { const quote = isText ? getPreferredQuote(value.chars, options.singleQuote) : value.type === "ConcatStatement" - ? getPreferredQuote( - value.parts - .map((part) => (part.type === "TextNode" ? part.chars : "")) - .join(""), - options.singleQuote, - ) - : ""; + ? getPreferredQuote( + value.parts + .map((part) => (part.type === "TextNode" ? part.chars : "")) + .join(""), + options.singleQuote, + ) + : ""; const valueDoc = print("value"); diff --git ORI/prettier/src/language-html/embed/utils.js ALT/prettier/src/language-html/embed/utils.js index 1c51e85..7d313ed 100644 --- ORI/prettier/src/language-html/embed/utils.js +++ ALT/prettier/src/language-html/embed/utils.js @@ -17,8 +17,8 @@ function shouldHugJsExpression(ast, options) { ? ast.node.body[0].expression : ast.node : ast.type === "JsExpressionRoot" - ? ast.node - : ast; + ? ast.node + : ast; return ( rootNode && (rootNode.type === "ObjectExpression" || diff --git ORI/prettier/src/language-html/print/children.js ALT/prettier/src/language-html/print/children.js index dd31bed..1b44b83 100644 --- ORI/prettier/src/language-html/print/children.js +++ ALT/prettier/src/language-html/print/children.js @@ -59,55 +59,57 @@ function printBetweenLine(prevNode, nextNode) { : line : "" : preferHardlineAsLeadingSpaces(nextNode) - ? hardline - : softline + ? hardline + : softline : (needsToBorrowNextOpeningTagStartMarker(prevNode) && - (hasPrettierIgnore(nextNode) || + (hasPrettierIgnore(nextNode) || + /** + * 123 + */ + nextNode.firstChild || + /** + * 123 + */ + nextNode.isSelfClosing || + /** + * 123 0))) || + /** + * 123 + */ + (prevNode.type === "element" && + prevNode.isSelfClosing && + needsToBorrowPrevClosingTagEndMarker(nextNode)) + ? "" + : !nextNode.isLeadingSpaceSensitive || + preferHardlineAsLeadingSpaces(nextNode) || /** - * 123 + * Want to write us a letter? Use ourmailing address. */ - nextNode.firstChild || - /** - * 123 - */ - nextNode.isSelfClosing || - /** - * 123 0))) || - /** - * 123 - */ - (prevNode.type === "element" && - prevNode.isSelfClosing && - needsToBorrowPrevClosingTagEndMarker(nextNode)) - ? "" - : !nextNode.isLeadingSpaceSensitive || - preferHardlineAsLeadingSpaces(nextNode) || - /** - * Want to write us a letter? Use ourmailing address. - */ - (needsToBorrowPrevClosingTagEndMarker(nextNode) && - prevNode.lastChild && - needsToBorrowParentClosingTagStartMarker(prevNode.lastChild) && - prevNode.lastChild.lastChild && - needsToBorrowParentClosingTagStartMarker(prevNode.lastChild.lastChild)) - ? hardline - : nextNode.hasLeadingSpaces - ? line - : softline; + (needsToBorrowPrevClosingTagEndMarker(nextNode) && + prevNode.lastChild && + needsToBorrowParentClosingTagStartMarker(prevNode.lastChild) && + prevNode.lastChild.lastChild && + needsToBorrowParentClosingTagStartMarker( + prevNode.lastChild.lastChild, + )) + ? hardline + : nextNode.hasLeadingSpaces + ? line + : softline; } function printChildren(path, options, print) { diff --git ORI/prettier/src/language-html/print/tag.js ALT/prettier/src/language-html/print/tag.js index 9258095..ac9f231 100644 --- ORI/prettier/src/language-html/print/tag.js +++ ALT/prettier/src/language-html/print/tag.js @@ -62,8 +62,8 @@ function printClosingTagSuffix(node, options) { return needsToBorrowParentClosingTagStartMarker(node) ? printClosingTagStartMarker(node.parent, options) : needsToBorrowNextOpeningTagStartMarker(node) - ? printOpeningTagStartMarker(node.next) - : ""; + ? printOpeningTagStartMarker(node.next) + : ""; } function printClosingTagStartMarker(node, options) { @@ -233,8 +233,8 @@ function printAttributes(path, options, print) { typeof ignoreAttributeData === "boolean" ? () => ignoreAttributeData : Array.isArray(ignoreAttributeData) - ? (attribute) => ignoreAttributeData.includes(attribute.rawName) - : () => false; + ? (attribute) => ignoreAttributeData.includes(attribute.rawName) + : () => false; const printedAttributes = path.map( ({ node: attribute }) => @@ -294,8 +294,8 @@ function printAttributes(path, options, print) { ? " " : "" : node.isSelfClosing - ? line - : softline, + ? line + : softline, ); } @@ -329,8 +329,8 @@ function printOpeningTagPrefix(node, options) { return needsToBorrowParentOpeningTagEndMarker(node) ? printOpeningTagEndMarker(node.parent) : needsToBorrowPrevClosingTagEndMarker(node) - ? printClosingTagEndMarker(node.prev, options) - : ""; + ? printClosingTagEndMarker(node.prev, options) + : ""; } function printOpeningTagStartMarker(node) { diff --git ORI/prettier/src/language-js/embed/html.js ALT/prettier/src/language-js/embed/html.js index 8d301dc..b15b6a1 100644 --- ORI/prettier/src/language-js/embed/html.js +++ ALT/prettier/src/language-js/embed/html.js @@ -77,8 +77,8 @@ async function printEmbedHtmlLike(parser, textToDoc, print, path, options) { options.htmlWhitespaceSensitivity === "ignore" ? hardline : leadingWhitespace && trailingWhitespace - ? line - : null; + ? line + : null; if (linebreak) { return group(["`", indent([linebreak, group(contentDoc)]), linebreak, "`"]); diff --git ORI/prettier/src/language-js/needs-parens.js ALT/prettier/src/language-js/needs-parens.js index 0fccfdd..5253ad0 100644 --- ORI/prettier/src/language-js/needs-parens.js +++ ALT/prettier/src/language-js/needs-parens.js @@ -95,10 +95,10 @@ function needsParens(path, options) { const expression = !statement ? undefined : statement.type === "ExpressionStatement" - ? statement.expression - : statement.type === "ForStatement" - ? statement.init - : statement.left; + ? statement.expression + : statement.type === "ForStatement" + ? statement.init + : statement.left; if ( expression && startsWithNoLookaheadToken( diff --git ORI/prettier/src/language-js/print/array.js ALT/prettier/src/language-js/print/array.js index cd99d7c..dec3523 100644 --- ORI/prettier/src/language-js/print/array.js +++ ALT/prettier/src/language-js/print/array.js @@ -60,8 +60,8 @@ function printArray(path, options, print) { node.type === "TupleTypeAnnotation" && node.types ? "types" : node.type === "TSTupleType" || node.type === "TupleTypeAnnotation" - ? "elementTypes" - : "elements"; + ? "elementTypes" + : "elements"; const elements = node[elementsProperty]; if (elements.length === 0) { parts.push( @@ -114,12 +114,12 @@ function printArray(path, options, print) { const trailingComma = !canHaveTrailingComma ? "" : needsForcedTrailingComma - ? "," - : !shouldPrintComma(options) - ? "" - : shouldUseConciseFormatting - ? ifBreak(",", "", { groupId }) - : ifBreak(","); + ? "," + : !shouldPrintComma(options) + ? "" + : shouldUseConciseFormatting + ? ifBreak(",", "", { groupId }) + : ifBreak(","); parts.push( group( @@ -213,8 +213,8 @@ function printArrayElementsConcisely(path, options, print, trailingComma) { isLineAfterElementEmpty(path, options) ? [hardline, hardline] : hasComment(next, CommentCheckFlags.Leading | CommentCheckFlags.Line) - ? hardline - : line, + ? hardline + : line, ); } }, "elements"); diff --git ORI/prettier/src/language-js/print/assignment.js ALT/prettier/src/language-js/print/assignment.js index 8e8d032..feaf363 100644 --- ORI/prettier/src/language-js/print/assignment.js +++ ALT/prettier/src/language-js/print/assignment.js @@ -121,9 +121,9 @@ function chooseLayout(path, options, print, leftDoc, rightPropertyName) { return !isTail ? "chain" : rightNode.type === "ArrowFunctionExpression" && - rightNode.body.type === "ArrowFunctionExpression" - ? "chain-tail-arrow-chain" - : "chain-tail"; + rightNode.body.type === "ArrowFunctionExpression" + ? "chain-tail-arrow-chain" + : "chain-tail"; } const isHeadOfLongChain = !isTail && isAssignment(rightNode.right); diff --git ORI/prettier/src/language-js/print/decorators.js ALT/prettier/src/language-js/print/decorators.js index 634c57c..b766eab 100644 --- ORI/prettier/src/language-js/print/decorators.js +++ ALT/prettier/src/language-js/print/decorators.js @@ -59,8 +59,8 @@ function printDecorators(path, options, print) { path.key === "declaration" && isExportDeclaration(parent) ? hardline : shouldBreak - ? breakParent - : "", + ? breakParent + : "", join(line, path.map(print, "decorators")), line, ]; diff --git ORI/prettier/src/language-js/print/flow.js ALT/prettier/src/language-js/print/flow.js index 8c5f0eb..2bd0744 100644 --- ORI/prettier/src/language-js/print/flow.js +++ ALT/prettier/src/language-js/print/flow.js @@ -153,8 +153,8 @@ function printFlow(path, options, print) { const name = node.name ? print("name") : path.parent.this === node - ? "this" - : ""; + ? "this" + : ""; return [ name, printOptionalToken(path), diff --git ORI/prettier/src/language-js/print/function.js ALT/prettier/src/language-js/print/function.js index c668e82..9d00d84 100644 --- ORI/prettier/src/language-js/print/function.js +++ ALT/prettier/src/language-js/print/function.js @@ -168,8 +168,8 @@ function printMethodValue(path, options, print) { shouldBreakParameters ? group(parametersDoc, { shouldBreak: true }) : shouldGroupParameters - ? group(parametersDoc) - : parametersDoc, + ? group(parametersDoc) + : parametersDoc, returnTypeDoc, ]), ]; diff --git ORI/prettier/src/language-js/print/jsx.js ALT/prettier/src/language-js/print/jsx.js index be90185..fac4bfc 100644 --- ORI/prettier/src/language-js/print/jsx.js +++ ALT/prettier/src/language-js/print/jsx.js @@ -690,8 +690,8 @@ function printJsxOpeningClosingFragment(path, options /*, print*/) { hasOwnLineComment ? hardline : nodeHasComment && !isOpeningFragment - ? " " - : "", + ? " " + : "", printDanglingComments(path, options), ]), hasOwnLineComment ? hardline : "", diff --git ORI/prettier/src/language-js/print/module.js ALT/prettier/src/language-js/print/module.js index fdae117..f086f4f 100644 --- ORI/prettier/src/language-js/print/module.js +++ ALT/prettier/src/language-js/print/module.js @@ -256,8 +256,8 @@ function printImportAttributes(path, options, print) { const property = isNonEmptyArray(node.attributes) ? "attributes" : isNonEmptyArray(node.assertions) - ? "assertions" - : undefined; + ? "assertions" + : undefined; if (!property) { return ""; diff --git ORI/prettier/src/language-js/print/object.js ALT/prettier/src/language-js/print/object.js index 44ddd3f..db3a6c3 100644 --- ORI/prettier/src/language-js/print/object.js +++ ALT/prettier/src/language-js/print/object.js @@ -42,8 +42,8 @@ function printObject(path, options, print) { node.type === "TSTypeLiteral" || isEnumBody ? "members" : node.type === "TSInterfaceBody" - ? "body" - : "properties", + ? "body" + : "properties", ]; if (isTypeAnnotation) { fields.push("indexers", "callProperties", "internalSlots"); @@ -104,8 +104,8 @@ function printObject(path, options, print) { const separator = isFlowInterfaceLikeBody ? ";" : node.type === "TSInterfaceBody" || node.type === "TSTypeLiteral" - ? ifBreak(semi, ";") - : ","; + ? ifBreak(semi, ";") + : ","; const leftBrace = node.type === "RecordExpression" ? "#{" : node.exact ? "{|" : "{"; const rightBrace = node.exact ? "|}" : "}"; diff --git ORI/prettier/src/language-js/print/ternary.js ALT/prettier/src/language-js/print/ternary.js index 8fecc3d..b96863b 100644 --- ORI/prettier/src/language-js/print/ternary.js +++ ALT/prettier/src/language-js/print/ternary.js @@ -293,8 +293,8 @@ function printTernary(path, options, print) { isParentTest ? part : options.useTabs - ? dedent(indent(part)) - : align(Math.max(0, options.tabWidth - 2), part), + ? dedent(indent(part)) + : align(Math.max(0, options.tabWidth - 2), part), ); } @@ -321,8 +321,8 @@ function printTernary(path, options, print) { parent === firstNonConditionalParent ? group(doc, { shouldBreak }) : shouldBreak - ? [doc, breakParent] - : doc; + ? [doc, breakParent] + : doc; // Break the closing paren to keep the chain right after it: // (a diff --git ORI/prettier/src/language-js/print/type-parameters.js ALT/prettier/src/language-js/print/type-parameters.js index 688b6ec..4a77ec2 100644 --- ORI/prettier/src/language-js/print/type-parameters.js +++ ALT/prettier/src/language-js/print/type-parameters.js @@ -87,10 +87,10 @@ function printTypeParameters(path, options, print, paramsKey) { node.type === "TSTypeParameterInstantiation" // https://github.com/microsoft/TypeScript/issues/21984 ? "" : shouldForceTrailingComma(path, options, paramsKey) - ? "," - : shouldPrintComma(options) - ? ifBreak(",") - : ""; + ? "," + : shouldPrintComma(options) + ? ifBreak(",") + : ""; return group( [ diff --git ORI/prettier/src/language-markdown/printer-markdown.js ALT/prettier/src/language-markdown/printer-markdown.js index d9d6462..9deaa3e 100644 --- ORI/prettier/src/language-markdown/printer-markdown.js +++ ALT/prettier/src/language-markdown/printer-markdown.js @@ -305,12 +305,12 @@ function genericPrint(path, options, print) { ? (childPath.isFirst ? node.start : isGitDiffFriendlyOrderedList - ? 1 - : node.start + childPath.index) + + ? 1 + : node.start + childPath.index) + (nthSiblingIndex % 2 === 0 ? ". " : ") ") : nthSiblingIndex % 2 === 0 - ? "- " - : "* "; + ? "- " + : "* "; return node.isAligned || /* workaround for https://github.com/remarkjs/remark/issues/315 */ node.hasIndentedCodeblock @@ -340,8 +340,8 @@ function genericPrint(path, options, print) { node.referenceType === "full" ? printLinkReference(node) : node.referenceType === "collapsed" - ? "[]" - : "", + ? "[]" + : "", ]; case "imageReference": switch (node.referenceType) { diff --git ORI/prettier/src/language-yaml/utils.js ALT/prettier/src/language-yaml/utils.js index c2f8c1e..6530041 100644 --- ORI/prettier/src/language-yaml/utils.js +++ ALT/prettier/src/language-yaml/utils.js @@ -182,10 +182,10 @@ function getFlowScalarLineContents(nodeType, content, options) { index === 0 && index === lineContents.length - 1 ? lineContent : index !== 0 && index !== lineContents.length - 1 - ? lineContent.trim() - : index === 0 - ? lineContent.trimEnd() - : lineContent.trimStart(), + ? lineContent.trim() + : index === 0 + ? lineContent.trimEnd() + : lineContent.trimStart(), ); if (options.proseWrap === "preserve") { @@ -307,9 +307,9 @@ function getBlockValueLineContents( return trailingNewlineCount === 0 ? lineContents : trailingNewlineCount >= 2 && !isLastDescendant - ? // next empty line - lineContents.slice(0, -(trailingNewlineCount - 1)) - : lineContents.slice(0, -trailingNewlineCount); + ? // next empty line + lineContents.slice(0, -(trailingNewlineCount - 1)) + : lineContents.slice(0, -trailingNewlineCount); } } diff --git ORI/prettier/src/main/normalize-options.js ALT/prettier/src/main/normalize-options.js index c4e7e80..fdab515 100644 --- ORI/prettier/src/main/normalize-options.js +++ ALT/prettier/src/main/normalize-options.js @@ -47,9 +47,9 @@ function normalizeOptions( }); } : Array.isArray(passThrough) - ? (key, value) => - !passThrough.includes(key) ? undefined : { [key]: value } - : (key, value) => ({ [key]: value }); + ? (key, value) => + !passThrough.includes(key) ? undefined : { [key]: value } + : (key, value) => ({ [key]: value }); const schemas = optionInfosToSchemas(optionInfos, { isCLI, FlagSchema }); const normalizer = new vnopts.Normalizer(schemas, { diff --git ORI/prettier/src/utils/print-string.js ALT/prettier/src/utils/print-string.js index 8cbe600..310698b 100644 --- ORI/prettier/src/utils/print-string.js +++ ALT/prettier/src/utils/print-string.js @@ -16,8 +16,8 @@ function printString(raw, options) { !options.singleQuote) ? '"' : options.__isInHtmlAttribute - ? "'" - : getPreferredQuote(rawContent, options.singleQuote); + ? "'" + : getPreferredQuote(rawContent, options.singleQuote); // It might sound unnecessary to use `makeString` even if the string already // is enclosed with `enclosingQuote`, but it isn't. The string could contain diff --git ORI/prettier/tests/config/utils/create-snapshot.js ALT/prettier/tests/config/utils/create-snapshot.js index d404999..ed5f2ea 100644 --- ORI/prettier/tests/config/utils/create-snapshot.js +++ ALT/prettier/tests/config/utils/create-snapshot.js @@ -13,8 +13,8 @@ function stringify(value) { return value === Number.POSITIVE_INFINITY ? "Infinity" : Array.isArray(value) - ? `[${value.map((v) => JSON.stringify(v)).join(", ")}]` - : JSON.stringify(value); + ? `[${value.map((v) => JSON.stringify(v)).join(", ")}]` + : JSON.stringify(value); } function printOptions(options) { diff --git ORI/prettier/tests/config/utils/stringify-options-for-title.js ALT/prettier/tests/config/utils/stringify-options-for-title.js index 11e92ee..d25c671 100644 --- ORI/prettier/tests/config/utils/stringify-options-for-title.js +++ ALT/prettier/tests/config/utils/stringify-options-for-title.js @@ -3,8 +3,8 @@ function stringifyOptions(options) { key === "plugins" || key === "errors" ? undefined : value === Number.POSITIVE_INFINITY - ? "Infinity" - : value, + ? "Infinity" + : value, ); return string === "{}" ? "" : string; diff --git ORI/prettier/tests/integration/__tests__/support-info.js ALT/prettier/tests/integration/__tests__/support-info.js index 849c919..3a354aa 100644 --- ORI/prettier/tests/integration/__tests__/support-info.js +++ ALT/prettier/tests/integration/__tests__/support-info.js @@ -23,8 +23,8 @@ async function getCoreInfo() { ...(option.type === "int" ? { range: option.range } : option.type === "choice" - ? { choices: option.choices.map((choice) => choice.value) } - : null), + ? { choices: option.choices.map((choice) => choice.value) } + : null), }, ]), ); diff --git ORI/prettier/tests/integration/cli-worker.js ALT/prettier/tests/integration/cli-worker.js index 7c8743a..99f460d 100644 --- ORI/prettier/tests/integration/cli-worker.js +++ ALT/prettier/tests/integration/cli-worker.js @@ -47,8 +47,8 @@ async function run() { stream === process.stdout ? "process.stdout" : stream === process.stderr - ? "process.stderr" - : "unknown stream" + ? "process.stderr" + : "unknown stream" })]]\n`, ); }; diff --git ORI/prettier/website/playground/Playground.js ALT/prettier/website/playground/Playground.js index 845b9ed..7ff2c15 100644 --- ORI/prettier/website/playground/Playground.js +++ ALT/prettier/website/playground/Playground.js @@ -514,8 +514,8 @@ function getSecondFormat(formatted, reformatted) { return formatted === "" ? "" : formatted === reformatted - ? "✓ Second format is unchanged." - : reformatted; + ? "✓ Second format is unchanged." + : reformatted; } export default Playground; diff --git ORI/prettier/website/static/worker.js ALT/prettier/website/static/worker.js index c8b2389..b56c5f2 100644 --- ORI/prettier/website/static/worker.js +++ ALT/prettier/website/static/worker.js @@ -45,10 +45,10 @@ function serializeAst(ast) { value instanceof Error ? { name: value.name, message: value.message, ...value } : typeof value === "bigint" - ? `BigInt('${String(value)}')` - : typeof value === "symbol" - ? String(value) - : value, + ? `BigInt('${String(value)}')` + : typeof value === "symbol" + ? String(value) + : value, 2, ); } ```
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: marmelab/react-admin@fbf280286c715d6ef0c38d7111eab249aa929dc1

Diff (868 lines) ```diff diff --git ORI/react-admin/examples/crm/src/misc/Status.tsx ALT/react-admin/examples/crm/src/misc/Status.tsx index a63a357..b61e3cf 100644 --- ORI/react-admin/examples/crm/src/misc/Status.tsx +++ ALT/react-admin/examples/crm/src/misc/Status.tsx @@ -5,12 +5,12 @@ const getColorFromStatus = (status: string) => status === 'cold' ? '#7dbde8' : status === 'warm' - ? '#e8cb7d' - : status === 'hot' - ? '#e88b7d' - : status === 'in-contract' - ? '#a4e87d' - : '#000'; + ? '#e8cb7d' + : status === 'hot' + ? '#e88b7d' + : status === 'in-contract' + ? '#a4e87d' + : '#000'; export const Status = ({ status }: { status: string }) => ( { typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? 'ra.auth.sign_in_error' - : error.message, + ? 'ra.auth.sign_in_error' + : error.message, { type: 'error', messageArgs: { @@ -50,8 +50,8 @@ const Login = () => { typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-core/src/auth/useAuthState.ts ALT/react-admin/packages/ra-core/src/auth/useAuthState.ts index 8f2f4ff..33157e5 100644 --- ORI/react-admin/packages/ra-core/src/auth/useAuthState.ts +++ ALT/react-admin/packages/ra-core/src/auth/useAuthState.ts @@ -108,5 +108,5 @@ const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? defaultMessage - : error.message; + ? defaultMessage + : error.message; diff --git ORI/react-admin/packages/ra-core/src/auth/useCheckAuth.ts ALT/react-admin/packages/ra-core/src/auth/useCheckAuth.ts index 2db6a45..ac96be2 100644 --- ORI/react-admin/packages/ra-core/src/auth/useCheckAuth.ts +++ ALT/react-admin/packages/ra-core/src/auth/useCheckAuth.ts @@ -108,5 +108,5 @@ const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? defaultMessage - : error.message; + ? defaultMessage + : error.message; diff --git ORI/react-admin/packages/ra-core/src/auth/useGetIdentity.ts ALT/react-admin/packages/ra-core/src/auth/useGetIdentity.ts index 667f772..0dea5f6 100644 --- ORI/react-admin/packages/ra-core/src/auth/useGetIdentity.ts +++ ALT/react-admin/packages/ra-core/src/auth/useGetIdentity.ts @@ -63,13 +63,13 @@ export const useGetIdentity = ( result.isLoading ? { isLoading: true } : result.error - ? { error: result.error, isLoading: false } - : { - data: result.data, - identity: result.data, - refetch: result.refetch, - isLoading: false, - }, + ? { error: result.error, isLoading: false } + : { + data: result.data, + identity: result.data, + refetch: result.refetch, + isLoading: false, + }, [result] ); diff --git ORI/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts ALT/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts index 361b522..04ec2cc 100644 --- ORI/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts +++ ALT/react-admin/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts @@ -64,8 +64,8 @@ const useLogoutIfAccessDenied = (): LogoutIfAccessDenied => { e && e.redirectTo != null ? e.redirectTo : error && error.redirectTo - ? error.redirectTo - : undefined; + ? error.redirectTo + : undefined; const shouldNotify = !( disableNotification || @@ -141,7 +141,7 @@ const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? defaultMessage - : error.message; + ? defaultMessage + : error.message; export default useLogoutIfAccessDenied; diff --git ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx index 3be0661..dc9fab4 100644 --- ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx +++ ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx @@ -126,8 +126,8 @@ const useDeleteWithConfirmController = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx index 59630dd..3502b4f 100644 --- ORI/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx +++ ALT/react-admin/packages/ra-core/src/controller/button/useDeleteWithUndoController.tsx @@ -91,8 +91,8 @@ const useDeleteWithUndoController = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-core/src/controller/create/useCreateController.ts ALT/react-admin/packages/ra-core/src/controller/create/useCreateController.ts index f08ad5d..690e686 100644 --- ORI/react-admin/packages/ra-core/src/controller/create/useCreateController.ts +++ ALT/react-admin/packages/ra-core/src/controller/create/useCreateController.ts @@ -96,8 +96,8 @@ export const useCreateController = < transformFromSave ? transformFromSave(data) : transform - ? transform(data) - : data + ? transform(data) + : data ).then(async (data: Partial) => { const mutate = getMutateWithMiddlewares(create); try { @@ -131,27 +131,28 @@ export const useCreateController = < onError: onErrorFromSave ? onErrorFromSave : onError - ? onError - : (error: Error) => { - notify( - typeof error === 'string' - ? error - : error.message || - 'ra.notification.http_error', - { - type: 'error', - messageArgs: { - _: - typeof error === 'string' - ? error - : error && - error.message - ? error.message - : undefined, - }, - } - ); - }, + ? onError + : (error: Error) => { + notify( + typeof error === 'string' + ? error + : error.message || + 'ra.notification.http_error', + { + type: 'error', + messageArgs: { + _: + typeof error === + 'string' + ? error + : error && + error.message + ? error.message + : undefined, + }, + } + ); + }, } ); } catch (error) { diff --git ORI/react-admin/packages/ra-core/src/controller/edit/useEditController.ts ALT/react-admin/packages/ra-core/src/controller/edit/useEditController.ts index 0a46165..880513c 100644 --- ORI/react-admin/packages/ra-core/src/controller/edit/useEditController.ts +++ ALT/react-admin/packages/ra-core/src/controller/edit/useEditController.ts @@ -150,10 +150,10 @@ export const useEditController = < previousData: recordCached.previousData, }) : transform - ? transform(data, { - previousData: recordCached.previousData, - }) - : data + ? transform(data, { + previousData: recordCached.previousData, + }) + : data ).then(async (data: Partial) => { const mutate = getMutateWithMiddlewares(update); @@ -185,27 +185,28 @@ export const useEditController = < onError: onErrorFromSave ? onErrorFromSave : onError - ? onError - : (error: Error | string) => { - notify( - typeof error === 'string' - ? error - : error.message || - 'ra.notification.http_error', - { - type: 'error', - messageArgs: { - _: - typeof error === 'string' - ? error - : error && - error.message - ? error.message - : undefined, - }, - } - ); - }, + ? onError + : (error: Error | string) => { + notify( + typeof error === 'string' + ? error + : error.message || + 'ra.notification.http_error', + { + type: 'error', + messageArgs: { + _: + typeof error === + 'string' + ? error + : error && + error.message + ? error.message + : undefined, + }, + } + ); + }, } ); } catch (error) { diff --git ORI/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts ALT/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts index 5027fca..fa25351 100644 --- ORI/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts +++ ALT/react-admin/packages/ra-core/src/controller/field/useReferenceArrayFieldController.ts @@ -86,8 +86,8 @@ export const useReferenceArrayFieldController = < typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ), diff --git ORI/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts ALT/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts index 0f9ebe7..04de0d2 100644 --- ORI/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts +++ ALT/react-admin/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts @@ -168,8 +168,8 @@ export const useReferenceManyFieldController = < typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ), @@ -200,8 +200,8 @@ export const useReferenceManyFieldController = < hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? page * perPage < total - : undefined, + ? page * perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : page > 1, setSort, showFilter, diff --git ORI/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx ALT/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx index b76df91..889d34e 100644 --- ORI/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx +++ ALT/react-admin/packages/ra-core/src/controller/field/useReferenceOneFieldController.tsx @@ -86,8 +86,8 @@ export const useReferenceOneFieldController = < typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ), diff --git ORI/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts ALT/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts index 6a630bb..7364ea1 100644 --- ORI/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts +++ ALT/react-admin/packages/ra-core/src/controller/input/referenceDataStatus.ts @@ -65,8 +65,8 @@ export const getSelectedReferencesStatus = ( !field.value || field.value.length === referenceRecords.length ? REFERENCES_STATUS_READY : referenceRecords.length > 0 - ? REFERENCES_STATUS_INCOMPLETE - : REFERENCES_STATUS_EMPTY; + ? REFERENCES_STATUS_INCOMPLETE + : REFERENCES_STATUS_EMPTY; interface GetStatusForArrayInputParams { field: ControllerRenderProps; diff --git ORI/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts ALT/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts index d4b7074..d91c802 100644 --- ORI/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts +++ ALT/react-admin/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts @@ -122,8 +122,8 @@ export const useReferenceArrayInputController = < matchingReferences && matchingReferences.length > 0 ? mergeReferences(matchingReferences, finalReferenceRecords) : finalReferenceRecords.length > 0 - ? finalReferenceRecords - : matchingReferences; + ? finalReferenceRecords + : matchingReferences; const refetch = useCallback(() => { refetchGetMany(); @@ -163,8 +163,8 @@ export const useReferenceArrayInputController = < hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? params.page * params.perPage < total - : undefined, + ? params.page * params.perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : params.page > 1, isFromReference: true, }; diff --git ORI/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts ALT/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts index 694be2c..a280fa9 100644 --- ORI/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts +++ ALT/react-admin/packages/ra-core/src/controller/input/useReferenceInputController.ts @@ -179,8 +179,8 @@ export const useReferenceInputController = ( hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? params.page * params.perPage < total - : undefined, + ? params.page * params.perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : params.page > 1, isFromReference: true, }; diff --git ORI/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx ALT/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx index 4c985fe..f33ffa7 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx +++ ALT/react-admin/packages/ra-core/src/controller/list/useExpanded.tsx @@ -42,8 +42,8 @@ export const useExpanded = ( ? [] : [...ids.slice(0, index), ...ids.slice(index + 1)] : single - ? [id] - : [...ids, id]; + ? [id] + : [...ids, id]; }); }, [setExpandedIds, id, single]); diff --git ORI/react-admin/packages/ra-core/src/controller/list/useList.ts ALT/react-admin/packages/ra-core/src/controller/list/useList.ts index b454ffd..30ca424 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useList.ts +++ ALT/react-admin/packages/ra-core/src/controller/list/useList.ts @@ -177,8 +177,8 @@ export const useList = ( ) : recordValue.includes(filterValue) : Array.isArray(filterValue) - ? filterValue.includes(recordValue) - : filterValue == recordValue; // eslint-disable-line eqeqeq + ? filterValue.includes(recordValue) + : filterValue == recordValue; // eslint-disable-line eqeqeq return result; } ) diff --git ORI/react-admin/packages/ra-core/src/controller/list/useListController.ts ALT/react-admin/packages/ra-core/src/controller/list/useListController.ts index da04fcf..a640c04 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useListController.ts +++ ALT/react-admin/packages/ra-core/src/controller/list/useListController.ts @@ -165,8 +165,8 @@ export const useListController = ( hasNextPage: pageInfo ? pageInfo.hasNextPage : total != null - ? query.page * query.perPage < total - : undefined, + ? query.page * query.perPage < total + : undefined, hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : query.page > 1, }; }; diff --git ORI/react-admin/packages/ra-core/src/controller/list/useListParams.ts ALT/react-admin/packages/ra-core/src/controller/list/useListParams.ts index 674de5a..c14ea79 100644 --- ORI/react-admin/packages/ra-core/src/controller/list/useListParams.ts +++ ALT/react-admin/packages/ra-core/src/controller/list/useListParams.ts @@ -334,8 +334,8 @@ export const getQuery = ({ Object.keys(queryFromLocation).length > 0 ? queryFromLocation : hasCustomParams(params) - ? { ...params } - : { filter: filterDefaultValues || {} }; + ? { ...params } + : { filter: filterDefaultValues || {} }; if (!query.sort) { query.sort = sort.field; diff --git ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx index c044598..aab68a7 100644 --- ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx +++ ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.spec.tsx @@ -52,8 +52,8 @@ const TestedComponent = ({ role }) => { role === 'admin' ? [, ] : role === 'user' - ? [] - : [] + ? [] + : [] } @@ -76,8 +76,8 @@ const TestedComponentReturningNull = ({ role }) => { role === 'admin' ? [, ] : role === 'user' - ? [] - : null + ? [] + : null } diff --git ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx index 179e5b6..c6eadca 100644 --- ORI/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx +++ ALT/react-admin/packages/ra-core/src/core/useConfigureAdminRouterFromChildren.tsx @@ -125,10 +125,12 @@ const useRoutesAndResourcesFromChildren = ( !!functionChild ? 'loading' : newRoutesAndResources.resources.length > 0 || - newRoutesAndResources.customRoutesWithLayout.length > 0 || - newRoutesAndResources.customRoutesWithoutLayout.length > 0 - ? 'ready' - : 'empty' + newRoutesAndResources.customRoutesWithLayout.length > + 0 || + newRoutesAndResources.customRoutesWithoutLayout.length > + 0 + ? 'ready' + : 'empty' ); if (functionChild) { @@ -248,10 +250,10 @@ const getStatus = ({ return getSingleChildFunction(children) ? 'loading' : resources.length > 0 || - customRoutesWithLayout.length > 0 || - customRoutesWithoutLayout.length > 0 - ? 'ready' - : 'empty'; + customRoutesWithLayout.length > 0 || + customRoutesWithoutLayout.length > 0 + ? 'ready' + : 'empty'; }; /** diff --git ORI/react-admin/packages/ra-core/src/form/useAugmentedForm.ts ALT/react-admin/packages/ra-core/src/form/useAugmentedForm.ts index 19218f0..6992cf8 100644 --- ORI/react-admin/packages/ra-core/src/form/useAugmentedForm.ts +++ ALT/react-admin/packages/ra-core/src/form/useAugmentedForm.ts @@ -64,8 +64,8 @@ export const useAugmentedForm = (props: UseAugmentedFormProps) => { const finalResolver = resolver ? resolver : validate - ? getSimpleValidationResolver(validate) - : undefined; + ? getSimpleValidationResolver(validate) + : undefined; const form = useForm({ criteriaMode, diff --git ORI/react-admin/packages/ra-core/src/form/useChoices.tsx ALT/react-admin/packages/ra-core/src/form/useChoices.tsx index 1ed535e..44a8e55 100644 --- ORI/react-admin/packages/ra-core/src/form/useChoices.tsx +++ ALT/react-admin/packages/ra-core/src/form/useChoices.tsx @@ -64,8 +64,8 @@ export const useChoices = ({ return isValidElement(choiceName) ? choiceName : translateChoice - ? translate(String(choiceName), { _: choiceName }) - : String(choiceName); + ? translate(String(choiceName), { _: choiceName }) + : String(choiceName); }, [optionText, translate, translateChoice] ); diff --git ORI/react-admin/packages/ra-core/src/form/useInput.spec.tsx ALT/react-admin/packages/ra-core/src/form/useInput.spec.tsx index a989b5b..80dbc45 100644 --- ORI/react-admin/packages/ra-core/src/form/useInput.spec.tsx +++ ALT/react-admin/packages/ra-core/src/form/useInput.spec.tsx @@ -179,8 +179,8 @@ describe('useInput', () => { {typeof values[source] === 'undefined' ? 'undefined' : values[source] - ? 'true' - : 'false'} + ? 'true' + : 'false'} ); }; diff --git ORI/react-admin/packages/ra-core/src/form/validate.ts ALT/react-admin/packages/ra-core/src/form/validate.ts index df494bb..575b734 100644 --- ORI/react-admin/packages/ra-core/src/form/validate.ts +++ ALT/react-admin/packages/ra-core/src/form/validate.ts @@ -58,11 +58,11 @@ const getMessage = ( values, }) : messageArgs - ? { - message, - args: messageArgs, - } - : message; + ? { + message, + args: messageArgs, + } + : message; type Memoize = any>( func: T, diff --git ORI/react-admin/packages/ra-core/src/store/useStore.stories.tsx ALT/react-admin/packages/ra-core/src/store/useStore.stories.tsx index 66bb59c..f1bb3e2 100644 --- ORI/react-admin/packages/ra-core/src/store/useStore.stories.tsx +++ ALT/react-admin/packages/ra-core/src/store/useStore.stories.tsx @@ -58,10 +58,10 @@ const StoreRaw = ({ name }) => { {value === undefined ? 'undefined' : value === null - ? 'null' - : value === '' - ? "''" - : value} + ? 'null' + : value === '' + ? "''" + : value} ); }; diff --git ORI/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx ALT/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx index 6166b93..4755a54 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/auth/LoginForm.tsx @@ -31,8 +31,8 @@ export const LoginForm = (props: LoginFormProps) => { typeof error === 'string' ? error : typeof error === 'undefined' || !error.message - ? 'ra.auth.sign_in_error' - : error.message, + ? 'ra.auth.sign_in_error' + : error.message, { type: 'error', messageArgs: { @@ -40,8 +40,8 @@ export const LoginForm = (props: LoginFormProps) => { typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx index 7d3d5f1..5285439 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx @@ -68,8 +68,8 @@ export const BulkDeleteWithConfirmButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx index 963304d..8c22bbf 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkDeleteWithUndoButton.tsx @@ -61,8 +61,8 @@ export const BulkDeleteWithUndoButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx index 7be7e89..707668d 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithConfirmButton.tsx @@ -60,8 +60,8 @@ export const BulkUpdateWithConfirmButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx index 70e224d..35fc447 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/BulkUpdateWithUndoButton.tsx @@ -52,8 +52,8 @@ export const BulkUpdateWithUndoButton = ( typeof error === 'string' ? error : error && error.message - ? error.message - : undefined, + ? error.message + : undefined, }, } ); diff --git ORI/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx ALT/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx index c232df9..06226fb 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/button/DeleteButton.tsx @@ -63,8 +63,8 @@ export const DeleteButton = ( const finalMutationMode = mutationMode ? mutationMode : saveContext?.mutationMode - ? saveContext.mutationMode - : 'undoable'; + ? saveContext.mutationMode + : 'undoable'; return finalMutationMode === 'undoable' ? ( // @ts-ignore I looked for the error for one hour without finding it diff --git ORI/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx ALT/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx index f5d0eb3..f42df99 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/field/DateField.tsx @@ -78,8 +78,8 @@ const DateFieldImpl = < value instanceof Date ? value : typeof value === 'string' || typeof value === 'number' - ? new Date(value) - : undefined; + ? new Date(value) + : undefined; let dateOptions = options; if ( diff --git ORI/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx ALT/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx index e6fc0c7..904f2fa 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx @@ -97,8 +97,8 @@ export const NumberInput = ({ ? parse(target.valueAsNumber) : target.valueAsNumber : parse - ? parse(target.value) - : convertStringToNumber(target.value); + ? parse(target.value) + : convertStringToNumber(target.value); field.onChange(newValue); }; diff --git ORI/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx ALT/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx index 21da8b1..b0e942b 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx @@ -253,8 +253,8 @@ export const SelectArrayInput = (props: SelectArrayInputProps) => { const finalValue = Array.isArray(field.value ?? []) ? field.value : field.value - ? [field.value] - : []; + ? [field.value] + : []; const outlinedInputProps = variant === 'outlined' diff --git ORI/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx ALT/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx index a37e8c1..607027b 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/input/SelectInput.tsx @@ -207,8 +207,8 @@ export const SelectInput = (props: SelectInputProps) => { return isElement(emptyText) ? emptyText : emptyText === '' - ? ' ' // em space, forces the display of an empty line of normal height - : translate(emptyText, { _: emptyText }); + ? ' ' // em space, forces the display of an empty line of normal height + : translate(emptyText, { _: emptyText }); }, [emptyText, translate]); const renderMenuItemOption = useCallback( diff --git ORI/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx ALT/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx index 243f802..c851ebf 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/layout/Theme/ThemeProvider.tsx @@ -48,8 +48,8 @@ export const ThemeProvider = ({ typeof mode === 'object' ? mode // FIXME: legacy useTheme, to be removed in v5 : mode === 'dark' - ? darkTheme - : lightTheme || themeOverride + ? darkTheme + : lightTheme || themeOverride ); } catch (e) { console.warn('Failed to reuse custom theme from store', e); diff --git ORI/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx ALT/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx index b1e4199..5e3c01a 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx @@ -160,8 +160,8 @@ export const SimpleList = ( _: primaryText, }) : isElement(primaryText) - ? primaryText - : primaryText(record, record.id)} + ? primaryText + : primaryText(record, record.id)} {!!tertiaryText && (isValidElement(tertiaryText) ? ( @@ -182,13 +182,13 @@ export const SimpleList = ( } ) : isElement( - tertiaryText - ) - ? tertiaryText - : tertiaryText( - record, - record.id - )} + tertiaryText + ) + ? tertiaryText + : tertiaryText( + record, + record.id + )} ))}
@@ -201,8 +201,8 @@ export const SimpleList = ( _: secondaryText, }) : isElement(secondaryText) - ? secondaryText - : secondaryText(record, record.id)) + ? secondaryText + : secondaryText(record, record.id)) } /> {(rightAvatar || rightIcon) && ( diff --git ORI/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx ALT/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx index f9824c6..3742fa0 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/list/datagrid/DatagridConfigurable.tsx @@ -67,13 +67,13 @@ export const DatagridConfigurable = ({ child.props.label && typeof child.props.label === 'string' // this list is serializable, so we can't store ReactElement in it ? child.props.label : child.props.source - ? // force the label to be the source - undefined - : // no source or label, generate a label - translate('ra.configurable.Datagrid.unlabeled', { - column: index, - _: `Unlabeled column #%{column}`, - }), + ? // force the label to be the source + undefined + : // no source or label, generate a label + translate('ra.configurable.Datagrid.unlabeled', { + column: index, + _: `Unlabeled column #%{column}`, + }), })); if (columns.length !== availableColumns.length) { setAvailableColumns(columns); diff --git ORI/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx ALT/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx index 07bdfef..a9982be 100644 --- ORI/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx +++ ALT/react-admin/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx @@ -122,8 +122,8 @@ export const Pagination: FC = memo(props => { const ActionsComponent = actions ? actions // overridden by caller : !isLoading && total != null - ? PaginationActions // regular navigation - : undefined; // partial navigation (uses default TablePaginationActions) + ? PaginationActions // regular navigation + : undefined; // partial navigation (uses default TablePaginationActions) return (
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: typescript-eslint/typescript-eslint@4bf2d7360eaf74c9ef87b196ff4c459b8f50800b

Diff (410 lines) ```diff diff --git ORI/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts ALT/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts index dad8feb..212e3bc 100644 --- ORI/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts +++ ALT/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts @@ -177,11 +177,11 @@ export default createRule({ ), ) : replacements !== undefined - ? fixer.replaceTextRange( - [replacements.start, replacements.end], - replacements.text, - ) - : []; + ? fixer.replaceTextRange( + [replacements.start, replacements.end], + replacements.text, + ) + : []; }, }); }); diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts index 2d4d3f5..1cb6945 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/key-spacing.ts @@ -244,35 +244,35 @@ export default util.createRule({ (typeof options.align === 'object' ? options.align.on : typeof options.multiLine?.align === 'object' - ? options.multiLine.align.on - : options.multiLine?.align ?? options.align) ?? 'colon'; + ? options.multiLine.align.on + : options.multiLine?.align ?? options.align) ?? 'colon'; const beforeColon = (typeof options.align === 'object' ? options.align.beforeColon : options.multiLine - ? typeof options.multiLine.align === 'object' - ? options.multiLine.align.beforeColon - : options.multiLine.beforeColon - : options.beforeColon) ?? false; + ? typeof options.multiLine.align === 'object' + ? options.multiLine.align.beforeColon + : options.multiLine.beforeColon + : options.beforeColon) ?? false; const expectedWhitespaceBeforeColon = beforeColon ? 1 : 0; const afterColon = (typeof options.align === 'object' ? options.align.afterColon : options.multiLine - ? typeof options.multiLine.align === 'object' - ? options.multiLine.align.afterColon - : options.multiLine.afterColon - : options.afterColon) ?? true; + ? typeof options.multiLine.align === 'object' + ? options.multiLine.align.afterColon + : options.multiLine.afterColon + : options.afterColon) ?? true; const expectedWhitespaceAfterColon = afterColon ? 1 : 0; const mode = (typeof options.align === 'object' ? options.align.mode : options.multiLine - ? typeof options.multiLine.align === 'object' - ? // same behavior as in original rule - options.multiLine.align.mode ?? options.multiLine.mode - : options.multiLine.mode - : options.mode) ?? 'strict'; + ? typeof options.multiLine.align === 'object' + ? // same behavior as in original rule + options.multiLine.align.mode ?? options.multiLine.mode + : options.multiLine.mode + : options.mode) ?? 'strict'; for (const node of group) { if (isKeyTypeNode(node)) { @@ -307,8 +307,8 @@ export default util.createRule({ ? 'extraKey' : 'extraValue' : align === 'colon' - ? 'missingKey' - : 'missingValue', + ? 'missingKey' + : 'missingValue', fix: fixer => { if (difference > 0) { return fixer.removeRange([ @@ -344,8 +344,8 @@ export default util.createRule({ ? options.singleLine.beforeColon : options.beforeColon : options.multiLine - ? options.multiLine.beforeColon - : options.beforeColon) ?? false; + ? options.multiLine.beforeColon + : options.beforeColon) ?? false; const expectedWhitespaceBeforeColon = beforeColon ? 1 : 0; const afterColon = (singleLine @@ -353,8 +353,8 @@ export default util.createRule({ ? options.singleLine.afterColon : options.afterColon : options.multiLine - ? options.multiLine.afterColon - : options.afterColon) ?? true; + ? options.multiLine.afterColon + : options.afterColon) ?? true; const expectedWhitespaceAfterColon = afterColon ? 1 : 0; const mode = (singleLine @@ -362,8 +362,8 @@ export default util.createRule({ ? options.singleLine.mode : options.mode : options.multiLine - ? options.multiLine.mode - : options.mode) ?? 'strict'; + ? options.multiLine.mode + : options.mode) ?? 'strict'; if (isApplicable(node)) { checkBeforeColon(node, expectedWhitespaceBeforeColon, mode); diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts index cadd102..a9bbbdc 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts @@ -361,8 +361,8 @@ function getNodeType(node: Member): MemberKind | null { return node.value && functionExpressions.includes(node.value.type) ? 'method' : node.readonly - ? 'readonly-field' - : 'field'; + ? 'readonly-field' + : 'field'; case AST_NODE_TYPES.TSPropertySignature: return node.readonly ? 'readonly-field' : 'field'; case AST_NODE_TYPES.TSIndexSignature: @@ -520,8 +520,8 @@ function getRank( 'static' in node && node.static ? 'static' : abstract - ? 'abstract' - : 'instance'; + ? 'abstract' + : 'instance'; const accessibility = getAccessibility(node); // Collect all existing member groups that apply to this node... diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts index 93b2140..5bfc146 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts @@ -126,8 +126,8 @@ export default util.createRule({ parent?.type === AST_NODE_TYPES.TSInterfaceBody ? parent.body : parent?.type === AST_NODE_TYPES.TSTypeLiteral - ? parent.members - : []; + ? parent.members + : []; const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] = members.filter( diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts index c2b87cc..00d656f 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts @@ -172,8 +172,8 @@ function createValidator( custom?.match === true ? 'match' : custom?.match === false - ? 'not match' - : null, + ? 'not match' + : null, }; } diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts index d740341..725f260 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -98,15 +98,15 @@ export default util.createRule({ ...(useAutoFix ? { fix } : !mergedWithClassDeclaration - ? { - suggest: [ - { - messageId: 'noEmptyWithSuper', - fix, - }, - ], - } - : null), + ? { + suggest: [ + { + messageId: 'noEmptyWithSuper', + fix, + }, + ], + } + : null), }); } } diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index 9f938ac..6ad8a81 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -221,10 +221,10 @@ export default util.createRule<[Options], MessageIds>({ allowInGenericTypeArguments && allowAsThisParameter ? 'invalidVoidNotReturnOrThisParamOrGeneric' : allowInGenericTypeArguments - ? getNotReturnOrGenericMessageId(node) - : allowAsThisParameter - ? 'invalidVoidNotReturnOrThisParam' - : 'invalidVoidNotReturn', + ? getNotReturnOrGenericMessageId(node) + : allowAsThisParameter + ? 'invalidVoidNotReturnOrThisParam' + : 'invalidVoidNotReturn', node, }); }, diff --git ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts index ae6c56e..f3398a6 100644 --- ORI/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts +++ ALT/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts @@ -266,8 +266,8 @@ export default util.createRule({ : 'comparingNullableToTrueDirect' : 'comparingNullableToFalse' : comparison.negated - ? 'negated' - : 'direct', + ? 'negated' + : 'direct', node, }); }, diff --git ORI/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts ALT/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts index 30132f9..eddf23b 100644 --- ORI/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts +++ ALT/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts @@ -103,10 +103,10 @@ function reducer( const usedSetting = settings.errorLevel ? settings.errorLevel : !recommendation - ? DEFAULT_RULE_SETTING - : recommendation === 'strict' - ? 'warn' - : recommendation; + ? DEFAULT_RULE_SETTING + : recommendation === 'strict' + ? 'warn' + : recommendation; if (BASE_RULES_TO_BE_OVERRIDDEN.has(key)) { const baseRuleName = BASE_RULES_TO_BE_OVERRIDDEN.get(key)!; diff --git ORI/typescript-eslint/packages/typescript-estree/src/convert.ts ALT/typescript-eslint/packages/typescript-estree/src/convert.ts index 71fe614..882f40a 100644 --- ORI/typescript-eslint/packages/typescript-estree/src/convert.ts +++ ALT/typescript-eslint/packages/typescript-estree/src/convert.ts @@ -2643,8 +2643,8 @@ export class Converter { node.kind === SyntaxKind.ConstructSignature ? AST_NODE_TYPES.TSConstructSignatureDeclaration : node.kind === SyntaxKind.CallSignature - ? AST_NODE_TYPES.TSCallSignatureDeclaration - : AST_NODE_TYPES.TSFunctionType; + ? AST_NODE_TYPES.TSCallSignatureDeclaration + : AST_NODE_TYPES.TSFunctionType; const result = this.createNode< | TSESTree.TSFunctionType | TSESTree.TSCallSignatureDeclaration @@ -2672,8 +2672,8 @@ export class Converter { parentKind === SyntaxKind.InterfaceDeclaration ? AST_NODE_TYPES.TSInterfaceHeritage : parentKind === SyntaxKind.HeritageClause - ? AST_NODE_TYPES.TSClassImplements - : AST_NODE_TYPES.TSInstantiationExpression; + ? AST_NODE_TYPES.TSClassImplements + : AST_NODE_TYPES.TSInstantiationExpression; const result = this.createNode< | TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements diff --git ORI/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts ALT/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts index 7518b0b..a7d862a 100644 --- ORI/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ ALT/typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -36,8 +36,8 @@ export function createParseSettings( options.debugLevel === true ? new Set(['typescript-eslint']) : Array.isArray(options.debugLevel) - ? new Set(options.debugLevel) - : new Set(), + ? new Set(options.debugLevel) + : new Set(), errorOnTypeScriptSyntacticAndSemanticIssues: false, errorOnUnknownASTType: options.errorOnUnknownASTType === true, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: @@ -59,8 +59,8 @@ export function createParseSettings( typeof options.loggerFn === 'function' ? options.loggerFn : options.loggerFn === false - ? (): void => {} - : console.log, // eslint-disable-line no-console + ? (): void => {} + : console.log, // eslint-disable-line no-console moduleResolver: options.moduleResolver ?? '', preserveNodeMaps: options.preserveNodeMaps !== false, programs: Array.isArray(options.programs) ? options.programs : null, diff --git ORI/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts ALT/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts index 0f286ef..7f3e7e8 100644 --- ORI/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts +++ ALT/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts @@ -405,8 +405,8 @@ describe('parseAndGenerateServices', () => { ext === '.json' ? '{ "x": 1 }' : jsxContent - ? 'const x =
;' - : 'const x = 1'; + ? 'const x =
;' + : 'const x = 1'; it(`should parse ${ext} file - ${ jsxContent ? 'with' : 'without' } JSX content - parserOptions.jsx = ${jsxSetting}`, () => { diff --git ORI/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts ALT/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts index bcb80ec..4aca4b0 100644 --- ORI/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts +++ ALT/typescript-eslint/packages/utils/src/eslint-utils/InferTypesFromRule.ts @@ -9,8 +9,8 @@ type InferOptionsTypeFromRule = T extends RuleModule< > ? TOptions : T extends RuleCreateFunction - ? TOptions - : unknown; + ? TOptions + : unknown; /** * Uses type inference to fetch the TMessageIds type from the given RuleModule @@ -21,7 +21,7 @@ type InferMessageIdsTypeFromRule = T extends RuleModule< > ? TMessageIds : T extends RuleCreateFunction - ? TMessageIds - : unknown; + ? TMessageIds + : unknown; export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule }; diff --git ORI/typescript-eslint/packages/website/plugins/generated-rule-docs.ts ALT/typescript-eslint/packages/website/plugins/generated-rule-docs.ts index 2e5a325..cdc39d6 100644 --- ORI/typescript-eslint/packages/website/plugins/generated-rule-docs.ts +++ ALT/typescript-eslint/packages/website/plugins/generated-rule-docs.ts @@ -258,16 +258,16 @@ export const generatedRuleDocs: Plugin = () => { meta.schema instanceof Array ? meta.schema[0] : meta.schema.type === 'array' - ? { - ...(meta.schema.definitions - ? { definitions: meta.schema.definitions } - : {}), - ...(meta.schema.$defs - ? { $defs: (meta.schema as JSONSchema7).$defs } - : {}), - ...(meta.schema.prefixItems as [JSONSchema])[0], - } - : meta.schema; + ? { + ...(meta.schema.definitions + ? { definitions: meta.schema.definitions } + : {}), + ...(meta.schema.$defs + ? { $defs: (meta.schema as JSONSchema7).$defs } + : {}), + ...(meta.schema.prefixItems as [JSONSchema])[0], + } + : meta.schema; children.splice( optionsH2Index + 1, diff --git ORI/typescript-eslint/packages/website/src/components/ast/utils.ts ALT/typescript-eslint/packages/website/src/components/ast/utils.ts index de55a5c..936e647 100644 --- ORI/typescript-eslint/packages/website/src/components/ast/utils.ts +++ ALT/typescript-eslint/packages/website/src/components/ast/utils.ts @@ -60,8 +60,8 @@ export function hasChildInRange( item.model.type === 'object' ? isInRange(position, item.model) : item.model.type === 'array' - ? isArrayInRange(position, item.model) - : false, + ? isArrayInRange(position, item.model) + : false, ), ); } diff --git ORI/typescript-eslint/packages/website/src/components/linter/utils.ts ALT/typescript-eslint/packages/website/src/components/linter/utils.ts index e2a4b3e..ff90ded 100644 --- ORI/typescript-eslint/packages/website/src/components/linter/utils.ts +++ ALT/typescript-eslint/packages/website/src/components/linter/utils.ts @@ -89,8 +89,8 @@ export function parseMarkers( marker.owner === 'eslint' ? code.value : marker.owner === 'typescript' - ? 'TypeScript' - : marker.owner; + ? 'TypeScript' + : marker.owner; if (!result[group]) { result[group] = { ```
github-actions[bot] commented 9 months ago

prettier/prettier@main VS prettier/prettier@3.0.3 :: vega/vega-lite@c9659206602eda1d894702a2a1f5b526b9832f9f

Diff (321 lines) ```diff diff --git ORI/vega-lite/src/channel.ts ALT/vega-lite/src/channel.ts index 289cc69..a359383 100644 --- ORI/vega-lite/src/channel.ts +++ ALT/vega-lite/src/channel.ts @@ -219,16 +219,16 @@ export function isSecondaryRangeChannel(c: ExtendedChannel): c is SecondaryRange export type MainChannelOf = C extends 'x2' ? 'x' : C extends 'y2' - ? 'y' - : C extends 'latitude2' - ? 'latitude' - : C extends 'longitude2' - ? 'longitude' - : C extends 'theta2' - ? 'theta' - : C extends 'radius2' - ? 'radius' - : C; + ? 'y' + : C extends 'latitude2' + ? 'latitude' + : C extends 'longitude2' + ? 'longitude' + : C extends 'theta2' + ? 'theta' + : C extends 'radius2' + ? 'radius' + : C; /** * Get the main channel for a range channel. E.g. `x` for `x2`. @@ -254,16 +254,16 @@ export function getMainRangeChannel(channel: C): Main export type SecondaryChannelOf = C extends 'x' ? 'x2' : C extends 'y' - ? 'y2' - : C extends 'latitude' - ? 'latitude2' - : C extends 'longitude' - ? 'longitude2' - : C extends 'theta' - ? 'theta2' - : C extends 'radius' - ? 'radius2' - : undefined; + ? 'y2' + : C extends 'latitude' + ? 'latitude2' + : C extends 'longitude' + ? 'longitude2' + : C extends 'theta' + ? 'theta2' + : C extends 'radius' + ? 'radius2' + : undefined; export function getVgPositionChannel(channel: PolarPositionChannel | PositionChannel) { if (isPolarPositionChannel(channel)) { diff --git ORI/vega-lite/src/channeldef.ts ALT/vega-lite/src/channeldef.ts index 77ed5a2..3cfd86f 100644 --- ORI/vega-lite/src/channeldef.ts +++ ALT/vega-lite/src/channeldef.ts @@ -1097,10 +1097,10 @@ export function initFieldOrDatumDef( const guideType = isPositionFieldOrDatumDef(fd) ? 'axis' : isMarkPropFieldOrDatumDef(fd) - ? 'legend' - : isFacetFieldDef(fd) - ? 'header' - : null; + ? 'legend' + : isFacetFieldDef(fd) + ? 'header' + : null; if (guideType && fd[guideType]) { const {format, formatType, ...newGuide} = fd[guideType]; if (isCustomFormatType(formatType) && !config.customFormatTypes) { diff --git ORI/vega-lite/src/compile/axis/config.ts ALT/vega-lite/src/compile/axis/config.ts index ee6b002..2f242bb 100644 --- ORI/vega-lite/src/compile/axis/config.ts +++ ALT/vega-lite/src/compile/axis/config.ts @@ -55,12 +55,12 @@ export function getAxisConfigs( scaleType === 'band' ? ['axisDiscrete', 'axisBand'] : scaleType === 'point' - ? ['axisDiscrete', 'axisPoint'] - : isQuantitative(scaleType) - ? ['axisQuantitative'] - : scaleType === 'time' || scaleType === 'utc' - ? ['axisTemporal'] - : []; + ? ['axisDiscrete', 'axisPoint'] + : isQuantitative(scaleType) + ? ['axisQuantitative'] + : scaleType === 'time' || scaleType === 'utc' + ? ['axisTemporal'] + : []; const axisChannel = channel === 'x' ? 'axisX' : 'axisY'; const axisOrient = isSignalRef(orient) ? 'axisOrient' : `axis${titleCase(orient)}`; // axisTop, axisBottom, ... diff --git ORI/vega-lite/src/compile/data/facet.ts ALT/vega-lite/src/compile/data/facet.ts index 4c3e581..a501aa4 100644 --- ORI/vega-lite/src/compile/data/facet.ts +++ ALT/vega-lite/src/compile/data/facet.ts @@ -63,8 +63,8 @@ export class FacetNode extends DataFlowNode { ...(isSortField(sort) ? {sortField: sort} : isArray(sort) - ? {sortIndexField: sortArrayIndexField(fieldDef, channel)} - : {}) + ? {sortIndexField: sortArrayIndexField(fieldDef, channel)} + : {}) }; } } @@ -231,8 +231,8 @@ export class FacetNode extends DataFlowNode { ? {signal: `ceil(${cardinality} / ${columns})`} : 1 : columns - ? {signal: `min(${cardinality}, ${columns})`} - : {signal: cardinality}; + ? {signal: `min(${cardinality}, ${columns})`} + : {signal: cardinality}; data.push({ name: `${this.facet.name}_${headerChannel}`, diff --git ORI/vega-lite/src/compile/data/geojson.ts ALT/vega-lite/src/compile/data/geojson.ts index d60f5d5..6e47d59 100644 --- ORI/vega-lite/src/compile/data/geojson.ts +++ ALT/vega-lite/src/compile/data/geojson.ts @@ -29,10 +29,10 @@ export class GeoJSONNode extends DataFlowNode { return isFieldDef(def) ? def.field : isDatumDef(def) - ? {expr: `${def.datum}`} - : isValueDef(def) - ? {expr: `${def['value']}`} - : undefined; + ? {expr: `${def.datum}`} + : isValueDef(def) + ? {expr: `${def['value']}`} + : undefined; }) as [GeoPositionChannel, GeoPositionChannel]; if (pair[0] || pair[1]) { diff --git ORI/vega-lite/src/compile/data/geopoint.ts ALT/vega-lite/src/compile/data/geopoint.ts index 282e4a7..a885913 100644 --- ORI/vega-lite/src/compile/data/geopoint.ts +++ ALT/vega-lite/src/compile/data/geopoint.ts @@ -35,10 +35,10 @@ export class GeoPointNode extends DataFlowNode { return isFieldDef(def) ? def.field : isDatumDef(def) - ? {expr: `${def.datum}`} - : isValueDef(def) - ? {expr: `${def['value']}`} - : undefined; + ? {expr: `${def.datum}`} + : isValueDef(def) + ? {expr: `${def['value']}`} + : undefined; }) as [GeoPositionChannel, GeoPositionChannel]; const suffix = coordinates[0] === LONGITUDE2 ? '2' : ''; diff --git ORI/vega-lite/src/compile/mark/encode/position-rect.ts ALT/vega-lite/src/compile/mark/encode/position-rect.ts index 72cc218..f1b09d5 100644 --- ORI/vega-lite/src/compile/mark/encode/position-rect.ts +++ ALT/vega-lite/src/compile/mark/encode/position-rect.ts @@ -210,10 +210,10 @@ function positionAndSize( ? 0 : 0.5 : isSignalRef(bandSize) - ? {signal: `(1-${bandSize})/2`} - : isRelativeBandSize(bandSize) - ? (1 - bandSize.band) / 2 - : 0 + ? {signal: `(1-${bandSize})/2`} + : isRelativeBandSize(bandSize) + ? (1 - bandSize.band) / 2 + : 0 }); if (vgSizeChannel) { @@ -328,8 +328,8 @@ function rectBinPosition({ const bandPosition = isSignalRef(bandSize) ? {signal: `(1-${bandSize.signal})/2`} : isRelativeBandSize(bandSize) - ? (1 - bandSize.band) / 2 - : 0.5; + ? (1 - bandSize.band) / 2 + : 0.5; if (isBinning(fieldDef.bin) || fieldDef.timeUnit) { return { diff --git ORI/vega-lite/src/compile/selection/project.ts ALT/vega-lite/src/compile/selection/project.ts index 0cd9136..0fee2a1 100644 --- ORI/vega-lite/src/compile/selection/project.ts +++ ALT/vega-lite/src/compile/selection/project.ts @@ -157,8 +157,8 @@ const project: SelectionCompiler = { hasContinuousDomain(model.getScaleComponent(channel).get('type')) ? 'R' : fieldDef.bin - ? 'R-RE' - : 'E'; + ? 'R-RE' + : 'E'; const p: SelectionProjection = {field, channel, type: tplType, index: proj.items.length}; p.signals = {...signalName(p, 'data'), ...signalName(p, 'visual')}; diff --git ORI/vega-lite/src/compile/selection/translate.ts ALT/vega-lite/src/compile/selection/translate.ts index 0c2602c..25cce1a 100644 --- ORI/vega-lite/src/compile/selection/translate.ts +++ ALT/vega-lite/src/compile/selection/translate.ts @@ -92,19 +92,19 @@ function onDelta( !boundScales || !scaleCmpt ? 'panLinear' : scaleType === 'log' - ? 'panLog' - : scaleType === 'symlog' - ? 'panSymlog' - : scaleType === 'pow' - ? 'panPow' - : 'panLinear'; + ? 'panLog' + : scaleType === 'symlog' + ? 'panSymlog' + : scaleType === 'pow' + ? 'panPow' + : 'panLinear'; const arg = !boundScales ? '' : scaleType === 'pow' - ? `, ${scaleCmpt.get('exponent') ?? 1}` - : scaleType === 'symlog' - ? `, ${scaleCmpt.get('constant') ?? 1}` - : ''; + ? `, ${scaleCmpt.get('exponent') ?? 1}` + : scaleType === 'symlog' + ? `, ${scaleCmpt.get('constant') ?? 1}` + : ''; const update = `${panFn}(${extent}, ${offset}${arg})`; signal.on.push({ diff --git ORI/vega-lite/src/compile/selection/zoom.ts ALT/vega-lite/src/compile/selection/zoom.ts index b839130..a75a370 100644 --- ORI/vega-lite/src/compile/selection/zoom.ts +++ ALT/vega-lite/src/compile/selection/zoom.ts @@ -93,19 +93,19 @@ function onDelta( !boundScales || !scaleCmpt ? 'zoomLinear' : scaleType === 'log' - ? 'zoomLog' - : scaleType === 'symlog' - ? 'zoomSymlog' - : scaleType === 'pow' - ? 'zoomPow' - : 'zoomLinear'; + ? 'zoomLog' + : scaleType === 'symlog' + ? 'zoomSymlog' + : scaleType === 'pow' + ? 'zoomPow' + : 'zoomLinear'; const arg = !boundScales ? '' : scaleType === 'pow' - ? `, ${scaleCmpt.get('exponent') ?? 1}` - : scaleType === 'symlog' - ? `, ${scaleCmpt.get('constant') ?? 1}` - : ''; + ? `, ${scaleCmpt.get('exponent') ?? 1}` + : scaleType === 'symlog' + ? `, ${scaleCmpt.get('constant') ?? 1}` + : ''; const update = `${zoomFn}(${base}, ${anchor}, ${delta}${arg})`; signal.on.push({ diff --git ORI/vega-lite/src/compositemark/errorbar.ts ALT/vega-lite/src/compositemark/errorbar.ts index 13e0e12..527efd4 100644 --- ORI/vega-lite/src/compositemark/errorbar.ts +++ ALT/vega-lite/src/compositemark/errorbar.ts @@ -446,10 +446,10 @@ function errorBarAggregationAndCalculation< const center: ErrorBarCenter = markDef.center ? markDef.center : markDef.extent - ? markDef.extent === 'iqr' - ? 'median' - : 'mean' - : config.errorbar.center; + ? markDef.extent === 'iqr' + ? 'median' + : 'mean' + : config.errorbar.center; const extent: ErrorBarExtent = markDef.extent ? markDef.extent : center === 'mean' ? 'stderr' : 'iqr'; if ((center === 'median') !== (extent === 'iqr')) { diff --git ORI/vega-lite/src/selection.ts ALT/vega-lite/src/selection.ts index f0f8590..7a6f7af 100644 --- ORI/vega-lite/src/selection.ts +++ ALT/vega-lite/src/selection.ts @@ -222,8 +222,8 @@ export interface SelectionParameter { value?: T extends 'point' ? SelectionInit | SelectionInitMapping[] : T extends 'interval' - ? SelectionInitIntervalMapping - : never; + ? SelectionInitIntervalMapping + : never; /** * When set, a selection is populated by input elements (also known as dynamic query widgets) @@ -240,8 +240,8 @@ export interface SelectionParameter { bind?: T extends 'point' ? Binding | Record | LegendBinding : T extends 'interval' - ? 'scales' - : never; + ? 'scales' + : never; } export type TopLevelSelectionParameter = SelectionParameter & { ```