Skip to content

Commit b6d2ca8

Browse files
Proposal: Apply prettier on the whole project files (kirillzyusko#313)
## 📜 Description This is a proposal. When I'm working on the repository, I notice that the formatter (prettier) update some part of the files even if I don't changed them. This occurs because some files are not formatted with it, this PR add a new npm command (`format`) and run it. I know that this is a lot of changes (especially in the docs markdown files), feels free to close the PR if you don't want to deal with this. ## 💡 Motivation and Context This simplifies collaboration on the project, can even been run on commit using `lint-staged`. --------- Co-authored-by: kirillzyusko <[email protected]>
1 parent 97e9c8f commit b6d2ca8

File tree

325 files changed

+4154
-3764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

325 files changed

+4154
-3764
lines changed

.eslintrc.cjs

+43-53
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,92 @@
11
module.exports = {
22
root: true,
3-
plugins: ['@typescript-eslint', 'react', 'react-native', 'jest', 'import'],
3+
plugins: ["@typescript-eslint", "react", "react-native", "jest", "import"],
44
extends: [
5-
'@react-native',
6-
'prettier',
7-
'eslint:recommended',
8-
'plugin:@typescript-eslint/recommended',
9-
'plugin:jest/recommended',
10-
'plugin:import/typescript',
5+
"@react-native",
6+
"prettier",
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:jest/recommended",
10+
"plugin:import/typescript",
1111
],
1212
settings: {
13-
'import/parsers': {
14-
'@typescript-eslint/parser': ['.ts', '.tsx'],
13+
"import/parsers": {
14+
"@typescript-eslint/parser": [".ts", ".tsx"],
1515
},
16-
'import/resolver': {
16+
"import/resolver": {
1717
typescript: {
1818
alwaysTryTypes: true,
19-
project: '<root>/tsconfig.json',
19+
project: "<root>/tsconfig.json",
2020
},
2121
},
2222
},
2323
rules: {
24-
'prettier/prettier': [
25-
'error',
24+
"prettier/prettier": [
25+
"error",
2626
{
27-
quoteProps: 'consistent',
28-
singleQuote: true,
29-
tabWidth: 2,
30-
trailingComma: 'es5',
31-
useTabs: false,
27+
quoteProps: "consistent",
28+
trailingComma: "all",
3229
},
3330
],
3431
// react
35-
'react-hooks/exhaustive-deps': 'warn',
32+
"react-hooks/exhaustive-deps": "warn",
3633
// typescript
37-
'@typescript-eslint/consistent-type-imports': [
38-
'error',
39-
{ prefer: 'type-imports' },
34+
"@typescript-eslint/consistent-type-imports": [
35+
"error",
36+
{ prefer: "type-imports" },
4037
],
41-
'@typescript-eslint/no-var-requires': 'warn',
38+
"@typescript-eslint/no-var-requires": "warn",
4239
// import
43-
'sort-imports': [
44-
'error',
40+
"sort-imports": [
41+
"error",
4542
{
4643
// sort destructure imports
4744
ignoreCase: false,
4845
ignoreDeclarationSort: true,
4946
ignoreMemberSort: false,
50-
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'],
47+
memberSyntaxSortOrder: ["none", "all", "single", "multiple"],
5148
allowSeparatedGroups: true,
5249
},
5350
],
54-
'import/order': [
55-
'error',
51+
"import/order": [
52+
"error",
5653
{
57-
'groups': [
58-
'builtin',
59-
'external',
60-
'internal',
61-
'parent',
62-
'sibling',
63-
'index',
64-
'type',
54+
"groups": [
55+
"builtin",
56+
"external",
57+
"internal",
58+
"parent",
59+
"sibling",
60+
"index",
61+
"type",
6562
],
66-
'alphabetize': {
67-
order: 'asc',
63+
"alphabetize": {
64+
order: "asc",
6865
caseInsensitive: true,
6966
},
70-
'newlines-between': 'always',
67+
"newlines-between": "always",
7168
},
7269
],
7370
},
7471
overrides: [
7572
{
76-
files: ['src/specs/**'],
73+
files: ["src/specs/**"],
7774
rules: {
78-
'@typescript-eslint/ban-types': [
79-
'error',
75+
"@typescript-eslint/ban-types": [
76+
"error",
8077
{
8178
extendDefaults: true,
8279
types: {
83-
'{}': false,
80+
"{}": false,
8481
},
8582
},
8683
],
8784
},
8885
},
8986
],
9087
env: {
91-
'react-native/react-native': true,
92-
'jest/globals': true,
88+
"react-native/react-native": true,
89+
"jest/globals": true,
9390
},
94-
ignorePatterns: [
95-
'node_modules/**',
96-
'lib/**',
97-
'example/**',
98-
'FabricExample/**',
99-
'docs/**',
100-
'scripts/**',
101-
],
91+
ignorePatterns: ["node_modules/**", "lib/**", "scripts/**"],
10292
};

.github/ISSUE_TEMPLATE/bug_report.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
4+
title: ""
55
labels: bug
66
assignees: kirillzyusko
7-
87
---
98

109
**Describe the bug**
@@ -18,6 +17,7 @@ I would be highly appreciate if you can provide repository for reproducing your
1817

1918
**To Reproduce**
2019
Steps to reproduce the behavior:
20+
2121
1. Go to '...'
2222
2. Click on '....'
2323
3. Scroll down to '....'
@@ -30,13 +30,14 @@ A clear and concise description of what you expected to happen.
3030
If applicable, add screenshots to help explain your problem.
3131

3232
**Smartphone (please complete the following information):**
33-
- Desktop OS: [e.g. Windows 10, MacOS 10.15.5]
34-
- Device: [e.g. iPhone8]
35-
- OS: [e.g. iOS 10.0]
36-
- RN version: [e.g. 0.68.2]
37-
- RN architecture: [e.g. old/new or paper/fabric]
38-
- JS engine: [e.g. JSC, Hermes, v8]
39-
- Library version: [e.g. 1.2.0]
33+
34+
- Desktop OS: [e.g. Windows 10, MacOS 10.15.5]
35+
- Device: [e.g. iPhone8]
36+
- OS: [e.g. iOS 10.0]
37+
- RN version: [e.g. 0.68.2]
38+
- RN architecture: [e.g. old/new or paper/fabric]
39+
- JS engine: [e.g. JSC, Hermes, v8]
40+
- Library version: [e.g. 1.2.0]
4041

4142
**Additional context**
42-
Add any other context about the problem here.
43+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
4+
title: ""
55
labels: Feature
66
assignees: kirillzyusko
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**
@@ -17,4 +16,4 @@ A clear and concise description of what you want to happen.
1716
A clear and concise description of any alternative solutions or features you've considered.
1817

1918
**Additional context**
20-
Add any other context or screenshots about the feature request here.
19+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
## 📜 Description
2+
23
<!-- Describe your changes in detail -->
34

45
## 💡 Motivation and Context
6+
57
<!-- Why is this change required? What problem does it solve? -->
68
<!-- If it fixes an open issue, please link to the issue here. -->
79

@@ -12,26 +14,31 @@
1214
<!-- If your changes don't affect one of platform/language below - then remove this platform/language -->
1315

1416
### JS
15-
-
16-
-
17+
18+
-
19+
-
1720

1821
### iOS
19-
-
20-
-
22+
23+
-
24+
-
2125

2226
### Android
23-
-
24-
-
27+
28+
-
29+
-
2530

2631
## 🤔 How Has This Been Tested?
32+
2733
<!-- Please describe in detail how you tested your changes. -->
2834
<!-- Include details of your testing environment, and the tests you ran to -->
2935
<!-- see how your change affects other areas of the code, etc. -->
3036

3137
## 📸 Screenshots (if appropriate):
38+
3239
<!-- Add screenshots/video if needed -->
3340
<!-- That would be highly appreciated if you can add how it looked before and after your changes -->
3441

3542
## 📝 Checklist
3643

37-
- [ ] CI successfully passed
44+
- [ ] CI successfully passed

.github/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ markComment: >
77
This issue has been automatically marked as stale because it has not had
88
recent activity. It will be closed if no further activity occurs. Thank you
99
for your contributions.
10-
closeComment: true
10+
closeComment: true

.github/workflows/android-e2e-test.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ name: 🛠 Android e2e tests
22
on:
33
pull_request:
44
paths:
5-
- '.github/workflows/android-e2e-test.yml'
6-
- 'package.json'
7-
- 'android/**'
8-
- 'example/**'
9-
- 'e2e/**'
10-
- 'src/**'
5+
- ".github/workflows/android-e2e-test.yml"
6+
- "package.json"
7+
- "android/**"
8+
- "example/**"
9+
- "e2e/**"
10+
- "src/**"
1111
push:
1212
branches:
1313
- main
1414
paths:
15-
- '.github/workflows/android-e2e-test.yml'
16-
- 'package.json'
17-
- 'android/**'
18-
- 'example/**'
19-
- 'e2e/**'
20-
- 'src/**'
15+
- ".github/workflows/android-e2e-test.yml"
16+
- "package.json"
17+
- "android/**"
18+
- "example/**"
19+
- "e2e/**"
20+
- "src/**"
2121

2222
jobs:
2323
test:
@@ -27,19 +27,19 @@ jobs:
2727
env:
2828
WORKING_DIRECTORY: example
2929
concurrency:
30-
group: android-e2e-${{ github.ref }}
31-
cancel-in-progress: true
30+
group: android-e2e-${{ github.ref }}
31+
cancel-in-progress: true
3232
steps:
3333
- uses: actions/checkout@v3
3434
- uses: actions/setup-node@v3
3535
with:
36-
node-version: 16.x
37-
cache: 'yarn'
36+
node-version: 18.x
37+
cache: "yarn"
3838
- name: Setup JDK 11
3939
uses: actions/setup-java@v3
4040
with:
41-
distribution: 'microsoft'
42-
java-version: '11'
41+
distribution: "microsoft"
42+
java-version: "11"
4343
- name: Get yarn cache directory path
4444
id: yarn-cache-dir-path
4545
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
@@ -77,8 +77,8 @@ jobs:
7777
api-level: 28
7878
target: default
7979
profile: pixel_2
80-
ram-size: '4096M'
81-
disk-size: '10G'
80+
ram-size: "4096M"
81+
disk-size: "10G"
8282
disable-animations: false
8383
avd-name: e2e_emulator
8484
arch: x86_64
@@ -87,4 +87,4 @@ jobs:
8787
if: ${{ failure() }}
8888
with:
8989
name: android-fail-screen-shoots
90-
path: e2e/artifacts
90+
path: e2e/artifacts

.github/workflows/build-android-fabric.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ on:
55
branches:
66
- main
77
paths:
8-
- '.github/workflows/build-android-fabric.yml'
9-
- 'android/**'
10-
- 'FabricExample/android/**'
11-
- 'yarn.lock'
12-
- 'FabricExample/yarn.lock'
13-
- 'src/specs/**'
8+
- ".github/workflows/build-android-fabric.yml"
9+
- "android/**"
10+
- "FabricExample/android/**"
11+
- "yarn.lock"
12+
- "FabricExample/yarn.lock"
13+
- "src/specs/**"
1414
pull_request:
1515
paths:
16-
- '.github/workflows/build-android-fabric.yml'
17-
- 'android/**'
18-
- 'FabricExample/android/**'
19-
- 'yarn.lock'
20-
- 'FabricExample/yarn.lock'
21-
- 'src/specs/**'
16+
- ".github/workflows/build-android-fabric.yml"
17+
- "android/**"
18+
- "FabricExample/android/**"
19+
- "yarn.lock"
20+
- "FabricExample/yarn.lock"
21+
- "src/specs/**"
2222

2323
jobs:
2424
build:
@@ -30,8 +30,8 @@ jobs:
3030
- name: Setup JDK 11
3131
uses: actions/setup-java@v3
3232
with:
33-
distribution: 'microsoft'
34-
java-version: '11'
33+
distribution: "microsoft"
34+
java-version: "11"
3535

3636
- name: Get yarn cache directory path
3737
id: fabric-yarn-cache-dir-path
@@ -57,4 +57,4 @@ jobs:
5757
restore-keys: |
5858
${{ runner.os }}-fabric-gradle-
5959
- name: Run Gradle Build for FabricExample/android/
60-
run: cd FabricExample/android && ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a && cd ../..
60+
run: cd FabricExample/android && ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a && cd ../..

0 commit comments

Comments
 (0)