File tree 3 files changed +18
-16
lines changed
3 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const error = "error";
4
4
const warn = process . argv . includes ( "--report-unused-disable-directives" )
5
5
? "error"
6
6
: "warn" ;
7
+ const off = "off" ;
7
8
8
9
module . exports = {
9
10
root : true ,
@@ -61,6 +62,7 @@ module.exports = {
61
62
eqeqeq : [ error , "always" , { null : "ignore" } ] ,
62
63
strict : error ,
63
64
yoda : warn ,
65
+ "no-control-regex" : off ,
64
66
} ,
65
67
overrides : [
66
68
{
Original file line number Diff line number Diff line change @@ -77,20 +77,20 @@ module.exports = {
77
77
// Note that if you use the `node:` prefix for Node.js builtins,
78
78
// you can avoid this complexity: You can simply use "^node:".
79
79
[
80
- " ^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)" ,
80
+ / ^ ( a s s e r t | b u f f e r | c h i l d _ p r o c e s s | c l u s t e r | c o n s o l e | c o n s t a n t s | c r y p t o | d g r a m | d n s | d o m a i n | e v e n t s | f s | h t t p | h t t p s | m o d u l e | n e t | o s | p a t h | p u n y c o d e | q u e r y s t r i n g | r e a d l i n e | r e p l | s t r e a m | s t r i n g _ d e c o d e r | s y s | t i m e r s | t l s | t t y | u r l | u t i l | v m | z l i b | f r e e l i s t | v 8 | p r o c e s s | a s y n c _ h o o k s | h t t p 2 | p e r f _ h o o k s ) ( \ / .* | $ ) / u ,
81
81
] ,
82
82
// Packages. `react` related packages come first.
83
- [ " ^react" , " ^@?\\w" ] ,
83
+ [ / ^ r e a c t / u , / ^ @ ? \w / u ] ,
84
84
// Internal packages.
85
- [ " ^(@|@company|@ui|components|utils|config|vendored-lib)(/.*|$)" ] ,
85
+ [ / ^ ( @ | @ c o m p a n y | @ u i | c o m p o n e n t s | u t i l s | c o n f i g | v e n d o r e d - l i b ) ( \ / .* | $ ) / u ] ,
86
86
// Side effect imports.
87
- [ "^\\ u0000" ] ,
87
+ [ / ^ \ u0000/ u ] ,
88
88
// Parent imports. Put `..` last.
89
- [ "^\\.\\ .(?!/?$)" , "^\\.\\. /?$" ] ,
89
+ [ / ^ \. \ .(? ! \ /? $ ) / u , / ^ \. \. \ /? $ / u ] ,
90
90
// Other relative imports. Put same-folder imports and `.` last.
91
- [ "^\\. /(?=.*/)(?!/?$)" , "^\\ .(?!/?$)" , "^\\. /?$" ] ,
91
+ [ / ^ \. \ /(? = .* \ /) (? ! \ /? $ ) / u , / ^ \ .(? ! \ /? $ ) / u , / ^ \. \ /? $ / u ] ,
92
92
// Style imports.
93
- [ " ^.+\\ .s?css$" ] ,
93
+ [ / ^ .+ \. s ? c s s $ / u ] ,
94
94
] ,
95
95
} ,
96
96
] ,
Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
+ // @ts -check
3
+ // @ts -check
2
4
3
5
const shared = require ( "./shared" ) ;
4
6
5
7
const defaultGroups = [
6
8
// Side effect imports.
7
- [ "^\\ u0000" ] ,
9
+ [ / ^ \ u0000/ u ] ,
8
10
// Node.js builtins prefixed with `node:`.
9
- [ " ^node:" ] ,
11
+ [ / ^ n o d e : / u ] ,
10
12
// Packages.
11
13
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
12
- [ " ^@?\\w" ] ,
14
+ [ / ^ @ ? \w / u ] ,
13
15
// Absolute imports and other imports such as Vue-style `@/foo`.
14
16
// Anything not matched in another group.
15
- [ "^" ] ,
17
+ [ / ^ / u ] ,
16
18
// Relative imports.
17
19
// Anything that starts with a dot.
18
- [ "^\\." ] ,
20
+ [ / ^ \. / u ] ,
19
21
] ;
20
22
21
23
module . exports = {
@@ -30,9 +32,7 @@ module.exports = {
30
32
type : "array" ,
31
33
items : {
32
34
type : "array" ,
33
- items : {
34
- type : "string" ,
35
- } ,
35
+ uniqueItems : true ,
36
36
} ,
37
37
} ,
38
38
} ,
@@ -51,7 +51,7 @@ module.exports = {
51
51
const { groups : rawGroups = defaultGroups } = context . options [ 0 ] || { } ;
52
52
53
53
const outerGroups = rawGroups . map ( ( groups ) =>
54
- groups . map ( ( item ) => RegExp ( item , "u" ) ) ,
54
+ groups . map ( ( item ) => ( item instanceof RegExp ? item : RegExp ( item , "u" ) ) ) ,
55
55
) ;
56
56
57
57
const parents = new Set ( ) ;
You can’t perform that action at this time.
0 commit comments