Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: Update rules #107

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 29 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,39 @@ const path = require('path');
module.exports = {
// Configuration for JavaScript files
extends: [
'expo',
'plugin:tailwindcss/recommended',
'expo',
'plugin:tailwindcss/recommended',
'prettier',
'eslint:recommended'
'eslint:recommended',
'plugin:@tanstack/query/recommended',
],
env: {
'jest/globals': true,
'node': true
node: true,
},
plugins: [
'unicorn',
'unicorn',
'@typescript-eslint',
'unused-imports',
'tailwindcss',
'simple-import-sort',
'sonarjs',
'jest'
'jest',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
ignorePatterns: [
"node_modules",
"*.config.js",
"docs",
"cli",
"android",
"ios",
"lint-staged.config.js",
"i18next-syntax-validation.js",
".eslintrc.js"
'node_modules',
'*.config.js',
'docs',
'cli',
'android',
'ios',
'lint-staged.config.js',
'i18next-syntax-validation.js',
'.eslintrc.js',
],
rules: {
'import/no-duplicates': 'error',
Expand Down Expand Up @@ -81,7 +82,7 @@ module.exports = {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
}
},
],
curly: [2, 'all'],
'prefer-const': [
Expand All @@ -91,16 +92,20 @@ module.exports = {
},
],
'object-shorthand': 'error',
'arrow-body-style': ["error", "as-needed"],
'no-console': ['error', {allow: ['error']}],
'arrow-body-style': ['error', 'as-needed'],
'no-console': ['error', { allow: ['error'] }],
'guard-for-in': 'error',
'@typescript-eslint/no-magic-numbers': ["error",
{ ignoreArrayIndexes: true,
ignoreEnums: true,
ignore: [-1, 0, 1]
}
'@typescript-eslint/no-magic-numbers': [
'error',
{ ignoreArrayIndexes: true, ignoreEnums: true, ignore: [-1, 0, 1] },
],
'@typescript-eslint/prefer-nullish-coalescing': "error"
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'react/jsx-fragments': ['error', 'syntax'],
'react/jsx-no-useless-fragment': 'error',
'react/no-children-prop': ['error', { allowFunctions: true }],
'no-nested-ternary': 'error',
'no-unneeded-ternary': 'error',
'prefer-template': 'error',
},
overrides: [
// Configuration for translations files (i18next)
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"@commitlint/config-conventional": "^19.2.2",
"@dev-plugins/react-query": "^0.0.7",
"@expo/config": "~9.0.2",
"@tanstack/eslint-plugin-query": "^5.62.1",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react-native": "^12.7.2",
"@types/i18n-js": "^3.8.9",
Expand All @@ -130,6 +131,7 @@
"eslint-plugin-i18n-json": "^4.0.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-sonarjs": "^1.0.4",
"eslint-plugin-tailwindcss": "^3.15.2",
Expand Down
113 changes: 101 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading