From a8ce1bcfa69bd9e4a69c8bb9e7156bec80860a38 Mon Sep 17 00:00:00 2001 From: Rui Costa Date: Fri, 15 Dec 2023 00:59:48 +0000 Subject: [PATCH] chore: use more of prettier defaults --- .prettierrc | 2 -- package.json | 2 +- src/helpers/cardinal.ts | 2 +- src/helpers/ordinal.ts | 2 +- src/index.ts | 2 +- tsconfig.build.json | 14 +++++++------- tsconfig.json | 36 ++++++++++++++++++------------------ 7 files changed, 29 insertions(+), 31 deletions(-) diff --git a/.prettierrc b/.prettierrc index 4bbc4be..c959087 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,3 @@ { - "trailingComma": "es5", - "printWidth": 80, "useTabs": true } diff --git a/package.json b/package.json index 012a660..0d1fbd8 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "scripts": { "build": "tsx sh/build.ts", "coverage": "tsx sh/coverage.ts", - "format": "prettier --write src sh", + "format": "prettier --write src sh ./*.json", "lint:ts": "tsc --noEmit", "lint": "eslint src --ext ts,tsx", "run:examples:react": "tsx sh/run-examples-react.ts", diff --git a/src/helpers/cardinal.ts b/src/helpers/cardinal.ts index d5eb5e2..d62a205 100644 --- a/src/helpers/cardinal.ts +++ b/src/helpers/cardinal.ts @@ -3,7 +3,7 @@ export function getCardinal( n: number, options: Record, o: number, - locale: string + locale: string, ) { const specificNumber = `=${n}`; if (specificNumber in options) { diff --git a/src/helpers/ordinal.ts b/src/helpers/ordinal.ts index 3aac1c2..efea7a6 100644 --- a/src/helpers/ordinal.ts +++ b/src/helpers/ordinal.ts @@ -1,7 +1,7 @@ export function getOrdinal( n: number, options: Record, - locale: string + locale: string, ) { const pr = new Intl.PluralRules(locale, { type: "ordinal" }); const rule = pr.select(n); diff --git a/src/index.ts b/src/index.ts index 9e32c5a..4d4c52f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -51,7 +51,7 @@ class I18n { #resolve( placeholder: Value | MessagePlaceholder, - values: Record = {} + values: Record = {}, ): Value { if (typeof placeholder !== "object") { return placeholder; diff --git a/tsconfig.build.json b/tsconfig.build.json index 4e76d14..4478a5f 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,8 +1,8 @@ { - "extends": "./tsconfig.json", - "compilerOptions": { - "declaration": true, - "outDir": "./dist", - }, - "exclude": ["node_modules/**/*", "**/*.test.ts", "sh/*", "examples/**/*"] -} \ No newline at end of file + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "./dist" + }, + "exclude": ["node_modules/**/*", "**/*.test.ts", "sh/*", "examples/**/*"] +} diff --git a/tsconfig.json b/tsconfig.json index ab2e6f1..7987eef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,19 @@ { - "compilerOptions": { - "baseUrl": "./", - "declaration": true, - "esModuleInterop": true, - "jsx": "preserve", - "lib": ["dom", "esnext"], - "module": "commonjs", - "moduleResolution": "node", - "outDir": "./dist", - "removeComments": true, - "resolveJsonModule": true, - "strict": true, - "target": "es2019", - "types": ["vitest/globals"], - }, - "include": ["src/**/*", "sh/**/*", "examples/**/*"], - "exclude": ["node_modules/**/*"] -} \ No newline at end of file + "compilerOptions": { + "baseUrl": "./", + "declaration": true, + "esModuleInterop": true, + "jsx": "preserve", + "lib": ["dom", "esnext"], + "module": "commonjs", + "moduleResolution": "node", + "outDir": "./dist", + "removeComments": true, + "resolveJsonModule": true, + "strict": true, + "target": "es2019", + "types": ["vitest/globals"] + }, + "include": ["src/**/*", "sh/**/*", "examples/**/*"], + "exclude": ["node_modules/**/*"] +}