{"id":19547,"library":"eslint-config-nestjs","title":"eslint-config-nestjs","description":"An ESLint configuration preset extracted from the official NestJS TypeScript starter. Version 0.8.0 consolidates ESLint, TypeScript-ESLint, Prettier, and other plugins into a single shareable config, reducing direct dependencies. It is distributed as an npm package and updated occasionally. Unlike manually wiring up @typescript-eslint/eslint-plugin, @typescript-eslint/parser, eslint-config-prettier, eslint-plugin-prettier, and prettier, this preset provides a one-line extend and automatic plugin resolution, though it offers limited customization out of the box.","status":"active","version":"0.8.0","language":"javascript","source_language":"en","source_url":"https://github.com/daopk/eslint-config-nestjs","tags":["javascript"],"install":[{"cmd":"npm install eslint-config-nestjs","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-nestjs","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-nestjs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for ESLint to function","package":"eslint","optional":false},{"reason":"provides TypeScript-specific lint rules","package":"@typescript-eslint/eslint-plugin","optional":false},{"reason":"parses TypeScript code for ESLint","package":"@typescript-eslint/parser","optional":false},{"reason":"disables rules that conflict with Prettier","package":"eslint-config-prettier","optional":false},{"reason":"runs Prettier as an ESLint rule","package":"eslint-plugin-prettier","optional":false},{"reason":"peer dependency for eslint-plugin-prettier","package":"prettier","optional":false}],"imports":[{"note":"The preset name is 'nestjs' (without the eslint-config- prefix) as per ESLint's resolution rules. Using the full scoped name will fail.","wrong":"extends: 'eslint-config-nestjs'","symbol":"eslint-config-nestjs","correct":"extends: 'nestjs' in .eslintrc.js"},{"note":"This package is a shareable config, not a plugin. Direct require() does not work; use `extends` in ESLint config.","wrong":"module.exports = require('eslint-config-nestjs')","symbol":"default config","correct":"module.exports = { extends: 'nestjs' }"},{"note":"The preset already includes the required plugins. Adding them manually may cause duplication or conflicts.","wrong":"plugins: ['@typescript-eslint', 'prettier'] in user config","symbol":"plugins","correct":"ESLint automatically resolves plugins when extending 'nestjs'"}],"quickstart":{"code":"// .eslintrc.js\nmodule.exports = {\n  extends: 'nestjs',\n  parserOptions: {\n    project: './tsconfig.json',\n  },\n};\n\n// Install peer dependencies (if not auto-installed)\n// npm i -D eslint-config-nestjs eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-prettier prettier\n\n// Run ESLint:\n// npx eslint \"src/**/*.ts\"","lang":"javascript","description":"Minimal ESLint config using the nestjs preset, including parser options for TypeScript project. Shows how to extend the preset and run ESLint."},"warnings":[{"fix":"Run `npm i -D eslint-config-nestjs @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-prettier prettier`.\"","message":"The preset's peer dependencies may not be automatically installed by npm/pnpm. Ensure all peer dependencies are present.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Verify eslint-config-nestjs is in node_modules and check ESLint's config resolution by running `npx eslint --print-config src/index.ts`.\"","message":"Using 'extends: 'nestjs'' in .eslintrc.js will be ignored if the preset is not installed or if ESLint cannot resolve the configuration.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Disable the plugin by adding `'prettier/prettier': 'off'` in rules.","message":"The preset includes `eslint-plugin-prettier` which may cause performance issues on large projects. Consider using Prettier as a separate formatter.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install the package: `npm i -D eslint-config-nestjs`.\"","cause":"The eslint-config-nestjs package is not installed or not in node_modules.","error":"ESLint couldn't find the config \"nestjs\""},{"fix":"Install peer dependency: `npm i -D @typescript-eslint/eslint-plugin @typescript-eslint/parser`.\"","cause":"Missing peer dependency @typescript-eslint/eslint-plugin.","error":"Failed to load plugin '@typescript-eslint' declared in 'nestjs': Cannot find module '@typescript-eslint/eslint-plugin'"},{"fix":"Install the missing plugin: `npm i -D eslint-plugin-prettier prettier`.\"","cause":"eslint-plugin-prettier is not installed.","error":"Definition for rule 'prettier/prettier' was not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}