Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/configs/nextjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { ensurePackages, interopDefault } from '../utils'

function normalizeRules(rules: Record<string, any>): Record<string, any> {
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],
),
)
}
Expand Down
7 changes: 3 additions & 4 deletions src/configs/stylistic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { pluginAntfu } from '../plugins'
import { interopDefault } from '../utils'

export const StylisticConfigDefaults: StylisticConfig = {
experimental: true,
indent: 2,
jsx: true,
quotes: 'single',
Expand All @@ -17,6 +18,7 @@ export async function stylistic(
options: StylisticOptions = {},
): Promise<TypedFlatConfigItem[]> {
const {
experimental,
indent,
jsx,
lessOpinionated = false,
Expand All @@ -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',
Expand All @@ -49,7 +52,6 @@ export async function stylistic(
...config.rules,

'antfu/consistent-chaining': 'error',
'antfu/consistent-list-newline': 'error',

...(lessOpinionated
? {
Expand All @@ -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 }],
Comment on lines -65 to -66
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as customize's return


...overrides,
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export interface OptionsStylistic {
}

export interface StylisticConfig
extends Pick<StylisticCustomizeOptions, 'indent' | 'quotes' | 'jsx' | 'semi'> {
extends Pick<StylisticCustomizeOptions, 'indent' | 'quotes' | 'jsx' | 'semi' | 'experimental'> {
}

export interface OptionsOverrides {
Expand Down
Loading