Nitpicky ESLint rules.
npm install -D eslint eslint-plugin-nestjs-pedantic
module.exports = {
// ...
plugins: [
// ...
"nestjs-pedantic",
],
extends: [
// ...
"nestjs-pedantic/recommended",
],
};
Either use one of the configs in eslint-plugin-nestjs-pedantic/lib/configs
or import the plugin as a standalone from eslint-plugin-nestjs-pedantic
.
const nestjsPedanticRecommended = require("eslint-plugin-nestjs-pedantic/lib/configs/recommended");
module.exports = {
// ...
...nestjsPedanticRecommended,
};
💼 Configurations enabled in.
🌐 Set in the all
configuration.
✅ Set in the recommended
configuration.
🔧 Automatically fixable by the --fix
CLI option.
💡 Manually fixable by editor suggestions.
Name | Description | 💼 | 🔧 | 💡 |
---|---|---|---|---|
match-methods-to-routes | Match method names to the decorated API routes | 🌐 ✅ | 🔧 | |
no-duplicate-route-params | Disallow duplicate route parameters | 🌐 ✅ | ||
no-unused-route-params | Disallow unused route parameters | 🌐 ✅ | 💡 | |
route-convention | Keep a convention when decorating routes | 🌐 ✅ | 🔧 | 💡 |
safe-route-params | Ensure safe usage of the @Param decorator |
🌐 ✅ | 💡 |