-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypescript.mjs
44 lines (37 loc) · 996 Bytes
/
typescript.mjs
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
import tsParser from '@typescript-eslint/parser'
import eslintPluginImportX from 'eslint-plugin-import-x'
import tseslint from 'typescript-eslint'
import { JAVASCRIPT_FILES, TYPESCRIPT_FILES } from '../constants.mjs'
export default tseslint.config(
tseslint.configs.recommendedTypeChecked,
eslintPluginImportX.flatConfigs.typescript,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: [...TYPESCRIPT_FILES, ...JAVASCRIPT_FILES],
ignores: ['eslint.config.js'],
languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
},
},
{
files: ['**/*.js'],
extends: [tseslint.configs.disableTypeChecked],
},
{
files: TYPESCRIPT_FILES,
rules: {
'@typescript-eslint/no-explicit-any': 1,
'@typescript-eslint/no-floating-promises': 1,
'@typescript-eslint/no-unsafe-argument': 1,
},
},
)