@kami-ui/eslint-config
v0.0.6
Published
Kami UI | Eslint configurations
Readme
@kami-ui/eslint-config
Shared ESLint flat configs for Kami UI packages and apps. It includes typed TypeScript rules, Prettier integration, and ready-to-use presets for React, Next.js, and Storybook.
Install
pnpm
pnpm add -D @kami-ui/eslint-confignpm
npm install -D @kami-ui/eslint-configYarn
yarn add -D @kami-ui/eslint-configNotes
This package expects
eslint@>=9and the flat config format (eslint.config.js).
This package also expects
typescript@>=5for the type-checked rules to work correctly, but it can be used in JS projects as well (just without the type-aware rules).
Available presets
| Preset | Import path | Use case |
| --------- | --------------------------------------------------------- | ------------------------------------------------------ |
| Base | @kami-ui/eslint-config or @kami-ui/eslint-config/base | Shared packages, libraries, and general TS/JS projects |
| React | @kami-ui/eslint-config/react | React apps and component libraries |
| Next.js | @kami-ui/eslint-config/next | Next.js applications |
| Storybook | @kami-ui/eslint-config/storybook | Projects that also lint Storybook files |
Usage
Create an eslint.config.js file and spread the preset you want to use.
Base
import config from "@kami-ui/eslint-config";
export default config;React
import config from "@kami-ui/eslint-config/react";
export default config;Next.js
import config from "@kami-ui/eslint-config/next";
export default config;Storybook
import config from "@kami-ui/eslint-config/storybook";
export default config;Custom overrides
You can extend the shared rules with project-specific overrides:
import config from "@kami-ui/eslint-config/react";
export default [
...config,
{
files: ["**/*.js"],
rules: {
"@typescript-eslint/no-require-imports": "off",
},
},
];What is included
Depending on the preset, this package enables rules from:
@eslint/jstypescript-eslintrecommended type-checked configseslint-plugin-prettiereslint-plugin-importeslint-plugin-eslint-commentseslint-plugin-prefer-arrow-functions- React, React Hooks, and React Refresh plugins
- Next.js and Storybook plugins
Recommended scripts
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}Notes
- Keep a
tsconfig.jsonin the project root so typed linting can work correctly. - The React preset attempts to auto-detect your installed React version.
- The config is opinionated and includes rules such as
no-consolewarnings and arrow-function preferences.
