Skip to content

Commit 6061f1c

Browse files
committed
build: add prettier as a separate command
react native config no long runs prettier as part of eslint facebook/react-native#43756 We now run prettier on its own
1 parent 93a2de0 commit 6061f1c

4 files changed

Lines changed: 43 additions & 77 deletions

File tree

dev-client/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native',
3+
extends: ['@react-native', 'prettier'],
44
rules: {
55
'react/jsx-uses-react': 'off',
66
'react/react-in-jsx-scope': 'off',

dev-client/.prettierignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Ignore everything except the code in src/ and some config files
2+
# Based on https://stackoverflow.com/a/70715829/458193
3+
*
4+
!.eslintrc.js
5+
!babel.config.js
6+
!index.js
7+
!jest.integration.config.js
8+
!jest.unit.config.js
9+
!metro.config.js
10+
!react-native.config.js
11+
!app.config.ts
12+
!src/**/*.js
13+
!src/**/*.jsx
14+
!src/**/*.ts
15+
!src/**/*.tsx
16+
!*/
17+
.expo/**

dev-client/package-lock.json

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

dev-client/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
"scripts": {
66
"android": "expo run:android",
77
"ios": "expo run:ios",
8-
"lint": "eslint ./ --ext .js --ext .ts --ext .tsx --max-warnings 0 --ignore-path ../.gitignore",
8+
"eslint": "eslint ./ --ext .js --ext .ts --ext .tsx --max-warnings 0 --ignore-path ../.gitignore",
9+
"lint": "npm run eslint && npm run prettier",
910
"lint-js": "npm run lint",
10-
"format": "npm run lint -- --fix",
11+
"prettier": "prettier --check .",
12+
"prettier-format": "prettier --write .",
13+
"format": "npm run lint -- --fix && npm run prettier-format",
1114
"format-js": "npm run format",
1215
"start": "expo start --dev-client",
1316
"test": "jest",
@@ -102,7 +105,7 @@
102105
"babel-plugin-root-import": "^6.6.0",
103106
"depcheck": "^1.4.7",
104107
"eslint": "^8.57.0",
105-
"eslint-plugin-prettier": "^5.2.1",
108+
"eslint-config-prettier": "^9.1.0",
106109
"flat": "^6.0.1",
107110
"i18next-conv": "^15.0.0",
108111
"jest": "^29.7.0",

0 commit comments

Comments
 (0)