Skip to content

Commit

Permalink
build: enable Prettier formatting
Browse files Browse the repository at this point in the history
This commit enables Prettier formatting to maintain a consistent code style
across the entire codebase. It's now a community standard and easy to use with
tools like Husky, which set up Git hooks to run formatting before actions such
as `git commit`.

There are no functional changes in this commit, only stylish updates to the formatting.

I enabled single quotes because they are widely used and even recommended by large technology
companies. For example, you can find a link to Google's JavaScript style guide
at https://google.github.io/styleguide/jsguide.html#features-strings-use-single-quotes
  • Loading branch information
arturovt committed May 29, 2024
1 parent 05d5424 commit f3aa848
Show file tree
Hide file tree
Showing 165 changed files with 2,294 additions and 2,008 deletions.
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

npm run pretty-quick -- --check
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules

/dist
/doc
/lib
/package.json
/package-lock.json

/.vscode
/.idea
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"endOfLine": "lf"
}
176 changes: 88 additions & 88 deletions dist/typesense.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/typesense.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/typesense.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/Typesense.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Client from "./Typesense/Client";
import SearchClient from "./Typesense/SearchClient";
import * as Errors from "./Typesense/Errors";
import Client from './Typesense/Client';
import SearchClient from './Typesense/SearchClient';
import * as Errors from './Typesense/Errors';
export { Client, SearchClient, Errors };
declare const _default: {
Client: typeof Client;
Expand Down
4 changes: 2 additions & 2 deletions lib/Typesense/Alias.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CollectionAliasSchema } from "./Aliases";
import ApiCall from "./ApiCall";
import { CollectionAliasSchema } from './Aliases';
import ApiCall from './ApiCall';
export default class Alias {
private name;
private apiCall;
Expand Down
2 changes: 1 addition & 1 deletion lib/Typesense/Alias.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Typesense/Aliases.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ApiCall from "./ApiCall";
import ApiCall from './ApiCall';
export interface CollectionAliasCreateSchema {
collection_name: string;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Typesense/Aliases.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions lib/Typesense/Analytics.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ApiCall from "./ApiCall";
import AnalyticsRules from "./AnalyticsRules";
import AnalyticsRule from "./AnalyticsRule";
import AnalyticsEvents from "./AnalyticsEvents";
import ApiCall from './ApiCall';
import AnalyticsRules from './AnalyticsRules';
import AnalyticsRule from './AnalyticsRule';
import AnalyticsEvents from './AnalyticsEvents';
export default class Analytics {
private readonly apiCall;
private readonly _analyticsRules;
Expand Down
2 changes: 1 addition & 1 deletion lib/Typesense/Analytics.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/Typesense/AnalyticsEvents.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ApiCall from "./ApiCall";
import { AnalyticsEventCreateSchema } from "./AnalyticsEvent";
import ApiCall from './ApiCall';
import { AnalyticsEventCreateSchema } from './AnalyticsEvent';
export default class AnalyticsEvents {
private readonly apiCall;
constructor(apiCall: ApiCall);
Expand Down
4 changes: 2 additions & 2 deletions lib/Typesense/AnalyticsEvents.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/Typesense/AnalyticsRule.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ApiCall from "./ApiCall";
import ApiCall from './ApiCall';
export interface AnalyticsRuleCreateSchema {
type: "popular_queries" | "nohits_queries" | "counter";
type: 'popular_queries' | 'nohits_queries' | 'counter';
params: {
source: {
collections: string[];
Expand Down
4 changes: 2 additions & 2 deletions lib/Typesense/AnalyticsRules.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ApiCall from "./ApiCall";
import { AnalyticsRuleCreateSchema, AnalyticsRuleSchema } from "./AnalyticsRule";
import ApiCall from './ApiCall';
import { AnalyticsRuleCreateSchema, AnalyticsRuleSchema } from './AnalyticsRule';
export interface AnalyticsRulesRetrieveSchema {
rules: AnalyticsRuleSchema[];
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Typesense/AnalyticsRules.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions lib/Typesense/ApiCall.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AxiosRequestConfig, AxiosResponse, Method } from "axios";
import TypesenseError from "./Errors/TypesenseError";
import Configuration, { NodeConfiguration } from "./Configuration";
import { AxiosRequestConfig, AxiosResponse, Method } from 'axios';
import TypesenseError from './Errors/TypesenseError';
import Configuration, { NodeConfiguration } from './Configuration';
interface Node extends NodeConfiguration {
isHealthy: boolean;
index: string | number;
Expand All @@ -21,7 +21,7 @@ export default class ApiCall {
constructor(configuration: Configuration);
get<T>(endpoint: string, queryParameters?: any, { abortSignal, responseType, }?: {
abortSignal?: any;
responseType?: AxiosRequestConfig["responseType"] | undefined;
responseType?: AxiosRequestConfig['responseType'] | undefined;
}): Promise<T>;
delete<T>(endpoint: string, queryParameters?: any): Promise<T>;
post<T>(endpoint: string, bodyParameters?: any, queryParameters?: any, additionalHeaders?: any): Promise<T>;
Expand All @@ -32,7 +32,7 @@ export default class ApiCall {
bodyParameters?: any;
additionalHeaders?: any;
abortSignal?: any;
responseType?: AxiosRequestConfig["responseType"] | undefined;
responseType?: AxiosRequestConfig['responseType'] | undefined;
skipConnectionTimeout?: boolean;
enableKeepAlive?: boolean | undefined;
}): Promise<T>;
Expand Down
48 changes: 24 additions & 24 deletions lib/Typesense/ApiCall.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f3aa848

Please sign in to comment.