@@ -8,26 +8,35 @@ import {
88} from '@theguild/components/server' ;
99
1010const docsComponents = getDocsMDXComponents ( {
11- async ESLintConfigs ( { gitFolder, additionalFiles } : { gitFolder : string , additionalFiles : Record < string , string > } ) {
11+ async ESLintConfigs ( {
12+ gitFolder,
13+ additionalFiles,
14+ } : {
15+ gitFolder : string ;
16+ additionalFiles : Record < string , string > ;
17+ } ) {
1218 const user = 'dimaMachina' ;
1319 const repo = 'graphql-eslint' ;
1420 const branch = 'master' ;
1521 const docsPath = path . join ( process . cwd ( ) , '..' , 'examples' , gitFolder ) ;
1622
1723 const promises = Object . entries ( {
1824 ...additionalFiles ,
19- 'ESLint Flat Config' : 'eslint.config.js'
25+ 'ESLint Flat Config' : 'eslint.config.js' ,
2026 } ) . map ( async ( [ heading , filePath ] ) => {
2127 const { ext } = path . parse ( filePath ) ;
2228 return `## ${ heading }
2329
2430\`\`\`${ ext . slice ( 1 ) } filename="${ filePath } "
2531${ ( await fs . readFile ( `${ docsPath } /${ filePath } ` , 'utf8' ) ) . trim ( ) }
26- \`\`\``
27- } )
28- const files = await Promise . all ( promises )
32+ \`\`\`` ;
33+ } ) ;
34+ const files = await Promise . all ( promises ) ;
2935
30- const hasLegacyConfig = await fs . access ( `${ docsPath } /.eslintrc.cjs` ) . then ( ( ) => true ) . catch ( ( ) => '' )
36+ const hasLegacyConfig = await fs
37+ . access ( `${ docsPath } /.eslintrc.cjs` )
38+ . then ( ( ) => true )
39+ . catch ( ( ) => '' ) ;
3140
3241 return (
3342 < MDXRemote
@@ -42,7 +51,9 @@ ${hasLegacyConfig ? `> or [ESLint Legacy Config](https://github.com/${user}/${re
4251
4352${ files . join ( '\n' ) }
4453
45- ${ hasLegacyConfig && `
54+ ${
55+ hasLegacyConfig &&
56+ `
4657## ESLint Legacy Config
4758
4859> [!WARNING]
@@ -51,7 +62,8 @@ ${hasLegacyConfig && `
5162
5263\`\`\`js filename=".eslintrc.cjs"
5364${ ( await fs . readFile ( `${ docsPath } /.eslintrc.cjs` , 'utf8' ) ) . trim ( ) }
54- \`\`\`` }
65+ \`\`\``
66+ }
5567` ) }
5668 />
5769 ) ;
0 commit comments