@sanity/prettier-config
Version:
Sanity.io Prettier shared configuration
1 lines • 2.26 kB
Source Map (JSON)
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import type {Config} from 'prettier'\n\n/**\n * Some of Prettier's defaults can be overridden by an EditorConfig file. We\n * define those here to ensure that doesn't happen.\n *\n * See: https://github.com/prettier/prettier/blob/main/docs/configuration.md#editorconfig\n */\nconst overridableDefaults = {\n endOfLine: 'lf',\n tabWidth: 2 as const,\n useTabs: false,\n} satisfies Config\n\nconst json5 = {\n files: ['*.json5'] as const,\n options: {\n quoteProps: 'preserve',\n singleQuote: false,\n },\n} satisfies NonNullable<Config['overrides']>[number]\n\nconst yaml = {\n files: ['*.yml'] as const,\n options: {\n singleQuote: false,\n },\n} satisfies NonNullable<Config['overrides']>[number]\n\nconst oxc = {\n files: ['**/*.{js,mjs,cjs,jsx}'] as const,\n options: {\n plugins: ['@prettier/plugin-oxc'] as const,\n parser: 'oxc',\n },\n} satisfies NonNullable<Config['overrides']>[number]\n\nconst oxcTs = {\n files: ['**/*.{ts,mts,cts,tsx}'] as const,\n options: {\n plugins: ['@prettier/plugin-oxc'] as const,\n parser: 'oxc-ts',\n },\n} satisfies NonNullable<Config['overrides']>[number]\n\nconst config = {\n ...overridableDefaults,\n printWidth: 100 as const,\n semi: false,\n singleQuote: true,\n quoteProps: 'consistent',\n bracketSpacing: false,\n plugins: ['prettier-plugin-packagejson'] as const,\n overrides: [json5, yaml, oxc, oxcTs] as [typeof json5, typeof yaml, typeof oxc, typeof oxcTs],\n} satisfies Config\n\nexport default config\n"],"names":[],"mappings":";AAQA,MAAM,sBAAsB;AAAA,EAC1B,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AACX,GAEM,QAAQ;AAAA,EACZ,OAAO,CAAC,SAAS;AAAA,EACjB,SAAS;AAAA,IACP,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA;AAEjB,GAEM,OAAO;AAAA,EACX,OAAO,CAAC,OAAO;AAAA,EACf,SAAS;AAAA,IACP,aAAa;AAAA,EAAA;AAEjB,GAEM,MAAM;AAAA,EACV,OAAO,CAAC,uBAAuB;AAAA,EAC/B,SAAS;AAAA,IACP,SAAS,CAAC,sBAAsB;AAAA,IAChC,QAAQ;AAAA,EAAA;AAEZ,GAEM,QAAQ;AAAA,EACZ,OAAO,CAAC,uBAAuB;AAAA,EAC/B,SAAS;AAAA,IACP,SAAS,CAAC,sBAAsB;AAAA,IAChC,QAAQ;AAAA,EAAA;AAEZ,GAEM,SAAS;AAAA,EACb,GAAG;AAAA,EACH,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,SAAS,CAAC,6BAA6B;AAAA,EACvC,WAAW,CAAC,OAAO,MAAM,KAAK,KAAK;AACrC;;"}