Skip to content

Commit

Permalink
feat: graphql glob that supports .qgl extensions (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
tasiotas committed Mar 26, 2024
1 parent 13c4890 commit f586293
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -146,7 +146,9 @@ Add the following settings to your `.vscode/settings.json`:
"json",
"jsonc",
"yaml",
"toml"
"toml",
"gql",
"graphql"
]
}
```
Expand Down
4 changes: 2 additions & 2 deletions src/configs/formatters.ts
@@ -1,5 +1,5 @@
import { isPackageExists } from 'local-pkg'
import { GLOB_ASTRO, GLOB_CSS, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS } from '../globs'
import { GLOB_ASTRO, GLOB_CSS, GLOB_GRAPHQL, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS } from '../globs'
import type { VendoredPrettierOptions } from '../vender/prettier-types'
import { ensurePackages, interopDefault, parserPlain } from '../utils'
import type { FlatConfigItem, OptionsFormatters, StylisticConfig } from '../types'
Expand Down Expand Up @@ -227,7 +227,7 @@ export async function formatters(

if (options.graphql) {
configs.push({
files: ['**/*.graphql'],
files: [GLOB_GRAPHQL],
languageOptions: {
parser: parserPlain,
},
Expand Down
1 change: 1 addition & 0 deletions src/globs.ts
Expand Up @@ -25,6 +25,7 @@ export const GLOB_YAML = '**/*.y?(a)ml'
export const GLOB_TOML = '**/*.toml'
export const GLOB_HTML = '**/*.htm?(l)'
export const GLOB_ASTRO = '**/*.astro'
export const GLOB_GRAPHQL = '**/*.{g,graph}ql'

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

Expand Down

0 comments on commit f586293

Please sign in to comment.