From 4cf1946cec5e55c86a0469de1c7ee05779ebb588 Mon Sep 17 00:00:00 2001 From: tasiotas Date: Sat, 23 Mar 2024 07:42:31 -0700 Subject: [PATCH 1/4] add graphql glob --- src/globs.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/globs.ts b/src/globs.ts index 8bfa0625fb..3f3606c066 100644 --- a/src/globs.ts +++ b/src/globs.ts @@ -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}` From bb046116e44a0e522578a406d09187f4665716e1 Mon Sep 17 00:00:00 2001 From: tasiotas Date: Sat, 23 Mar 2024 07:46:12 -0700 Subject: [PATCH 2/4] add graphql glob --- src/configs/formatters.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/configs/formatters.ts b/src/configs/formatters.ts index 484a9a36a0..d340a598be 100644 --- a/src/configs/formatters.ts +++ b/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' @@ -227,7 +227,7 @@ export async function formatters( if (options.graphql) { configs.push({ - files: ['**/*.graphql'], + files: [GLOB_GRAPHQL], languageOptions: { parser: parserPlain, }, From b053cfea97ee1bc9f6eb018da9eceb7d11954cca Mon Sep 17 00:00:00 2001 From: tasiotas Date: Sat, 23 Mar 2024 07:50:02 -0700 Subject: [PATCH 3/4] add gql to eslint.validate --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3093ab83e0..421c94cd45 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,9 @@ Add the following settings to your `.vscode/settings.json`: "json", "jsonc", "yaml", - "toml" + "toml", + "gql", + "graphql" ] } ``` From 6fabadf98e71b2b62adb71e713e148c05afdd6cb Mon Sep 17 00:00:00 2001 From: tasiotas Date: Sat, 23 Mar 2024 08:08:21 -0700 Subject: [PATCH 4/4] removed semicolon --- src/globs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/globs.ts b/src/globs.ts index 3f3606c066..44d950adfb 100644 --- a/src/globs.ts +++ b/src/globs.ts @@ -25,7 +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_GRAPHQL = '**/*.{g,graph}ql' export const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`