API reference / @backpack/eslint-config
@backpack/eslint-config
️ 🛠
This package contains presets for ESLint.
What's included?
All "recommended" rules from:
- eslint
- typescript-eslint
- eslint-plugin-import, including dependencies
- eslint-plugin-vitest
- Pre-configured settings for
import/no-extraneous-dependencies
matching the recommended project structure
Feedback requested!
Would you like to share your thoughts on ESLint presets? Please consider making a contribution by submitting a pull request.
Getting started
First, ensure you have set up Nexus as private registry needed to use Backpack. Also, make sure you are using ESLint 9.0 or higher. If that is not the case, you need to upgrade it first.
Then, install the package using npm:
bash
npm install -D @backpack/eslint-config
Now, set up your eslint.config.js
:
javascript
import backpack from "@backpack/eslint-config";
import tseslint from "typescript-eslint";
export default tseslint.config(
...backpack.configs.recommended,
{
rules: {
// additional overrides here...
},
}
);
If you are migrating from an existing setup, you can remove some unnecessary dependencies:
bash
npm uninstall @eslint/js @typescript-eslint/parser @vitest/eslint-plugin eslint-import-resolver-typescript eslint-plugin-import