From 3462971e30491d4f3eb366e3b6815897e3563980 Mon Sep 17 00:00:00 2001 From: Oleg Proskurin Date: Thu, 9 Oct 2025 22:44:36 +0700 Subject: [PATCH] feat: add prettier --- .prettierignore | 49 +++++++++++++++++++++++++++++++ .prettierrc.json | 10 +++++++ apps/admin/.eslintrc.json | 10 +++++++ apps/api-service/eslint.config.js | 3 ++ apps/landing/.eslintrc.json | 10 +++++++ apps/studio/.eslintrc.json | 10 +++++++ package.json | 5 ++++ pnpm-lock.yaml | 15 ++++++++-- 8 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.json create mode 100644 apps/admin/.eslintrc.json create mode 100644 apps/landing/.eslintrc.json create mode 100644 apps/studio/.eslintrc.json diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..9ea06f7 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,49 @@ +# Dependencies +node_modules +.pnpm-store + +# Build outputs +dist +build +.next +out +.turbo + +# Environment files +.env +.env.* + +# Logs +logs +*.log +npm-debug.log* +pnpm-debug.log* + +# Data and storage +data/ +*.sql +*.db +*.sqlite + +# Lock files +pnpm-lock.yaml +package-lock.json +yarn.lock + +# Coverage and test reports +coverage +.nyc_output + +# Editor files +.vscode +.idea +*.swp +*.swo + +# OS files +.DS_Store +Thumbs.db + +# Generated files +*.min.js +*.min.css diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..e0937b5 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,10 @@ +{ + "semi": true, + "trailingComma": "all", + "singleQuote": true, + "printWidth": 100, + "tabWidth": 2, + "useTabs": false, + "arrowParens": "always", + "endOfLine": "lf" +} diff --git a/apps/admin/.eslintrc.json b/apps/admin/.eslintrc.json new file mode 100644 index 0000000..85cf00f --- /dev/null +++ b/apps/admin/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "extends": [ + "next/core-web-vitals", + "prettier" + ], + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error" + } +} diff --git a/apps/api-service/eslint.config.js b/apps/api-service/eslint.config.js index 8d92bde..ff48600 100644 --- a/apps/api-service/eslint.config.js +++ b/apps/api-service/eslint.config.js @@ -13,6 +13,9 @@ module.exports = [ '@typescript-eslint': require('@typescript-eslint/eslint-plugin'), prettier: require('eslint-plugin-prettier'), }, + extends: [ + require('eslint-config-prettier'), + ], rules: { 'prettier/prettier': 'error', '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], diff --git a/apps/landing/.eslintrc.json b/apps/landing/.eslintrc.json new file mode 100644 index 0000000..85cf00f --- /dev/null +++ b/apps/landing/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "extends": [ + "next/core-web-vitals", + "prettier" + ], + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error" + } +} diff --git a/apps/studio/.eslintrc.json b/apps/studio/.eslintrc.json new file mode 100644 index 0000000..85cf00f --- /dev/null +++ b/apps/studio/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "extends": [ + "next/core-web-vitals", + "prettier" + ], + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error" + } +} diff --git a/package.json b/package.json index 140fac9..8cba81b 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,8 @@ "typecheck:studio": "pnpm --filter @banatie/studio typecheck", "typecheck:admin": "pnpm --filter @banatie/admin typecheck", "test": "pnpm --filter @banatie/api-service test", + "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,md}\"", + "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,md}\"", "clean": "pnpm -r clean && rm -rf node_modules", "install:all": "pnpm install" }, @@ -50,7 +52,10 @@ "author": "", "license": "MIT", "devDependencies": { + "eslint-config-prettier": "^9.1.2", + "eslint-plugin-prettier": "^5.5.4", "kill-port": "^2.0.1", + "prettier": "^3.6.2", "typescript": "^5.9.2" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0b96acb..86d240c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,18 @@ importers: .: devDependencies: + eslint-config-prettier: + specifier: ^9.1.2 + version: 9.1.2(eslint@9.36.0(jiti@2.6.1)) + eslint-plugin-prettier: + specifier: ^5.5.4 + version: 5.5.4(eslint-config-prettier@9.1.2(eslint@9.36.0(jiti@2.6.1)))(eslint@9.36.0(jiti@2.6.1))(prettier@3.6.2) kill-port: specifier: ^2.0.1 version: 2.0.1 + prettier: + specifier: ^3.6.2 + version: 3.6.2 typescript: specifier: ^5.9.2 version: 5.9.2 @@ -7279,7 +7288,7 @@ snapshots: eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1))(eslint@8.57.1) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.57.1) eslint-plugin-react: 7.37.5(eslint@8.57.1) eslint-plugin-react-hooks: 5.0.0-canary-7118f5dd7-20230705(eslint@8.57.1) @@ -7313,7 +7322,7 @@ snapshots: tinyglobby: 0.2.15 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1) transitivePeerDependencies: - supports-color @@ -7328,7 +7337,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.44.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9