Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tophat/eslint-config

Package Overview
Dependencies
Maintainers
3
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tophat/eslint-config

Top Hat's shareable eslint configuration

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.8K
increased by0.04%
Maintainers
3
Weekly downloads
 
Created
Source

@tophat/eslint-config

npm npm downloads

:shark: Top Hat's shareable eslint configuration

Usage

The default config includes the following:

  • A set of base eslint rules for all JavaScript/TypeScript projects
  • Rules for React apps
  • Rules for Jest tests
  • Rules for web apps

Extend the default config by first installing all the required dependencies:

yarn add --dev \
    @tophat/eslint-config \
    eslint \
    prettier \
    eslint-config-prettier \
    eslint-plugin-prettier \
    eslint-plugin-react \
    eslint-plugin-react-hooks \
    eslint-plugin-jsx-a11y \
    eslint-plugin-jest \
    eslint-plugin-import \
    eslint-import-resolver-typescript \
    @typescript-eslint/eslint-plugin \
    @typescript-eslint/parser \
    @tophat/eslint-import-resolver-require

or

npm install --save-dev # etc ...

Then update your eslint config (for example, .eslintrc.js):

module.exports = {
    extends: '@tophat'
}

Note: @tophat/eslint-import-resolver-require is an optional peer dependency and helps with Yarn Berry projects.

Note that Typescript is required.

Picking and choosing certain configs

You can extend each of the configs separately by specifying them in your eslint config:

module.exports = {
    extends: [
        // Pick and choose from the following list of configs
        '@tophat/eslint-config/base',
        '@tophat/eslint-config/react',
        '@tophat/eslint-config/jest',
        '@tophat/eslint-config/web',
    ]
}

Peer dependencies per config

Each config requires certain peer dependencies:

  • base: eslint, prettier, eslint-config-prettier, eslint-plugin-import, eslint-plugin-prettier
  • react: eslint-plugin-react, eslint-plugin-react-hooks, eslint-plugin-jsx-a11y
  • jest: eslint-plugin-jest
  • web: (none)

You only have to install the dependencies for the configs which you are using.

Upgrading this package

See the CHANGELOG.

Making changes to this package

See the CONTRIBUTING guide.

FAQs

Package last updated on 02 Dec 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

  • 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