1+ import { resolve } from 'path' ;
2+
13import stylelint , { type Config } from 'stylelint' ;
24
35// importing from the package would create circular dependency
@@ -7,6 +9,11 @@ import config from '../../stylelint-config-standard-linaria/src';
79
810// note: need to run pnpm install to pick up updates from any parse/stringify changes
911describe ( 'stylelint' , ( ) => {
12+ const configBasedir = resolve (
13+ __dirname ,
14+ '../../stylelint-config-standard-linaria'
15+ ) ;
16+
1017 it ( 'should not error with valid syntax' , async ( ) => {
1118 const source = `
1219 css\`
@@ -26,6 +33,7 @@ describe('stylelint', () => {
2633 const result = await stylelint . lint ( {
2734 code : source ,
2835 config : config as Config ,
36+ configBasedir,
2937 } ) ;
3038
3139 expect ( result . errored ) . toEqual ( false ) ;
@@ -46,6 +54,7 @@ describe('stylelint', () => {
4654 } ,
4755 } as Config ,
4856 fix : true ,
57+ configBasedir,
4958 } ) ;
5059 expect ( result . errored ) . toEqual ( false ) ;
5160 expect ( result . output ) . toMatchInlineSnapshot ( `
@@ -71,6 +80,7 @@ describe('stylelint', () => {
7180 } ,
7281 } as Config ,
7382 fix : true ,
83+ configBasedir,
7484 } ) ;
7585 expect ( result . errored ) . toEqual ( false ) ;
7686 expect ( result . output ) . toMatchInlineSnapshot ( `
@@ -97,6 +107,7 @@ describe('stylelint', () => {
97107 } ,
98108 } as Config ,
99109 fix : true ,
110+ configBasedir,
100111 } ) ;
101112 expect ( result . output ) . toMatchInlineSnapshot ( `
102113 "
@@ -124,6 +135,7 @@ describe('stylelint', () => {
124135 indentation : 4 ,
125136 } ,
126137 } as Config ,
138+ configBasedir,
127139 } ) ;
128140
129141 expect ( result . errored ) . toEqual ( false ) ;
0 commit comments