55 */
66
77/**
8- * @type {import('tsconfig.json') }
8+ * @type {typeof import('./ tsconfig.json') }
99 * @const tsconfig - Tsconfig object
1010 */
11- const tsconfig = require ( 'tsconfig/dist/ tsconfig' ) . loadSync ( __dirname ) . config
11+ const tsconfig = require ( './ tsconfig.json' )
1212
1313/**
1414 * @type {boolean }
@@ -22,7 +22,7 @@ const jsx = Boolean(tsconfig.compilerOptions.jsx)
2222 */
2323const config = {
2424 env : {
25- [ tsconfig . compilerOptions . target ] : true ,
25+ [ require ( './ tsconfig.build.json' ) . compilerOptions . target ] : true ,
2626 node : true
2727 } ,
2828 extends : [
@@ -33,7 +33,7 @@ const config = {
3333 globals : {
3434 Chai : 'readonly' ,
3535 Console : 'readonly' ,
36- JSX : 'readonly' ,
36+ JSX : jsx ? 'readonly' : false ,
3737 LoadHook : 'readonly' ,
3838 LoadHookContext : 'readonly' ,
3939 LoadHookResult : 'readonly' ,
@@ -120,9 +120,10 @@ const config = {
120120 {
121121 allowArgumentsExplicitlyTypedAsAny : true ,
122122 allowDirectConstAssertionInArrowFunctions : true ,
123- allowHigherOrderFunctions : true ,
123+ allowHigherOrderFunctions : false ,
124124 allowTypedFunctionExpressions : true ,
125- allowedNames : [ ]
125+ allowedNames : [ ] ,
126+ shouldTrackReferences : true
126127 }
127128 ] ,
128129 '@typescript-eslint/init-declarations' : 0 ,
@@ -191,7 +192,7 @@ const config = {
191192 '@typescript-eslint/no-explicit-any' : 0 ,
192193 '@typescript-eslint/no-extra-non-null-assertion' : 2 ,
193194 '@typescript-eslint/no-extra-parens' : 0 ,
194- '@typescript-eslint/no-extra-semi' : 2 ,
195+ '@typescript-eslint/no-extra-semi' : 0 ,
195196 '@typescript-eslint/no-extraneous-class' : [
196197 2 ,
197198 {
@@ -490,7 +491,7 @@ const config = {
490491 'node/no-new-require' : 2 ,
491492 'node/no-path-concat' : 2 ,
492493 'node/no-process-env' : 0 ,
493- 'node/no-process-exit' : 2 ,
494+ 'node/no-process-exit' : 0 ,
494495 'node/no-unpublished-bin' : 0 ,
495496 'node/no-unpublished-import' : 0 ,
496497 'node/no-unpublished-require' : 0 ,
@@ -530,7 +531,6 @@ const config = {
530531 'unicorn/better-regex' : [ 2 , { sortCharacterClasses : true } ] ,
531532 'unicorn/catch-error-name' : [ 2 , { name : 'e' } ] ,
532533 'unicorn/consistent-destructuring' : 2 ,
533- 'unicorn/consistent-function-scoping' : 2 ,
534534 'unicorn/custom-error-definition' : 2 ,
535535 'unicorn/empty-brace-spaces' : 2 ,
536536 'unicorn/error-message' : 2 ,
@@ -800,16 +800,14 @@ const config = {
800800 files : [ '*.cjs' , '*.md/*.cjs' , '*.mjs' ] ,
801801 rules : {
802802 '@typescript-eslint/explicit-module-boundary-types' : 0 ,
803- '@typescript-eslint/no-implicit-any-catch' : 0 ,
804- '@typescript-eslint/restrict-template-expressions' : 0
803+ '@typescript-eslint/no-implicit-any-catch' : 0
805804 }
806805 } ,
807806 {
808807 files : [ '*.cjs' , '*.cts' ] ,
809808 rules : {
810809 '@typescript-eslint/no-require-imports' : 0 ,
811- '@typescript-eslint/no-var-requires' : 0 ,
812- 'unicorn/prefer-module' : 0
810+ '@typescript-eslint/no-var-requires' : 0
813811 }
814812 } ,
815813 {
@@ -818,6 +816,12 @@ const config = {
818816 'no-undef' : 0
819817 }
820818 } ,
819+ {
820+ files : [ '*.cts' ] ,
821+ rules : {
822+ 'unicorn/prefer-module' : 0
823+ }
824+ } ,
821825 {
822826 files : [ '*.d.ts' ] ,
823827 rules : {
@@ -918,7 +922,7 @@ const config = {
918922 }
919923 } ,
920924 {
921- files : [ '*.jsonc' ] ,
925+ files : [ '*.json5' , '*. jsonc'] ,
922926 rules : {
923927 'jsonc/no-comments' : 0
924928 }
@@ -1027,7 +1031,6 @@ const config = {
10271031 'promise/prefer-await-to-callbacks' : 0 ,
10281032 'promise/valid-params' : 0 ,
10291033 'unicorn/consistent-destructuring' : 0 ,
1030- 'unicorn/consistent-function-scoping' : 0 ,
10311034 'unicorn/explicit-length-check' : 0 ,
10321035 'unicorn/no-array-for-each' : 0 ,
10331036 'unicorn/prefer-at' : 0 ,
0 commit comments