Skip to content

Commit 325215d

Browse files
authored
Merge pull request #17 from imdevan/update-eslint
2 parents 1ac3d2e + 34ad7f7 commit 325215d

File tree

19 files changed

+735
-367
lines changed

19 files changed

+735
-367
lines changed

.eslintignore

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

.eslintrc.yaml

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

eslint.config.js

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
import eslint from '@eslint/js';
2+
import prettier from 'eslint-config-prettier';
3+
import eslintComments from 'eslint-plugin-eslint-comments';
4+
import json from 'eslint-plugin-json';
5+
import jsxA11y from 'eslint-plugin-jsx-a11y';
6+
import react from 'eslint-plugin-react';
7+
import reactHooks from 'eslint-plugin-react-hooks';
8+
import reactNative from 'eslint-plugin-react-native';
9+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
10+
import tseslint from 'typescript-eslint';
11+
12+
export default tseslint.config(
13+
eslint.configs.recommended,
14+
tseslint.configs.recommended,
15+
tseslint.configs.stylistic,
16+
{
17+
ignores: [
18+
'node_modules',
19+
'package-lock.json',
20+
'build',
21+
'dist',
22+
'*.expo',
23+
'coverage',
24+
'.github',
25+
'.idea',
26+
'.vscode',
27+
'*.yaml',
28+
'*.yml',
29+
'*.md',
30+
],
31+
plugins: {
32+
react,
33+
'react-hooks': reactHooks,
34+
'react-native': reactNative,
35+
'jsx-a11y': jsxA11y,
36+
'@typescript-eslint': tseslint.plugin,
37+
'eslint-comments': eslintComments,
38+
json,
39+
simpleImportSort,
40+
},
41+
languageOptions: {
42+
parser: tseslint.parser,
43+
parserOptions: {
44+
ecmaFeatures: {
45+
jsx: true,
46+
},
47+
ecmaVersion: 'latest',
48+
project: './tsconfig.json',
49+
sourceType: 'module',
50+
},
51+
globals: {
52+
JSX: true,
53+
require: true,
54+
module: true,
55+
__dirname: true,
56+
setTimeout: true,
57+
},
58+
},
59+
rules: {
60+
'@typescript-eslint/array-type': [
61+
'error',
62+
{
63+
default: 'generic',
64+
readonly: 'generic',
65+
},
66+
],
67+
// '@typescript-eslint/explicit-function-return-type': 'error',
68+
// '@typescript-eslint/explicit-module-boundary-types': 'error',
69+
'@typescript-eslint/no-explicit-any': [
70+
'error',
71+
{
72+
fixToUnknown: false,
73+
ignoreRestArgs: false,
74+
},
75+
],
76+
'@typescript-eslint/no-require-imports': 'off', // diabling until typescript rewrite
77+
'@typescript-eslint/no-shadow': 'error',
78+
'@typescript-eslint/no-empty-function': 'off', // disabling due to lots of functions defaulting to empt@typescript-eslint/no-empty-functiony
79+
'@typescript-eslint/no-unused-vars': [
80+
'error',
81+
{
82+
caughtErrors: 'none',
83+
},
84+
],
85+
'no-underscore-dangle': 'off',
86+
'comma-dangle': ['error', 'always-multiline'],
87+
'comma-style': ['error', 'last'],
88+
'jsx-quotes': ['error', 'prefer-single'],
89+
'linebreak-style': ['error', 'unix'],
90+
'no-console': 'error',
91+
'no-duplicate-imports': 'error',
92+
'no-multi-spaces': 'error',
93+
'no-shadow': 'error',
94+
'no-template-curly-in-string': 'error',
95+
'no-trailing-spaces': 'error',
96+
'no-undef': 'error',
97+
'react-native/no-inline-styles': 'warn',
98+
'react/jsx-filename-extension': [
99+
'error',
100+
{
101+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
102+
},
103+
],
104+
'simpleImportSort/imports': ['error'],
105+
'react/prop-types': 'off', // Disabling until typescript rewrite
106+
},
107+
},
108+
prettier,
109+
);

0 commit comments

Comments
 (0)