1- import eslint from '@eslint/js' ;
2- import globals from 'globals' ;
3- import tseslint from 'typescript-eslint' ;
1+ import js from '@eslint/js' ;
2+ import stylisticPlugin from '@stylistic/eslint-plugin' ;
3+ import ts from '@typescript-eslint/eslint-plugin' ;
4+ import tsParser from '@typescript-eslint/parser' ;
45
56export default [
6- eslint . configs . recommended ,
7- ...tseslint . configs . recommended ,
7+ {
8+ name : 'formatLint' ,
9+ plugins : {
10+ '@stylistic' : stylisticPlugin ,
11+ } ,
12+ rules : {
13+ '@stylistic/semi' : 'warn' ,
14+ '@stylistic/no-extra-semi' : 'error' ,
15+ '@stylistic/no-mixed-spaces-and-tabs' : 'warn' ,
16+ } ,
17+ } ,
18+ {
19+ name : 'jsLint' ,
20+ files : [ '**/*.js' , '**/*.mjs' ] ,
21+ rules : {
22+ ...js . configs . recommended . rules ,
23+ eqeqeq : 'warn' ,
24+ } ,
25+ } ,
26+ {
27+ name : 'tsLint' ,
28+ files : [ '**/*.ts' ] ,
29+ languageOptions : {
30+ parser : tsParser ,
31+ parserOptions : {
32+ ecmaFeatures : { modules : true } ,
33+ ecmaVersion : 'latest' ,
34+ project : './tsconfig.json' ,
35+ } ,
36+ } ,
37+ plugins : {
38+ '@typescript-eslint' : ts ,
39+ } ,
40+ rules : {
41+ ...ts . configs [ 'eslint-recommended' ] . rules ,
42+ ...ts . configs . recommended . rules ,
43+ '@typescript-eslint/no-require-imports' : 'off' ,
44+ '@typescript-eslint/no-explicit-any' : 'off' ,
45+ '@typescript-eslint/no-unused-vars' : [
46+ 'error' ,
47+ {
48+ argsIgnorePattern : '^_' ,
49+ varsIgnorePattern : '^_' ,
50+ caughtErrorsIgnorePattern : '^_' ,
51+ } ,
52+ ] ,
53+ } ,
54+ } ,
855 {
956 files : [
1057 'src/**/*.js' ,
@@ -15,11 +62,6 @@ export default [
1562 'test/**/*.ts' ,
1663 ] ,
1764 } ,
18- {
19- languageOptions : {
20- globals : { ...globals . node } ,
21- } ,
22- } ,
2365 {
2466 ignores : [
2567 // dependencies
@@ -32,6 +74,8 @@ export default [
3274
3375 // dev-tools
3476 '*.js' ,
77+ '*.mjs' ,
78+ '*.ts' ,
3579
3680 // testing
3781 'coverage/' ,
@@ -64,24 +108,4 @@ export default [
64108 'placeholder_*' ,
65109 ] ,
66110 } ,
67- {
68- rules : {
69- eqeqeq : 'warn' ,
70- semi : 'warn' ,
71- 'no-mixed-spaces-and-tabs' : 'warn' ,
72- 'no-extra-semi' : 'error' ,
73- 'no-unreachable' : 'warn' ,
74- 'no-unused-vars' : 'off' ,
75- '@typescript-eslint/no-require-imports' : 'off' ,
76- '@typescript-eslint/no-explicit-any' : 'off' ,
77- '@typescript-eslint/no-unused-vars' : [
78- 'error' ,
79- {
80- argsIgnorePattern : '^_' ,
81- varsIgnorePattern : '^_' ,
82- caughtErrorsIgnorePattern : '^_' ,
83- } ,
84- ] ,
85- } ,
86- } ,
87111] ;
0 commit comments