forked from PalisadoesFoundation/talawa-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
77 lines (73 loc) · 1.94 KB
/
.eslintrc.json
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
{
"env": {
"es2022": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"overrides": [
{
"files": ["./src/typeDefs/**/*.ts"],
"processor": "@graphql-eslint/graphql"
},
{
"files": ["./src/typeDefs/**/*.graphql"],
"parser": "@graphql-eslint/eslint-plugin",
"plugins": ["@graphql-eslint"],
// Do not apply naming conventions to .graphql files
"rules": {
"@typescript-eslint/naming-convention": "off"
}
},
{
"files": ["tests/**/*"],
"rules": {
"no-restricted-imports": "off"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": ".",
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "eslint-plugin-tsdoc"],
"root": true,
"rules": {
"no-restricted-imports": [
"error",
{
"patterns": ["**/src/**"]
}
],
// warn/1, error/2, off/0
"tsdoc/syntax": "error",
// Typescript Rules
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-var-requires": "off",
// Typescript rule to enforce PascalCase naming convention for types and interfaces
"@typescript-eslint/naming-convention": [
"error",
// Interfaces must begin with Interface_ or Test_Interface_ followed by a PascalCase name
{
"selector": "interface",
"format": ["PascalCase"],
"prefix": ["Interface_", "Test_Interface_"]
},
// Type Aliases must be in PascalCase
{
"selector": "typeAlias",
"format": ["PascalCase"]
}
]
}
}