Socket
Socket
Sign inDemoInstall

@knotel/eslint-config-react

Package Overview
Dependencies
Maintainers
25
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@knotel/eslint-config-react

Knotel global eslint configuration for React applications and components


Version published
Weekly downloads
4
Maintainers
25
Weekly downloads
 
Created
Source

@knotel/eslint-config-react

Knotel shared eslint configuration for React-based applications and components

[![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Downloads Stats][npm-downloads]][npm-url]

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

FAQs

Package last updated on 12 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc