Skip to content
Merged
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
14 changes: 14 additions & 0 deletions .changeset/update-eslint-deps-and-configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@mheob/eslint-config": major
---

Update ESLint dependencies and enhance React and perfectionist configs

- Bump ESLint to v10, perfectionist to v5, and many other dependencies
- Add React Server Components support via react-rsc plugin
- Add type-aware React rules (no-implicit-key, no-leaked-conditional-rendering)
- Add React naming convention rules (context-name, ref-name, use-state)
- Update perfectionist sort-imports groups to v5 naming convention
- Enhance ignores config to support function-based userIgnores and TypeScript file ignoring
- Add GLOB_ASTRO_TS glob pattern and ignoresTypeAware type option
- Update generated type definitions for new plugin rules
144 changes: 0 additions & 144 deletions .coderabbit.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions packages/eslint-config/src/cli/versions-map.generated.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const versionsMap = {
'@eslint-react/eslint-plugin': '^2.3.13',
'@next/eslint-plugin-next': '^16.1.0',
'@eslint-react/eslint-plugin': '^2.12.4',
'@next/eslint-plugin-next': '^16.1.6',
'astro-eslint-parser': '^1.2.2',
eslint: '^9.39.2',
eslint: '^10.0.0',
'eslint-plugin-astro': '^1.5.0',
'eslint-plugin-react-hooks': '^7.0.1',
'eslint-plugin-react-refresh': '^0.4.26',
'eslint-plugin-svelte': '^3.13.1',
'eslint-plugin-react-refresh': '^0.5.0',
'eslint-plugin-svelte': '^3.15.0',
'prettier-plugin-astro': '^0.14.1',
'svelte-eslint-parser': '^1.4.1',
};
16 changes: 13 additions & 3 deletions packages/eslint-config/src/configs/ignores.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GLOB_EXCLUDE } from '../globs';
import { GLOB_EXCLUDE, GLOB_TS, GLOB_TSX } from '../globs';
import type { TypedFlatConfigItem } from '../types';

/**
Expand All @@ -9,12 +9,22 @@ import type { TypedFlatConfigItem } from '../types';
* and the userIgnores.
*
* @param userIgnores - The user's choices from the CLI prompt.
* @param ignoreTypeScript - Whether to ignore TypeScript files.
* @returns Promise that resolves once the ignores ESLint rules are configured.
*/
export async function ignores(userIgnores: string[] = []): Promise<TypedFlatConfigItem[]> {
export async function ignores(
userIgnores: ((originals: string[]) => string[]) | string[] = [],
ignoreTypeScript = false,
): Promise<TypedFlatConfigItem[]> {
let ignores = [...GLOB_EXCLUDE];

if (ignoreTypeScript) ignores.push(GLOB_TS, GLOB_TSX);

ignores = typeof userIgnores === 'function' ? userIgnores(ignores) : [...ignores, ...userIgnores];

return [
{
ignores: [...GLOB_EXCLUDE, ...userIgnores],
ignores,
name: 'mheob/ignores',
},
];
Expand Down
22 changes: 14 additions & 8 deletions packages/eslint-config/src/configs/perfectionist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,31 @@ export async function perfectionist(): Promise<TypedFlatConfigItem[]> {
'error',
{
groups: [
'type',
['builtin-type', 'builtin'],
['external-type', 'external'],
['internal-type', 'internal'],
['parent-type', 'parent', 'sibling-type', 'sibling', 'index-type', 'index'],
'type-import',
'value-builtin',
['type-external', 'value-external'],
['type-internal', 'value-internal'],
[
'type-parent',
'value-parent',
'type-sibling',
'value-sibling',
'type-index',
'value-index',
],
'side-effect',
'style',
'object',
'ts-equals-import',
'unknown',
],
internalPattern: ['^@/.*', '^~/.*'],
type: 'natural',
},
],
'perfectionist/sort-interfaces': ['error', customSort],
'perfectionist/sort-intersection-types': ['error', { type: 'natural' }],
'perfectionist/sort-jsx-props': [
'error',
{ groups: ['multiline', 'unknown', 'shorthand'], type: 'natural' },
{ groups: ['multiline-prop', 'unknown', 'shorthand-prop'], type: 'natural' },
],
'perfectionist/sort-maps': ['error', { type: 'natural' }],
'perfectionist/sort-named-exports': ['error', { type: 'natural' }],
Expand Down
Loading