forked from andoka-soudanais/entity
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
125 lines (124 loc) · 3.28 KB
/
eslint.config.js
File metadata and controls
125 lines (124 loc) · 3.28 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
const { defineConfig, globalIgnores } = require('eslint/config');
const universeNodeConfig = require('eslint-config-universe/flat/node');
const universeSharedTypescriptAnalysisConfig = require('eslint-config-universe/flat/shared/typescript-analysis');
const tsdoc = require('eslint-plugin-tsdoc');
module.exports = defineConfig([
globalIgnores([
'packages/entity-codemod/**/__testfixtures__/**',
'packages/*/build',
'coverage',
'coverage-integration',
'doc',
]),
universeNodeConfig,
universeSharedTypescriptAnalysisConfig,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname,
},
},
plugins: {
tsdoc,
},
rules: {
'no-restricted-imports': ['error', { paths: ['.', '..', '../..'] }],
'tsdoc/syntax': 'warn',
'no-console': 'warn',
'handle-callback-err': 'off',
eqeqeq: ['warn', 'always'],
'no-restricted-properties': [
'warn',
{
object: 'it',
property: 'only',
message: 'it.only should not be committed to main.',
},
{
object: 'test',
property: 'only',
message: 'test.only should not be committed to main.',
},
{
object: 'describe',
property: 'only',
message: 'describe.only should not be committed to main.',
},
{
object: 'it',
property: 'skip',
message: 'it.skip should not be committed to main.',
},
{
object: 'test',
property: 'skip',
message: 'test.skip should not be committed to main.',
},
{
object: 'describe',
property: 'skip',
message: 'describe.skip should not be committed to main.',
},
],
},
},
{
settings: {
jest: {
version: 29,
},
},
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
rules: {
'no-void': [
'warn',
{
allowAsStatement: true,
},
],
'@typescript-eslint/explicit-function-return-type': [
'warn',
{
allowExpressions: true,
},
],
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'enumMember',
format: ['UPPER_CASE'],
},
// async functions must have names ending with 'Async'
{
selector: ['function', 'classMethod', 'typeMethod'],
format: ['camelCase'],
modifiers: ['async'],
suffix: ['Async'],
},
],
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': ['error'],
},
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
ignores: ['**/*tests__/**', 'packages/entity-codemod/src/transforms/**'],
rules: {
'no-restricted-exports': ['error', { restrictDefaultExports: { direct: true } }],
},
},
{
files: ['**/__tests__/**/*.ts', '**/__tests__/**/*.tsx', '**/__tests__/**/*.d.ts'],
rules: {
// ts-mockito verify function needs void functions within verify which is a void function
'@typescript-eslint/no-confusing-void-expression': 'off',
},
},
]);