@luxass/eslint-utils
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

eslint-utils

npm version npm downloads

ESlint utilities

📦 Installation

npm install @luxass/eslint-utils

📚 Usage

import { createEslintRule, createESLintRuleBuilder } from "@luxass/eslint-utils";

const createESLintRule = createEslintRuleBuilder("https://github.com/luxass/eslint-plugin-overdrive/blob/main/src/rules/$RULE_NAME.md");

const preferNothing = createESLintRule<[], "preferNothing">({
  name: "preferNothing",
  meta: {
    type: "suggestion",
    docs: {
      description: "Prefer nothing",
      recommended: "error",
    },
    schema: [],
  },
  defaultOptions: [],
  create(context) {
    return {
      Program(node) {
        context.report({
          node,
          messageId: "preferNothing",
        });
      },
    };
  },
  messages: {
    preferNothing: "Prefer nothing",
  },
});
// the rule will now have the following docs url "https://github.com/luxass/eslint-plugin-overdrive/blob/main/src/rules/prefer-nothing.md"

📄 License

Published under MIT License.

Package Sidebar

Install

npm i @luxass/eslint-utils

Weekly Downloads

20

Version

0.1.1

License

MIT

Unpacked Size

20.3 kB

Total Files

16

Last publish

Collaborators

  • luxass