@@ -5,6 +5,9 @@ import globals from "globals";
55import eslint from "@eslint/js" ;
66import tseslint from "typescript-eslint" ;
77import eslintConfigPrettier from "eslint-config-prettier/flat" ;
8+ import importPlugin from "eslint-plugin-import" ;
9+ import nodePlugin from "eslint-plugin-n" ;
10+ import unusedImports from "eslint-plugin-unused-imports" ;
811
912export default tseslint . config (
1013 globalIgnores ( [
@@ -24,7 +27,13 @@ export default tseslint.config(
2427 eslint . configs . recommended ,
2528 tseslint . configs . recommendedTypeChecked ,
2629 {
30+ plugins : {
31+ import : importPlugin ,
32+ n : nodePlugin ,
33+ "unused-imports" : unusedImports ,
34+ } ,
2735 rules : {
36+ // Existing rule
2837 "@typescript-eslint/no-floating-promises" : [
2938 "error" ,
3039 {
@@ -33,6 +42,56 @@ export default tseslint.config(
3342 ] ,
3443 } ,
3544 ] ,
45+
46+ // Import/Export Organization
47+ "@typescript-eslint/consistent-type-imports" : [
48+ "error" ,
49+ { prefer : "type-imports" } ,
50+ ] ,
51+ "import/order" : [
52+ "error" ,
53+ {
54+ groups : [ "builtin" , "external" , "internal" , "parent" , "sibling" ] ,
55+ "newlines-between" : "always" ,
56+ alphabetize : { order : "asc" , caseInsensitive : true } ,
57+ } ,
58+ ] ,
59+ "n/prefer-node-protocol" : "error" ,
60+
61+ // Type Consistency
62+ "@typescript-eslint/consistent-type-definitions" : [ "error" , "type" ] ,
63+ "@typescript-eslint/prefer-as-const" : "error" ,
64+
65+ // Immutable Patterns (excluding prefer-readonly-parameter-types per feedback)
66+ "@typescript-eslint/prefer-readonly" : "error" ,
67+
68+ // Error Standards
69+ "@typescript-eslint/prefer-promise-reject-errors" : "error" ,
70+ "@typescript-eslint/only-throw-error" : "error" ,
71+
72+ // Function Style
73+ "@typescript-eslint/promise-function-async" : "error" ,
74+ "@typescript-eslint/require-await" : "error" ,
75+ "prefer-arrow-callback" : "error" ,
76+
77+ // Console Control
78+ "no-console" : [ "warn" , { allow : [ "error" , "warn" ] } ] ,
79+
80+ // Unused Code
81+ "@typescript-eslint/no-unused-vars" : [
82+ "error" ,
83+ {
84+ argsIgnorePattern : "^_" ,
85+ varsIgnorePattern : "^_" ,
86+ } ,
87+ ] ,
88+ "unused-imports/no-unused-imports" : "error" ,
89+
90+ // Strict Typing Enhancements
91+ "@typescript-eslint/strict-boolean-expressions" : "warn" ,
92+ "@typescript-eslint/no-unnecessary-condition" : "warn" ,
93+ "@typescript-eslint/prefer-nullish-coalescing" : "error" ,
94+ "@typescript-eslint/prefer-optional-chain" : "error" ,
3695 } ,
3796 } ,
3897 {
0 commit comments