Skip to content

Commit

Permalink
revert: update prettier version (#1301)
Browse files Browse the repository at this point in the history
* Revert "chore(deps): update prettier version (#1284)"
This reverts commit c9e6b8f.
  • Loading branch information
diegopf authored Sep 26, 2023
1 parent c9e6b8f commit dce7676
Show file tree
Hide file tree
Showing 31 changed files with 162 additions and 248 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"husky": "~8.0.3",
"lerna": "~6.6.0",
"lint-staged": "~13.2.0",
"prettier": "~3.0.3"
"prettier": "~2.8.3"
},
"engines": {
"node": ">=18",
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-plugin-x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@
"@typescript-eslint/parser": "~5.49.0",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "~11.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "~3.5.2",
"eslint-plugin-cypress": "~2.12.1",
"eslint-plugin-import": "~2.27.5",
"eslint-plugin-jest": "~27.2.0",
"eslint-plugin-jsdoc": "~39.6.4",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-tsdoc": "~0.2.17",
"eslint-plugin-vue": "~8.7.1",
"eslint-plugin-vuejs-accessibility": "~2.0.0",
"prettier-plugin-tailwindcss": "~0.5.4"
"prettier-plugin-tailwindcss": "~0.3.0"
},
"devDependencies": {
"eslint": "~8.32.0",
"prettier": "~3.0.3"
"prettier": "~2.8.3"
},
"peerDependencies": {
"eslint": "~8.32.0",
"prettier": "^3.0.3"
"prettier": "^2.0.5"
},
"prettier": "./prettier-config.js",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-x/prettier-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ module.exports = {
trailingComma: 'none',
vueIndentScriptAndStyle: true,
plugins: [
'prettier-plugin-tailwindcss' // MUST come last
require('prettier-plugin-tailwindcss') // MUST come last
]
};
5 changes: 1 addition & 4 deletions packages/storage-service/src/browser-storage-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import { StorageService } from './storage-service';
export class BrowserStorageService implements StorageService {
protected logger: Logger;

public constructor(
private storage: Storage = localStorage,
private prefix: string = 'empathy'
) {
public constructor(private storage: Storage = localStorage, private prefix: string = 'empathy') {
this.logger = logger.child(`[StorageService][${prefix}]`);
}

Expand Down
5 changes: 1 addition & 4 deletions packages/x-adapter/src/http-clients/errors/request-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ export class RequestError extends Error {
*
* @public
*/
public constructor(
public readonly message: string,
public readonly response: Response
) {
public constructor(public readonly message: string, public readonly response: Response) {
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ export const webpackConfig = {
]
},
output: {
devtoolModuleFilenameTemplate: ({
resourcePath,
hash,
query
}: webpackFilenameTemplateInfo) =>
devtoolModuleFilenameTemplate: ({ resourcePath, hash, query }: webpackFilenameTemplateInfo) =>
resourcePath.match(/\.vue$/) &&
!query.match(/type=script/) &&
!query.match(/\?rollup-plugin-vue=script.ts/)
Expand Down
1 change: 0 additions & 1 deletion packages/x-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
"typescript": "~4.9.4",
"vue": "~2.7.14",
"vue-docgen-cli": "~4.67.0",
"vue-loader": "^15.10.2",
"vue-router": "~3.6.5",
"vue-template-compiler": "~2.7.14",
"vuex": "~3.6.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function fakeIncrementalMovement(element: HTMLElement): void {
({
left: position++,
top: position++
}) as DOMRect;
} as DOMRect);
}

// Method for enter in hooks of component afterEnter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
&--move,
&--enter-active,
&--leave-active {
transition:
opacity $transition-opacity-duration ease-out,
transition: opacity $transition-opacity-duration ease-out,
transform $transition-transform-duration ease-out;
}
Expand Down
5 changes: 2 additions & 3 deletions packages/x-components/src/components/layouts/layouts.mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ export default class LayoutsMixin extends Vue {
protected hasContent(...slotNames: string[]): boolean {
return (
(this.devMode ||
slotNames.some(
slotName =>
this.$scopedSlots[slotName]?.(undefined)?.some(vNode => vNode.tag !== undefined)
slotNames.some(slotName =>
this.$scopedSlots[slotName]?.(undefined)?.some(vNode => vNode.tag !== undefined)
)) ??
false
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,8 @@
&__collapse-aside {
width: calc(
(
100% - var(--x-size-gap-default) * (var(--x-number-columns-layout-columns, 5)) - var(
--x-size-margin-layout-columns
)
100% - var(--x-size-gap-default) * (var(--x-number-columns-layout-columns, 5)) -
var(--x-size-margin-layout-columns)
) / var(--x-number-columns-layout-columns, 5) + var(--x-size-gap-default)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,8 @@ interface RenderBaseScrollOptions {
clientHeight?: number;
/** Distance to the end of the scroll. */
distanceToBottom?: number;
/**
* Flag to enable or disable resetting the scroll when the events at {@link BaseScroll.resetOn}
* are emitted.
*/
/** Flag to enable or disable resetting the scroll when the events at {@link BaseScroll.resetOn}
* are emitted. */
resetOnChange?: boolean;
/** List of events to reset the scroll when they are emitted. */
resetOn?: XEvent[];
Expand Down
5 changes: 2 additions & 3 deletions packages/x-components/src/store/utils/getters-proxy.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ function defineGetterProxy<ModuleName extends XModuleName>(
});
}

/**
* Clean the cache (This is for testing purpose).
/** Clean the cache (This is for testing purpose).
*
* @internal
*/
* */
export function cleanGettersProxyCache(): void {
cache = {};
}
Expand Down
6 changes: 2 additions & 4 deletions packages/x-components/src/store/utils/query.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import { RelatedTag } from '@empathyco/x-types';
* @public
*/
export interface QueryState {
/**
* The query of the module. Different modules may have queries that differ in value
* or time.
*/
/** The query of the module. Different modules may have queries that differ in value
* or time. */
query: string;
}

Expand Down
6 changes: 2 additions & 4 deletions packages/x-components/src/store/utils/status-store.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
* @public
*/
export interface StatusState {
/**
* The request status. Useful for changing the displayed component depending on whether the
* request has succeeded, has not been fulfilled or has failed.
*/
/** The request status. Useful for changing the displayed component depending on whether the
* request has succeeded, has not been fulfilled or has failed. */
status: RequestStatus;
}

Expand Down
19 changes: 8 additions & 11 deletions packages/x-components/src/utils/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,14 @@ export function groupItemsBy<ArrayType, ReturnType extends string | number>(
array: ArrayType[],
groupBy: (item: ArrayType, index: number) => ReturnType
): Record<ReturnType, ArrayType[]> {
return array.reduce<Record<ReturnType, ArrayType[]>>(
(accumulator, current, index) => {
const keyValue = groupBy(current, index);
if (!accumulator[keyValue]) {
accumulator[keyValue] = [];
}
accumulator[keyValue].push(current);
return accumulator;
},
{} as Record<ReturnType, ArrayType[]>
);
return array.reduce<Record<ReturnType, ArrayType[]>>((accumulator, current, index) => {
const keyValue = groupBy(current, index);
if (!accumulator[keyValue]) {
accumulator[keyValue] = [];
}
accumulator[keyValue].push(current);
return accumulator;
}, {} as Record<ReturnType, ArrayType[]>);
}

/**
Expand Down
6 changes: 2 additions & 4 deletions packages/x-components/src/utils/currency-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ const FORMAT_REGEX = /(i([^id]+))?i+(([^id?]+)(d+)(\?)?)?/;
interface CurrencyConfig {
/** The character between a group of three integer 'i's and the following one. */
integerSeparator: string;
/**
* The character between a group of three integer 'i's and the following one. It also
* supports more than one single character.
*/
/** The character between a group of three integer 'i's and the following one. It also
* supports more than one single character. */
decimalSeparator: string;
/** Length of decimals numbers. It counts the number of 'd's after the integer part. */
decimalsNumber: number;
Expand Down
12 changes: 6 additions & 6 deletions packages/x-components/src/wiring/namespaced-wiring.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export type NamespacedWireCommitPayload<
* @public
*/
export interface NamespacedWireCommit<ModuleName extends XModuleName> {
<MutationName extends MutationNamesFor<ModuleName>>(
mutation: MutationName
): Wire<ExtractMutationPayload<ModuleName, MutationName>>;
<MutationName extends MutationNamesFor<ModuleName>>(mutation: MutationName): Wire<
ExtractMutationPayload<ModuleName, MutationName>
>;
<MutationName extends MutationNamesFor<ModuleName>>(
mutation: MutationName,
payload: NamespacedWireCommitPayload<ModuleName, MutationName>
Expand Down Expand Up @@ -132,9 +132,9 @@ export type NamespacedWireDispatchPayload<
* @public
*/
export interface NamespacedWireDispatch<ModuleName extends XModuleName> {
<ActionName extends ActionNamesFor<ModuleName>>(
action: ActionName
): Wire<ExtractActionPayload<ModuleName, ActionName>>;
<ActionName extends ActionNamesFor<ModuleName>>(action: ActionName): Wire<
ExtractActionPayload<ModuleName, ActionName>
>;
<ActionName extends ActionNamesFor<ModuleName>>(
action: ActionName,
payload: NamespacedWireDispatchPayload<ModuleName, ActionName>
Expand Down
6 changes: 3 additions & 3 deletions packages/x-components/src/wiring/wiring.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ export interface WireService<SomeService extends Record<string, MonadicFunction>
* @param method - The method to invoke.
* @returns A Wire that expects to receive the function parameter as payload.
*/
<SomeMethod extends keyof SomeService>(
method: SomeMethod
): Wire<FirstParameter<SomeService[SomeMethod]>>;
<SomeMethod extends keyof SomeService>(method: SomeMethod): Wire<
FirstParameter<SomeService[SomeMethod]>
>;
/**
* Creates a wire that will invoke the given service function with the provided static payload.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ describe('testing Filters component', () => {
interface RenderExcludeFiltersWithNoResultsOptions {
/** The filters data to render. */
filters?: Filter[];
/**
* The template to render. Receives the `filters` via prop, and has registered the
* {@link ExcludeFiltersWithNoResults} component.
*/
/** The template to render. Receives the `filters` via prop, and has registered the
* {@link ExcludeFiltersWithNoResults} component. */
template?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ describe('testing Filters component', () => {
interface RenderFiltersOptions {
/** The filters data to render. */
filters?: Filter[];
/**
* The template to render. Receives the `filters` via prop, and has registered the
* {@link FiltersComponent} as `Filters`.
*/
/** The template to render. Receives the `filters` via prop, and has registered the
* {@link FiltersComponent} as `Filters`. */
template?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ interface RenderSelectedFiltersAPI {
selectedFiltersListWrapper: Wrapper<Vue>;
/** Toggle nth filter of the facet provided. */
toggleFacetNthFilter: (facetId: string, nth: number) => Promise<void>;
/**
* Retrieves the wrapper for the items of the list rendered by the {@link SelectedFiltersList}
* component.
*/
/** Retrieves the wrapper for the items of the list rendered by the {@link SelectedFiltersList}
* component. */
selectedFiltersItems: () => WrapperArray<Vue>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export default class FiltersInjectionMixin extends Vue {
@Prop({ required: false })
protected parentId?: Filter['id'];

/**
* The injected filters array.
/** The injected filters array.
*
* @public
*/
Expand Down
5 changes: 1 addition & 4 deletions packages/x-components/src/x-modules/facets/entities/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ export interface FilterEntityModifier<Metadata extends Dictionary = Dictionary>
export abstract class BaseFilterEntityModifier<Metadata extends Dictionary = Dictionary>
implements FilterEntity<Metadata>
{
public constructor(
protected store: Store<RootXStoreState>,
protected entity: FilterEntity
) {}
public constructor(protected store: Store<RootXStoreState>, protected entity: FilterEntity) {}

/**
* Selects the filter passed by parameter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ export class HistoryQueriesGetter implements GettersClass<HistoryQueriesXStoreMo
}

/**
* Creates a function for searching in the history queries array the items
* that match the current query.
* Creates a function for searching in the history queries array the items that match the current
* query.
*
* @param normalizedQuery - The normalized query for search into the array.
* @param hideIfEqualsQuery - If `true`, removes items that are exactly like
* the current query.
* @returns A filter function for searching into the array of history queries with
* the provided params.
* @param hideIfEqualsQuery - If `true`, removes items that are exactly like the current query.
* @returns A filter function for searching into the array of history queries with the provided
* params.
* @internal
*/
protected searchInHistoryQueries(
Expand All @@ -51,8 +50,10 @@ export class HistoryQueriesGetter implements GettersClass<HistoryQueriesXStoreMo

const historyQueriesGetter = new HistoryQueriesGetter();

// eslint-disable-next-line jsdoc/require-description-complete-sentence
/**
* @public
* {@inheritDoc HistoryQueriesGetter.historyQueries}
*
* @public
*/
export const historyQueries = historyQueriesGetter.historyQueries.bind(historyQueriesGetter);
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ describe('testing next query item component', () => {
interface RenderNextQueryOptions {
/** The next query data to render. */
suggestion?: NextQuery;
/**
* The template to render. Receives the `nextQuery` via prop, and has registered the
* {@link NextQueryComponent} as `NextQuery`.
*/
/** The template to render. Receives the `nextQuery` via prop, and has registered the
* {@link NextQueryComponent} as `NextQuery`. */
template?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,15 @@
feature: this.queryFeature,
location: this.location
});
const filters = this.queryPreviewInfo.filters?.reduce(
(filtersList, filterId) => {
const facetId = filterId.split(':')[0];
const rawFilter = createRawFilter(filterId);
filtersList[facetId] = filtersList[facetId]
? filtersList[facetId].concat(rawFilter)
: [rawFilter];
return filtersList;
},
{} as Record<string, Filter[]>
);
const filters = this.queryPreviewInfo.filters?.reduce((filtersList, filterId) => {
const facetId = filterId.split(':')[0];
const rawFilter = createRawFilter(filterId);
filtersList[facetId] = filtersList[facetId]
? filtersList[facetId].concat(rawFilter)
: [rawFilter];
return filtersList;
}, {} as Record<string, Filter[]>);
return {
query: this.queryPreviewInfo.query,
Expand Down
Loading

0 comments on commit dce7676

Please sign in to comment.