Skip to content

DimensionDev/eslint-plugin

Repository files navigation

@masknet/eslint-plugin

Installation

You'll first need to install eslint:

npm install --save-dev eslint

Next, install @masknet/eslint-plugin:

npm install --save-dev @masknet/eslint-plugin

Usage

Add @masknet to the plugins section of your .eslintrc configuration file.

{
  "$schema": "https://dimensiondev.github.io/eslint-plugin/src/schema.json",
  "plugins": ["@masknet"],
  "rules": {
    "@masknet/array/no-unneeded-flat-map": "warn",
    "@masknet/array/prefer-from": "error",
    "@masknet/browser/no-persistent-storage": "error",
    "@masknet/browser/no-set-html": "error",
    "@masknet/browser/prefer-location-assign": "warn",
    "@masknet/jsx/no-class-component": "warn",
    "@masknet/jsx/no-logical": "error",
    "@masknet/jsx/no-set-html": "error",
    "@masknet/jsx/no-template-literal": "warn",
    "@masknet/jsx/no-unneeded-nested": "warn",
    "@masknet/jsx/prefer-test-id": "error",
    "@masknet/string/no-data-url": "error",
    "@masknet/string/no-interpolation": "warn",
    "@masknet/string/no-locale-case": "error",
    "@masknet/string/no-simple-template-literal": "warn",
    "@masknet/string/no-unneeded-to-string": "warn",
    "@masknet/type/no-const-enum": "error",
    "@masknet/type/no-empty-literal": "error",
    "@masknet/type/no-force-cast-via-top-type": "error",
    "unicorn/no-instanceof-array": "off",
    "@masknet/type/no-instanceof-wrapper": "error",
    "@masknet/type/no-number-constructor": "error",
    "@masknet/type/no-wrapper-type-reference": "error",
    "@masknet/type/prefer-return-type-annotation": "warn",
    "@masknet/unicode/no-bidi": "error",
    "@masknet/unicode/no-invisible": "error",
    "@masknet/unicode/specific-set": "error",
    "@masknet/no-builtin-base64": "error",
    "@masknet/no-default-error": "error",
    "@masknet/no-for-in": "warn",
    "@masknet/no-redundant-variable": "warn",
    "@masknet/no-single-return": "warn",
    "@masknet/no-then": "warn",
    "@masknet/no-timer": "error",
    "@masknet/no-top-level": "error",
    "@masknet/no-unsafe-date": "error",
    "@masknet/prefer-default-export": "warn",
    "@masknet/prefer-defer-import": "error",
    "@masknet/prefer-early-return": "warn",
    "@masknet/prefer-fetch": "warn",
    "@masknet/prefer-timer-id": "error"
  }
}

Supported Rules

Key: :white_check_mark: = recommended, :wrench: = fixable, :bulb: = suggestions, :gear: = configurable, :thought_balloon: = requires type information

LICENSE

MIT