Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-plugin-adamhamlin

adamhamlin27MIT1.0.0TypeScript support: included

Collection of custom ESLint rules

eslint, eslintplugin, eslint-plugin, sort, sorting, forbid, pattern, everywhere, empty, block, comment

readme

ESLint Plugin

npm version CI Status Badge

My collection of miscellaneous custom ESLint rules!

Install

npm install eslint-plugin-adamhamlin --save-dev

Usage

Add adamhamlin to the plugins section of your .eslintrc configuration file:

{
    "plugins": ["adamhamlin"]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "adamhamlin/no-empty-block-comment": "error",
        "adamhamlin/opt-in-sort": "error",
        "adamhamlin/forbid-pattern-everywhere": [
            "error",
            {
                "patterns": ["bleep|bloop"]
            }
        ]
    }
}

Rules

This plugin makes the following lint rules available:

  • no-emppty-block-comment - Block comments must have non-empty content.
  • opt-in-sort - Enforce sorting of object keys, array values, or TS enums/interfaces/types by adding the @sort annotation.
  • forbid-pattern-everywhere - Specified pattern(s) are disallowed everywhere--in variables, functions, literals, property names, classes, types, interfaces, etc.

TODO

  • Use eslint-doc-generator to generate the rules list?

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.0.0 (2024-07-26)

Features

  • opt-in-sort: allow sort of TS unions (#8) (ff005eb)

0.2.0 (2023-02-06)

Features

  • Add opt-in-sort rule (#5) (df80288)
  • Improve forbid-pattern-everywhere behavior (#6) (c2acc0b)

0.1.2 (2023-01-17)

Bug Fixes

0.1.1 (2023-01-17)

Bug Fixes

  • Use kebab case for exported rule names (#3) (4ef1cf4)

0.1.0 (2023-01-16)