From 45e302d6ebf9bf31463805022ced8717ef6aaad2 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 5 Oct 2023 09:38:23 +0800 Subject: [PATCH] fix(jsonc): indent config --- src/configs/jsonc.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/configs/jsonc.ts b/src/configs/jsonc.ts index 8137556c6a..c4d40c36a2 100644 --- a/src/configs/jsonc.ts +++ b/src/configs/jsonc.ts @@ -8,6 +8,10 @@ export function jsonc(options: OptionsStylistic & OptionsOverrides = {}): FlatES overrides = {}, } = options + const { + indent = 2, + } = typeof stylistic === 'boolean' ? {} : stylistic + return [ { name: 'antfu:jsonc:setup', @@ -54,7 +58,7 @@ export function jsonc(options: OptionsStylistic & OptionsOverrides = {}): FlatES 'jsonc/array-bracket-spacing': ['error', 'never'], 'jsonc/comma-dangle': ['error', 'never'], 'jsonc/comma-style': ['error', 'last'], - 'jsonc/indent': ['error', 2], + 'jsonc/indent': ['error', indent], 'jsonc/key-spacing': ['error', { afterColon: true, beforeColon: false }], 'jsonc/object-curly-newline': ['error', { consistent: true, multiline: true }], 'jsonc/object-curly-spacing': ['error', 'always'],