-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.cjs
46 lines (45 loc) · 1.57 KB
/
eslint.config.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
const path = require('path');
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
module.exports = [
...tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: path.resolve(__dirname),
project: './tsconfig.eslint.json',
projectFolderIgnoreList: ['**/node_modules/**', '**/dist/**', '**/dist-admin/**'],
warnOnUnsupportedTypeScriptVersion: false,
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2023,
sourceType: 'module',
},
},
plugins: {
prettier: require('eslint-plugin-prettier'),
},
ignores: ['**/node_modules/**', 'dist/**', 'cjs/**', 'esm/**', 'docs/**', 'mock/**', '**/*.js', '**/*.d.ts'],
rules: {
'prettier/prettier': 'warn',
indent: ['off', 2],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }],
// todo
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-floating-promises': 'off',
},
files: ['src/**/*.ts'],
},
{
files: ['*.js', '*.cjs', '*.mjs'],
...tseslint.configs.disableTypeChecked,
}
),
];