Skip to content

Commit b89999f

Browse files
Merge pull request #107 from rootstrap/feature/eslint-new-rules
ESLint: Update rules
2 parents c477dc6 + 9757074 commit b89999f

File tree

8 files changed

+3728
-8206
lines changed

8 files changed

+3728
-8206
lines changed

.eslintrc.js

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,39 @@ const path = require('path');
33
module.exports = {
44
// Configuration for JavaScript files
55
extends: [
6-
'expo',
7-
'plugin:tailwindcss/recommended',
6+
'expo',
7+
'plugin:tailwindcss/recommended',
88
'prettier',
9-
'eslint:recommended'
9+
'eslint:recommended',
10+
'plugin:@tanstack/query/recommended',
1011
],
1112
env: {
1213
'jest/globals': true,
13-
'node': true
14+
node: true,
1415
},
1516
plugins: [
16-
'unicorn',
17+
'unicorn',
1718
'@typescript-eslint',
1819
'unused-imports',
1920
'tailwindcss',
2021
'simple-import-sort',
2122
'sonarjs',
22-
'jest'
23+
'jest',
2324
],
2425
parser: '@typescript-eslint/parser',
2526
parserOptions: {
2627
project: './tsconfig.json',
2728
},
2829
ignorePatterns: [
29-
"node_modules",
30-
"*.config.js",
31-
"docs",
32-
"cli",
33-
"android",
34-
"ios",
35-
"lint-staged.config.js",
36-
"i18next-syntax-validation.js",
37-
".eslintrc.js"
30+
'node_modules',
31+
'*.config.js',
32+
'docs',
33+
'cli',
34+
'android',
35+
'ios',
36+
'lint-staged.config.js',
37+
'i18next-syntax-validation.js',
38+
'.eslintrc.js',
3839
],
3940
rules: {
4041
'import/no-duplicates': 'error',
@@ -81,7 +82,7 @@ module.exports = {
8182
argsIgnorePattern: '^_',
8283
varsIgnorePattern: '^_',
8384
caughtErrorsIgnorePattern: '^_',
84-
}
85+
},
8586
],
8687
curly: [2, 'all'],
8788
'prefer-const': [
@@ -91,16 +92,20 @@ module.exports = {
9192
},
9293
],
9394
'object-shorthand': 'error',
94-
'arrow-body-style': ["error", "as-needed"],
95-
'no-console': ['error', {allow: ['error']}],
95+
'arrow-body-style': ['error', 'as-needed'],
96+
'no-console': ['error', { allow: ['error'] }],
9697
'guard-for-in': 'error',
97-
'@typescript-eslint/no-magic-numbers': ["error",
98-
{ ignoreArrayIndexes: true,
99-
ignoreEnums: true,
100-
ignore: [-1, 0, 1]
101-
}
98+
'@typescript-eslint/no-magic-numbers': [
99+
'error',
100+
{ ignoreArrayIndexes: true, ignoreEnums: true, ignore: [-1, 0, 1] },
102101
],
103-
'@typescript-eslint/prefer-nullish-coalescing': "error"
102+
'@typescript-eslint/prefer-nullish-coalescing': 'error',
103+
'react/jsx-fragments': ['error', 'syntax'],
104+
'react/jsx-no-useless-fragment': 'error',
105+
'react/no-children-prop': ['error', { allowFunctions: true }],
106+
'no-nested-ternary': 'error',
107+
'no-unneeded-ternary': 'error',
108+
'prefer-template': 'error',
104109
},
105110
overrides: [
106111
// Configuration for translations files (i18next)

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
"@commitlint/config-conventional": "^19.2.2",
115115
"@dev-plugins/react-query": "^0.0.7",
116116
"@expo/config": "~9.0.2",
117+
"@tanstack/eslint-plugin-query": "^5.62.1",
117118
"@testing-library/jest-dom": "^6.5.0",
118119
"@testing-library/react-native": "^12.7.2",
119120
"@types/i18n-js": "^3.8.9",
@@ -131,6 +132,7 @@
131132
"eslint-plugin-i18n-json": "^4.0.0",
132133
"eslint-plugin-jest": "^28.8.3",
133134
"eslint-plugin-prettier": "^5.2.1",
135+
"eslint-plugin-react": "^7.37.2",
134136
"eslint-plugin-simple-import-sort": "^10.0.0",
135137
"eslint-plugin-sonarjs": "^1.0.4",
136138
"eslint-plugin-tailwindcss": "^3.15.2",

0 commit comments

Comments
 (0)