irfanbaigse / eslint-config-ns

ESLint config ready to be used in multiple projects. Based on Airbnb's code style with prettier and jest support.

Home Page:https://www.npmjs.com/package/eslint-config-ns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eslint-config-ns

npm version GitHub license

In August 2018, I published an article with the title "How to create your own shared esLint, prettier and stylelint configuration" on Medium. One of the results of the article, is this shareable eslint-config (and the one for stylelint).

It lints your javascript projects with ease, based on the popular javascript code style from Airbnb.

Features

Installation

The default export contains all default Airbnb ESLint rules, including ECMAScript 6+, and the ones listed below. It requires some peerDependencies as well.

Install the package with

npm install eslint-config-ns --save-dev

# or
yarn add eslint-config-ns -D

Then install the correct versions of each peerDependency package, which are listed by the command:

npm info "eslint-config-ns@latest" peerDependencies

If using npm 5+, use this shortcut:

npx install-peerdeps --dev eslint-config-ns

# or
yarn add eslint-config-ns -D --peer

Usage

Now add the config to either your package.json:

{
  "eslintConfig": {
    "extends": "eslint-config-ns"
  }
}

to your .eslintrc:

{
  "extends": "eslint-config-ns"
}

or .eslintrc.js:

module.exports = {
  extends: 'eslint-config-ns',
}

Assumptions

This ESLint configuration comes with some fundamental assumptions:

  • react and/or node environment
  • jest as the selected test-suite
  • browser and/or node environment
  • parser: babel (used babel-eslint parser)

Even though I made some assumptions, you can easily overwrite, extend and unset rules and any other setting in your custom eslint config.

LICENCE

MIT

Maintainers


Stefan Natter

About

ESLint config ready to be used in multiple projects. Based on Airbnb's code style with prettier and jest support.

https://www.npmjs.com/package/eslint-config-ns

License:MIT License


Languages

Language:JavaScript 96.3%Language:HTML 3.7%