-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
44 lines (39 loc) · 1.29 KB
/
eslint.config.mjs
File metadata and controls
44 lines (39 loc) · 1.29 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 { dirname } from 'path'
import { fileURLToPath } from 'url'
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import { FlatCompat } from '@eslint/eslintrc'
import { fixupConfigRules } from '@eslint/compat'
// Initial file generated with `npm lint -- --init`
const __filename = fileURLToPath( import.meta.url )
const __dirname = dirname( __filename )
const compat = new FlatCompat( {
baseDirectory: __dirname,
} )
/** @type {import('eslint').Linter.Config[]} */
const config = [
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...fixupConfigRules( compat.extends( 'plugin:react/recommended' ) ),
...fixupConfigRules( compat.extends( 'plugin:react-hooks/recommended' ) ),
...fixupConfigRules( compat.extends( 'plugin:react-server-components/recommended' ) ),
{
settings: {
react: {
version: 'detect',
},
},
},
{ files: [ 'src/**/*.{js,jsx,mjs,cjs,ts,tsx}' ] },
{ ignores: [ 'dist', 'scripts', 'coverage' ] },
{ rules: {
'@typescript-eslint/no-namespace': 'off',
'react-hooks/set-state-in-effect': 'warn',
'react-hooks/refs': 'warn',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
} },
]
export default config