0.14.0 • Published 4 years ago

@knotel/eslint-config-react v0.14.0

Weekly downloads
14
License
MIT
Repository
github
Last release
4 years ago

@knotel/eslint-config-react

Knotel shared eslint configuration for React-based applications and components

NPM Version Build Status Downloads Stats

Installation

yarn add --dev @knotel/eslint-config-react

Also make sure to add the peerDependencies:

yarn add --dev eslint eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks

Usage

In order to use the shared config simply add the following to your package.json:

{
  "name": "@knotel/my-package",
  "version": "1.0.0",
  ...
  "eslintConfig": {
    "extends": [
      "@knotel/eslint-config-react"
    ]
  },
  "eslintIgnore": [
    "node_modules",
    "dist",
    ".cache"
  ],
  ...
}

You can also add it in an .eslintrc or eslintrc.json file but adding the config in your package.json will reduce unnecessary clutter.

Configuring your VSCode workspace

For the best developer experience, follow these steps to configure VSCode:

  1. Make sure you have ESlint configured in VSCode (Extensions > Search for "Eslint" > Install)
  2. Install the StandardJS extensions for VSCode
  3. Add these keys to your VScode settings JSON:
  "standard.autoFixOnSave": true,
  "eslint.autoFixOnSave": true,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "typescript",
      "autoFix": true
    },
    {
      "language": "typescriptreact",
      "autoFix": true
    }
  ],
  1. Add some scripts to your package.json:
  "scripts": {
    ...
    "test:lint": "eslint --ext .js --ext .jsx src",
    "test:lint:fix": "eslint --ext .js --ext .jsx src --fix",
    ...
  },

Contributing

Submit a pull request against the mono repo

0.14.0

4 years ago

0.13.0

4 years ago

0.12.0

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago