Skip to content

adamhamlin/eslint-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

75cc7ee · Jul 26, 2024

History

14 Commits
Jul 26, 2024
Jan 16, 2023
Jul 26, 2024
Jul 26, 2024
Jul 26, 2024
Jul 26, 2024
Jan 16, 2023
Jan 16, 2023
Jan 16, 2023
Jan 16, 2023
Jul 26, 2024
Jan 2, 2023
Feb 6, 2023
Feb 5, 2023
Jan 17, 2023
Jul 26, 2024
Jul 26, 2024
Jan 17, 2023

Repository files navigation

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?