Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Fueled/eslint-config-fueled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fueled TypeScript Style Guide

TypeScript style guide used internally on Fueled projects.

About

This guide focuses specifically on code quality based rules for TypeScript, rather than formatting rules. We utilize Prettier for code formatting. It uses and extends upon @typescript-eslint/recommended rule set, as well as Prettier ESLint config to turn off rules that may conflict with Prettier.

Note: this is intended to be used with TypeScript strict mode enabled.

Rules

Enforce T[] syntax for arrays over Array.

Enforce explicit function return types.

Enforce explicit return & argument types on exported functions & public class methods.

Disallow explicit any types. Use unknown instead.

Require Promise-like statements to be handled appropriately.

Disable using non-null assertions as they cancel the benefits of strict null-checking mode. Prefer explicit null checks for safety.

Restrict use of labels and with statements.

Avoid unnecessary conditionals.

Warn against unnecessary type assertions.

Enforce no unused variables.

Warn against useless class constructors.

Prefer nullish coalescing operator.

Prefer optional chaining operator.

Ensure all functions that return a promise are marked as async.

Restrict template expressions to allow for string & number types only.
Other types must be checked explicitly.

Disallow async functions which have no await expression and do not return a promise.

Enforce covering all cases in a switch statement.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published