@@ -88,130 +88,124 @@ const p11tGroups = {
8888 } ,
8989 groups : [ "id" , "type" , "meta" , "alias" , "rules" , "unknown" ] ,
9090} ;
91- export const strictTypeChecked = defineConfig ( [
92- {
93- ignores : GLOB_JS ,
94- } ,
95- {
96- extends : [
97- js . configs . recommended ,
98- ...tseslint . configs . strict ,
91+ export const strictTypeChecked = defineConfig ( {
92+ ignores : GLOB_JS ,
93+ } , {
94+ extends : [
95+ js . configs . recommended ,
96+ ...tseslint . configs . strict ,
97+ ] ,
98+ files : GLOB_TS ,
99+ rules : {
100+ eqeqeq : [ "error" , "smart" ] ,
101+ "no-console" : "error" ,
102+ "no-else-return" : "error" ,
103+ "no-fallthrough" : [ "error" , { commentPattern : ".*intentional fallthrough.*" } ] ,
104+ "no-implicit-coercion" : [ "error" , { allow : [ "!!" ] } ] ,
105+ "prefer-object-has-own" : "error" ,
106+ "no-restricted-syntax" : [
107+ "error" ,
108+ {
109+ message : "no typescript named import" ,
110+ selector : "ImportDeclaration[source.value='typescript'] ImportSpecifier" ,
111+ } ,
99112 ] ,
100- files : GLOB_TS ,
101- rules : {
102- eqeqeq : [ "error" , "smart" ] ,
103- "no-console" : "error" ,
104- "no-else-return" : "error" ,
105- "no-fallthrough" : [ "error" , { commentPattern : ".*intentional fallthrough.*" } ] ,
106- "no-implicit-coercion" : [ "error" , { allow : [ "!!" ] } ] ,
107- "prefer-object-has-own" : "error" ,
108- "no-restricted-syntax" : [
109- "error" ,
110- {
111- message : "no typescript named import" ,
112- selector : "ImportDeclaration[source.value='typescript'] ImportSpecifier" ,
113- } ,
114- ] ,
115- "@typescript-eslint/ban-ts-comment" : [
116- "error" ,
117- {
118- "ts-check" : false ,
119- "ts-expect-error" : "allow-with-description" ,
120- "ts-ignore" : true ,
121- "ts-nocheck" : true ,
122- } ,
123- ] ,
124- "@typescript-eslint/ban-types" : "off" ,
125- "@typescript-eslint/consistent-type-exports" : "error" ,
126- "@typescript-eslint/consistent-type-imports" : "error" ,
127- "@typescript-eslint/explicit-function-return-type" : "off" ,
128- "@typescript-eslint/no-confusing-void-expression" : "off" ,
129- "@typescript-eslint/no-empty-object-type" : "off" ,
130- "@typescript-eslint/no-misused-promises" : "warn" ,
131- "@typescript-eslint/no-namespace" : "off" ,
132- "@typescript-eslint/no-unnecessary-parameter-property-assignment" : "warn" ,
133- "@typescript-eslint/no-unused-vars" : [ "warn" , { caughtErrors : "all" } ] ,
134- "@typescript-eslint/strict-boolean-expressions" : [ "error" , {
135- allowAny : false ,
136- allowNullableBoolean : false ,
137- allowNullableEnum : false ,
138- allowNullableNumber : false ,
139- allowNullableObject : false ,
140- allowNullableString : false ,
141- allowNumber : true ,
142- allowString : false ,
143- } ] ,
144- } ,
145- } ,
146- {
147- extends : [
148- jsdoc ( { config : "flat/recommended-typescript-error" } ) ,
149- pluginDeMorgan . configs . recommended ,
150- pluginPerfectionist . configs [ "recommended-natural" ] ,
151- pluginRegexp . configs [ "flat/recommended" ] ,
113+ "@typescript-eslint/ban-ts-comment" : [
114+ "error" ,
115+ {
116+ "ts-check" : false ,
117+ "ts-expect-error" : "allow-with-description" ,
118+ "ts-ignore" : true ,
119+ "ts-nocheck" : true ,
120+ } ,
152121 ] ,
153- files : GLOB_TS ,
154- plugins : {
155- [ "@stylistic" ] : stylistic ,
156- [ "function" ] : pluginFunction ,
157- [ "unicorn" ] : pluginUnicorn ,
158- } ,
159- rules : {
160- "function/function-return-boolean" : [ "error" , { pattern : "/^(is|has|can|should)/" } ] ,
161- "@stylistic/arrow-parens" : [ "warn" , "always" ] ,
162- "@stylistic/no-multi-spaces" : [ "warn" ] ,
163- "@stylistic/operator-linebreak" : "off" ,
164- "@stylistic/quote-props" : [ "error" , "as-needed" ] ,
165- "perfectionist/sort-exports" : "off" ,
166- "perfectionist/sort-imports" : "off" ,
167- "perfectionist/sort-interfaces" : [
168- "warn" ,
169- { ...p11tOptions , ...p11tGroups } ,
170- ] ,
171- "perfectionist/sort-intersection-types" : "off" ,
172- "perfectionist/sort-modules" : "off" ,
173- "perfectionist/sort-named-exports" : "off" ,
174- "perfectionist/sort-named-imports" : "off" ,
175- "perfectionist/sort-object-types" : [
176- "warn" ,
177- { ...p11tOptions , ...p11tGroups } ,
178- ] ,
179- "perfectionist/sort-objects" : [
180- "warn" ,
181- { ...p11tOptions , ...p11tGroups } ,
182- ] ,
183- "perfectionist/sort-switch-case" : "off" ,
184- "perfectionist/sort-union-types" : "off" ,
185- "jsdoc/check-param-names" : "warn" ,
186- "jsdoc/check-tag-names" : "warn" ,
187- "jsdoc/informative-docs" : "off" ,
188- "jsdoc/lines-before-block" : "off" ,
189- "jsdoc/require-jsdoc" : "off" ,
190- "jsdoc/require-param" : "warn" ,
191- "jsdoc/require-param-description" : "warn" ,
192- "jsdoc/require-returns" : "off" ,
193- "jsdoc/require-yields" : "warn" ,
194- "jsdoc/tag-lines" : "off" ,
195- "unicorn/template-indent" : [
196- "warn" ,
197- {
198- comments : templateIndentTags ,
199- tags : templateIndentTags ,
200- } ,
201- ] ,
202- } ,
122+ "@typescript-eslint/ban-types" : "off" ,
123+ "@typescript-eslint/consistent-type-exports" : "error" ,
124+ "@typescript-eslint/consistent-type-imports" : "error" ,
125+ "@typescript-eslint/explicit-function-return-type" : "off" ,
126+ "@typescript-eslint/no-confusing-void-expression" : "off" ,
127+ "@typescript-eslint/no-empty-object-type" : "off" ,
128+ "@typescript-eslint/no-misused-promises" : "warn" ,
129+ "@typescript-eslint/no-namespace" : "off" ,
130+ "@typescript-eslint/no-unnecessary-parameter-property-assignment" : "warn" ,
131+ "@typescript-eslint/no-unused-vars" : [ "warn" , { caughtErrors : "all" } ] ,
132+ "@typescript-eslint/strict-boolean-expressions" : [ "error" , {
133+ allowAny : false ,
134+ allowNullableBoolean : false ,
135+ allowNullableEnum : false ,
136+ allowNullableNumber : false ,
137+ allowNullableObject : false ,
138+ allowNullableString : false ,
139+ allowNumber : true ,
140+ allowString : false ,
141+ } ] ,
203142 } ,
204- ] ) ;
205- export const disableTypeChecked = defineConfig ( [
206- {
207- extends : [
208- tseslint . configs . disableTypeChecked ,
143+ } , {
144+ extends : [
145+ jsdoc ( { config : "flat/recommended-typescript-error" } ) ,
146+ pluginDeMorgan . configs . recommended ,
147+ pluginPerfectionist . configs [ "recommended-natural" ] ,
148+ pluginRegexp . configs [ "flat/recommended" ] ,
149+ ] ,
150+ files : GLOB_TS ,
151+ plugins : {
152+ [ "@stylistic" ] : stylistic ,
153+ [ "function" ] : pluginFunction ,
154+ [ "unicorn" ] : pluginUnicorn ,
155+ } ,
156+ rules : {
157+ "function/function-return-boolean" : [ "error" , { pattern : "/^(is|has|can|should)/" } ] ,
158+ "@stylistic/arrow-parens" : [ "warn" , "always" ] ,
159+ "@stylistic/no-multi-spaces" : [ "warn" ] ,
160+ "@stylistic/operator-linebreak" : "off" ,
161+ "@stylistic/quote-props" : [ "error" , "as-needed" ] ,
162+ "perfectionist/sort-exports" : "off" ,
163+ "perfectionist/sort-imports" : "off" ,
164+ "perfectionist/sort-interfaces" : [
165+ "warn" ,
166+ { ...p11tOptions , ...p11tGroups } ,
209167 ] ,
210- rules : {
211- "function/function-return-boolean" : "off" ,
212- } ,
168+ "perfectionist/sort-intersection-types" : "off" ,
169+ "perfectionist/sort-modules" : "off" ,
170+ "perfectionist/sort-named-exports" : "off" ,
171+ "perfectionist/sort-named-imports" : "off" ,
172+ "perfectionist/sort-object-types" : [
173+ "warn" ,
174+ { ...p11tOptions , ...p11tGroups } ,
175+ ] ,
176+ "perfectionist/sort-objects" : [
177+ "warn" ,
178+ { ...p11tOptions , ...p11tGroups } ,
179+ ] ,
180+ "perfectionist/sort-switch-case" : "off" ,
181+ "perfectionist/sort-union-types" : "off" ,
182+ "jsdoc/check-param-names" : "warn" ,
183+ "jsdoc/check-tag-names" : "warn" ,
184+ "jsdoc/informative-docs" : "off" ,
185+ "jsdoc/lines-before-block" : "off" ,
186+ "jsdoc/require-jsdoc" : "off" ,
187+ "jsdoc/require-param" : "warn" ,
188+ "jsdoc/require-param-description" : "warn" ,
189+ "jsdoc/require-returns" : "off" ,
190+ "jsdoc/require-yields" : "warn" ,
191+ "jsdoc/tag-lines" : "off" ,
192+ "unicorn/template-indent" : [
193+ "warn" ,
194+ {
195+ comments : templateIndentTags ,
196+ tags : templateIndentTags ,
197+ } ,
198+ ] ,
199+ } ,
200+ } ) ;
201+ export const disableTypeChecked = defineConfig ( {
202+ extends : [
203+ tseslint . configs . disableTypeChecked ,
204+ ] ,
205+ rules : {
206+ "function/function-return-boolean" : "off" ,
213207 } ,
214- ] ) ;
208+ } ) ;
215209/**
216210 * Common ESLint JS rules to disable that are problematic when using TypeScript.
217211 */
0 commit comments