@nkzw/eslint-config
v3.3.0
Published
ESLint config with sensible defaults.
Maintainers
Readme
@nkzw/eslint-config
Opinionated ESLint config with sensible defaults.
Installation & Usage
With ESLint v9+:
npm install @nkzw/eslint-configIn your eslint.config.js:
import nkzw from '@nkzw/eslint-config';
export default nkzw;Or, if you have custom ESLint rules or configuration:
import nkzw from '@nkzw/eslint-config';
export default [
...nkzw,
{
// Custom configuration.
},
];Then run pnpm eslint . or npm eslint ..
Note: You can use @nkzw/eslint-config 1.x with ESLint versions 8 and below.
Philosophy & Principles
Use this configuration if these principles resonate with you:
- Error, Never Warn: Warnings are noise and get ignored. Either it's an issue, or it isn't. This config forces developers to fix problems or explicitly disable the rule with a comment.
- Strict, Consistent Code Style: When multiple approaches exist, this configuration enforces the strictest, most consistent code style, preferring modern language features and best practices.
- Prevent Bugs: Problematic patterns such as
instanceofare not allowed, forcing developers to choose more robust patterns. Debug-only code such asconsole.logortest.onlyare disallowed to avoid unintended logging in production or accidental CI failures. - Fast: Slow rules are avoided. For example, TypeScript's
noUnusedLocalscheck is preferred overno-unused-vars. - Don't get in the way: Subjective or overly opinionated rules (e.g. style preferences) are disabled. Autofixable rules are preferred to reduce friction and save time.
Included Plugins & Rules
This configuration consists of the most useful and least annoying rules from the following eslint plugins:
typescript-eslinteslint-import-resolver-typescripteslint-plugin-unicorneslint-plugin-import-xeslint-plugin-reacteslint-plugin-react-hookseslint-plugin-perfectionisteslint-plugin-no-instanceofeslint-plugin-no-only-tests
Suggestions
This configuration is meant to be used with:
- TypeScript and the
noUnusedLocalssetting. - Prettier and the
@ianvs/prettier-plugin-sort-imports.
Read about more frontend tooling suggestions in this blog post.
