-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy patheslint.config.mjs
61 lines (58 loc) · 1.8 KB
/
eslint.config.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import eslint from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import reactPlugin from 'eslint-plugin-react';
import prettierConfig from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import globals from "globals";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default [
eslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
globals: {
...globals.browser,
...globals.node,
...globals.es6,
chrome: 'readonly',
browser: 'readonly'
}
},
plugins: {
'@typescript-eslint': tseslint,
'react': reactPlugin,
'prettier': prettierPlugin
},
rules: {
...tseslint.configs['recommended'].rules,
...reactPlugin.configs.recommended.rules,
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'prettier/prettier': 'error'
},
ignores: ["package.json","node_modules/", "**/*/dist/", "build/", "coverage/","*.config.js", "**/*.config.ts", "vitest.config.ts", "vite.config.ts"],
settings: {
react: {
version: 'detect'
}
}
},
prettierConfig
];