Skip to content

Commit fb73eae

Browse files
authored
Example fix and versions bump (#100)
* dynamic path resolve * upgrade RN * refactor to TS * refactoring * lint setup * fix * cleanup
1 parent 84934b9 commit fb73eae

Some content is hidden

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

47 files changed

+5322
-4214
lines changed

.eslintrc.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
module.exports = {
22
root: true,
3-
extends: ['@react-native-community', 'plugin:prettier/recommended', 'prettier'],
3+
extends: ['@react-native', 'plugin:prettier/recommended', 'prettier'],
44
plugins: ['react', 'unused-imports', 'prettier'],
55
parserOptions: {
66
ecmaFeatures: {
77
jsx: true
8-
}
8+
},
9+
requireConfigFile: false
910
},
1011
rules: {
11-
'no-unused-vars': 'off', // or "@typescript-eslint/no-unused-vars": "off",
12+
'@typescript-eslint/no-unused-vars': 'off', // or "no-unused-vars": "off",
1213
'unused-imports/no-unused-imports': 'error',
1314
'unused-imports/no-unused-vars': [
1415
'warn',
15-
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' }
16+
{
17+
vars: 'all',
18+
varsIgnorePattern: '^_',
19+
args: 'after-used',
20+
argsIgnorePattern: '^_'
21+
}
1622
],
1723
'prettier/prettier': [
1824
'error',
@@ -32,17 +38,5 @@ module.exports = {
3238
'comma-dangle': ['warn', 'never'],
3339
'react-native/no-inline-styles': 'off',
3440
'react-hooks/exhaustive-deps': 'off'
35-
},
36-
overrides: [
37-
{
38-
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
39-
rules: {
40-
'@typescript-eslint/no-shadow': ['error'],
41-
'no-shadow': 'off',
42-
'no-undef': 'off',
43-
'react-hooks/exhaustive-deps': 'warn',
44-
'react-native/no-unused-styles': 'warn'
45-
}
46-
}
47-
]
41+
}
4842
}

.vscode/settings.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,26 @@
33
{
44
"mode": "auto"
55
}
6-
]
6+
],
7+
"editor.codeActionsOnSave": {
8+
"source.fixAll.eslint": true
9+
},
10+
"eslint.lintTask.enable": true,
11+
"eslint.probe": [
12+
"javascript",
13+
"javascriptreact",
14+
"typescript",
15+
"typescriptreact",
16+
"html",
17+
"markdown",
18+
"react",
19+
"tsx",
20+
"ts"
21+
],
22+
"jest.autoRun": "off",
23+
"prettier.requireConfig": true,
24+
"prettier.semi": false,
25+
"prettier.trailingComma": "none",
26+
"typescript.format.enable": false,
27+
"typescript.preferences.includePackageJsonAutoImports": "on"
728
}

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['@babel/preset-react']
3+
}

example/.buckconfig

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

