-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.ts
More file actions
60 lines (59 loc) · 1.83 KB
/
eslint.config.ts
File metadata and controls
60 lines (59 loc) · 1.83 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
import eslintPluginJs from '@eslint/js'
import { defineConfig } from 'eslint/config'
import globals from 'globals'
import eslintTypescript from 'typescript-eslint'
export default defineConfig(
eslintPluginJs.configs.recommended,
eslintTypescript.configs.recommended,
{
languageOptions: {
globals: { ...globals.node },
parser: eslintTypescript.parser,
parserOptions: { warnOnUnsupportedTypeScriptVersion: false }
}
},
{
rules: {
'no-restricted-syntax': [
'error',
{
selector:
"ImportSpecifier[local.name='env'][parent.source.value='node:process']",
message:
"Importing env from 'node:process' is not allowed. Use env config instead."
},
{
selector:
"ImportSpecifier[local.name='env'][parent.source.value='process']",
message:
"Importing 'env' from 'process' is not allowed. Use env config instead."
},
{
selector:
"MemberExpression[object.name='process'][property.name='env']",
message:
"Accessing 'process.env' is not allowed. Use env config instead."
}
],
'newline-before-return': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' }
],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/array-type': ['error', { default: 'array' }],
'@typescript-eslint/naming-convention': [
'error',
{ selector: 'typeLike', format: ['PascalCase'] }
]
}
},
{
files: ['**/*.d.ts'],
rules: {
'@typescript-eslint/consistent-type-definitions': 'off'
}
}
)