-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy patheslint.config.mjs
More file actions
102 lines (94 loc) · 2.36 KB
/
Copy patheslint.config.mjs
File metadata and controls
102 lines (94 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettierPlugin from 'eslint-plugin-prettier';
import jsdocPlugin from 'eslint-plugin-jsdoc';
import { globalIgnores } from 'eslint/config';
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.eslintRecommended,
{
plugins: {
prettier: prettierPlugin,
jsdoc: jsdocPlugin,
},
rules: {
'prettier/prettier': 'error',
'object-shorthand': ['error', 'always'],
'no-unreachable': 'error',
},
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tseslint.parser,
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'jsdoc/require-jsdoc': [
'error',
{
contexts: ['MethodDefinition:not([accessibility="private"])'],
require: {
ClassDeclaration: true,
},
checkConstructors: false,
enableFixer: false,
},
],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allowDouble',
trailingUnderscore: 'allowDouble',
},
],
'@typescript-eslint/no-restricted-types': [
'error',
{
types: {
null: 'Use undefined instead of null',
},
},
],
'@typescript-eslint/array-type': [
'error',
{
default: 'generic',
},
],
'@typescript-eslint/no-this-alias': [
'error',
{
allowDestructuring: true,
allowedNames: ['node'],
},
],
},
},
{
files: ['examples/**/*'],
rules: {
'jsdoc/require-jsdoc': 'off',
},
},
globalIgnores([
// common
'**/dist/*',
'**/lib/*',
// sdk
'packages/sdk/src/api/yorkie/v1/yorkie_grpc_web_pb.d.ts',
'packages/sdk/src/api/yorkie/v1/yorkie_pb.d.ts',
'packages/sdk/src/api/yorkie/v1/resources_grpc_web_pb.d.ts',
'packages/sdk/src/api/yorkie/v1/resources_pb.d.ts',
'packages/sdk/test/vitest.d.ts',
// examples
'examples/**/*',
// schema
'packages/schema/antlr',
]),
);