1- import eslint from "@eslint/js" ;
2- import nPlugin from "eslint-plugin-n" ;
3- import tsEslint from "typescript-eslint" ;
4- import vitest from "@vitest/eslint-plugin" ;
5- import stylistic from "@stylistic/eslint-plugin" ;
6- import perfectionist from "eslint-plugin-perfectionist" ;
7- import unusedImports from "eslint-plugin-unused-imports" ;
1+ import nadle from "@nadle/eslint-config" ;
2+ import tsEslint , { type ConfigArray } from "typescript-eslint" ;
83
9- export default tsEslint . config (
10- eslint . configs . recommended ,
11- tsEslint . configs . recommended ,
12- nPlugin . configs [ "flat/recommended-module" ] ,
4+ const config : ConfigArray = tsEslint . config (
5+ ...nadle . configs . recommended ,
6+ nadle . configs . react ,
137 {
148 ignores : [
159 "**/lib" ,
@@ -22,104 +16,12 @@ export default tsEslint.config(
2216 ]
2317 } ,
2418 {
25- linterOptions : {
26- reportUnusedDisableDirectives : "error"
27- } ,
28- plugins : {
29- stylistic,
30- perfectionist,
31- unusedImports
32- } ,
3319 languageOptions : {
3420 parserOptions : {
3521 project : [ "**/tsconfig.eslint.json" ]
3622 }
37- } ,
38- rules : {
39- curly : "error" ,
40- "sort-keys" : "off" ,
41- "no-console" : "warn" ,
42- "max-params" : [ "error" , 4 ] ,
43- "no-restricted-imports" : [ "error" , { patterns : [ "consola" ] } ] ,
44-
45- "n/hashbang" : "off" ,
46- "n/no-missing-import" : "off" ,
47- "n/no-unpublished-import" : "off" ,
48- "n/prefer-node-protocol" : "error" ,
49- "n/no-unsupported-features/node-builtins" : "off" ,
50-
51- "unusedImports/no-unused-imports" : "error" ,
52-
53- "@typescript-eslint/no-namespace" : "off" ,
54- "@typescript-eslint/no-explicit-any" : "warn" ,
55- "@typescript-eslint/no-empty-object-type" : "off" ,
56- "@typescript-eslint/explicit-member-accessibility" : "error" ,
57- "@typescript-eslint/consistent-type-imports" : [ "error" , { prefer : "type-imports" , fixStyle : "inline-type-imports" } ] ,
58- "@typescript-eslint/no-unused-vars" : [
59- "error" ,
60- { argsIgnorePattern : "^_" , ignoreRestSiblings : true , destructuredArrayIgnorePattern : "^_" , caughtErrorsIgnorePattern : "^error$" }
61- ] ,
62-
63- "perfectionist/sort-named-imports" : [ "error" , { type : "line-length" } ] ,
64- "perfectionist/sort-objects" : [ "error" , { type : "line-length" , partitionByNewLine : true } ] ,
65- "perfectionist/sort-exports" : [ "error" , { type : "line-length" , partitionByNewLine : true } ] ,
66- "perfectionist/sort-interfaces" : [ "error" , { type : "line-length" , partitionByNewLine : true } ] ,
67- "perfectionist/sort-object-types" : [ "error" , { type : "line-length" , partitionByNewLine : true } ] ,
68- "perfectionist/sort-imports" : [
69- "error" ,
70- { type : "line-length" , newlinesBetween : "always" , groups : [ "side-effect" , "builtin" , "external" , [ "parent" , "sibling" , "index" ] ] }
71- ] ,
72-
73- "stylistic/padding-line-between-statements" : [
74- "error" ,
75- { prev : "*" , blankLine : "always" , next : [ "if" , "while" , "for" , "switch" , "try" , "do" , "return" ] } ,
76- { next : "*" , prev : "block-like" , blankLine : "always" }
77- ]
78- }
79- } ,
80- {
81- files : [ "packages/nadle/src/**" ] ,
82- rules : {
83- "no-restricted-properties" : [
84- "error" ,
85- {
86- property : "cwd" ,
87- object : "process" ,
88- message : "Avoid using process.cwd()"
89- } ,
90- {
91- property : "cwd" ,
92- object : "Process" ,
93- message : "Avoid using Process.cwd()"
94- }
95- ]
96- }
97- } ,
98- {
99- rules : {
100- "no-console" : "off"
101- } ,
102- files : [ "packages/sample-app/**" , "packages/nadle/test/**" , "packages/validators/**" , "packages/examples/**" ]
103- } ,
104- {
105- files : [ "packages/nadle/test/fixtures/**" ] ,
106- rules : {
107- "no-restricted-imports" : [ "error" , { patterns : [ "../**/src/*" ] } ]
108- }
109- } ,
110- {
111- plugins : {
112- vitest
113- } ,
114- files : [ "**/test/**/*.test.ts" ] ,
115- rules : {
116- ...vitest . configs . recommended . rules ,
117- "vitest/expect-expect" : [
118- "error" ,
119- {
120- assertFunctionNames : [ "expectPass" , "expectFail" , "expect" ]
121- }
122- ]
12323 }
12424 }
12525) ;
26+
27+ export default config ;
0 commit comments