0.1.0 ⢠Published 1 year ago
@pankaj-refyne/eslint-plugin v0.1.0
Refyne ESLint Plugin
The repository includes custom ESLint rules, written in TypeScript, designed to serve as guardrails. These rules help prevent errors and avoid mistakes when working with NestJS and Mongoose.
File Structure:
docs/rules/
for documentation.src/rules/
for rule definitions.tests/
for tests forsrc/
.
Installation
Use npm or a compatibility tool to install.
$ npm install --save-dev @refyne/eslint-plugin
Requirements
- Node.js v18.10.0
- ESLint
Usage
Modify your .eslintrc.js
{
plugins: ['@refyne'],
extends: [
'plugin:@refyne/recommended',
]
}
See also Configuring ESLint.
Rules
š¼ Set in the recommended
configuration.\
š§
Automatically fixable by the
--fix
CLI option.\
š”
Manually fixable by
editor suggestions.
Name | Description | š¼ | š§ | š” |
---|---|---|---|---|
inconsistent-mongoose-type-declaration | Detects inconsistent mongoose types in schema | ā | š” | |
incorrect-mongoose-index-field-name | Flags incorrect mongoose index creation on non-existing field | ā | ||
inappropriate-model-injection | Restricts model injection in certain files | ā | ||
incorrect-type-annotation-for-injection-model | Flags incorrect injection model type in constructor | ā | š” | |
incorrect-forward-ref-decorator-usage | Flags incorrect usage of forwardRef decorator in constructor | ā | š” |
Development Tools
npm test
runs tests.