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

eslint-config-sheriff

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-sheriff

A comprehensive Eslint configuration.

  • 3.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
135
decreased by-19.16%
Maintainers
1
Weekly downloads
 
Created
Source

Sheriff

📜 Table of Contents

  1. Table of Contents
  2. Description
  3. Philosophy
  4. Installation
  5. Usage
  6. Techs
  7. Requirements
  8. Eslint plugins
  9. Roadmap
  10. Acknowledgments

📖 Description

sheriff is a comprehensive Eslint configuration.
It takes into account various technologies (see: techs).

⚠️ At the moment, sheriff supports only Typescript codebases with modern Ecmascript standards. Maybe in the future i'll take in consideration support for vanilla Javascript. Refer to the roadmap.

💭 Philosophy / Why / Motivations

This library is very opinionated, but it's for the better. I took a lot of decisions so you don't have too 1. You can now quickstart static analysis in all your Typescript projects with ease. It's just 1 npm install.
You can think of sheriff like prettier or create-react-app. It's a tool that tool that comes battery-packed with optimal defaults. It remove configuration decisions from the equation, so you or your team can focus on developing the actual product.
And if you don't like something, you can easily override it, and just as easily you can extend it (see: usage).

🛠️ Installation

# npm
npm install -D eslint-config-sheriff

# yarn
yarn add -D eslint-config-sheriff

# pnpm
pnpm add -D eslint-config-sheriff

✨ Usage

This config is highly opinionated, so make sure to meet the hard requirements in your project. Then, follow these steps:

  1. Install the package from npm.

  2. Create a eslint.config.js 2 file and copy/paste the contents of this snippet:

    // eslint.config.js
    
    import sheriff from 'eslint-config-sheriff/recommended';
    
    export default [
        ...sheriff,
        {
            files: ['**/*{js,ts,jsx,tsx}'],
        },
    ];
    

    or, if you already have a eslint.config.js in your project, just append sheriff to the configs array, like this:

    // eslint.config.js
    
    import sheriff from 'eslint-config-sheriff/recommended';
    // my other imports...
    
    export default [
        // my other configurations...
        ...sheriff,
    ];
    
  3. Configure sheriff as desired in the sheriff.config.js file. (optional)

  4. Override any sheriff rule as desired in the eslint.config.js file. (optional)

🖥️ Techs

🔑 Requirements

Hard requirements

Recommendations

🐙 Eslint plugins

🚀 Roadmap

  • Consider more rules
  • eslint-plugin-n
  • eslint-plugin-next
  • Create the sheriff.config.js file
  • Create a cli ala create-react-app
  • Remove react as a hard requirement
  • Create a documentation website

🙏 Acknowledgments

For some of this config i partially used eslint-config-red as a base.
I don't take any attribution for the rules in the various eslint-plugins used here. Please consider starring the respective projects for the awesome work their authors made. The full list of the plugins used is here.

Footnotes

  1. This config is particularly useful for big teams with developers of various skill levels. I worked in a lot of different projects and teams through the years and i got accustomed to seeing all kinds of mistake being made. sheriff was made to prevent all of those mistakes. It is battle-tested in real-world scenarios, and shines especially in such scenarios.

  2. sheriff is based on the new format of Eslint configs. You cannot extend sheriff from a old config format, it wouldn't work.

Keywords

FAQs

Package last updated on 02 Oct 2022

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