Skip to content

Commit e14fd65

Browse files
committed
Use the shareable Prettier config
1 parent 420b753 commit e14fd65

File tree

10 files changed

+50
-25
lines changed

10 files changed

+50
-25
lines changed

.prettierignore

+30-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
**/dist/**
2-
**/etc/**
3-
**/temp/**
4-
**/__testfixtures__/**
1+
dist/
2+
temp/
3+
tmp/
4+
__testfixtures__/
5+
build/
6+
lib/
7+
8+
.yalc
9+
yalc.lock
10+
yalc.sig
11+
12+
.idea/
13+
.vscode/
14+
.tmp-projections
15+
coverage/
16+
17+
typesversions
18+
.cache
19+
.yarnrc
20+
.yarn/*
21+
.yarn/releases
22+
**/.yarn/cache
23+
.pnp.*
24+
*.tgz
25+
26+
tsconfig.vitest-temp.json
27+
.eslintcache
28+
29+
.docusaurus/
30+
.next/

.prettierrc.json

-4
This file was deleted.

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@babel/helper-compilation-targets": "^7.23.6",
3232
"@babel/traverse": "^7.24.1",
3333
"@babel/types": "^7.24.0",
34+
"@reduxjs/prettier-config": "workspace:^",
3435
"@types/react": "^19.0.1",
3536
"@types/react-dom": "^19.0.1",
3637
"@typescript-eslint/eslint-plugin": "6.12.0",
@@ -57,6 +58,8 @@
5758
"scripts": {
5859
"build": "yarn build:packages",
5960
"test": "yarn test:packages",
61+
"format": "prettier --write .",
62+
"format-check": "prettier --check .",
6063
"install": "yarn build-configs",
6164
"build-configs": "yarn workspaces foreach -Atip --include '@reduxjs/*config' run build",
6265
"build:examples": "yarn workspaces foreach -A --include '@reduxjs/*' --include '@examples-query-react/*' --include '@examples-action-listener/*' -vtp run build",

packages/rtk-codemods/.prettierrc.json

-6
This file was deleted.

packages/rtk-codemods/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"name": "@reduxjs/rtk-codemods",
33
"version": "0.1.2",
44
"scripts": {
5+
"format": "prettier --write . --ignore-path=$PROJECT_CWD/.prettierignore",
6+
"format-check": "prettier --check . --ignore-path=$PROJECT_CWD/.prettierignore",
57
"lint": "eslint .",
68
"test": "vitest --run",
79
"test:watch": "vitest --watch",
@@ -29,6 +31,7 @@
2931
"typescript": "^5.3.3"
3032
},
3133
"devDependencies": {
34+
"@reduxjs/prettier-config": "workspace:^",
3235
"@types/jscodeshift": "^0.11.11",
3336
"@typescript-eslint/parser": "^6.19.1",
3437
"eslint": "^8.56.0",

packages/rtk-query-codegen-openapi/.prettierrc

-7
This file was deleted.

packages/rtk-query-codegen-openapi/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"build": "yarn clean && tsup && chmod +x lib/bin/cli.mjs",
3636
"clean": "rimraf lib",
3737
"prepack": "yarn build && chmod +x lib/bin/cli.mjs",
38-
"format": "prettier --write \"src/**/*.ts\"",
38+
"format": "prettier --write . --ignore-path=$PROJECT_CWD/.prettierignore",
39+
"format-check": "prettier --check . --ignore-path=$PROJECT_CWD/.prettierignore",
3940
"test:update": "vitest --run --update",
4041
"test:update:enum": "lib/bin/cli.mjs test/config.example.enum.ts",
4142
"test": "vitest --run --typecheck",
@@ -51,6 +52,7 @@
5152
"@babel/preset-env": "^7.12.11",
5253
"@babel/preset-typescript": "^7.12.7",
5354
"@oazapfts/runtime": "^1.0.3",
55+
"@reduxjs/prettier-config": "workspace:^",
5456
"@reduxjs/toolkit": "^1.6.0",
5557
"@types/commander": "^2.12.2",
5658
"@types/glob-to-regexp": "^0.4.0",

packages/toolkit/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"@babel/helper-module-imports": "^7.24.7",
5555
"@microsoft/api-extractor": "^7.13.2",
5656
"@phryneas/ts-version": "^1.0.2",
57+
"@reduxjs/prettier-config": "workspace:^",
5758
"@size-limit/file": "^11.0.1",
5859
"@size-limit/webpack": "^11.0.1",
5960
"@testing-library/dom": "^10.4.0",
@@ -107,8 +108,8 @@
107108
"run-build": "tsup",
108109
"build": "yarn clean && yarn run-build && tsx scripts/fixUniqueSymbolExports.mts",
109110
"build-only": "yarn clean && yarn run-build",
110-
"format": "prettier --write \"(src|examples)/**/*.{ts,tsx}\" \"**/*.md\"",
111-
"format:check": "prettier --list-different \"(src|examples)/**/*.{ts,tsx}\" \"docs/*/**.md\"",
111+
"format": "prettier --write . --ignore-path=$PROJECT_CWD/.prettierignore",
112+
"format-check": "prettier --check . --ignore-path=$PROJECT_CWD/.prettierignore",
112113
"lint": "eslint src examples",
113114
"test": "vitest --typecheck --run ",
114115
"test:watch": "vitest --watch",

prettier.config.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createPrettierConfig } from '@reduxjs/prettier-config'
2+
3+
export default createPrettierConfig()

yarn.lock

+5-1
Original file line numberDiff line numberDiff line change
@@ -7606,7 +7606,7 @@ __metadata:
76067606
languageName: unknown
76077607
linkType: soft
76087608

7609-
"@reduxjs/prettier-config@workspace:packages/configs/prettier":
7609+
"@reduxjs/prettier-config@workspace:^, @reduxjs/prettier-config@workspace:packages/configs/prettier":
76107610
version: 0.0.0-use.local
76117611
resolution: "@reduxjs/prettier-config@workspace:packages/configs/prettier"
76127612
dependencies:
@@ -7627,6 +7627,7 @@ __metadata:
76277627
version: 0.0.0-use.local
76287628
resolution: "@reduxjs/rtk-codemods@workspace:packages/rtk-codemods"
76297629
dependencies:
7630+
"@reduxjs/prettier-config": "workspace:^"
76307631
"@types/jscodeshift": "npm:^0.11.11"
76317632
"@typescript-eslint/parser": "npm:^6.19.1"
76327633
eslint: "npm:^8.56.0"
@@ -7714,6 +7715,7 @@ __metadata:
77147715
"@babel/helper-module-imports": "npm:^7.24.7"
77157716
"@microsoft/api-extractor": "npm:^7.13.2"
77167717
"@phryneas/ts-version": "npm:^1.0.2"
7718+
"@reduxjs/prettier-config": "workspace:^"
77177719
"@size-limit/file": "npm:^11.0.1"
77187720
"@size-limit/webpack": "npm:^11.0.1"
77197721
"@testing-library/dom": "npm:^10.4.0"
@@ -8174,6 +8176,7 @@ __metadata:
81748176
"@babel/preset-env": "npm:^7.12.11"
81758177
"@babel/preset-typescript": "npm:^7.12.7"
81768178
"@oazapfts/runtime": "npm:^1.0.3"
8179+
"@reduxjs/prettier-config": "workspace:^"
81778180
"@reduxjs/toolkit": "npm:^1.6.0"
81788181
"@types/commander": "npm:^2.12.2"
81798182
"@types/glob-to-regexp": "npm:^0.4.0"
@@ -28332,6 +28335,7 @@ __metadata:
2833228335
"@babel/helper-compilation-targets": "npm:^7.23.6"
2833328336
"@babel/traverse": "npm:^7.24.1"
2833428337
"@babel/types": "npm:^7.24.0"
28338+
"@reduxjs/prettier-config": "workspace:^"
2833528339
"@types/react": "npm:^19.0.1"
2833628340
"@types/react-dom": "npm:^19.0.1"
2833728341
"@typescript-eslint/eslint-plugin": "npm:6.12.0"

0 commit comments

Comments
 (0)