11/* eslint-disable license-header/header */
2- /* eslint-disable n/no-unpublished-import */
32import eslint from '@eslint/js' ;
43import tseslint from 'typescript-eslint' ;
54import globals from 'globals' ;
6- import nodePlugin from 'eslint-plugin-n' ;
75import licenseHeaderPlugin from 'eslint-plugin-license-header' ;
6+ import nodePlugin from 'eslint-plugin-n' ;
87
98const license = [
109 '/*' ,
@@ -34,16 +33,14 @@ const baseConfig = tseslint.config(
3433 ] ,
3534 } ,
3635 {
37- files : [ '**/*.{js,ts,mjs}' ] ,
36+ files : [ '**/*.{js,ts,mjs}' , '*.{js,ts,mjs}' ] ,
3837 plugins : {
3938 'license-header' : licenseHeaderPlugin ,
40- n : nodePlugin ,
41- '@typescript-eslint' : tseslint . plugin ,
39+ node : nodePlugin ,
4240 } ,
4341 extends : [
4442 eslint . configs . recommended ,
45- tseslint . configs . recommended ,
46- nodePlugin . configs [ 'flat/recommended' ] ,
43+ // nodePlugin.configs['flat/recommended'],
4744 ] ,
4845 languageOptions : {
4946 ecmaVersion : 2022 ,
@@ -57,27 +54,59 @@ const baseConfig = tseslint.config(
5754 } ,
5855 } ,
5956 rules : {
57+ // old rules
6058 quotes : [ 'error' , 'single' , { avoidEscape : true } ] ,
6159 eqeqeq : [ 'error' , 'smart' ] ,
6260 'prefer-rest-params' : 'off' ,
63- 'n/no-deprecated-api' : [ 'warn' ] ,
6461 'license-header/header' : [ 'error' , license ] ,
62+
63+ // new rules
64+ 'no-unused-vars' : 'warn' ,
65+ 'node/no-deprecated-api' : 'warn' ,
6566 } ,
6667 } ,
6768
6869 // TypeScript strict rules
6970 {
7071 files : [ '**/*.ts' ] ,
71- // extends: [...tseslint.configs.strictTypeChecked],
72- extends : [ ...tseslint . configs . recommendedTypeChecked ] ,
72+ plugins : {
73+ '@typescript-eslint' : tseslint . plugin ,
74+ } ,
75+ // turn on when we can check types
76+ // extends: [...tseslint.configs.recommendedTypeChecked],
77+ extends : [ ...tseslint . configs . recommended ] ,
7378 languageOptions : {
7479 parser : tseslint . parser ,
7580 parserOptions : {
7681 project : true ,
7782 } ,
7883 } ,
7984 rules : {
80- '@typescript-eslint/no-var-requires' : 'off' ,
85+ // 'node/no-missing-import': 'off',
86+
87+ // things that should be repaired
88+ '@typescript-eslint/no-explicit-any' : 'warn' ,
89+ '@typescript-eslint/no-require-imports' : 'warn' ,
90+ '@typescript-eslint/no-unsafe-function-type' : 'warn' ,
91+ '@typescript-eslint/no-empty-object-type' : 'warn' ,
92+ '@typescript-eslint/no-unused-vars' : [
93+ 'warn' ,
94+ { argsIgnorePattern : '^_' } ,
95+ ] ,
96+
97+ // old rules
98+ // this is a replacement for the deprecated ban-types rules
99+ '@typescript-eslint/no-restricted-types' : [
100+ 'warn' ,
101+ {
102+ types : {
103+ Function : 'fix' ,
104+ } ,
105+ } ,
106+ ] ,
107+ // TODO: fix inheritance
108+ '@typescript-eslint/no-floating-promises' : 'error' ,
109+ '@typescript-eslint/no-this-alias' : 'off' ,
81110 '@typescript-eslint/naming-convention' : [
82111 'error' ,
83112 {
@@ -87,11 +116,18 @@ const baseConfig = tseslint.config(
87116 leadingUnderscore : 'require' ,
88117 } ,
89118 ] ,
90- 'n/no-missing-import' : 'off' ,
119+ '@typescript-eslint/no-var-requires' : 'off' ,
120+ '@typescript-eslint/no-inferrable-types' : [
121+ 'error' ,
122+ { ignoreProperties : true } ,
123+ ] ,
124+ '@typescript-eslint/no-empty-function' : [ 'off' ] ,
125+ '@typescript-eslint/no-shadow' : [ 'warn' ] ,
126+ 'prefer-rest-params' : 'off' ,
91127 } ,
92128 } ,
93129
94- // Test files relaxed rules
130+ // Test files have relaxed rules
95131 {
96132 files : [ '**/test/**/*.ts' , '**/*.test.ts' ] ,
97133 rules : {
0 commit comments