Socket
Book a DemoInstallSign in
Socket

@shaizei/eslint-config

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shaizei/eslint-config

This package contains shareable ESLint configuration used by the applications created with @shaizei/cli.

0.1.0-beta.13
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

@shaizei/eslint-config

This package contains shareable ESLint configuration used by the applications created with @shaizei/cli.

Getting Started

1. Installation

Using Yarn:

  yarn add @shaizei/eslint-config --dev

Using npm:

  npm install @shaizei/eslint-config --save-dev

2. Usage

  • Create a new file and name it as .eslintrc.js
  • Import relevant config file from @shaizei/eslint-config and just export it as follows.

For JavaScript projects:

module.exports = {
  extends: '@shaizei/eslint-config/javascriptReact',
};

For TypeScript projects:

module.exports = {
  extends: '@shaizei/eslint-config/typescriptReact',
};
  • In order to have a .eslintignore file as well, just run the following command from terminal:
  cat ./node_modules/@shaizei/eslint-config/.eslintignore >> .eslintignore

Override Default Config

If you want to override the default configuration, then add the following code in .eslintrc.js file:

For JavaScript projects:

module.exports = {
  extends: '@shaizei/eslint-config/javascriptReact',
  // your config options goes here, e.g. plugins: [...]
};

For TypeScript projects:

module.exports = {
  extends: '@shaizei/eslint-config/typescriptReact',
  // your config options goes here, e.g. plugins: [...]
};

VSCode ESLint Extension Setup

As we're not installing ESLint locally per project, but leveraging ESLint and associated packages installed in @shaizei/eslint-config project. Thus, we need to inform VSCode ESLint extension that how to resolve ESLint.

  • Go to settings.json in VSCode.

  • Add following settings:

  "eslint.nodePath": "./node_modules/@shaizei/eslint-config/node_modules"

Above mentioned settings will let the extension read ESLint from @shaizei/eslint-config.

Also, for TypeScript, we need to tell ESLint extension to lint .ts and .tsx files as well. We recommend to add following setting as well in settings.json:

  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ],

Keywords

eslint

FAQs

Package last updated on 14 Sep 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.