diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index efadf16586..b064ee0f7f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -126,8 +126,8 @@ catalogs: specifier: ^7.4.0 version: 7.4.0 '@stylistic/eslint-plugin': - specifier: ^5.4.0 - version: 5.4.0 + specifier: ^5.5.0 + version: 5.5.0 '@typescript-eslint/eslint-plugin': specifier: ^8.46.1 version: 8.46.1 @@ -243,7 +243,7 @@ importers: version: 7.4.0 '@stylistic/eslint-plugin': specifier: catalog:prod - version: 5.4.0(eslint@9.37.0(jiti@2.6.1)) + version: 5.5.0(eslint@9.37.0(jiti@2.6.1)) '@typescript-eslint/eslint-plugin': specifier: catalog:prod version: 8.46.1(@typescript-eslint/parser@8.46.1(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3) @@ -309,7 +309,7 @@ importers: version: 4.2.0(@typescript-eslint/eslint-plugin@8.46.1(@typescript-eslint/parser@8.46.1(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.37.0(jiti@2.6.1)) eslint-plugin-vue: specifier: catalog:prod - version: 10.5.0(@stylistic/eslint-plugin@5.4.0(eslint@9.37.0(jiti@2.6.1)))(@typescript-eslint/parser@8.46.1(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.37.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.37.0(jiti@2.6.1))) + version: 10.5.0(@stylistic/eslint-plugin@5.5.0(eslint@9.37.0(jiti@2.6.1)))(@typescript-eslint/parser@8.46.1(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.37.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.37.0(jiti@2.6.1))) eslint-plugin-yml: specifier: catalog:prod version: 1.19.0(eslint@9.37.0(jiti@2.6.1)) @@ -1239,8 +1239,8 @@ packages: resolution: {integrity: sha512-X67V4cCgM0Sz50bP8GbVzmiL8DHC2IXvdKcsN7DlxHyf+/T4d9GveeGukwha5Fx3MuYeGZWKag7TFL2ZY4w54A==} engines: {node: '>=18.0.0'} - '@stylistic/eslint-plugin@5.4.0': - resolution: {integrity: sha512-UG8hdElzuBDzIbjG1QDwnYH0MQ73YLXDFHgZzB4Zh/YJfnw8XNsloVtytqzx0I2Qky9THSdpTmi8Vjn/pf/Lew==} + '@stylistic/eslint-plugin@5.5.0': + resolution: {integrity: sha512-IeZF+8H0ns6prg4VrkhgL+yrvDXWDH2cKchrbh80ejG9dQgZWp10epHMbgRuQvgchLII/lfh6Xn3lu6+6L86Hw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^9.37.0 @@ -4487,7 +4487,7 @@ snapshots: '@slidev/types@0.47.5': {} - '@stylistic/eslint-plugin@5.4.0(eslint@9.37.0(jiti@2.6.1))': + '@stylistic/eslint-plugin@5.5.0(eslint@9.37.0(jiti@2.6.1))': dependencies: '@eslint-community/eslint-utils': 4.9.0(eslint@9.37.0(jiti@2.6.1)) '@typescript-eslint/types': 8.46.1 @@ -5688,7 +5688,7 @@ snapshots: optionalDependencies: '@typescript-eslint/eslint-plugin': 8.46.1(@typescript-eslint/parser@8.46.1(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3) - eslint-plugin-vue@10.5.0(@stylistic/eslint-plugin@5.4.0(eslint@9.37.0(jiti@2.6.1)))(@typescript-eslint/parser@8.46.1(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.37.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.37.0(jiti@2.6.1))): + eslint-plugin-vue@10.5.0(@stylistic/eslint-plugin@5.5.0(eslint@9.37.0(jiti@2.6.1)))(@typescript-eslint/parser@8.46.1(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.37.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.37.0(jiti@2.6.1))): dependencies: '@eslint-community/eslint-utils': 4.9.0(eslint@9.37.0(jiti@2.6.1)) eslint: 9.37.0(jiti@2.6.1) @@ -5699,7 +5699,7 @@ snapshots: vue-eslint-parser: 10.2.0(eslint@9.37.0(jiti@2.6.1)) xml-name-validator: 4.0.0 optionalDependencies: - '@stylistic/eslint-plugin': 5.4.0(eslint@9.37.0(jiti@2.6.1)) + '@stylistic/eslint-plugin': 5.5.0(eslint@9.37.0(jiti@2.6.1)) '@typescript-eslint/parser': 8.46.1(eslint@9.37.0(jiti@2.6.1))(typescript@5.9.3) eslint-plugin-vuejs-accessibility@2.4.1(eslint@9.37.0(jiti@2.6.1)): diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 038d6bdd82..a9867d6d00 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -56,7 +56,7 @@ catalogs: '@clack/prompts': ^0.11.0 '@eslint-community/eslint-plugin-eslint-comments': ^4.5.0 '@eslint/markdown': ^7.4.0 - '@stylistic/eslint-plugin': ^5.4.0 + '@stylistic/eslint-plugin': ^5.5.0 '@typescript-eslint/eslint-plugin': ^8.46.1 '@typescript-eslint/parser': ^8.46.1 '@vitest/eslint-plugin': ^1.3.20 diff --git a/src/configs/nextjs.ts b/src/configs/nextjs.ts index 541f71e30c..26db22fed5 100644 --- a/src/configs/nextjs.ts +++ b/src/configs/nextjs.ts @@ -4,8 +4,9 @@ import { ensurePackages, interopDefault } from '../utils' function normalizeRules(rules: Record): Record { return Object.fromEntries( - Object.entries(rules).map(([key, value]) => - [key, typeof value === 'string' ? [value] : value], + Object.entries(rules).map( + ([key, value]) => + [key, typeof value === 'string' ? [value] : value], ), ) } diff --git a/src/configs/stylistic.ts b/src/configs/stylistic.ts index bc8d0eaeb1..dd93caa535 100644 --- a/src/configs/stylistic.ts +++ b/src/configs/stylistic.ts @@ -3,6 +3,7 @@ import { pluginAntfu } from '../plugins' import { interopDefault } from '../utils' export const StylisticConfigDefaults: StylisticConfig = { + experimental: true, indent: 2, jsx: true, quotes: 'single', @@ -17,6 +18,7 @@ export async function stylistic( options: StylisticOptions = {}, ): Promise { const { + experimental, indent, jsx, lessOpinionated = false, @@ -31,6 +33,7 @@ export async function stylistic( const pluginStylistic = await interopDefault(import('@stylistic/eslint-plugin')) const config = pluginStylistic.configs.customize({ + experimental, indent, jsx, pluginName: 'style', @@ -49,7 +52,6 @@ export async function stylistic( ...config.rules, 'antfu/consistent-chaining': 'error', - 'antfu/consistent-list-newline': 'error', ...(lessOpinionated ? { @@ -62,9 +64,6 @@ export async function stylistic( } ), - 'style/generator-star-spacing': ['error', { after: true, before: false }], - 'style/yield-star-spacing': ['error', { after: true, before: false }], - ...overrides, }, }, diff --git a/src/types.ts b/src/types.ts index 580d48116e..a344d3996e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -220,7 +220,7 @@ export interface OptionsStylistic { } export interface StylisticConfig - extends Pick { + extends Pick { } export interface OptionsOverrides {