Skip to content

Commit 14bbfa7

Browse files
committed
[compiler] Fix up prettier
Our prettier setup is all messed up after the merge, so this PR should fix things ghstack-source-id: f825460 Pull Request resolved: #29213
1 parent a9a0106 commit 14bbfa7

File tree

16 files changed

+59
-162
lines changed

16 files changed

+59
-162
lines changed

.github/workflows/compiler-typescript.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ jobs:
2424
run: echo "matrix=$(find packages -mindepth 1 -maxdepth 1 -type d | sed 's!packages/!!g' | tr '\n' ',' | sed s/.$// | jq -Rsc '. / "," - [""]')" >> $GITHUB_OUTPUT
2525

2626
# Hardcoded to improve parallelism for babel-plugin-react-compiler
27+
prettier:
28+
name: Run prettier
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: 18.x
35+
cache: "yarn"
36+
cache-dependency-path: compiler/yarn.lock
37+
- name: Restore cached node_modules
38+
uses: actions/cache@v4
39+
with:
40+
path: "**/node_modules"
41+
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
42+
- run: yarn install --frozen-lockfile
43+
- run: yarn prettier:ci
44+
45+
# Hardcoded to improve parallelism
2746
lint:
2847
name: Lint babel-plugin-react-compiler
2948
runs-on: ubuntu-latest
@@ -40,10 +59,9 @@ jobs:
4059
path: "**/node_modules"
4160
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
4261
- run: yarn install --frozen-lockfile
43-
- run: yarn workspace babel-plugin-react-compiler prettier:ci
4462
- run: yarn workspace babel-plugin-react-compiler lint
4563

46-
# Hardcoded to improve parallelism for babel-plugin-react-compiler
64+
# Hardcoded to improve parallelism
4765
jest:
4866
name: Jest babel-plugin-react-compiler
4967
runs-on: ubuntu-latest
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ module.exports = {
8282
],
8383
"@typescript-eslint/array-type": ["error", { default: "generic" }],
8484
"@typescript-eslint/triple-slash-reference": "off",
85+
"@typescript-eslint/no-var-requires": "off"
8586
},
8687
parser: "@typescript-eslint/parser",
8788
plugins: ["@typescript-eslint"],
8889
root: true,
89-
ignorePatterns: ["src/__tests__/**/*", "src/**/*.d.ts", "dist/**/*"],
90+
ignorePatterns: ["**/__tests__/**/*", "**/*.d.ts", "**/dist/**/*"],
9091
env: {
9192
node: true,
9293
},

compiler/.prettierignore

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
.fixtures/
2-
bench/
31
**/dist
42
**/__tests__/fixtures/**/*.expect.md
53
**/__tests__/fixtures/**/*.flow.js
64
**/.next
7-
test262/
8-
*.md
5+
6+
crates
7+
apps/playground/public
8+
9+
**/LICENSE
10+
.*
11+
*.md*
912
*.json
1013
*.css
1114
*.webmanifest
12-
packages/js-fuzzer
15+
*.map
16+
*.sh
17+
*.txt
18+
*.ico
19+
*.svg
20+
*.lock
21+
*.toml

compiler/.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const config = {
2+
requirePragma: false,
3+
parser: "babel-ts",
4+
semi: true,
5+
singleQuote: false,
6+
trailingComma: "es5"
7+
}
8+
9+
module.exports = config;

compiler/.prettierrc.json

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

compiler/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"build": "yarn workspaces run build",
2525
"dev": "concurrently --kill-others -n compiler,runtime,playground \"yarn workspace babel-plugin-react-compiler run build --watch\" \"yarn workspace react-compiler-runtime run build --watch\" \"wait-on packages/babel-plugin-react-compiler/dist/index.js && yarn workspace playground run dev\"",
2626
"test": "yarn workspaces run test",
27+
"prettier:write": "prettier --write . --log-level=warn",
28+
"prettier:ci": "prettier --check . --log-level=warn",
2729
"snap": "yarn workspace babel-plugin-react-compiler run snap",
2830
"snap:build": "yarn workspace snap run build",
2931
"postinstall": "perl -p -i -e 's/react\\.element/react.transitional.element/' packages/snap/node_modules/fbt/lib/FbtReactUtil.js && perl -p -i -e 's/didWarnAboutUsingAct = false;/didWarnAboutUsingAct = true;/' packages/babel-plugin-react-compiler/node_modules/react-dom/cjs/react-dom-test-utils.development.js",
@@ -40,6 +42,7 @@
4042
"concurrently": "^7.4.0",
4143
"folder-hash": "^4.0.4",
4244
"ora": "5.4.1",
45+
"prettier": "^3.2.5",
4346
"prompt-promise": "^1.0.3",
4447
"rollup": "^4.13.2",
4548
"rollup-plugin-banner2": "^1.2.3",

compiler/packages/babel-plugin-react-compiler/.prettierignore

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

compiler/packages/babel-plugin-react-compiler/.prettierrc.json

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

compiler/packages/babel-plugin-react-compiler/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
"snap:build": "yarn workspace snap run build",
1616
"snap:ci": "yarn snap:build && yarn snap",
1717
"ts:analyze-trace": "scripts/ts-analyze-trace.sh",
18-
"prettier": "node ./scripts/prettier.js write-changed",
19-
"prettier:all": "node ./scripts/prettier.js write",
20-
"prettier:ci": "prettier --check .",
2118
"lint": "yarn eslint src"
2219
},
2320
"dependencies": {
@@ -53,7 +50,6 @@
5350
"glob": "^7.1.6",
5451
"jest": "^29.0.3",
5552
"jest-environment-jsdom": "^29.0.3",
56-
"prettier": "2.8.8",
5753
"react": "19.0.0-beta-b498834eab-20240506",
5854
"react-dom": "19.0.0-beta-b498834eab-20240506",
5955
"rimraf": "^3.0.2",

compiler/packages/babel-plugin-react-compiler/scripts/prettier.js

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

0 commit comments

Comments
 (0)