Socket
Book a DemoInstallSign in
Socket

@bavard/eslint-config-typescript

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bavard/eslint-config-typescript

Bavard's base TS ESLint config, following our styleguide

0.1.8
npmnpm
Version published
Maintainers
2
Created
Source

eslint-config-typescript

Bavard's ESLint config with TypeScript support

Setup

1) Install

npm install @bavard/eslint-config-typescript --save-dev

2) Install devDependencies

If your app is a Node.js app:

Install the following devDependencies:

npm install @typescript-eslint/eslint-plugin \
            @typescript-eslint/parser \
            eslint-config-airbnb-typescript \
            eslint-config-prettier \
            eslint-plugin-import \
            eslint-plugin-jest \
            eslint-plugin-prettier \
            prettier \
            --save-dev

If your app is a React.js app:

npm install @typescript-eslint/eslint-plugin \
            @typescript-eslint/parser \
            eslint-config-airbnb-typescript \
            eslint-config-prettier \
            eslint-plugin-import \
            eslint-plugin-jest \
            eslint-plugin-jsx-a11y \
            eslint-plugin-prettier \
            eslint-plugin-react \
            eslint-plugin-react-hooks \
            prettier \
            --save-dev

If your app is Vue.js app:

npm install @typescript-eslint/eslint-plugin \
            @typescript-eslint/parser \
            eslint-config-airbnb-typescript \
            eslint-config-prettier \
            eslint-plugin-import \
            eslint-plugin-jest \
            eslint-plugin-vue \
            eslint-plugin-prettier \
            prettier \
            --save-dev

2) Configure ESLint

Create a .eslintrc.js ESLint config file at the root of your repo.

Paste the following code in the file:

If your app is a Node.js app:

module.exports = {
  root: true,
  extends: [
    "@bavard/eslint-config-typescript/node",
  ],
};

If your app is a React.js app:

module.exports = {
  root: true,
  extends: [
    "@bavard/eslint-config-typescript/react",
  ],
};

If your app is a Vue.js app:

module.exports = {
  root: true,
  extends: [
    "@bavard/eslint-config-typescript/vue",
  ],
};

License

Open source licensed as MIT.

Keywords

eslint

FAQs

Package last updated on 31 Jul 2021

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.