example/.eslintrc.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
module.exports = {
22
root: true,
3-
extends: ['@react-native-community', 'plugin:prettier/recommended', 'prettier'],
3+
extends: ['@react-native', 'plugin:prettier/recommended', 'prettier'],
44
plugins: ['react', 'unused-imports', 'prettier'],
55
parserOptions: {
66
ecmaFeatures: {
77
jsx: true
8-
}
8+
},
9+
requireConfigFile: false
910
},
1011
rules: {
11-
'no-unused-vars': 'off', // or "@typescript-eslint/no-unused-vars": "off",
12+
'@typescript-eslint/no-unused-vars': 'off', // or "no-unused-vars": "off",
1213
'unused-imports/no-unused-imports': 'error',
1314
'unused-imports/no-unused-vars': [
1415
'warn',
15-
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' }
16+
{
17+
vars: 'all',
18+
varsIgnorePattern: '^_',
19+
args: 'after-used',
20+
argsIgnorePattern: '^_'
21+
}
1622
],
1723
'prettier/prettier': [
1824
'error',

example/.gitignore

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23+
ios/.xcode.env.local
2324

2425
# Android/IntelliJ
2526
#
@@ -29,33 +30,37 @@ build/
2930
local.properties
3031
*.iml
3132
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
3236

3337
# node.js
3438
#
3539
node_modules/
3640
npm-debug.log
3741
yarn-error.log
3842

39-
# BUCK
40-
buck-out/
41-
\.buckd/
42-
*.keystore
43-
!debug.keystore
44-
4543
# fastlane
4644
#
4745
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
4846
# screenshots whenever they are needed.
4947
# For more information about the recommended setup visit:
5048
# https://docs.fastlane.tools/best-practices/source-control/
5149

52-
*/fastlane/report.xml
53-
*/fastlane/Preview.html
54-
*/fastlane/screenshots
50+
**/fastlane/report.xml
51+
**/fastlane/Preview.html
52+
**/fastlane/screenshots
53+
**/fastlane/test_output
5554

5655
# Bundle artifact
5756
*.jsbundle
5857

5958
# Ruby / CocoaPods
6059
/ios/Pods/
6160
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*
64+
65+
# testing
66+
/coverage

example/.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/.watchmanconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

example/App.js renamed to example/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ const App = () => {
2929

3030
return (
3131
<AutocompleteDropdownContextProvider>
32-
<SafeAreaView style={(backgroundStyle, { flex: 1 })}>
32+
<SafeAreaView style={[backgroundStyle, { flex: 1, backgroundColor: 'red' }]}>
3333
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
3434
<KeyboardAvoidingView
3535
style={{ flex: 1 }}
36-
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
36+
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
3737
enabled>
3838
<ScrollView
3939
nestedScrollEnabled

example/Gemfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby '>= 2.6.10'
4+
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '>= 1.11.3'
6+
gem 'cocoapods', '~> 1.13'
7+
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

example/Gemfile.lock

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.5)
4+
CFPropertyList (3.0.6)
55
rexml
6-
activesupport (6.1.5)
6+
activesupport (7.0.8)
77
concurrent-ruby (~> 1.0, >= 1.0.2)
88
i18n (>= 1.6, < 2)
99
minitest (>= 5.1)
1010
tzinfo (~> 2.0)
11-
zeitwerk (~> 2.3)
12-
addressable (2.8.0)
13-
public_suffix (>= 2.0.2, < 5.0)
11+
addressable (2.8.5)
12+
public_suffix (>= 2.0.2, < 6.0)
1413
algoliasearch (1.27.5)
1514
httpclient (~> 2.8, >= 2.8.3)
1615
json (>= 1.5.1)
1716
atomos (0.1.3)
1817
claide (1.1.0)
19-
cocoapods (1.11.3)
18+
cocoapods (1.14.2)
2019
addressable (~> 2.8)
2120
claide (>= 1.0.2, < 2.0)
22-
cocoapods-core (= 1.11.3)
21+
cocoapods-core (= 1.14.2)
2322
cocoapods-deintegrate (>= 1.0.3, < 2.0)
24-
cocoapods-downloader (>= 1.4.0, < 2.0)
23+
cocoapods-downloader (>= 2.0)
2524
cocoapods-plugins (>= 1.0.0, < 2.0)
2625
cocoapods-search (>= 1.0.0, < 2.0)
27-
cocoapods-trunk (>= 1.4.0, < 2.0)
26+
cocoapods-trunk (>= 1.6.0, < 2.0)
2827
cocoapods-try (>= 1.1.0, < 2.0)
2928
colored2 (~> 3.1)
3029
escape (~> 0.0.4)
3130
fourflusher (>= 2.3.0, < 3.0)
3231
gh_inspector (~> 1.0)
3332
molinillo (~> 0.8.0)
3433
nap (~> 1.0)
35-
ruby-macho (>= 1.0, < 3.0)
36-
xcodeproj (>= 1.21.0, < 2.0)
37-
cocoapods-core (1.11.3)
38-
activesupport (>= 5.0, < 7)
34+
ruby-macho (>= 2.3.0, < 3.0)
35+
xcodeproj (>= 1.23.0, < 2.0)
36+
cocoapods-core (1.14.2)
37+
activesupport (>= 5.0, < 8)
3938
addressable (~> 2.8)
4039
algoliasearch (~> 1.0)
4140
concurrent-ruby (~> 1.1)
@@ -45,7 +44,7 @@ GEM
4544
public_suffix (~> 4.0)
4645
typhoeus (~> 1.0)
4746
cocoapods-deintegrate (1.0.5)
48-
cocoapods-downloader (1.6.3)
47+
cocoapods-downloader (2.0)
4948
cocoapods-plugins (1.0.0)
5049
nap
5150
cocoapods-search (1.0.1)
@@ -54,47 +53,47 @@ GEM
5453
netrc (~> 0.11)
5554
cocoapods-try (1.2.0)
5655
colored2 (3.1.2)
57-
concurrent-ruby (1.1.10)
56+
concurrent-ruby (1.2.2)
5857
escape (0.0.4)
59-
ethon (0.15.0)
58+
ethon (0.16.0)
6059
ffi (>= 1.15.0)
61-
ffi (1.15.5)
60+
ffi (1.16.3)
6261
fourflusher (2.3.1)
6362
fuzzy_match (2.0.4)
6463
gh_inspector (1.1.3)
6564
httpclient (2.8.3)
66-
i18n (1.10.0)
65+
i18n (1.14.1)
6766
concurrent-ruby (~> 1.0)
68-
json (2.6.1)
69-
minitest (5.15.0)
67+
json (2.6.3)
68+
minitest (5.20.0)
7069
molinillo (0.8.0)
7170
nanaimo (0.3.0)
7271
nap (1.1.0)
7372
netrc (0.11.0)
7473
public_suffix (4.0.7)
75-
rexml (3.2.5)
74+
rexml (3.2.6)
7675
ruby-macho (2.5.1)
7776
typhoeus (1.4.0)
7877
ethon (>= 0.9.0)
79-
tzinfo (2.0.4)
78+
tzinfo (2.0.6)
8079
concurrent-ruby (~> 1.0)
81-
xcodeproj (1.21.0)
80+
xcodeproj (1.23.0)
8281
CFPropertyList (>= 2.3.3, < 4.0)
8382
atomos (~> 0.1.3)
8483
claide (>= 1.0.2, < 2.0)
8584
colored2 (~> 3.1)
8685
nanaimo (~> 0.3.0)
8786
rexml (~> 3.2.4)
88-
zeitwerk (2.5.4)
8987

9088
PLATFORMS
9189
ruby
9290

9391
DEPENDENCIES
94-
cocoapods (~> 1.11, >= 1.11.2)
92+
activesupport (>= 6.1.7.3, < 7.1.0)
93+
cocoapods (~> 1.13)
9594

9695
RUBY VERSION
97-
ruby 2.7.4p191
96+
ruby 3.1.3p185
9897

9998
BUNDLED WITH
100-
2.2.27
99+
2.3.26

example/README.md

Whitespace-only changes.

example/__tests__/App-test.js renamed to example/__tests__/App.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import 'react-native'
66
import React from 'react'
77
import App from '../App'
88

9+
// Note: import explicitly to use the types shiped with jest.
10+
import { it } from '@jest/globals'
11+
912
// Note: test renderer must be required after react-native.
1013
import renderer from 'react-test-renderer'
1114

0 commit comments

Comments
 (0)