Skip to content

Commit 29f649c

Browse files
committed
⬆️ update code based on upgraded dependencies
1 parent cc4f1b9 commit 29f649c

File tree

45 files changed

+272
-230
lines changed

Some content is hidden

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

45 files changed

+272
-230
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ ios
33
android
44
.expo
55
.tamagui
6+
*.config.js
7+
theme.d.ts

.eslintrc

-77
This file was deleted.

.eslintrc.cjs

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
rules: {
4+
"import/order": [
5+
"error",
6+
{
7+
groups: [
8+
"builtin",
9+
"external",
10+
"internal",
11+
"parent",
12+
"sibling",
13+
"index",
14+
],
15+
alphabetize: {
16+
caseInsensitive: true,
17+
order: "asc",
18+
},
19+
"newlines-between": "always",
20+
},
21+
],
22+
"perfectionist/sort-objects": [
23+
"error",
24+
{
25+
type: "line-length",
26+
order: "desc",
27+
},
28+
],
29+
"react-native/no-raw-text": [
30+
"off",
31+
{
32+
skip: ["Heading", "Body", "Title", "Button"],
33+
},
34+
],
35+
"import/newline-after-import": ["error", { count: 1 }],
36+
"@typescript-eslint/no-unsafe-assignment": "off",
37+
"@typescript-eslint/no-misused-promises": "off",
38+
"@typescript-eslint/no-unsafe-argument": "off",
39+
"@typescript-eslint/no-explicit-any": "off",
40+
"react-native/no-color-literals": "off",
41+
"no-console": "error",
42+
},
43+
overrides: [
44+
{
45+
files: [
46+
"*.stories.tsx",
47+
"test/**",
48+
"*.config.js",
49+
"*.config.ts",
50+
"plugins/**",
51+
],
52+
rules: {
53+
"import/no-extraneous-dependencies": "off",
54+
"import/no-default-export": "off",
55+
},
56+
},
57+
{
58+
env: {
59+
"jest/globals": true,
60+
jest: true,
61+
},
62+
files: ["test/**"],
63+
},
64+
{
65+
rules: {
66+
"import/no-extraneous-dependencies": "off",
67+
"import/no-default-export": "off",
68+
},
69+
files: ["theme.ts"],
70+
},
71+
],
72+
settings: {
73+
"import/parsers": {
74+
"@typescript-eslint/parser": [".ts", ".tsx"],
75+
},
76+
"import/resolver": {
77+
typescript: {},
78+
},
79+
},
80+
extends: ["@callstack", "plugin:@typescript-eslint/recommended-type-checked"],
81+
parserOptions: {
82+
tsconfigRootDir: __dirname,
83+
project: true,
84+
},
85+
plugins: ["perfectionist", "prettier", "@typescript-eslint"],
86+
parser: "@typescript-eslint/parser",
87+
root: true,
88+
};

.github/workflows/codeql.yml

+31-32
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
19+
branches: ["main"]
2020
schedule:
21-
- cron: '36 23 * * 4'
21+
- cron: "36 23 * * 4"
2222

2323
jobs:
2424
analyze:
@@ -38,45 +38,44 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
language: [ 'java', 'javascript', 'ruby', 'swift' ]
41+
language: ["java", "javascript", "ruby", "swift"]
4242
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
4343
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
4444
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
4545
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
4646

4747
steps:
48-
- name: Checkout repository
49-
uses: actions/checkout@v3
48+
- name: Checkout repository
49+
uses: actions/checkout@v3
5050

51-
# Initializes the CodeQL tools for scanning.
52-
- name: Initialize CodeQL
53-
uses: github/codeql-action/init@v2
54-
with:
55-
languages: ${{ matrix.language }}
56-
# If you wish to specify custom queries, you can do so here or in a config file.
57-
# By default, queries listed here will override any specified in a config file.
58-
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# Initializes the CodeQL tools for scanning.
52+
- name: Initialize CodeQL
53+
uses: github/codeql-action/init@v2
54+
with:
55+
languages: ${{ matrix.language }}
56+
# If you wish to specify custom queries, you can do so here or in a config file.
57+
# By default, queries listed here will override any specified in a config file.
58+
# Prefix the list here with "+" to use these queries and those in the config file.
5959

60-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
61-
# queries: security-extended,security-and-quality
60+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
61+
# queries: security-extended,security-and-quality
6262

63+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
64+
# If this step fails, then you should remove it and run the build manually (see below)
65+
- name: Autobuild
66+
uses: github/codeql-action/autobuild@v2
6367

64-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
65-
# If this step fails, then you should remove it and run the build manually (see below)
66-
- name: Autobuild
67-
uses: github/codeql-action/autobuild@v2
68+
# ℹ️ Command-line programs to run using the OS shell.
69+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6870

69-
# ℹ️ Command-line programs to run using the OS shell.
70-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
71+
# If the Autobuild fails above, remove it and uncomment the following three lines.
72+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
7173

