File tree Expand file tree Collapse file tree 2 files changed +55
-1
lines changed
packages/eslint-config-react-native Expand file tree Collapse file tree 2 files changed +55
-1
lines changed Original file line number Diff line number Diff line change 1+ import expoConfig from 'eslint-config-expo/flat.js'
2+ import { defineConfig , globalIgnores } from 'eslint/config'
3+
4+ /** Globally ignored */
5+ const ignores = globalIgnores ( [ '.expo/' ] )
6+
7+ /** @type {import("eslint").Linter.Config } */
8+ const common = {
9+ rules : {
10+ // Very expensive check
11+ 'import/namespace' : 'off' ,
12+ // Very expensive check
13+ 'import/no-duplicates' : 'off' ,
14+ } ,
15+ }
16+
17+ /** @type {import("eslint").Linter.Config } */
18+ const react = {
19+ rules : {
20+ 'react/jsx-sort-props' : [
21+ 'warn' ,
22+ {
23+ multiline : 'first' ,
24+ reservedFirst : [ 'key' ] ,
25+ callbacksLast : true ,
26+ shorthandLast : true ,
27+ } ,
28+ ] ,
29+ 'react/display-name' : 'off' ,
30+ } ,
31+ }
32+
33+ /** @type {import("eslint").Linter.Config } */
34+ const typescript = {
35+ rules : {
36+ // Handled by TypeScript, see https://www.typescriptlang.org/tsconfig/#noUnusedLocals
37+ '@typescript-eslint/no-unused-vars' : 'off' ,
38+ // Its common in React Native to import types using require syntax, see https://reactnative.dev/docs/images#static-image-resources
39+ '@typescript-eslint/no-require-imports' : 'off' ,
40+
41+ // '@typescript-eslint/consistent-type-imports': [
42+ // 'warn',
43+ // { prefer: 'type-imports', fixStyle: 'inline-type-imports' },
44+ // ],
45+ } ,
46+ }
47+
48+ export default defineConfig ( [
49+ expoConfig ,
50+ ignores ,
51+ common ,
52+ typescript ,
53+ react ,
54+ ] )
Original file line number Diff line number Diff line change 11{
2- "name" : " @strv/react-native" ,
2+ "name" : " @strv/eslint-config- react-native" ,
33 "description" : " STRV's ESLint config for React Native projects" ,
44 "version" : " 1.0.0" ,
55 "author" :
" Petr Chalupa <[email protected] >" ,
You can’t perform that action at this time.
0 commit comments