Skip to content

Commit 18d431f

Browse files
committed
fix: add tslint rules and fix some
1 parent d5df36f commit 18d431f

File tree

6 files changed

+71
-31
lines changed

6 files changed

+71
-31
lines changed

examples/SampleApp/eslint.config.mjs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import eslintPluginJest from 'eslint-plugin-jest';
66

77
import eslintReactNativeConfig from '@react-native/eslint-config';
88

9-
import typescriptParser from '@typescript-eslint/parser';
9+
import tsEslint from 'typescript-eslint';
1010

1111
const globals = Object.keys(eslintReactNativeConfig.globals).reduce((acc, key) => {
1212
if (eslintReactNativeConfig.globals[key]) {
@@ -15,7 +15,8 @@ const globals = Object.keys(eslintReactNativeConfig.globals).reduce((acc, key) =
1515
return acc;
1616
}, {});
1717

18-
export default [
18+
export default tsEslint.config(
19+
tsEslint.configs.recommended,
1920
{
2021
ignores: ['node_modules/', 'dist/', '**/*.config.js'],
2122
},
@@ -24,7 +25,12 @@ export default [
2425
languageOptions: {
2526
ecmaVersion: 'latest',
2627
sourceType: 'module',
27-
parser: typescriptParser,
28+
parser: tsEslint.parser,
29+
parserOptions: {
30+
ecmaFeatures: {
31+
jsx: true,
32+
},
33+
},
2834
globals: {
2935
...globals,
3036
console: 'readonly',
@@ -43,4 +49,4 @@ export default [
4349
'react-native/no-inline-styles': 'off',
4450
},
4551
},
46-
];
52+
);

examples/SampleApp/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"ios": "react-native run-ios",
1212
"start": "react-native start",
1313
"test": "jest",
14-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
14+
"lint": "eslint .",
1515
"lint-fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
1616
"extract-changelog": "FILTER_PATH='examples/SampleApp' TAG_FORMAT=$npm_package_name'@v${version}' node ../../release/extract-changelog.js",
1717
"bootstrap": "yarn install",
@@ -65,7 +65,6 @@
6565
"@types/jest": "^29.5.13",
6666
"@types/react": "^18.2.6",
6767
"@types/react-test-renderer": "^18.0.0",
68-
"@typescript-eslint/parser": "^8.24.1",
6968
"eslint": "^9.20.1",
7069
"eslint-plugin-eslint-comments": "^3.2.0",
7170
"eslint-plugin-jest": "^28.11.0",
@@ -75,7 +74,8 @@
7574
"jest": "^29.7.0",
7675
"prettier": "^3.5.1",
7776
"react-test-renderer": "18.3.1",
78-
"typescript": "5.7.3"
77+
"typescript": "5.7.3",
78+
"typescript-eslint": "^8.24.1"
7979
},
8080
"engines": {
8181
"node": ">=18"

examples/SampleApp/src/components/OverlayBackdrop.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type OverlayBackdropProps = {
66
style?: StyleProp<ViewStyle>;
77
};
88

9-
export const OverlayBackdrop = (props: OverlayBackdropProps): JSX.Element => {
9+
export const OverlayBackdrop = (props: OverlayBackdropProps): React.ReactNode => {
1010
const { style = {} } = props;
1111
const {
1212
theme: {

examples/SampleApp/src/hooks/useChatClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ messaging.setBackgroundMessageHandler(async (remoteMessage) => {
7373
const requestAndroidPermission = async () => {
7474
if (Platform.OS === 'android' && Platform.Version >= 33) {
7575
const result = await PermissionsAndroid.request(
76-
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
76+
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,
7777
);
7878
return result === PermissionsAndroid.RESULTS.GRANTED;
7979
}

examples/SampleApp/src/hooks/usePaginatedUsers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useRef, useState } from 'react';
1+
import React, { useEffect, useRef, useState } from 'react';
22

33
import { useAppContext } from '../context/AppContext';
44

examples/SampleApp/yarn.lock

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,6 +2643,21 @@
26432643
dependencies:
26442644
"@types/yargs-parser" "*"
26452645

2646+
"@typescript-eslint/[email protected]":
2647+
version "8.24.1"
2648+
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.24.1.tgz#d104c2a6212304c649105b18af2c110b4a1dd4ae"
2649+
integrity sha512-ll1StnKtBigWIGqvYDVuDmXJHVH4zLVot1yQ4fJtLpL7qacwkxJc1T0bptqw+miBQ/QfUbhl1TcQ4accW5KUyA==
2650+
dependencies:
2651+
"@eslint-community/regexpp" "^4.10.0"
2652+
"@typescript-eslint/scope-manager" "8.24.1"
2653+
"@typescript-eslint/type-utils" "8.24.1"
2654+
"@typescript-eslint/utils" "8.24.1"
2655+
"@typescript-eslint/visitor-keys" "8.24.1"
2656+
graphemer "^1.4.0"
2657+
ignore "^5.3.1"
2658+
natural-compare "^1.4.0"
2659+
ts-api-utils "^2.0.1"
2660+
26462661
"@typescript-eslint/eslint-plugin@^7.1.1":
26472662
version "7.18.0"
26482663
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz#b16d3cf3ee76bf572fdf511e79c248bdec619ea3"
@@ -2658,6 +2673,17 @@
26582673
natural-compare "^1.4.0"
26592674
ts-api-utils "^1.3.0"
26602675

2676+
"@typescript-eslint/[email protected]":
2677+
version "8.24.1"
2678+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.24.1.tgz#67965c2d2ddd7eadb2f094c395695db8334ef9a2"
2679+
integrity sha512-Tqoa05bu+t5s8CTZFaGpCH2ub3QeT9YDkXbPd3uQ4SfsLoh1/vv2GEYAioPoxCWJJNsenXlC88tRjwoHNts1oQ==
2680+
dependencies:
2681+
"@typescript-eslint/scope-manager" "8.24.1"
2682+
"@typescript-eslint/types" "8.24.1"
2683+
"@typescript-eslint/typescript-estree" "8.24.1"
2684+
"@typescript-eslint/visitor-keys" "8.24.1"
2685+
debug "^4.3.4"
2686+
26612687
"@typescript-eslint/parser@^7.1.1":
26622688
version "7.18.0"
26632689
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.18.0.tgz#83928d0f1b7f4afa974098c64b5ce6f9051f96a0"
@@ -2669,17 +2695,6 @@
26692695
"@typescript-eslint/visitor-keys" "7.18.0"
26702696
debug "^4.3.4"
26712697

2672-
"@typescript-eslint/parser@^8.24.1":
2673-
version "8.24.1"
2674-
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.24.1.tgz#67965c2d2ddd7eadb2f094c395695db8334ef9a2"
2675-
integrity sha512-Tqoa05bu+t5s8CTZFaGpCH2ub3QeT9YDkXbPd3uQ4SfsLoh1/vv2GEYAioPoxCWJJNsenXlC88tRjwoHNts1oQ==
2676-
dependencies:
2677-
"@typescript-eslint/scope-manager" "8.24.1"
2678-
"@typescript-eslint/types" "8.24.1"
2679-
"@typescript-eslint/typescript-estree" "8.24.1"
2680-
"@typescript-eslint/visitor-keys" "8.24.1"
2681-
debug "^4.3.4"
2682-
26832698
"@typescript-eslint/[email protected]":
26842699
version "5.62.0"
26852700
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c"
@@ -2714,6 +2729,16 @@
27142729
debug "^4.3.4"
27152730
ts-api-utils "^1.3.0"
27162731

2732+
"@typescript-eslint/[email protected]":
2733+
version "8.24.1"
2734+
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.24.1.tgz#99113e1df63d1571309d87eef68967344c78dd65"
2735+
integrity sha512-/Do9fmNgCsQ+K4rCz0STI7lYB4phTtEXqqCAs3gZW0pnK7lWNkvWd5iW545GSmApm4AzmQXmSqXPO565B4WVrw==
2736+
dependencies:
2737+
"@typescript-eslint/typescript-estree" "8.24.1"
2738+
"@typescript-eslint/utils" "8.24.1"
2739+
debug "^4.3.4"
2740+
ts-api-utils "^2.0.1"
2741+
27172742
"@typescript-eslint/[email protected]":
27182743
version "5.62.0"
27192744
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f"
@@ -2780,6 +2805,16 @@
27802805
"@typescript-eslint/types" "7.18.0"
27812806
"@typescript-eslint/typescript-estree" "7.18.0"
27822807

2808+
"@typescript-eslint/[email protected]", "@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0":
2809+
version "8.24.1"
2810+
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.24.1.tgz#08d14eac33cfb3456feeee5a275b8ad3349e52ed"
2811+
integrity sha512-OOcg3PMMQx9EXspId5iktsI3eMaXVwlhC8BvNnX6B5w9a4dVgpkQZuU8Hy67TolKcl+iFWq0XX+jbDGN4xWxjQ==
2812+
dependencies:
2813+
"@eslint-community/eslint-utils" "^4.4.0"
2814+
"@typescript-eslint/scope-manager" "8.24.1"
2815+
"@typescript-eslint/types" "8.24.1"
2816+
"@typescript-eslint/typescript-estree" "8.24.1"
2817+
27832818
"@typescript-eslint/utils@^5.10.0":
27842819
version "5.62.0"
27852820
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86"
@@ -2794,16 +2829,6 @@
27942829
eslint-scope "^5.1.1"
27952830
semver "^7.3.7"
27962831

2797-
"@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0":
2798-
version "8.24.1"
2799-
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.24.1.tgz#08d14eac33cfb3456feeee5a275b8ad3349e52ed"
2800-
integrity sha512-OOcg3PMMQx9EXspId5iktsI3eMaXVwlhC8BvNnX6B5w9a4dVgpkQZuU8Hy67TolKcl+iFWq0XX+jbDGN4xWxjQ==
2801-
dependencies:
2802-
"@eslint-community/eslint-utils" "^4.4.0"
2803-
"@typescript-eslint/scope-manager" "8.24.1"
2804-
"@typescript-eslint/types" "8.24.1"
2805-
"@typescript-eslint/typescript-estree" "8.24.1"
2806-
28072832
"@typescript-eslint/[email protected]":
28082833
version "5.62.0"
28092834
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e"
@@ -7910,6 +7935,15 @@ typed-array-length@^1.0.7:
79107935
possible-typed-array-names "^1.0.0"
79117936
reflect.getprototypeof "^1.0.6"
79127937

7938+
typescript-eslint@^8.24.1:
7939+
version "8.24.1"
7940+
resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.24.1.tgz#ce85d791392608a2a9f80c4b2530a214d16a2a47"
7941+
integrity sha512-cw3rEdzDqBs70TIcb0Gdzbt6h11BSs2pS0yaq7hDWDBtCCSei1pPSUXE9qUdQ/Wm9NgFg8mKtMt1b8fTHIl1jA==
7942+
dependencies:
7943+
"@typescript-eslint/eslint-plugin" "8.24.1"
7944+
"@typescript-eslint/parser" "8.24.1"
7945+
"@typescript-eslint/utils" "8.24.1"
7946+
79137947
79147948
version "5.7.3"
79157949
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"

0 commit comments

Comments
 (0)