@@ -6,6 +6,7 @@ import { FlatESLint } from "eslint/use-at-your-own-risk";
66import * as tsParser from "@typescript-eslint/parser" ;
77import recommendedConfig from "eslint-plugin-solid/configs/recommended" ;
88import typescriptConfig from "eslint-plugin-solid/configs/typescript" ;
9+ import plugin from "eslint-plugin-solid" ;
910
1011const cwd = path . resolve ( "test" , "fixture" ) ;
1112const validDir = path . join ( cwd , "valid" ) ;
@@ -66,3 +67,24 @@ test.concurrent("fixture (flat)", async () => {
6667
6768 expect ( results . filter ( ( result ) => result . filePath === jsxUndefPath ) . length ) . toBe ( 1 ) ;
6869} ) ;
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