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-kdnj
Usage
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
import
order 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 export statement | |
❌ | 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 import statement | |
❌ | 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 void operators | |
❌ | one-var | Enforces variables to be declared either together or separately in functions | |
❌ | require-await | Disallow async functions which have no await expression | |
\@typescript-eslint/no-explicit-any | Disallows usage of any type | ||
❌ | \@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 any type into a variable | ||
❌ | \@typescript-eslint/require-await | Disallows async functions which have no await expression | |
\@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
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago