1.0.7 • Published 2 years ago

eslint-plugin-ts-custom-rules v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

eslint-plugin-ts-js-custom-rules

Some custom rules to apply to typescript.

  • function-in-alpha-order - Allows checking that functions are in alpha order in a module or class
  • no-throw-with-error - Disallow throw with Error - must sub-class Error
  • throw-error-with-new - Indicates whether a throw of Error is used with a new (ie. throw new Error)

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-ts-custom-rules:

npm install pick68/eslint-plugin-ts-custom-rules --save-dev

Usage

Add ts-custom-rules to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": [
    "eslint-plugin-ts-custom-rules"
  ]
}

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

{
  "rules": {
    "ts-custom-rules/throw-error-with-new": "warn",
    "ts-custom-rules/no-throw-with-error": "warn",
    "ts-custom-rules/functions-in-alpha-order": "warn",
  }
}
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago