1. eslint-config-mourner
A strict ESLint config for my JavaScript projects
eslint-config-mourner
Package: eslint-config-mourner
Created by: mourner
Last modified: Fri, 17 Jun 2022 19:52:55 GMT
Version: 3.0.0
License: ISC
Downloads: 15,943
Repository: https://github.com/mourner/eslint-config-mourner

Install

npm install eslint-config-mourner
yarn add eslint-config-mourner

eslint-config-mourner

A great ESLint config with sensible defaults
that I use in all my JavaScript projects.

It is meant to be strict, enforcing as many useful rules and conventions as possible
to keep the code clean, elegant and consistent across projects.

The rules are easy to follow, so this is a good starting place for new projects,
while being easy to disable on a case by case basis for existing projects
if you want to enforce and fix them gradually or have justified exceptions.

Install

To use it in your project, run:

 npm install --save-dev eslint eslint-config-mourner

Then add a following .eslintrc file in the repo root:

 {
  "extends": "mourner"
}

Finally, add eslint to a package.json script:

 "scripts": {
  "lint": "eslint index.js test/test*.js",
  "pretest": "npm run lint"
}

Now run npm run lint and enjoy thousands of errors! :)

Automatic fixes

To make things easier, you can run eslint with --fix option
that automatically fixes all simple errors like indentation and quotes for you.

Overrides

Some of the rules may be too strict for your project,
but you can easily override any rules or options like this:

 {
  "extends": "eslint-config-mourner",
  "rules": {
    "space-before-function-paren": 0,
    "indent": [2, 2]
  },
  "env": {
    "mocha": true
  }
}

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code