Fix types - Mobile

This commit is contained in:
Utku Bakir
2022-08-11 12:22:58 +03:00
parent 56495719d5
commit ab432d4dd0
7 changed files with 53 additions and 54 deletions

View File

@@ -1,8 +1,42 @@
module.exports = {
...require('@sd/config/eslint-react-native.js'),
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
env: {
'react-native/react-native': true
},
ignorePatterns: ['**/*.js', '**/*.json', 'android', 'ios', '.expo']
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 12,
sourceType: 'module'
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended'
],
plugins: ['react', 'react-native'],
rules: {
'react/display-name': 'off',
'react/prop-types': 'off',
'react/no-unescaped-entities': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-control-regex': 'off',
'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs']
},
ignorePatterns: ['**/*.js', '**/*.json', 'node_modules', 'android', 'ios', '.expo'],
settings: {
react: {
version: 'detect'
}
}
};

View File

@@ -6,7 +6,8 @@
"scripts": {
"dev": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios"
"ios": "expo run:ios",
"lint": "eslint src/**/*.{ts,tsx} && tsc --noEmit"
},
"dependencies": {
"@expo/vector-icons": "^13.0.0",
@@ -41,16 +42,23 @@
"zustand": "^4.0.0"
},
"devDependencies": {
"@sd/config": "file:../../packages/config",
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.18.9",
"@rnx-kit/metro-config": "^1.2.36",
"@rnx-kit/metro-resolver-symlinks": "^0.1.21",
"@types/react": "~18.0.15",
"@types/react-native": "~0.69.5",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0",
"metro-minify-terser": "^0.72.0",
"react-native-svg": "^12.4.3",
"react-native-svg-transformer": "^1.0.0"
"react-native-svg-transformer": "^1.0.0",
"typescript": "^4.7.4"
},
"private": true
}

View File

Binary file not shown.

View File

@@ -8,6 +8,7 @@ declare module '*.svg' {
// This declaration is used by useNavigation, Link, ref etc.
declare global {
namespace ReactNavigation {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface RootParamList extends RootStackParamList {}
}
}

View File

@@ -1,42 +0,0 @@
module.exports = {
env: {
'react-native/react-native': true
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 12,
sourceType: 'module'
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended'
],
plugins: ['react', 'react-native'],
rules: {
'react/display-name': 'off',
'react/prop-types': 'off',
'react/no-unescaped-entities': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-control-regex': 'off',
'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs']
},
ignorePatterns: ['**/*.js', '**/*.json', 'node_modules'],
settings: {
react: {
version: 'detect'
}
}
};

View File

@@ -4,8 +4,7 @@
"main": "index.js",
"license": "GPL-3.0-only",
"files": [
"eslint-react.js",
"eslint-react-native.js"
"eslint-react.js"
],
"devDependencies": {
"eslint": "^8.21.0",
@@ -13,7 +12,6 @@
"@typescript-eslint/parser": "^5.30.7",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0"
"eslint-plugin-react-hooks": "^4.6.0"
}
}

BIN
pnpm-lock.yaml generated
View File

Binary file not shown.