eslint-config-kdnj v2.0.4

Koding Ninja's standardized ESLint configuration with bundled dependencies (Prettier, TypeScript, etc.)
Table of contents
Installing
Add eslint@^8 and eslint-config-kdnj as a (dev) dependency:
# using npm
npm install --save-dev eslint@^8 eslint-config-kdnj
# using yarn
yarn add --dev eslint@^8 eslint-config-kdnjUsage
Add eslint-config-kdnj in your ESLint configuration:
module.exports = {
  extends: [
    "eslint-config-kdnj",
    // ...
  ],
};For React projects
module.exports = {
  extends: [
    "eslint-config-kdnj/react",
    // ...
  ],
};For Next.js projects*
*) Add eslint-config-next as dev dependency
module.exports = {
  extends: [
    "eslint-config-kdnj/react",
    "plugin:@next/next/recommended",
    // ...
  ],
};Example usage
Here are project examples using eslint-config-kdnj:
Rules
eslint-config-kdnj uses these plugins and extend from these configs:
- eslint-config-kentcdodds: Opinionated rules by Kent C. Dodds
- eslint-config-prettier: disable any ESLint rules that conflict with Prettier
- eslint-plugin-prettier: enable to integrate ESlint with Prettier
- eslint-plugin-simple-import-sort: sort importorder in a file
Overridden rules by this configuration can be seen on the table below:
❌: disabled, 🔧: fixable with
eslint --fix
| ❌ | 🔧 | Rule | Description | 
|---|---|---|---|
| ❌ | import/extensions | Ensure consistent use of file extension within the import path | |
| 🔧 | import/newline-after-import | Enforces having one or more empty lines after the last import statement | |
| 🔧 | simple-import-sort/exports | Enforces the order of exportstatement | |
| ❌ | import/order | Import sorting (disabled to prevent conflict with simple-import-sort/imports) | |
| ❌ | sort-imports | Import sorting (disabled to prevent conflict with simple-import-sort/imports) | |
| 🔧 | simple-import-sort/imports | Enforces the order of importstatement | |
| ❌ | max-lines | Enforces a maximum number of lines per file | |
| ❌ | max-lines-per-function | Enforces a maximum number of lines of code in a function | |
| ❌ | no-void | Disallow voidoperators | |
| ❌ | one-var | Enforces variables to be declared either together or separately in functions | |
| ❌ | require-await | Disallow async functions which have no awaitexpression | |
| \@typescript-eslint/no-explicit-any | Disallows usage of anytype | ||
| ❌ | \@typescript-eslint/no-unnecessary-condition | Prevents conditionals where an expression is always evaluates to truthy or falsy | |
| \@typescript-eslint/no-unsafe-assignment | Disallows assigning a value with anytype into a variable | ||
| ❌ | \@typescript-eslint/require-await | Disallows async functions which have no awaitexpression | |
| \@typescript-eslint/restrict-template-expressions | Enforces template literal expressions to be of string type | ||
| ❌ | \@typescript-eslint/unbound-method | Enforces unbound methods are called with their expected scope | 
Suggestions and/or questions
Head over to our dedicated Discord channel for eslint-config-kdnj.
Maintainers
Compliance
License
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago