-
-
Notifications
You must be signed in to change notification settings - Fork 121
/
.eslintrc.cjs
133 lines (132 loc) · 3.3 KB
/
.eslintrc.cjs
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
126
127
128
129
130
131
132
133
const { join } = require('node:path');
const { existsSync, readFileSync } = require('node:fs');
module.exports = {
extends: ['@nkzw', 'plugin:@deities/strict'],
ignorePatterns: [
'artemis/prisma/pothos-types.ts',
'dist/',
'electron/out/',
'hera/i18n/CampaignMap.tsx',
'mobile/android',
'mobile/ios',
],
overrides: [
{
files: ['**/__generated__/**/*.ts'],
rules: {
'unicorn/no-abusive-eslint-disable': 0,
},
},
{
files: ['scripts/fixtures/**/*.tsx'],
rules: {
'unicorn/numeric-separators-style': 0,
},
},
{
files: ['i18n/**/*.cjs', 'hera/i18n/**/EntityMap.tsx'],
rules: {
'sort-keys-fix/sort-keys-fix': 0,
},
},
{
files: [
'{codegen,infra,scripts,tests}/**/*.tsx',
'artemis/{prisma,scripts}/**/*.tsx',
'artemis/artemis.tsx',
],
rules: {
'no-console': 0,
},
},
{
files: ['artemis/discord/**/*.tsx'],
rules: {
'no-console': [2, { allow: ['error'] }],
},
},
{
files: [
'.eslintrc.cjs',
'eslint-plugin/index.js',
'i18n/Common.cjs',
'infra/babelPlugins.tsx',
],
rules: {
'@typescript-eslint/no-require-imports': 0,
},
},
{
files: ['**/__tests__/**/*.tsx'],
rules: {
'workspaces/no-relative-imports': 0,
},
},
],
plugins: ['@deities', 'workspaces'],
rules: {
'@typescript-eslint/array-type': [2, { default: 'generic' }],
'@typescript-eslint/no-restricted-imports': [
2,
{
paths: [
{
allowTypeImports: true,
message: `Use 'react-relay/hooks' instead.`,
name: 'react-relay',
},
{
message: `Use 'athena-prisma-client' instead.`,
name: '@prisma/client',
},
],
},
],
'import/no-extraneous-dependencies': [
2,
{
devDependencies: [
'./{ares,artemis,deimos,twitch,offline}/vite.config.ts',
'./{ares,artemis}/scripts/**/*.{js,cjs,tsx}',
'./ares/ares.tsx',
'./artemis/prisma/seed.tsx',
'./codegen/**',
'./docs/vocs.config.tsx',
'./electron/**',
'./infra/**',
'./mobile/capacitor.config.ts',
'./scripts/**',
'./tests/**',
'./vitest.config.ts',
'**/__tests__/**',
],
packageDir: [__dirname].concat(
existsSync(join(__dirname, './electron')) ? ['./electron'] : [],
existsSync(join(__dirname, './mobile')) ? ['./mobile'] : [],
readFileSync('./pnpm-workspace.yaml', 'utf8')
.split('\n')
.slice(1)
.map((n) =>
join(
__dirname,
n
.replaceAll(/\s*-\s+/g, '')
.replaceAll("'", '')
.replaceAll('\r', ''),
),
),
),
},
],
'import/no-unresolved': [
2,
{
ignore: [String.raw`\?worker`, 'athena-crisis:*', 'glob', 'virtual:*'],
},
],
'no-extra-parens': 0,
'no-restricted-globals': [2, 'alert', 'confirm'],
'workspaces/no-absolute-imports': 2,
'workspaces/no-relative-imports': 2,
},
};