From e3b3ace09e3a4c1c8692f2eb5ababc76df59aef8 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 22 Sep 2023 15:31:16 +0800 Subject: [PATCH] feat: enable `antfu/consistent-object-newline` --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- src/configs/stylistic.ts | 4 +++- src/configs/vue.ts | 3 +-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index beb944b6ba..628af412df 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@typescript-eslint/eslint-plugin": "^6.7.2", "@typescript-eslint/parser": "^6.7.2", "eslint-define-config": "^1.23.0", - "eslint-plugin-antfu": "^1.0.0-beta.2", + "eslint-plugin-antfu": "^1.0.0-beta.3", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-i": "^2.28.1", "eslint-plugin-jsdoc": "^46.8.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c3e164e32..a8760310f4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,8 +30,8 @@ importers: specifier: ^1.23.0 version: 1.23.0 eslint-plugin-antfu: - specifier: ^1.0.0-beta.2 - version: 1.0.0-beta.2(eslint@8.49.0)(typescript@5.2.2) + specifier: ^1.0.0-beta.3 + version: 1.0.0-beta.3(eslint@8.49.0)(typescript@5.2.2) eslint-plugin-eslint-comments: specifier: ^3.2.0 version: 3.2.0(eslint@8.49.0) @@ -2086,8 +2086,8 @@ packages: - supports-color dev: false - /eslint-plugin-antfu@1.0.0-beta.2(eslint@8.49.0)(typescript@5.2.2): - resolution: {integrity: sha512-jrgUzJ/R+mFCX8f3x2HUQZfF4vMRFyGT/MQNKKFO1DcEGnVVq3zmYife+uYpLQUd4sfySo5wVOY3a/pvnfSYIg==} + /eslint-plugin-antfu@1.0.0-beta.3(eslint@8.49.0)(typescript@5.2.2): + resolution: {integrity: sha512-jP9wSGmfWbAUVqzZAdq314kNFTnKjZpiqdQhCbKDVdSL9m6aGuG94FOK5nbpwQJA5vKdYc3PSPiZy1yFjWDPwg==} dependencies: '@typescript-eslint/utils': 6.7.2(eslint@8.49.0)(typescript@5.2.2) transitivePeerDependencies: diff --git a/src/configs/stylistic.ts b/src/configs/stylistic.ts index 42f1817a1f..d86eb326ca 100644 --- a/src/configs/stylistic.ts +++ b/src/configs/stylistic.ts @@ -12,6 +12,8 @@ export const javascriptStylistic: FlatESLintConfigItem[] = [ }, rules: { 'antfu/if-newline': 'error', + 'antfu/consistent-object-newline': 'error', + 'comma-dangle': ['error', 'always-multiline'], 'curly': ['error', 'multi-or-nest', 'consistent'], 'quotes': ['error', 'single'], @@ -75,7 +77,7 @@ export const javascriptStylistic: FlatESLintConfigItem[] = [ 'style/no-tabs': 'error', 'style/no-trailing-spaces': 'error', 'style/no-whitespace-before-property': 'error', - 'style/object-curly-newline': ['error', { consistent: true, multiline: true }], + 'style/object-curly-newline': OFF, 'style/object-curly-spacing': ['error', 'always'], 'style/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }], 'style/operator-linebreak': ['error', 'before'], diff --git a/src/configs/vue.ts b/src/configs/vue.ts index 617e16665c..1f85da7466 100644 --- a/src/configs/vue.ts +++ b/src/configs/vue.ts @@ -80,8 +80,7 @@ export function vue(options: OptionsHasTypeScript = {}): FlatESLintConfigItem[] 'vue/no-unused-refs': 'error', 'vue/no-useless-v-bind': 'error', 'vue/no-v-html': OFF, - 'vue/no-v-text-v-html-on-component': OFF, - 'vue/object-curly-newline': ['error', { consistent: true, multiline: true }], + 'vue/object-curly-newline': OFF, 'vue/object-curly-spacing': ['error', 'always'], 'vue/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }], 'vue/object-shorthand': [