nestjs-http-promise/.eslintrc.js
Conicaw c9dd5e8d02
refactor: make eslint consistent with other services
Make eslint consistent with other services

commit-id:5e520892
2023-12-29 20:10:58 -06:00

81 lines
2.4 KiB
JavaScript

module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: [
'@typescript-eslint/eslint-plugin',
'simple-import-sort',
'no-type-assertion',
'sonarjs',
'import',
'unused-imports',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:@typescript-eslint/strict',
'plugin:prettier/recommended',
'plugin:sonarjs/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
eqeqeq: 'error',
'no-lonely-if': 'error',
'no-multi-assign': 'error',
'@typescript-eslint/no-shadow': 'error',
'no-useless-return': 'error',
'no-useless-rename': 'error',
'one-var-declaration-per-line': 'error',
'prefer-object-spread': 'error',
'no-unreachable-loop': 'error',
'no-template-curly-in-string': 'error',
'default-case-last': 'error',
'no-array-constructor': 'error',
'no-else-return': 'error',
'no-negated-condition': 'error',
'array-callback-return': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'no-type-assertion/no-type-assertion': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/consistent-type-exports': 'error',
'import/consistent-type-specifier-style': 'error',
'import/no-duplicates': 'error',
'import/no-unresolved': 'error',
curly: 'error',
'no-console': [
'warn',
{
allow: ['warn', 'error'],
},
],
quotes: [
'error',
'single',
{
avoidEscape: true,
},
],
'prefer-template': 'error',
'@typescript-eslint/return-await': ['error', 'always'],
'unused-imports/no-unused-imports': 'error',
},
};