2.0.4 • Published 2 years ago

eslint-config-kdnj v2.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

eslint-config-kdnj

npm packagephobia/install packagephobia/publish

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:

Overridden rules by this configuration can be seen on the table below:

❌: disabled, 🔧: fixable with eslint --fix

🔧RuleDescription
import/extensionsEnsure consistent use of file extension within the import path
🔧import/newline-after-importEnforces having one or more empty lines after the last import statement
🔧simple-import-sort/exportsEnforces the order of export statement
import/orderImport sorting (disabled to prevent conflict with simple-import-sort/imports)
sort-importsImport sorting (disabled to prevent conflict with simple-import-sort/imports)
🔧simple-import-sort/importsEnforces the order of import statement
max-linesEnforces a maximum number of lines per file
max-lines-per-functionEnforces a maximum number of lines of code in a function
no-voidDisallow void operators
one-varEnforces variables to be declared either together or separately in functions
require-awaitDisallow async functions which have no await expression
\@typescript-eslint/no-explicit-anyDisallows usage of any type
\@typescript-eslint/no-unnecessary-conditionPrevents conditionals where an expression is always evaluates to truthy or falsy
\@typescript-eslint/no-unsafe-assignmentDisallows assigning a value with any type into a variable
\@typescript-eslint/require-awaitDisallows async functions which have no await expression
\@typescript-eslint/restrict-template-expressionsEnforces template literal expressions to be of string type
\@typescript-eslint/unbound-methodEnforces 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

FOSSA Status

License

MIT License, Copyright (c) 2021 Koding Ninja

1.1.5

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.0

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

1.0.0-1

3 years ago

1.0.0-0

3 years ago

1.0.0-2

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago