Skip to content

Commit f25cbd5

Browse files
chore: eslint fixes
1 parent 6ca18a8 commit f25cbd5

8 files changed

Lines changed: 866 additions & 76 deletions

File tree

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ auto-changelog.js
77
# generated by bob
88
lib/
99

10+
# jest
11+
jest.config.*

.eslintrc.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
"extends": [
99
"airbnb-typescript",
1010
"plugin:prettier/recommended",
11-
"@react-native-community",
11+
"@react-native",
1212
"plugin:@typescript-eslint/recommended",
1313
"plugin:import/typescript",
1414
"plugin:react-hooks/recommended",
1515
"plugin:react/recommended",
16-
"plugin:@typescript-eslint/eslint-recommended",
17-
"plugin:@typescript-eslint/recommended",
18-
"plugin:@typescript-eslint/recommended-requiring-type-checking"
16+
"plugin:@typescript-eslint/recommended-type-checked",
17+
"plugin:@typescript-eslint/stylistic-type-checked"
1918
],
2019
"overrides": [
2120
{
@@ -54,6 +53,8 @@
5453
"rules": {
5554
"import/named": "off",
5655
"@typescript-eslint/no-unnecessary-type-assertion": 0,
56+
"@typescript-eslint/consistent-indexed-object-style": 0,
57+
"@typescript-eslint/prefer-nullish-coalescing": 0,
5758
"prefer-template": "off",
5859
"no-param-reassign": "off",
5960
"react/no-unused-prop-types": "off",

example/.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ index.js
33
metro.config.js
44
babel.config.js
55
routes.tsx
6+
7+
# jest
8+
jest.config.*

example/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
1010
},
1111
"dependencies": {
12-
"react": "18.2.0",
13-
"react-native": "0.72.3",
1412
"@react-navigation/native": "^6.1.7",
1513
"@react-navigation/native-stack": "^6.9.13",
1614
"add": "^2.0.6",
1715
"crypto-js": "^4.1.1",
1816
"lodash": "^4.17.21",
17+
"react": "18.2.0",
18+
"react-native": "0.72.3",
1919
"react-native-file-access": "^3.0.4",
2020
"react-native-gesture-handler": "^2.12.0",
2121
"react-native-reanimated": "^3.4.1",
@@ -30,25 +30,25 @@
3030
"@tsconfig/react-native": "^3.0.2",
3131
"@types/jest": "^29.5.3",
3232
"@types/react": "^18.2.17",
33-
"@types/react-test-renderer": "^18.0.0",
34-
"babel-jest": "^29.6.2",
35-
"eslint": "^8.46.0",
36-
"jest": "^29.6.2",
37-
"metro-react-native-babel-preset": "0.77.0",
38-
"prettier": "^3.0.0",
39-
"react-test-renderer": "18.2.0",
40-
"typescript": "5.1.6",
4133
"@types/react-native": "^0.72.2",
34+
"@types/react-test-renderer": "^18.0.0",
4235
"@typescript-eslint/eslint-plugin": "^6.2.0",
4336
"@typescript-eslint/parser": "^6.2.0",
37+
"babel-jest": "^29.6.2",
38+
"eslint": "^8.46.0",
4439
"eslint-config-airbnb": "^19.0.4",
4540
"eslint-config-airbnb-typescript": "^17.1.0",
4641
"eslint-config-prettier": "^8.9.0",
4742
"eslint-import-resolver-typescript": "^3.5.5",
4843
"eslint-plugin-flowtype": "^8.0.3",
4944
"eslint-plugin-import": "^2.28.0",
5045
"eslint-plugin-prettier": "^5.0.0",
51-
"eslint-plugin-react-hooks": "^4.6.0"
46+
"eslint-plugin-react-hooks": "^4.6.0",
47+
"jest": "^29.6.2",
48+
"metro-react-native-babel-preset": "0.77.0",
49+
"prettier": "^3.0.0",
50+
"react-test-renderer": "18.2.0",
51+
"typescript": "5.1.6"
5252
},
5353
"engines": {
5454
"node": ">=16"

jest.config.js

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

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"devDependencies": {
4545
"@commitlint/cli": "^17.6.7",
4646
"@commitlint/config-conventional": "^17.6.7",
47-
"@react-native-community/eslint-config": "^3.2.0",
47+
"@react-native/eslint-config": "^0.72.2",
4848
"@release-it/conventional-changelog": "^7.0.0",
4949
"@types/lodash": "^4.14.196",
5050
"@types/react": "^18.2.11",
@@ -60,10 +60,12 @@
6060
"eslint-import-resolver-typescript": "^3.5.5",
6161
"eslint-plugin-flowtype": "^8.0.3",
6262
"eslint-plugin-import": "^2.28.0",
63+
"eslint-plugin-jest": "^27.2.3",
6364
"eslint-plugin-prettier": "^5.0.0",
6465
"eslint-plugin-react-hooks": "^4.6.0",
6566
"eslint-plugin-react-native-a11y": "^3.3.0",
6667
"husky": "^8.0.3",
68+
"jest": "^29.6.2",
6769
"prettier": "^3.0.0",
6870
"react": "18.2.0",
6971
"react-native": "^0.72.3",
@@ -76,8 +78,8 @@
7678
"peerDependencies": {
7779
"react": "*",
7880
"react-native": "*",
79-
"react-native-reanimated": ">=2.2.0",
80-
"react-native-file-access": ">=3.0.0"
81+
"react-native-file-access": ">=3.0.0",
82+
"react-native-reanimated": ">=2.2.0"
8183
},
8284
"husky": {
8385
"hooks": {

src/types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface ImageState {
2323
uri: string | undefined;
2424
}
2525

26-
export type ImageProps = {
26+
export interface ImageProps {
2727
cacheKey?: string;
2828
defaultSource?: ImageURISource | number;
2929
maxAge?: number;
@@ -33,7 +33,7 @@ export type ImageProps = {
3333
source: string;
3434
style?: StyleProp<ImageStyle>;
3535
thumbnailSource?: string;
36-
};
36+
}
3737

3838
export interface IProps {
3939
accessibilityHint?: string;

0 commit comments

Comments
 (0)