-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy patheslint.config.js
More file actions
44 lines (43 loc) · 1.32 KB
/
eslint.config.js
File metadata and controls
44 lines (43 loc) · 1.32 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
import js from '@eslint/js';
import globals from 'globals';
import { defineConfig, globalIgnores } from 'eslint/config';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import securityPlugin from 'eslint-plugin-security';
export default defineConfig([
globalIgnores([
'dist',
'postcss.config.js',
'tailwind.config.js',
'vite.config.js',
]),
{
files: ['**/*.{js,jsx,ts,tsx}'],
// map plugin name -> module so flat config can use legacy plugins
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
security: securityPlugin,
},
extends: [
js.configs.recommended,
securityPlugin?.configs?.recommended || 'plugin:security/recommended',
],
languageOptions: {
ecmaVersion: 'latest',
globals: globals.browser,
parserOptions: {
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
// disallow console.log in source; allow console.error and console.warn
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'security/detect-object-injection': 'off',
},
},
]);