New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-good-code

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-good-code

A strict eslint configuration for typescript projects promoting good and maintainable coding practices.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
decreased by-48.57%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-good-code ✨ npm version GitHub Workflow Status

A shared strict eslint configuration for typescript (>=3.8) projects.

This package defines a strict eslint config to prevent code smells and promote maintainable coding practices.
It combines recommend settings from eslint, typescript-eslint, unicorn, sonarjs and further enables more rules.

Installation

Before installation make sure your project has eslint (>=7) and typescript (>=3.8) available.

Step 1: Install the required packages

npm i -D eslint-config-good-code @typescript-eslint/eslint-plugin eslint-plugin-sonarjs eslint-plugin-unicorn

Step 2: Extend the config in your app package.json

  "eslintConfig": {
    "extends": [
      "eslint-config-good-code"
    ]
  }

Principles

  • Typescript only (with tsx) - No react, jest, a11y etc. rules. Use in any kind of project.
  • No stylistic rules.
  • No conflicting or double enforced rules.
  • No enforcing of rules which typescript can already prevent.
  • (future) Multiple configurations - Allow a developer to choose what's required.
  • (future) Modular config - Allow customization per project.

Dealing with difficult rules

Readonly Parameters

Mutating objects passed as parameters can lead to unintended bugs. It is highly recommended that this rule should be kept enabled. But typescript does not ship with anything to make an object deeply immutable (aka readonly). Therefore, you can add type-fest, which includes ReadonlyDeep type to mark any object as readonly.

Acknowledgment

This project was made possible due to the incredible work done on the following projects:

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

FAQs

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