Skip to content

Commit 6a74fc8

Browse files
committed
chore: expo doctor compatibility
1 parent d4d14b0 commit 6a74fc8

8 files changed

Lines changed: 6066 additions & 12682 deletions

File tree

.eslintignore

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

.eslintrc.js

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

.husky/commit-msg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx --no-install commitlint --edit

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
npm run prettier
52
npm run lint

eslint.config.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const tseslint = require("@typescript-eslint/eslint-plugin");
2+
const tsparser = require("@typescript-eslint/parser");
3+
const react = require("eslint-plugin-react");
4+
5+
module.exports = [
6+
{
7+
ignores: [
8+
"node_modules/**",
9+
"build/**",
10+
"example/**",
11+
"exampleManual/**",
12+
"**/*.js",
13+
"**/*.json",
14+
],
15+
},
16+
{
17+
files: ["lib/**/*.ts", "lib/**/*.tsx"],
18+
languageOptions: {
19+
parser: tsparser,
20+
parserOptions: {
21+
ecmaVersion: "latest",
22+
sourceType: "module",
23+
ecmaFeatures: {
24+
jsx: true,
25+
},
26+
},
27+
},
28+
plugins: {
29+
"@typescript-eslint": tseslint,
30+
react: react,
31+
},
32+
settings: {
33+
react: {
34+
version: "detect",
35+
},
36+
},
37+
rules: {
38+
quotes: ["error", "double", { avoidEscape: true }],
39+
"max-len": ["error", 120],
40+
"@typescript-eslint/no-explicit-any": "warn",
41+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
42+
"react/jsx-filename-extension": ["error", { extensions: [".tsx"] }],
43+
"no-nested-ternary": "error",
44+
"prefer-destructuring": "error",
45+
camelcase: "error",
46+
},
47+
},
48+
];
49+

lib/helpers/useStateWithCallback.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import {
66
SetStateAction,
77
} from "react";
88

9-
type Callback<T> = (value?: any) => void;
10-
type DispatchWithCallback<T> = (value: any, callback?: Callback<any>) => void;
9+
type Callback = (value?: any) => void;
10+
type DispatchWithCallback = (value: any, callback?: Callback) => void;
1111

12-
function useStateWithCallback<T>(
12+
function useStateWithCallback(
1313
initialState: any | (() => any),
14-
): [any, DispatchWithCallback<SetStateAction<any>>] {
14+
): [any, DispatchWithCallback] {
1515
const [state, _setState] = useState(initialState);
1616

1717
const callbackRef = useRef<Callback<any>>();

0 commit comments

Comments
 (0)