Skip to content

Commit f586293

Browse files
authoredMar 26, 2024··
feat: graphql glob that supports .qgl extensions (#433)
1 parent 13c4890 commit f586293

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed
 

‎README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ Add the following settings to your `.vscode/settings.json`:
146146
"json",
147147
"jsonc",
148148
"yaml",
149-
"toml"
149+
"toml",
150+
"gql",
151+
"graphql"
150152
]
151153
}
152154
```

‎src/configs/formatters.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isPackageExists } from 'local-pkg'
2-
import { GLOB_ASTRO, GLOB_CSS, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS } from '../globs'
2+
import { GLOB_ASTRO, GLOB_CSS, GLOB_GRAPHQL, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS } from '../globs'
33
import type { VendoredPrettierOptions } from '../vender/prettier-types'
44
import { ensurePackages, interopDefault, parserPlain } from '../utils'
55
import type { FlatConfigItem, OptionsFormatters, StylisticConfig } from '../types'
@@ -227,7 +227,7 @@ export async function formatters(
227227

228228
if (options.graphql) {
229229
configs.push({
230-
files: ['**/*.graphql'],
230+
files: [GLOB_GRAPHQL],
231231
languageOptions: {
232232
parser: parserPlain,
233233
},

‎src/globs.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const GLOB_YAML = '**/*.y?(a)ml'
2525
export const GLOB_TOML = '**/*.toml'
2626
export const GLOB_HTML = '**/*.htm?(l)'
2727
export const GLOB_ASTRO = '**/*.astro'
28+
export const GLOB_GRAPHQL = '**/*.{g,graph}ql'
2829

2930
export const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`
3031

0 commit comments

Comments
 (0)
Please sign in to comment.