Skip to content

Commit c80992b

Browse files
authored
Update prettier config for the project. (#16303)
* Update prettier config for the project. * Add prettier to make lint-fix.
1 parent 4286163 commit c80992b

31 files changed

+889
-924
lines changed

.detoxrc.js

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
module.exports = {
2-
"testRunner": "jest",
3-
"testRegex": "\\.visual\\.js$",
4-
"runner-config": "visual-test/config.json",
5-
"devices": {
6-
"simulator": {
7-
"type": "ios.simulator",
8-
"device": {
9-
"type": "iPhone 11 Pro"
10-
}
11-
}
2+
testRunner: 'jest',
3+
testRegex: '\\.visual\\.js$',
4+
'runner-config': 'visual-test/config.json',
5+
devices: {
6+
simulator: {
7+
type: 'ios.simulator',
8+
device: {
9+
type: 'iPhone 11 Pro',
10+
},
11+
},
1212
},
13-
"apps": {
14-
"ios.release": {
15-
"name": "StatusIm",
16-
"type": "ios.app",
17-
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/StatusIm.app",
18-
"build": "make release-ios"
13+
apps: {
14+
'ios.release': {
15+
name: 'StatusIm',
16+
type: 'ios.app',
17+
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/StatusIm.app',
18+
build: 'make release-ios',
19+
},
20+
'ios.debug': {
21+
name: 'StatusIm',
22+
type: 'ios.app',
23+
binaryPath: process.env.TEST_BINARY_PATH,
24+
build: "make run-ios SIMULATOR='iPhone 11 Pro'",
1925
},
20-
"ios.debug": {
21-
"name": "StatusIm",
22-
"type": "ios.app",
23-
"binaryPath": process.env.TEST_BINARY_PATH,
24-
"build": "make run-ios SIMULATOR='iPhone 11 Pro'"
25-
}
2626
},
27-
"configurations": {
28-
"ios.sim.release": {
29-
"device": "simulator",
30-
"app": "ios.release"
27+
configurations: {
28+
'ios.sim.release': {
29+
device: 'simulator',
30+
app: 'ios.release',
3131
},
32-
"ios.sim.debug": {
33-
"device": "simulator",
34-
"app": "ios.debug"
35-
}
36-
}
37-
}
32+
'ios.sim.debug': {
33+
device: 'simulator',
34+
app: 'ios.debug',
35+
},
36+
},
37+
};

.eslintrc.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
root: true,
3-
extends: '@react-native-community',
4-
};
2+
root: true,
3+
extends: '@react-native-community',
4+
};

.prettierignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*
2+
!*.js
3+
!*/
4+
*.clj-kondo
5+
*.shadow-cljs
6+
modules
7+
result

.prettierrc.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
module.exports = {
2-
bracketSpacing: false,
3-
bracketSameLine: true,
4-
singleQuote: true,
5-
trailingComma: 'all',
6-
tabWidth: 4,
2+
arrowParens: 'always',
3+
printWidth: 120,
4+
semi: true,
5+
singleQuote: true,
6+
tabWidth: 2,
7+
trailingComma: 'all',
8+
useTabs: false,
79
};

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,16 @@ lint: ##@test Run code style checks
306306
@sh scripts/lint-re-frame-in-quo-components.sh && \
307307
clj-kondo --config .clj-kondo/config.edn --cache false --lint src && \
308308
ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \
309-
zprint '{:search-config? true}' -sfc $$ALL_CLOJURE_FILES
309+
zprint '{:search-config? true}' -sfc $$ALL_CLOJURE_FILES && \
310+
yarn prettier
310311

311312
# NOTE: We run the linter twice because of https://github.com/kkinnear/zprint/issues/271
312313
lint-fix: export TARGET := default
313314
lint-fix: ##@test Run code style checks and fix issues
314315
ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \
315316
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \
316-
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES
317+
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \
318+
yarn prettier
317319

318320

319321
shadow-server: export TARGET := clojure

babel.config.js

+18-23
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
module.exports = {
2-
3-
"presets": [
4-
"module:metro-react-native-babel-preset"
5-
],
6-
"plugins": [
7-
"react-native-reanimated/plugin"
8-
],
9-
"env": {
10-
"test": {
11-
"presets": [
12-
'@babel/preset-react',
13-
[
14-
'@babel/preset-env',
15-
{
16-
targets: {
17-
node: '14',
18-
},
19-
},
20-
],
21-
],
22-
}
23-
}
24-
}
2+
presets: ['module:metro-react-native-babel-preset'],
3+
plugins: ['react-native-reanimated/plugin'],
4+
env: {
5+
test: {
6+
presets: [
7+
'@babel/preset-react',
8+
[
9+
'@babel/preset-env',
10+
{
11+
targets: {
12+
node: '14',
13+
},
14+
},
15+
],
16+
],
17+
},
18+
},
19+
};

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import "node-libs-react-native/globals";
2-
import "./result/index.js";
1+
import 'node-libs-react-native/globals';
2+
import './result/index.js';

metro.config.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
* @format
66
*/
77
module.exports = {
8-
transformer: {
9-
getTransformOptions: async () => ({
10-
transform: {
11-
experimentalImportSupport: false,
12-
inlineRequires: true,
13-
},
14-
}),
15-
},
16-
resolver: {
17-
extraNodeModules: require('node-libs-react-native'),
18-
},
8+
transformer: {
9+
getTransformOptions: async () => ({
10+
transform: {
11+
experimentalImportSupport: false,
12+
inlineRequires: true,
13+
},
14+
}),
15+
},
16+
resolver: {
17+
extraNodeModules: require('node-libs-react-native'),
18+
},
1919
};
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var binary = require('@mapbox/node-pre-gyp');
22
var path = require('path');
3-
var binding_path = binary.find(path.resolve(path.join(__dirname,'./../../../package.json')));
3+
var binding_path = binary.find(path.resolve(path.join(__dirname, './../../../package.json')));
44

55
module.exports = require(binding_path);
6-

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"app:compile:android": "shadow-cljs compile android",
1111
"app:watch": "shadow-cljs watch android",
1212
"app:packager": "react-native start --host 0.0.0.0 --port 8081",
13-
"app:android": "react-native run-android"
13+
"app:android": "react-native run-android",
14+
"prettier": "prettier --write ."
1415
},
1516
"dependencies": {
1617
"@babel/preset-typescript": "^7.17.12",
@@ -95,6 +96,7 @@
9596
"jest-image-snapshot": "^5.1.0",
9697
"nodemon": "^2.0.16",
9798
"nyc": "^14.1.1",
99+
"prettier": "^2.8.8",
98100
"process": "0.11.10",
99101
"react-test-renderer": "18.0.0",
100102
"rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#refs/tags/v2.0.2-status",

react-native.config.js

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
module.exports = {
2-
dependencies: {
3-
'react-native-config': {
4-
platforms: {
5-
ios: null,
6-
},
7-
},
8-
'react-native-dialogs': {
9-
platforms: {
10-
android: null,
11-
ios: null,
12-
},
13-
},
14-
'react-native-image-resizer': {
15-
platforms: {
16-
ios: null,
17-
},
18-
},
19-
'react-native-status-keycard': {
20-
platforms: {
21-
android: null,
22-
ios: null,
23-
},
24-
},
25-
'@react-native-community/blur': {
26-
platforms: {
27-
android: null,
28-
},
29-
},
2+
dependencies: {
3+
'react-native-config': {
4+
platforms: {
5+
ios: null,
6+
},
307
},
8+
'react-native-dialogs': {
9+
platforms: {
10+
android: null,
11+
ios: null,
12+
},
13+
},
14+
'react-native-image-resizer': {
15+
platforms: {
16+
ios: null,
17+
},
18+
},
19+
'react-native-status-keycard': {
20+
platforms: {
21+
android: null,
22+
ios: null,
23+
},
24+
},
25+
'@react-native-community/blur': {
26+
platforms: {
27+
android: null,
28+
},
29+
},
30+
},
3131
};

0 commit comments

Comments
 (0)