@@ -18,86 +18,86 @@ const gitignorePath = path.resolve(rootPath, GIT_IGNORE)
1818const prettierignorePath = path . resolve ( rootPath , PRETTIER_IGNORE )
1919
2020module . exports = [
21- includeIgnoreFile ( gitignorePath ) ,
22- includeIgnoreFile ( prettierignorePath ) ,
23- {
24- files : [ '**/*.{c,}js' ] ,
25- ...importXPlugin . flatConfigs . recommended ,
26- languageOptions : {
27- ...importXPlugin . flatConfigs . recommended . languageOptions ,
28- ecmaVersion : 'latest' ,
29- sourceType : 'script'
30- } ,
31- rules : {
32- ...importXPlugin . flatConfigs . recommended . rules ,
33- 'import-x/no-named-as-default-member' : 'off' ,
34- 'import-x/no-unresolved' : [ 'error' , { commonjs : true } ] ,
35- 'import-x/order' : [
36- 'warn' ,
37- {
38- groups : [
39- 'builtin' ,
40- 'external' ,
41- 'internal' ,
42- [ 'parent' , 'sibling' , 'index' ] ,
43- 'type'
44- ] ,
45- pathGroups : [
46- {
47- pattern : '@socket{registry,security}/**' ,
48- group : 'internal'
49- }
50- ] ,
51- pathGroupsExcludedImportTypes : [ 'type' ] ,
52- 'newlines-between' : 'always' ,
53- alphabetize : {
54- order : 'asc'
55- }
56- }
57- ]
58- }
21+ includeIgnoreFile ( gitignorePath ) ,
22+ includeIgnoreFile ( prettierignorePath ) ,
23+ {
24+ files : [ '**/*.{c,}js' ] ,
25+ ...importXPlugin . flatConfigs . recommended ,
26+ languageOptions : {
27+ ...importXPlugin . flatConfigs . recommended . languageOptions ,
28+ ecmaVersion : 'latest' ,
29+ sourceType : 'script'
5930 } ,
60- {
61- files : [ 'scripts/**/*.js' , 'test/**/*.cjs' ] ,
62- ...nodePlugin . configs [ 'flat/recommended-script' ]
31+ rules : {
32+ ...importXPlugin . flatConfigs . recommended . rules ,
33+ 'import-x/no-named-as-default-member' : 'off' ,
34+ 'import-x/no-unresolved' : [ 'error' , { commonjs : true } ] ,
35+ 'import-x/order' : [
36+ 'warn' ,
37+ {
38+ groups : [
39+ 'builtin' ,
40+ 'external' ,
41+ 'internal' ,
42+ [ 'parent' , 'sibling' , 'index' ] ,
43+ 'type'
44+ ] ,
45+ pathGroups : [
46+ {
47+ pattern : '@socket{registry,security}/**' ,
48+ group : 'internal'
49+ }
50+ ] ,
51+ pathGroupsExcludedImportTypes : [ 'type' ] ,
52+ 'newlines-between' : 'always' ,
53+ alphabetize : {
54+ order : 'asc'
55+ }
56+ }
57+ ]
58+ }
59+ } ,
60+ {
61+ files : [ 'scripts/**/*.js' , 'test/**/*.cjs' ] ,
62+ ...nodePlugin . configs [ 'flat/recommended-script' ]
63+ } ,
64+ {
65+ files : [ 'scripts/**/*.js' , 'test/**/*.cjs' ] ,
66+ plugins : {
67+ 'sort-destructure-keys' : sortDestructureKeysPlugin ,
68+ unicorn : unicornPlugin
6369 } ,
64- {
65- files : [ 'scripts/**/*.js' , 'test/**/*.cjs' ] ,
66- plugins : {
67- 'sort-destructure-keys' : sortDestructureKeysPlugin ,
68- unicorn : unicornPlugin
69- } ,
70- rules : {
71- ...js . configs . recommended . rules ,
72- 'n/exports-style' : [ 'error' , 'module.exports' ] ,
73- // The n/no-unpublished-bin rule does does not support non-trivial glob
74- // patterns used in package.json "files" fields. In those cases we simplify
75- // the glob patterns used.
76- 'n/no-unpublished-bin' : [ 'error' ] ,
77- 'n/no-unsupported-features/es-builtins' : [ 'error' ] ,
78- 'n/no-unsupported-features/es-syntax' : [ 'error' ] ,
79- 'n/no-unsupported-features/node-builtins' : [
80- 'error' ,
81- {
82- ignores : [ 'test' , 'test.describe' ] ,
83- // Lazily access constants.maintainedNodeVersions.
84- version : constants . maintainedNodeVersions . previous
85- }
86- ] ,
87- 'n/prefer-node-protocol' : [ 'error' ] ,
88- 'no-await-in-loop' : [ 'error' ] ,
89- 'no-control-regex' : [ 'error' ] ,
90- 'no-empty' : [ 'error' , { allowEmptyCatch : true } ] ,
91- 'no-new' : [ 'error' ] ,
92- 'no-proto' : [ 'error' ] ,
93- 'no-unused-vars' : [
94- 'error' ,
95- { argsIgnorePattern : '^_|^this$' , ignoreRestSiblings : true }
96- ] ,
97- 'no-warning-comments' : [ 'warn' , { terms : [ 'fixme' ] } ] ,
98- 'sort-destructure-keys/sort-destructure-keys' : [ 'error' ] ,
99- 'sort-imports' : [ 'error' , { ignoreDeclarationSort : true } ] ,
100- 'unicorn/consistent-function-scoping' : [ 'error' ]
70+ rules : {
71+ ...js . configs . recommended . rules ,
72+ 'n/exports-style' : [ 'error' , 'module.exports' ] ,
73+ // The n/no-unpublished-bin rule does does not support non-trivial glob
74+ // patterns used in package.json "files" fields. In those cases we simplify
75+ // the glob patterns used.
76+ 'n/no-unpublished-bin' : [ 'error' ] ,
77+ 'n/no-unsupported-features/es-builtins' : [ 'error' ] ,
78+ 'n/no-unsupported-features/es-syntax' : [ 'error' ] ,
79+ 'n/no-unsupported-features/node-builtins' : [
80+ 'error' ,
81+ {
82+ ignores : [ 'test' , 'test.describe' ] ,
83+ // Lazily access constants.maintainedNodeVersions.
84+ version : constants . maintainedNodeVersions . previous
10185 }
86+ ] ,
87+ 'n/prefer-node-protocol' : [ 'error' ] ,
88+ 'no-await-in-loop' : [ 'error' ] ,
89+ 'no-control-regex' : [ 'error' ] ,
90+ 'no-empty' : [ 'error' , { allowEmptyCatch : true } ] ,
91+ 'no-new' : [ 'error' ] ,
92+ 'no-proto' : [ 'error' ] ,
93+ 'no-unused-vars' : [
94+ 'error' ,
95+ { argsIgnorePattern : '^_|^this$' , ignoreRestSiblings : true }
96+ ] ,
97+ 'no-warning-comments' : [ 'warn' , { terms : [ 'fixme' ] } ] ,
98+ 'sort-destructure-keys/sort-destructure-keys' : [ 'error' ] ,
99+ 'sort-imports' : [ 'error' , { ignoreDeclarationSort : true } ] ,
100+ 'unicorn/consistent-function-scoping' : [ 'error' ]
102101 }
102+ }
103103]
0 commit comments