add eslint config for react native

This commit is contained in:
Jesse de Wit
2023-11-10 21:21:50 +01:00
committed by ok300
parent 72f4ea0d0d
commit fc8be7ad20
5 changed files with 1662 additions and 19 deletions

View File

@@ -0,0 +1,43 @@
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'standard-with-typescript',
'plugin:react/recommended'
],
overrides: [
{
env: {
node: true
},
files: [
'.eslintrc.{js,cjs}'
],
parserOptions: {
sourceType: 'script'
}
}
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: [
'./tsconfig.json'
]
},
plugins: [
'react'
],
rules: {
'@typescript-eslint/explicit-function-return': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': 'off'
},
settings: {
react: {
version: 'detect'
}
}
}

View File

@@ -1,8 +0,0 @@
{
"endOfLine": "lf",
"printWidth": 80,
"semi": false,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "none"
}

View File

@@ -5,7 +5,9 @@
"main": "index.ts",
"license": "MIT",
"scripts": {
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"format": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
"compile": "tsc"
},
"dependencies": {
"@breeztech/react-native-breez-sdk": "0.2.9",
@@ -13,6 +15,15 @@
"react-native": "0.70.6"
},
"devDependencies": {
"tsx": "^3.12.7"
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.10.0",
"eslint": "^8.0.1",
"eslint-config-standard-with-typescript": "^39.1.1",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.33.2",
"tsx": "^3.12.7",
"typescript": "*"
}
}

View File

@@ -0,0 +1,27 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"module": "Node16",
"moduleResolution": "node16",
"noImplicitReturns": true,
"pretty": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "ES2021",
"lib": ["ES2021"],
"paths": {},
"types": ["@types/node"],
"noEmit": true,
"allowJs": true
},
"include": [
"**/*.ts",
".eslintrc.js",
]
}

File diff suppressed because it is too large Load Diff