@@ -2,49 +2,57 @@ module.exports = {
2
2
env : {
3
3
node : true ,
4
4
} ,
5
- parser : "@typescript-eslint/parser" , // Specifies the ESLint parser
6
- root : true , // make sure eslint picks up the config at the root of the directory
7
5
extends : [
8
6
"expo" ,
9
7
"eslint:recommended" , // ESLint rules
10
8
"plugin:@typescript-eslint/recommended" , // TypeScript rules
11
9
"plugin:react/recommended" , // React rules
12
- "plugin:react/jsx-runtime" , // support for React 17 JSX
10
+ "plugin:react/jsx-runtime" , // Support for React 17 JSX
13
11
"plugin:prettier/recommended" , // Prettier recommended rules
14
12
] ,
15
- plugins : [ "react" , "react-native" , "simple-import-sort" ] , // add React and React Native plugins
13
+ parser : "@typescript-eslint/parser" , // Specifies the ESLint parser
14
+ plugins : [
15
+ "react" ,
16
+ "react-native" ,
17
+ "simple-import-sort" ,
18
+ "perfectionist" , // Existing plugins plus 'perfectionist'
19
+ ] ,
20
+ root : true , // Make sure eslint picks up the config at the root of the directory
16
21
rules : {
17
- camelcase : "off" , // disable camelcase rule
18
- "@typescript-eslint/no-explicit-any" : "warn" , // detect usage of `any` type
22
+ "@typescript-eslint/no-explicit-any" : "warn" , // Detect usage of `any` type
23
+ "@typescript-eslint/no-unused-vars" : "warn" , // Detect unused variables
24
+ camelcase : "off" , // Disable camelcase rule
25
+ "perfectionist/sort-imports" : "error" , // Previous perfectionist rule
26
+ "perfectionist/sort-interfaces" : [ "error" ] , // New perfectionist rule
27
+ "perfectionist/sort-objects" : [ "error" , { type : "alphabetical" } ] , // New perfectionist rule
19
28
"prettier/prettier" : [
20
- // Prettier rules
21
29
"warn" ,
22
30
{
23
31
usePrettierrc : true ,
24
32
} ,
25
33
] ,
26
- "react-native/no-color-literals" : 2 , // enforce color literals are not used
27
- "react-native/no-unused-styles" : 2 , // detect unused StyleSheet rules
28
- "react-native/no-raw-text" : 0 , // detect raw text outside of Text component
29
- "react-native/sort-styles" : 2 , // enforce style definitions are sorted
30
- "@typescript-eslint/no-unused-vars" : "warn" , // detect unused variables
31
- "simple-import-sort/exports" : "warn" , // enforce sorting exports within module
34
+ "react-native/no-color-literals" : 2 , // Enforce color literals are not used
35
+ "react-native/no-raw-text" : 0 , // Detect raw text outside of Text component
36
+ "react-native/no-unused-styles" : 2 , // Detect unused StyleSheet rules
37
+ "react-native/sort-styles" : 2 , // Enforce style definitions are sorted
38
+ "simple-import-sort/exports" : "warn" , // Enforce sorting exports within module
32
39
"simple-import-sort/imports" : [
33
40
"warn" ,
34
41
{
35
42
groups : [
36
- // Side effect imports.
37
43
[ "^\\u0000" ] ,
38
- // Packages `react` related packages come first.
39
44
[ "^react" , "^@?\\w" ] ,
40
- // Environment variables
41
45
[ "^(@env)(/.*|$)" ] ,
42
- // Parent imports. Put `..` last.
43
46
[ "^\\.\\.(?!/?$)" , "^\\.\\./?$" ] ,
44
- // Other relative imports. Put same-folder imports and `.` last.
45
47
[ "^\\./(?=.*/)(?!/?$)" , "^\\.(?!/?$)" , "^\\./?$" ] ,
46
48
] ,
47
49
} ,
48
50
] ,
49
51
} ,
52
+ settings : {
53
+ perfectionist : {
54
+ partitionByComment : true ,
55
+ type : "line-length" ,
56
+ } ,
57
+ } ,
50
58
} ;
0 commit comments