eslint-config-espri-back
v4.1.0
Published
ES Lint rules used by ESPRI Digital on server side TS app
Downloads
60
Readme
Install
Run
npm install -D [email protected]
eslint.config.js
import eslintESPRIBack from "eslint-config-espri-back";
export default eslintESPRIBack;
Rules explanations
Base
- @typescript-eslint/recommended
Added rules
Each rules can be disable with // eslint-disable-next-line
but must be justified
@typescript-eslint/interface-name-prefix
off
because we do not want this rules from base
@typescript-eslint/explicit-function-return-type
off
because we do not want this rules from base
@typescript-eslint/explicit-module-boundary-types
off
because we do not want this rules from base
@typescript-eslint/no-explicit-any
off
because we do not want this rules from base
@typescript-eslint/no-empty-function
off
because we do not want this rules from base
@typescript-eslint/comma-dangle
error, always-multiline
because only the lines you are modifying must be touched
@typescript-eslint/semi
error, always
because we always want a semicolon at the end of each lines
@typescript-eslint/indent
error, 2
because we want to have an indentation of 2
@typescript-eslint/no-floating-promises
error
because a "floating" Promise is one that is created without any code set up to handle any errors it might throw. Floating Promises can cause several issues, such as improperly sequenced operations, ignored Promise rejections, and more.
no-async-promise-executor
error
because it allows to detect potential problems related to the use of asynchronous functions in promise constructors.
no-await-in-loop
error
because the program is not taking full advantage of the parallelization benefits of async/await.
no-promise-executor-return
error
because returning a value from an executor function is a possible error because the returned value cannot be used and it doesn’t affect the promise in any way
no-return-await
error
prevent a likely common performance hazard due to a lack of understanding of the semantics
@typescript-eslint/await-thenable
error
because using await on an object that is not a promise can lead to unexpected behavior and runtime errors.
@typescript-eslint/no-misused-promises
error
because improper use of promises can lead to problems such as memory leaks, runtime errors, and unexpected behavior.
@typescript-eslint/promise-function-async
error
because require any function or method that returns a Promise to be marked async