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