Skip to content

Commit a1e21d6

Browse files
committed
feat: add config
1 parent df02262 commit a1e21d6

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import expoConfig from 'eslint-config-expo/flat'
2+
import { defineConfig } from 'eslint/config'
3+
4+
/**
5+
* Common rules
6+
* @type {import("eslint").Linter.Config}
7+
*/
8+
const common = {
9+
ignores: ['.expo', 'node_modules'],
10+
rules: {},
11+
}
12+
13+
/**
14+
* React specific rules
15+
* @type {import("eslint").Linter.Config}
16+
*/
17+
const react = {
18+
rules: {
19+
'react/jsx-sort-props': [
20+
'warn',
21+
{
22+
multiline: 'first',
23+
reservedFirst: ['key'],
24+
callbacksLast: true,
25+
shorthandLast: true,
26+
},
27+
],
28+
'react/display-name': 'off',
29+
},
30+
}
31+
32+
/**
33+
* TypeScript specific rules
34+
* @type {import("eslint").Linter.Config}
35+
*/
36+
const typescript = {
37+
rules: {
38+
'@typescript-eslint/consistent-type-imports': [
39+
'warn',
40+
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
41+
],
42+
'@typescript-eslint/no-require-imports': 'off',
43+
},
44+
}
45+
46+
export default defineConfig([
47+
expoConfig,
48+
common,
49+
typescript,
50+
react,
51+
])

0 commit comments

Comments
 (0)