Skip to content

Commit 38dc415

Browse files
authored
merge Prettier checks into ESLint setup, deps bumps (#2017)
1 parent 9b3c755 commit 38dc415

13 files changed

Lines changed: 113 additions & 132 deletions

.github/workflows/code-deploy-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v5
13+
- uses: actions/checkout@v6
1414
- name: Use Bun
1515
uses: oven-sh/setup-bun@v2
1616
- name: Deploy

.github/workflows/code-deploy-production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
name: production
2020
url: https://reactnative.directory
2121
steps:
22-
- uses: actions/checkout@v5
22+
- uses: actions/checkout@v6
2323
- name: Use Bun
2424
uses: oven-sh/setup-bun@v2
2525
- name: Deploy

.github/workflows/code-lint-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515
- name: Use Bun
1616
uses: oven-sh/setup-bun@v2
1717
- name: Install dependencies

.github/workflows/data-test-and-validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515
- name: Use Bun
1616
uses: oven-sh/setup-bun@v2
1717
- name: Install dependencies

.github/workflows/vercel-cleanup-data-blobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515
- name: Use Bun
1616
uses: oven-sh/setup-bun@v2
1717
- name: Install dependencies

.prettierrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

app.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22
"expo": {
33
"name": "React Native Directory",
44
"slug": "react-native-directory",
5-
"platforms": [
6-
"web"
7-
],
5+
"platforms": ["web"],
86
"version": "1.0.0",
97
"icon": "./assets/logo.png",
108
"updates": {
119
"fallbackToCacheTimeout": 0
1210
},
13-
"assetBundlePatterns": [
14-
"**/*"
15-
],
11+
"assetBundlePatterns": ["**/*"],
1612
"ios": {
1713
"supportsTablet": true
1814
},
19-
"plugins": [
20-
"expo-font"
21-
]
15+
"plugins": ["expo-font"]
2216
}
2317
}

bun.lock

Lines changed: 43 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import json from '@eslint/json';
12
import nextPlugin from '@next/eslint-plugin-next';
23
import { defineConfig, globalIgnores } from 'eslint/config';
34
import universeNativeConfig from 'eslint-config-universe/flat/native.js';
45
import universeNodeConfig from 'eslint-config-universe/flat/node.js';
56
import universeWebConfig from 'eslint-config-universe/flat/web.js';
7+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
68

79
const COMMON_RULES = {
810
'import/order': [
@@ -60,13 +62,30 @@ const TS_COMMON_RULES = {
6062
'@typescript-eslint/no-restricted-types': 'error',
6163
};
6264

65+
const PRETTIER_RULES = {
66+
'prettier/prettier': [
67+
'warn',
68+
{
69+
printWidth: 100,
70+
tabWidth: 2,
71+
singleQuote: true,
72+
bracketSameLine: true,
73+
trailingComma: 'es5',
74+
endOfLine: 'auto',
75+
arrowParens: 'avoid',
76+
plugins: ['@prettier/plugin-oxc'],
77+
},
78+
],
79+
};
80+
6381
export default defineConfig([
6482
globalIgnores([
6583
'**/.next',
6684
'**/.swc',
6785
'**/node_modules',
6886
'**/out',
6987
'**/public',
88+
'**/assets',
7089
'README.md',
7190
'next-env.d.ts',
7291
]),
@@ -86,6 +105,20 @@ export default defineConfig([
86105
},
87106
},
88107

108+
prettierRecommended,
109+
110+
// Typed Bun files configuration
111+
{
112+
files: ['**/*.json'],
113+
language: 'json/json',
114+
plugins: {
115+
json,
116+
},
117+
rules: {
118+
...PRETTIER_RULES,
119+
},
120+
},
121+
89122
// App files configuration
90123
{
91124
files: ['**/*.tsx', '**/*.d.ts'],
@@ -95,6 +128,7 @@ export default defineConfig([
95128
},
96129
rules: {
97130
...nextPlugin.configs.recommended.rules,
131+
...PRETTIER_RULES,
98132
...COMMON_RULES,
99133
...TS_COMMON_RULES,
100134
'@next/next/no-img-element': 'off',
@@ -122,6 +156,7 @@ export default defineConfig([
122156
files: ['**/*.ts'],
123157
extends: [universeNodeConfig],
124158
rules: {
159+
...PRETTIER_RULES,
125160
...COMMON_RULES,
126161
...TS_COMMON_RULES,
127162
},
@@ -132,6 +167,7 @@ export default defineConfig([
132167
files: ['**/*.js', '**/*.mjs'],
133168
extends: [universeNodeConfig],
134169
rules: {
170+
...PRETTIER_RULES,
135171
...COMMON_RULES,
136172
},
137173
},

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
"data:update": "bun scripts/build-and-score-data",
1010
"data:test": "bun scripts/validate-libraries",
1111
"data:validate": "ajv validate -s react-native-libraries.schema.json -d react-native-libraries.json --verbose --allowUnionTypes",
12-
"libraries:cleanup": "bun scripts/cleanup-libraries-json && bun libraries:format",
12+
"libraries:cleanup": "bun scripts/cleanup-libraries-json && bun run lint --fix",
1313
"libraries:recalculate": "bun scripts/recalculate-scores",
14-
"libraries:format": "prettier --experimental-cli --write react-native-libraries.json",
1514
"libraries:check": "bun scripts/check-resources",
1615
"llms:generate": "bun scripts/generate-llms",
1716
"ci:cleanup-blobs": "bun scripts/cleanup-data-blobs",
@@ -29,7 +28,7 @@
2928
"es-toolkit": "^1.42.0",
3029
"expo": "54.0.25",
3130
"expo-font": "^14.0.9",
32-
"next": "^16.0.4",
31+
"next": "^16.0.5",
3332
"node-emoji": "^2.2.0",
3433
"react": "19.2.0",
3534
"react-content-loader": "^7.1.1",
@@ -42,9 +41,10 @@
4241
"use-debounce": "^10.0.6"
4342
},
4443
"devDependencies": {
44+
"@eslint/json": "^0.14.0",
4545
"@expo/next-adapter": "^6.0.0",
46-
"@next/bundle-analyzer": "^16.0.4",
47-
"@prettier/plugin-oxc": "^0.0.5",
46+
"@next/bundle-analyzer": "^16.0.5",
47+
"@prettier/plugin-oxc": "^0.1.2",
4848
"@types/bun": "^1.3.3",
4949
"@types/react": "^19.2.7",
5050
"@vercel/blob": "^0.27.3",
@@ -53,13 +53,14 @@
5353
"cheerio": "^1.1.2",
5454
"dotenv": "^17.2.3",
5555
"eslint": "^9.39.1",
56-
"eslint-config-next": "^16.0.4",
56+
"eslint-config-next": "^16.0.5",
5757
"eslint-config-universe": "^15.0.3",
58+
"eslint-plugin-prettier": "^5.5.4",
5859
"lint-staged": "^16.2.7",
5960
"next-compose-plugins": "^2.2.1",
6061
"next-fonts": "^1.5.1",
6162
"next-images": "^1.8.5",
62-
"prettier": "^3.6.2",
63+
"prettier": "^3.7.3",
6364
"simple-git-hooks": "^2.13.1",
6465
"typescript": "^5.9.3",
6566
"user-agent-data-types": "^0.4.2"

0 commit comments

Comments
 (0)