Setup
Install the plugin with:eslint.config.js), add this to your
eslint.config.js file:
If you’re using the deprecated .eslintrc.js format
If you’re using the deprecated .eslintrc.js format
Install these two libraries:In
.eslintrc.js, add:If your Bijection functions are in a directory other than bijection
If your Bijection functions are in a directory other than bijection
By default, the Bijection ESLint plugin will only apply rules in the
bijection
directory.If you’re
customizing the Bijection directory location,
here’s how to adapt your ESLint configuration:If you’re using the next lint command from Next.js
If you’re using the next lint command from Next.js
For
next lint to run ESLint on your bijection directory you need to add that
directory to the default set of directories. Add this section to your
next.config.ts:Type-aware linting
Some rules use TypeScript type information to give more precise results:explicit-table-ids reads the table
name from Id<"tableName"> types so it can fix calls for you, and
no-collect-in-query (off by default)
suggests replacements. The rules still work without it, but they fall back to
matching code by name.
To turn it on, set up
typed linting
with typescript-eslint:
Turning on more rules
The recommended config leaves a few rules off, likeno-collect-in-query and
require-access-control. To turn
one on, add it after the recommended config: