Socket
Socket
Sign inDemoInstall

eslint-config-opengovsg

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-config-opengovsg

ESLint configs for Open Government Products


Version published
Weekly downloads
866
increased by55.2%
Maintainers
1
Install size
6.90 kB
Created
Weekly downloads
 

Readme

Source

eslint-config-opengovsg

Goal

The goal of this package is to provide reasonable defaults for most common scenarios, so that developers can start building without worrying about linting configurations.

Explanation

ESLint is a tool to "find and fix problems in your JavaScript code" (from https://eslint.org/). We use ESLint to help us write better code. However, we do not want to invest efforts into the fine-tuning of detailed configurations, as those efforts can be better invested into building other things.

As a result, we will NEVER have self-defined opinions in the library, which means rules section should not exist in the configs. Instead, only recommended rule sets from the biggest linting libraries (e.g. eslint:recommended) will be used. Essentially:

  1. We fully trust the community out there to maintain a reasonable set of recommended rules, so that most common error-prone patterns are covered
  2. When something really does not make sense in recommended, there are 2 options:
    • influence and change the upstream recommended rule set
    • or do overrides in .eslintrc in our own repositories, NOT here. If a rule does not make sense to the broader community thus cannot enter the recommended rule set, it would not make sense to be here either.

Usage

To install (including all the peer dependencies as devDependencies):

npx install-peerdeps --dev eslint-config-opengovsg

Depending on the usage, put one of the following into .eslintrc:

  • TypeScript (yep we use TypeScript by default in OGP: {"extends": ["opengovsg"]})
  • React ({"extends": ["opengovsg", "opengovsg/react"]} or {"extends": ["opengovsg/javascript", "opengovsg/react"]})
  • Pulumi ({"extends": ["opengovsg", "opengovsg/pulumi"]})
  • JavaScript (in case you really do not need TypeScript: {"extends": ["opengovsg/javascript"]})

Keywords

FAQs

Last updated on 13 Mar 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc