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
31 changes: 0 additions & 31 deletions .changeset/optional-react-router-group.md

This file was deleted.

31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# @gaia-react/lint

## 2.0.0

### Major Changes

- [#42](https://github.com/gaia-react/lint/pull/42) [`b364e99`](https://github.com/gaia-react/lint/commit/b364e995699dc4417637e19c79f91a958a3949b2) Thanks [@stevensacks](https://github.com/stevensacks)! - React Router relaxations move out of `react` into a new opt-in `reactRouter` block.

`react` shipped a block scoped to `**/routes/**/*.tsx` that turned `no-empty-pattern` off. That glob is not unique to React Router: TanStack Router uses a `routes/` directory too, so a project on any other file-based router had the rule silently disabled across its whole route tree, with nothing in the composed config explaining why.

The relaxation now ships as its own block. Spread it after `react` if you run React Router in framework mode:

```js
...lint.react,
...lint.reactRouter,
```

**Breaking for React Router consumers.** Without that line, `no-empty-pattern` reports every route module that destructures nothing from its typed props (`({}: Route.ComponentProps)`). Adding the spread restores the previous behavior exactly; there is no other migration step. A project that never writes that shape sees no new errors either way, so the upgrade may well be a no-op in practice.

Projects on another router should omit it and keep the rule enabled. They will most likely also want to ignore their generated route tree:

```js
...lint.ignores({extra: ['**/routeTree.gen.ts']}),
```

The `/.react-router/**` glob stays in the `ignores` defaults. It names a directory that only exists in a React Router project, so it costs other projects nothing, while moving it would break React Router consumers who miss the new spread.

A new suite asks ESLint what the composed config resolves to on both sides of the opt-in, so a future change that folds the block back into `react`, or widens its glob, fails a test instead of quietly relaxing a rule.

Two dead config entries are removed in the same pass. Neither changes any effective rule:
- `react/display-name` was set to `off` in the route block, but `airbnb/config/react` already sets it to `off` for every file.
- The `typescript/only-throw-error` block disabled `@typescript-eslint/only-throw-error` for `hooks/`, `routes/`, and `sessions.server/`, but the `typescript/config` block already disables that rule globally for `**/*.ts?(x)`.

## 1.11.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gaia-react/lint",
"version": "1.11.0",
"version": "2.0.0",
"description": "GAIA's opinionated lint configuration.",
"type": "module",
"main": "./dist/index.js",
Expand Down