-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
85 lines (81 loc) · 2.36 KB
/
Copy patheslint.config.js
File metadata and controls
85 lines (81 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const { configs } = require('@typescript-eslint/eslint-plugin');
const typescriptParser = require('@typescript-eslint/parser');
module.exports = [
{
files: ['**/*.ts'],
ignores: [
'.eslintrc.js',
'ormconfig.js',
'redis.config.ts',
'redisSingle.config.ts',
'typeorm.config.ts',
'webpack-hmr.config.js',
'typeorm-transactional.ts',
'jest.config.js',
'release.config.js',
'generate-migration.js',
],
languageOptions: {
parser: typescriptParser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': configs.recommended,
prettier: require('eslint-plugin-prettier'),
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['**/*.js'],
ignores: ['.eslintrc.js', 'jest.config.js'],
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
require: 'readonly',
module: 'readonly',
process: 'readonly',
jest: 'readonly',
},
},
},
{
plugins: {
prettier: require('eslint-plugin-prettier'),
import: require('eslint-plugin-import'),
sonarjs: require('eslint-plugin-sonarjs'),
security: require('eslint-plugin-security'),
promise: require('eslint-plugin-promise'),
'optimize-regex': require('eslint-plugin-optimize-regex'),
},
rules: {
'prettier/prettier': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal'],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'sonarjs/no-duplicate-string': 'warn',
'sonarjs/no-identical-functions': 'warn',
'sonarjs/cognitive-complexity': ['warn', 15],
'security/detect-object-injection': 'warn',
'security/detect-unsafe-regex': 'error',
'promise/always-return': 'error',
'promise/no-return-wrap': 'error',
'optimize-regex/optimize-regex': 'warn',
},
},
];