1.0.3 • Published 2 years ago

eslint-config-neutral v1.0.3

Weekly downloads
-
License
BSL-1.0
Repository
github
Last release
2 years ago

⚪️ ESLint-config-neutral

ESLint Shareable Config that catches strictly the errors and nothing more.

With that config, you can code however you want. This config is a good choice for those who don't use ESLint at all because they feel like linters restrict them. By default, it doesn't dictate any opinionated things. Strictly the errors.

Also, this config is a good starter, akin to normalize.css, but for ESLint. Feel free to extend it to your liking.

Usage

npm install --save-dev eslint-config-neutral

Then, add this to your .eslintrc file:

{
   "extends": "neutral"
}

You can override rules or add yours directly in .eslintrc file.

Overview

RuleDescriptionComment
for-directionenforce for loop update clause moving the counter in the right directionOne wrong symbol will produce an unintended infinite loop that doesn’t seem wrong at first glance.
no-async-promise-executordisallow using an async function as a Promise executorPromise won’t be rejected if a runtime error happens.
no-await-in-loopdisallow await inside of loopsawait in loops doesn’t lead to asynchronous execution.
no-compare-neg-zerodisallow comparing against -0Comparing against -0 is very odd and unlikely. Programmers who didn’t research this topic specifically hardly know the answer.
no-cond-assigndisallow assignment operators in conditional expressionsA classic mistake.
no-dupe-argsdisallow duplicate arguments in function definitions
no-dupe-else-ifdisallow duplicate conditions in if-else-if chainsLeads to the code that looks like it will execute while it won’t.
no-dupe-keysdisallow duplicate keys in object literals
no-duplicate-casedisallow duplicate case labels
no-invalid-regexpdisallow invalid regular expression strings in RegExp constructors
no-loss-of-precisiondisallow literal numbers that lose precisionPrecision errors are notoriously hard to debug.
no-obj-callsdisallow calling global object properties as functionsThings like Math() are always errors.
no-unsafe-negationdisallow negating the left operand of relational operatorsif (!key in foo) meaning “check if the key exist in an object” won’t produce the correct results.
require-atomic-updatesdisallow assignments that can lead to race conditions due to usage of await or yield
use-isnanrequire calls to isNaN() when checking for NaNComparing against NaN is pointless. isNaN() function should be used instead.
valid-typeofenforce comparing typeof expressions against valid strings
no-const-assigndisallow reassigning const variables
no-dupe-class-membersdisallow duplicate class members
no-duplicate-importsdisallow duplicate module imports
no-new-symboldisallow new operators with the Symbol objectnew Symbol() is a counterintuitive error.
no-this-before-superdisallow this / super before calling super() in constructors

License

BSL-1.0. © Miloslav Voloskov.