Eslint default configuration for Nestjs project. It will help you to maintain the code quality of your project.
To begin using it, we first install the required dependencies.
npm install @hodfords/nestjs-eslint-config
To activate eslint, create a eslint.config.js
file in the root of your project and add the following configuration:
module.exports = require('@hodfords/nestjs-eslint-config');
Run the following command to lint your project:
npx eslint
This configuration extends the @hodfords/eslint-config
package. It includes the following plugins:
@typescript-eslint/eslint-plugin
@typescript-eslint/parser
eslint-plugin-prettier/recommended
Custom rules are also included in this configuration.
{
useTabs: false,
tabWidth: 4,
printWidth: 120,
singleQuote: true,
trailingComma: 'none'
}
@typescript-eslint/naming-convention
enumMember
:UPPER_CASE
objectLiteralProperty
:['camelCase', 'PascalCase', 'UPPER_CASE']
['class', 'interface', 'enum']
:PascalCase
variable
:['PascalCase', 'camelCase', 'UPPER_CASE']
function
:['PascalCase', 'camelCase']
'parameter','variable','function', 'classProperty','typeProperty','parameterProperty','classMethod','objectLiteralMethod','typeMethod'
:'camelCase'
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-unused-vars': ['error', { args: 'none' }]
max-line-per-function
:50
max-lines
:400
prefer-const
lines-between-class-members
indent
:off
This project is licensed under the MIT License