@@ -17,23 +17,31 @@ import type { TSESLint } from "@typescript-eslint/utils";
1717
1818import rules from "./rules" ;
1919
20- const blueprintPlugin = { configs : { recommended : { } } , rules } ;
20+ type ConfigName = " recommended" ;
2121
22- // Assign the config here so that we can reference blueprintPlugin.
23- const configs : { [ c in keyof ( typeof blueprintPlugin ) [ "configs" ] ] : TSESLint . FlatConfig . Config } = {
24- /**
25- * Enables all Blueprint-specific lint rules defined in this package.
26- */
27- recommended : {
28- plugins : { "@blueprintjs" : blueprintPlugin } ,
29- rules : {
30- "@blueprintjs/classes-constants" : "error" ,
31- "@blueprintjs/html-components" : "error" ,
32- "@blueprintjs/no-deprecated-components" : "error" ,
33- "@blueprintjs/no-deprecated-type-references" : "error" ,
34- } ,
22+ const blueprintPlugin = {
23+ configs : { recommended : { } } as Record < ConfigName , TSESLint . ClassicConfig . Config > ,
24+ flatConfigs : { recommended : { } } as Record < ConfigName , TSESLint . FlatConfig . Config > ,
25+ rules,
26+ } ;
27+
28+ // The recommended config enables all Blueprint-specific lint rules defined in this package.
29+ const config : TSESLint . ClassicConfig . Config = {
30+ plugins : [ "@blueprintjs" ] ,
31+ rules : {
32+ "@blueprintjs/classes-constants" : "error" ,
33+ "@blueprintjs/html-components" : "error" ,
34+ "@blueprintjs/no-deprecated-components" : "error" ,
35+ "@blueprintjs/no-deprecated-type-references" : "error" ,
3536 } ,
3637} ;
37- Object . assign ( blueprintPlugin . configs , configs ) ;
38+ const flatConfig : TSESLint . FlatConfig . Config = {
39+ ...config ,
40+ plugins : { "@blueprintjs" : blueprintPlugin } ,
41+ } ;
42+
43+ // Assign the config here so that we can reference blueprintPlugin.
44+ Object . assign ( blueprintPlugin . configs . recommended , config ) ;
45+ Object . assign ( blueprintPlugin . flatConfigs . recommended , flatConfig ) ;
3846
3947export = blueprintPlugin ;
0 commit comments