72-
# If the Autobuild fails above, remove it and uncomment the following three lines.
73-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
74+
# - run: |
75+
# echo "Run, Build Application using script"
76+
# ./location_of_script_within_repo/buildscript.sh
7477

75-
# - run: |
76-
# echo "Run, Build Application using script"
77-
# ./location_of_script_within_repo/buildscript.sh
78-
79-
- name: Perform CodeQL Analysis
80-
uses: github/codeql-action/analyze@v2
81-
with:
82-
category: "/language:${{matrix.language}}"
78+
- name: Perform CodeQL Analysis
79+
uses: github/codeql-action/analyze@v2
80+
with:
81+
category: "/language:${{matrix.language}}"

.prettierrc.cjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import("prettier").Config} */
2+
const config = {
3+
trailingComma: "es5",
4+
singleQuote: false,
5+
tabWidth: 2,
6+
semi: true,
7+
};
8+
9+
module.exports = config;

eas.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"distribution": "internal",
1616
"developmentClient": false,
1717
"env": {
18-
"TAMAGUI_TARGET": "native",
18+
"TAMAGUI_TARGET": "native"
1919
},
2020
"channel": "preview"
2121
},
@@ -24,7 +24,7 @@
2424
"buildType": "app-bundle"
2525
},
2626
"env": {
27-
"TAMAGUI_TARGET": "native",
27+
"TAMAGUI_TARGET": "native"
2828
},
2929
"distribution": "store",
3030
"channel": "production"

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
104104
"eslint": "^8.56.0",
105105
"eslint-import-resolver-typescript": "^3.6.1",
106+
"eslint-plugin-flowtype": "^8.0.3",
106107
"eslint-plugin-import": "^2.29.1",
107108
"eslint-plugin-jest": "^27.6.3",
108109
"eslint-plugin-perfectionist": "^2.5.0",

src/components/bottom-sheet-input/helpers.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
12
/* eslint-disable import/no-extraneous-dependencies */
23
import {
34
SizeVariantSpreadFunction,

src/components/bottom-sheet-input/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ export function useInputProps(props: InputProps, ref: any) {
7878

7979
const placeholderColorProp = props.placeholderTextColor;
8080
const placeholderTextColor =
81-
// @ts-expect-error
82-
theme[placeholderColorProp as any]?.get() ??
81+
// @ts-expect-error placeholderColor is not in the type
82+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
83+
(placeholderColorProp && theme?.[placeholderColorProp]?.get?.()) ??
8384
placeholderColorProp ??
8485
theme.placeholderColor?.get();
8586

src/components/bottom-sheet/accent-backdrop/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
TapGestureHandlerGestureEvent,
66
} from "react-native-gesture-handler";
77
import Animated, {
8-
Extrapolate,
8+
Extrapolation,
99
interpolate,
1010
interpolateColor,
1111
runOnJS,
@@ -46,7 +46,7 @@ export default function AccentBackdrop({
4646
animatedIndex.value,
4747
[-1, 0, 1],
4848
[0, 0.4, 0.8],
49-
Extrapolate.CLAMP
49+
Extrapolation.CLAMP
5050
),
5151
}));
5252

src/components/country-bottom-sheet/index.tsx

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback, useMemo, useState } from "react";
1+
import React, { ComponentProps, useCallback, useMemo, useState } from "react";
22
import { Modal, Platform, StyleSheet, Image } from "react-native";
33
import { Button, Circle } from "tamagui";
44

@@ -41,19 +41,21 @@ export default function CountryBottomSheet({
4141
onPress={handleOnPress}
4242
scaleIcon={1.4}
4343
borderRadius="$12"
44-
icon={({ color, size }) => (
45-
<Circle size={size} overflow="hidden" bg={color}>
46-
<Image
47-
accessible={Platform.OS !== "web"}
48-
tintColor={color}
49-
accessibilityIgnoresInvertColors
50-
style={StyleSheet.absoluteFill}
51-
source={{
52-
uri: `https://flagcdn.com/w40/${region.toLowerCase()}.png`,
53-
}}
54-
/>
55-
</Circle>
56-
)}
44+
icon={
45+
(({ color, size }: { color: string; size: number }) => (
46+
<Circle size={size} overflow="hidden" bg={color}>
47+
<Image
48+
accessible={Platform.OS !== "web"}
49+
tintColor={color}
50+
accessibilityIgnoresInvertColors
51+
style={StyleSheet.absoluteFill}
52+
source={{
53+
uri: `https://flagcdn.com/w40/${region.toLowerCase()}.png`,
54+
}}
55+
/>
56+
</Circle>
57+
)) as ComponentProps<typeof Button>["icon"]
58+
}
5759
>
5860
<Button.Text>+{countryCode}</Button.Text>
5961
</Button>

0 commit comments

Comments
 (0)