Skip to content

Commit

Permalink
fix(eslint): use latest perfectionist config
Browse files Browse the repository at this point in the history
  • Loading branch information
thecuvii committed Jul 28, 2024
1 parent 9db59da commit e2c48fe
Show file tree
Hide file tree
Showing 4 changed files with 449 additions and 359 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@zolplay/eslint-config": "workspace:*",
"@zolplay/prettier-config": "workspace:*",
"bumpp": "^9.4.1",
"eslint": "^9.7.0",
"eslint": "^9.8.0",
"prettier": "^3.3.3",
"typescript": "^5.5.4"
}
Expand Down
30 changes: 15 additions & 15 deletions packages/eslint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ export const factory = ({ next, prettier, reactQuery, tailwind }: EslintConfigOp
})

base.append([
...compat.config({
...(compat.config({
plugins: ['svg-jsx'],
rules: {
'svg-jsx/camel-case-colon': 'error',
'svg-jsx/camel-case-dash': 'error',
'svg-jsx/no-style-string': 'error',
},
}),
}) as any),
])

const customGroups = {
Expand Down Expand Up @@ -82,47 +82,47 @@ export const factory = ({ next, prettier, reactQuery, tailwind }: EslintConfigOp
base.append({
rules: {
'perfectionist/sort-array-includes': ['error', { type: 'natural' }],
'perfectionist/sort-enums': ['error', { type: 'natural', 'partition-by-comment': 'partitionByComment' }],
'perfectionist/sort-enums': ['error', { type: 'natural', partitionByComment: true }],
'perfectionist/sort-exports': ['error', { type: 'natural' }],
'perfectionist/sort-interfaces': [
'error',
{
type: 'natural',
'custom-groups': customGroups,
customGroups,
groupKind: 'required-first',
groups,
'optionality-order': 'required-first',
'partition-by-new-line': true,
partitionByNewLine: true,
},
],
'perfectionist/sort-jsx-props': [
'error',
{
type: 'natural',
'custom-groups': customGroups,
customGroups,
groups,
},
],
'perfectionist/sort-named-exports': ['error', { type: 'natural', 'group-kind': 'types-first' }],
'perfectionist/sort-named-exports': ['error', { type: 'natural', groupKind: 'types-first' }],
'perfectionist/sort-object-types': [
'error',
{
type: 'natural',
'custom-groups': customGroups,
customGroups,
groups,
'partition-by-new-line': true,
partitionByNewLine: true,
},
],
'perfectionist/sort-objects': [
'error',
{
type: 'natural',
'custom-groups': customGroups,
customGroups,
groups,
'partition-by-comment': true,
'partition-by-new-line': true,
partitionByComment: true,
partitionByNewLine: true,
},
],
'perfectionist/sort-union-types': ['error', { type: 'natural', 'nullable-last': true }],
'perfectionist/sort-union-types': ['error', { type: 'natural' }],
},
})

Expand Down Expand Up @@ -152,7 +152,7 @@ export const factory = ({ next, prettier, reactQuery, tailwind }: EslintConfigOp
},
])

!!reactQuery && base.append(queryPlugin.configs['flat/recommended'])
!!reactQuery && base.append(queryPlugin.configs['flat/recommended'] as any)

return base
}
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"eslint-plugin-svg-jsx": "^1.2.4"
},
"dependencies": {
"@antfu/eslint-config": "^2.23.2",
"@antfu/eslint-config": "^2.24.0",
"@eslint/eslintrc": "^3.1.0",
"@next/eslint-plugin-next": "^14.2.5",
"@tanstack/eslint-plugin-query": "^5.51.12",
"@tanstack/eslint-plugin-query": "^5.51.15",
"eslint-config-next": "^14.2.5",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
Expand Down
Loading

0 comments on commit e2c48fe

Please sign in to comment.