diff --git a/tests/css/color/__snapshots__/jsfmt.spec.js.snap b/tests/css/color/__snapshots__/jsfmt.spec.js.snap index 6eb531ee4..a7d18630c 100644 --- a/tests/css/color/__snapshots__/jsfmt.spec.js.snap +++ b/tests/css/color/__snapshots__/jsfmt.spec.js.snap @@ -257,6 +257,56 @@ printWidth: 80 ================================================================================ `; +exports[`color-level-4.css format 1`] = ` +====================================options===================================== +parsers: ["css"] +printWidth: 80 + | printWidth +=====================================input====================================== +/* https://www.w3.org/TR/css-color-4 */ +foo { + color: rgb(0, 128, 255); + color: rgba(0, 128, 255, 0.5); + color: hsl(198, 28%, 50%); + color: hsla(198, 28%, 50%, 0.5); + color: lab(56.29% 019.93 16.58 / 50%); + color: lch(56.29% 19.86 236.62 / 50%); + /* color(sRGB 0 0.50 1 / 50%); */ +} + +bar { + color: rgb(0 128 255); + color: rgb(0 128 255 / 50%); + color: hsl(198deg 28% 50%); + color: hsl(198deg 28% 50% / 50%); + color: lab(56.29% 019.93 16.58 / 50%); + color: lch(56.29% 19.86 236.62deg / 50%); +} + +=====================================output===================================== +/* https://www.w3.org/TR/css-color-4 */ +foo { + color: rgb(0, 128, 255); + color: rgba(0, 128, 255, 0.5); + color: hsl(198, 28%, 50%); + color: hsla(198, 28%, 50%, 0.5); + color: lab(56.29% 019.93 16.58 / 50%); + color: lch(56.29% 19.86 236.62 / 50%); + /* color(sRGB 0 0.50 1 / 50%); */ +} + +bar { + color: rgb(0 128 255); + color: rgb(0 128 255 / 50%); + color: hsl(198deg 28% 50%); + color: hsl(198deg 28% 50% / 50%); + color: lab(56.29% 019.93 16.58 / 50%); + color: lch(56.29% 19.86 236.62deg / 50%); +} + +================================================================================ +`; + exports[`current-color.css format 1`] = ` ====================================options===================================== parsers: ["css"] diff --git a/tests/css/color/color-level-4.css b/tests/css/color/color-level-4.css new file mode 100644 index 000000000..6c03a0a26 --- /dev/null +++ b/tests/css/color/color-level-4.css @@ -0,0 +1,19 @@ +/* https://www.w3.org/TR/css-color-4 */ +foo { + color: rgb(0, 128, 255); + color: rgba(0, 128, 255, 0.5); + color: hsl(198, 28%, 50%); + color: hsla(198, 28%, 50%, 0.5); + color: lab(56.29% 019.93 16.58 / 50%); + color: lch(56.29% 19.86 236.62 / 50%); + /* color(sRGB 0 0.50 1 / 50%); */ +} + +bar { + color: rgb(0 128 255); + color: rgb(0 128 255 / 50%); + color: hsl(198deg 28% 50%); + color: hsl(198deg 28% 50% / 50%); + color: lab(56.29% 019.93 16.58 / 50%); + color: lch(56.29% 19.86 236.62deg / 50%); +} diff --git a/tests/flow/generic/__snapshots__/jsfmt.spec.js.snap b/tests/flow/generic/__snapshots__/jsfmt.spec.js.snap index 02240702a..efa8b4ae1 100644 --- a/tests/flow/generic/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/generic/__snapshots__/jsfmt.spec.js.snap @@ -69,6 +69,35 @@ var X = { ================================================================================ `; +exports[`function-default-type-parameters.js - {"trailingComma":"all"} format 1`] = ` +====================================options===================================== +parsers: ["flow", "babel"] +printWidth: 80 +trailingComma: "all" + | printWidth +=====================================input====================================== +function foo(): any {} + +=====================================output===================================== +function foo(): any {} + +================================================================================ +`; + +exports[`function-default-type-parameters.js format 1`] = ` +====================================options===================================== +parsers: ["flow", "babel"] +printWidth: 80 + | printWidth +=====================================input====================================== +function foo(): any {} + +=====================================output===================================== +function foo(): any {} + +================================================================================ +`; + exports[`generic.js - {"trailingComma":"all"} format 1`] = ` ====================================options===================================== parsers: ["flow", "babel"] diff --git a/tests/flow/generic/function-default-type-parameters.js b/tests/flow/generic/function-default-type-parameters.js new file mode 100644 index 000000000..e5bbdcc6f --- /dev/null +++ b/tests/flow/generic/function-default-type-parameters.js @@ -0,0 +1 @@ +function foo(): any {} diff --git a/tests/typescript/generic/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/generic/__snapshots__/jsfmt.spec.js.snap index cf8261eef..470b1ece1 100644 --- a/tests/typescript/generic/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/generic/__snapshots__/jsfmt.spec.js.snap @@ -130,6 +130,38 @@ export const getVehicleDescriptor = async ( ================================================================================ `; +exports[`issue-6899.ts format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const getUnusedAuthorizationHoldDocuments = async (): Promise => {} + +const firestorePersonallyIdentifiablePaths: Array< + keyof Collections.Users.Entity +> = [] + +export const SUPPORTED_VEHICLE_TYPES: Array< + Collections.VehiclesStates.Entity['type'] +> = Object.values(Collections.VehiclesStates.Type); + +=====================================output===================================== +const getUnusedAuthorizationHoldDocuments = async (): Promise< + DocumentData[] +> => {}; + +const firestorePersonallyIdentifiablePaths: Array< + keyof Collections.Users.Entity +> = []; + +export const SUPPORTED_VEHICLE_TYPES: Array< + Collections.VehiclesStates.Entity["type"] +> = Object.values(Collections.VehiclesStates.Type); + +================================================================================ +`; + exports[`object-method.ts format 1`] = ` ====================================options===================================== parsers: ["typescript"] diff --git a/tests/typescript/generic/issue-6899.ts b/tests/typescript/generic/issue-6899.ts new file mode 100644 index 000000000..7ce76d5fa --- /dev/null +++ b/tests/typescript/generic/issue-6899.ts @@ -0,0 +1,9 @@ +const getUnusedAuthorizationHoldDocuments = async (): Promise => {} + +const firestorePersonallyIdentifiablePaths: Array< + keyof Collections.Users.Entity +> = [] + +export const SUPPORTED_VEHICLE_TYPES: Array< + Collections.VehiclesStates.Entity['type'] +> = Object.values(Collections.VehiclesStates.Type);