1.0.8 • Published 4 years ago

@sahoja/eslint-config-sahoja v1.0.8

Weekly downloads
4
License
ISC
Repository
-
Last release
4 years ago

Sahoja Javascript Styleguide

This package exports a centralized ESLint + Prettier configuration to be used by Sahoja's projects.

The goal of this configuration is to standarize the code style for all Javascript based projects. The config is based upon Airbnb's styles and adds Prettier's rules as well. We're using ESLint v6 because of a better compatibility with the current stable Airbnb packages in NPM.

Setup

Common

For both React and Node.js projects you'll need to set up these configurations:

Add the default prettier config inside package.json

{
...
  "prettier": "@sahoja/eslint-config-sahoja/prettier"
...
}

Install this package as a development dependency

$ yarn add @sahoja/eslint-config-sahoja --dev

React

  1. Install dependencies

For React-based projects, you'll need to install peer dependencies and the following:

  • eslint-config-airbnb
  • eslint-plugin-jsx-a11y
  • eslint-plugin-react
  • eslint-plugin-react-hooks

So your devDependencies should look something like this:

  "devDependencies": {
    "@sahoja/eslint-config-sahoja": "^1.0.6-beta.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6",
    "eslint-config-airbnb": "^18.1.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-prettier": "^3.1.3",
    "eslint-plugin-react": "^7.20.0",
    "eslint-plugin-react-hooks": "^2.5.0",
    "prettier": "^2.0.5"
  },
  1. Add .eslintrc

Add an ESLint config file that looks like this:

{
  "extends": "@sahoja/eslint-config-sahoja/configs/react"
}

Node.js

  1. Install dependencies

For Node-based projects, you'll need to install peer dependencies and the following:

  • eslint-config-airbnb-base
  • eslint-plugin-node

So your devDependencies should look something like this:

  "devDependencies": {
    "@sahoja/eslint-config-sahoja": "^1.0.6-beta.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6",
    "eslint-config-airbnb-base": "^14.1.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-prettier": "^3.1.3",
    "prettier": "^2.0.5"
  },
  1. Add .eslintrc

Add an ESLint config file that looks like this:

{
  "extends": "@sahoja/eslint-config-sahoja/configs/node"
}
1.0.8

4 years ago

1.0.7

4 years ago

1.0.6-beta.3

4 years ago

1.0.6-beta.2

4 years ago

1.0.5-beta.4

4 years ago

1.0.6-beta.0

4 years ago

1.0.5-beta.3

4 years ago

1.0.5-beta.1

4 years ago

1.0.5-beta.2

4 years ago

1.0.5-beta.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2-beta.6

4 years ago

1.0.2-beta.4

4 years ago

1.0.2-beta.5

4 years ago

1.0.2-beta.3

4 years ago

1.0.2-beta.2

4 years ago

1.0.2-beta.1

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.2-beta.0

4 years ago

1.0.0

4 years ago

1.0.0-beta.0

4 years ago