1- import simpleImportSort from "eslint-plugin-simple-import-sort" ;
2- import typescriptSortKeys from "eslint-plugin-typescript-sort-keys" ;
1+ import perfectionist from "eslint-plugin-perfectionist" ;
32import path from "node:path" ;
43import { fileURLToPath } from "node:url" ;
4+
55import { fixupConfigRules } from "@eslint/compat" ;
66import { FlatCompat } from "@eslint/eslintrc" ;
77import js from "@eslint/js" ;
@@ -10,9 +10,9 @@ import tsParser from "@typescript-eslint/parser";
1010const __filename = fileURLToPath ( import . meta. url ) ;
1111const __dirname = path . dirname ( __filename ) ;
1212const compat = new FlatCompat ( {
13+ allConfig : js . configs . all ,
1314 baseDirectory : __dirname ,
1415 recommendedConfig : js . configs . recommended ,
15- allConfig : js . configs . all ,
1616} ) ;
1717
1818export default [
@@ -27,93 +27,101 @@ export default [
2727 "plugin:prettier/recommended" ,
2828 ) ,
2929 ) ,
30+ perfectionist . configs [ "recommended-natural" ] ,
3031 {
31- plugins : {
32- "simple-import-sort" : simpleImportSort ,
33- "typescript-sort-keys" : typescriptSortKeys ,
34- } ,
35-
3632 languageOptions : {
37- parser : tsParser ,
3833 ecmaVersion : 2018 ,
34+ parser : tsParser ,
3935 sourceType : "module" ,
4036 } ,
4137
42- rules : {
43- curly : "error" ,
44- eqeqeq : [ "error" , "always" ] ,
45- "no-console" : "warn" ,
46- "no-debugger" : "warn" ,
47- "no-duplicate-case" : "error" ,
48- "no-use-before-define" : "off" ,
38+ plugins : { } ,
4939
40+ rules : {
5041 "@typescript-eslint/consistent-type-assertions" : [
5142 "error" ,
5243 {
5344 assertionStyle : "as" ,
5445 objectLiteralTypeAssertions : "allow-as-parameter" ,
5546 } ,
5647 ] ,
57-
5848 "@typescript-eslint/explicit-module-boundary-types" : "off" ,
59-
6049 "@typescript-eslint/naming-convention" : [
6150 1 ,
6251 {
63- selector : "interface" ,
6452 format : [ "PascalCase" ] ,
53+ selector : "interface" ,
6554 } ,
6655 ] ,
67-
6856 "@typescript-eslint/no-empty-function" : "off" ,
69- "@typescript-eslint/no-inferrable-types" : "off" ,
70- "@typescript-eslint/no-non-null-asserted-nullish-coalescing" : "error" ,
71- "@typescript-eslint/no-non-null-assertion" : "off" ,
72- "@typescript-eslint/no-var-requires" : "off" ,
73- "prettier/prettier" : [ "error" ] ,
74-
75- "simple-import-sort/imports" : [
76- "warn" ,
77- {
78- groups : [ [ "^\\u0000" ] , [ "^\\w" , "^@" ] , [ "^" ] , [ "^\\." ] ] ,
79- } ,
80- ] ,
81-
82- "typescript-sort-keys/string-enum" : [
57+ "@typescript-eslint/no-empty-interface" : "off" ,
58+ "@typescript-eslint/no-explicit-any" : [
8359 "error" ,
84- "asc" ,
8560 {
86- caseSensitive : false ,
87- natural : true ,
61+ fixToUnknown : true ,
8862 } ,
8963 ] ,
9064
65+ "@typescript-eslint/no-inferrable-types" : "off" ,
66+
67+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing" : "error" ,
68+
69+ "@typescript-eslint/no-non-null-assertion" : "off" ,
70+
9171 "@typescript-eslint/no-unused-expressions" : [
9272 "error" ,
9373 {
9474 allowShortCircuit : true ,
9575 allowTernary : true ,
9676 } ,
9777 ] ,
98-
99- "@typescript-eslint/no-empty-interface" : "off" ,
100-
101- "@typescript-eslint/no-explicit-any" : [
102- "error" ,
78+ "@typescript-eslint/no-unused-vars" : [
79+ "warn" ,
10380 {
104- fixToUnknown : true ,
81+ argsIgnorePattern : "^_" ,
82+ varsIgnorePattern : "^_" ,
10583 } ,
10684 ] ,
85+ "@typescript-eslint/no-var-requires" : "off" ,
86+ curly : "error" ,
87+ eqeqeq : [ "error" , "always" ] ,
88+ "no-console" : "warn" ,
89+
90+ "no-debugger" : "warn" ,
91+
92+ "no-duplicate-case" : "error" ,
10793
10894 "no-unused-vars" : "off" ,
10995
110- "@typescript-eslint/no-unused-vars" : [
96+ "no-use-before-define" : "off" ,
97+ "perfectionist/sort-enums" : [
11198 "warn" ,
11299 {
113- argsIgnorePattern : "^_" ,
114- varsIgnorePattern : "^_" ,
100+ partitionByComment : true ,
101+ partitionByNewLine : true ,
102+ } ,
103+ ] ,
104+ "perfectionist/sort-imports" : [
105+ "warn" ,
106+ {
107+ internalPattern : [ "^@" ] ,
108+ specialCharacters : "keep" ,
115109 } ,
116110 ] ,
111+ "perfectionist/sort-maps" : [
112+ "warn" ,
113+ {
114+ partitionByComment : true ,
115+ partitionByNewLine : true ,
116+ } ,
117+ ] ,
118+ "perfectionist/sort-objects" : "off" ,
119+ "perfectionist/sort-object-types" : "off" ,
120+ "perfectionist/sort-interfaces" : "off" ,
121+ "perfectionist/sort-classes" : "off" ,
122+ "perfectionist/sort-enums" : "off" ,
123+
124+ "prettier/prettier" : [ "error" ] ,
117125 } ,
118126 } ,
119127] ;
0 commit comments