@@ -6,6 +6,7 @@ import { FlatESLint } from "eslint/use-at-your-own-risk";
6
6
import * as tsParser from "@typescript-eslint/parser" ;
7
7
import recommendedConfig from "eslint-plugin-solid/configs/recommended" ;
8
8
import typescriptConfig from "eslint-plugin-solid/configs/typescript" ;
9
+ import plugin from "eslint-plugin-solid" ;
9
10
10
11
const cwd = path . resolve ( "test" , "fixture" ) ;
11
12
const validDir = path . join ( cwd , "valid" ) ;
@@ -66,3 +67,24 @@ test.concurrent("fixture (flat)", async () => {
66
67
67
68
expect ( results . filter ( ( result ) => result . filePath === jsxUndefPath ) . length ) . toBe ( 1 ) ;
68
69
} ) ;
70
+
71
+ describe ( "config format" , ( ) => {
72
+ test ( "flat config has meta" , ( ) => {
73
+ expect ( recommendedConfig . plugins . solid . meta . name ) . toBe ( "eslint-plugin-solid" ) ;
74
+ expect ( recommendedConfig . plugins . solid . meta . version ) . toEqual ( expect . any ( String ) ) ;
75
+ expect ( typescriptConfig . plugins . solid . meta . name ) . toBe ( "eslint-plugin-solid" ) ;
76
+ expect ( typescriptConfig . plugins . solid . meta . version ) . toEqual ( expect . any ( String ) ) ;
77
+ } ) ;
78
+
79
+ test ( 'flat configs are also exposed on plugin.configs["flat/*"]' , ( ) => {
80
+ // include flat configs on legacy config object with `flat/` prefix. The `fixture (flat)` test
81
+ // passing means that an equivalent config using `configs["flat/*"]` will also pass.
82
+ expect ( plugin . configs [ "flat/recommended" ] ) . toBe ( recommendedConfig ) ;
83
+ expect ( plugin . configs [ "flat/typescript" ] ) . toBe ( typescriptConfig ) ;
84
+ } ) ;
85
+
86
+ test ( "legacy configs use strings, not modules" , ( ) => {
87
+ expect ( plugin . configs . recommended . plugins ) . toStrictEqual ( [ "solid" ] ) ;
88
+ expect ( plugin . configs . typescript . plugins ) . toStrictEqual ( [ "solid" ] ) ;
89
+ } ) ;
90
+ } ) ;
0 commit comments