-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
70 lines (68 loc) · 2.68 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
62
63
64
65
66
67
68
69
70
import pluginJs from '@eslint/js'
import nextPlugin from '@next/eslint-plugin-next'
import eslintConfigPrettier from 'eslint-config-prettier'
import importPlugin from 'eslint-plugin-import'
import pluginPromise from 'eslint-plugin-promise'
import pluginReact from 'eslint-plugin-react'
// No support for Tailwind v4 yet. ETA: ~1 week
// https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/325
// import tailwind from 'eslint-plugin-tailwindcss'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default [
{
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}']
},
{
languageOptions: {
ecmaVersion: 'latest',
globals: { ...globals.browser, ...globals.node }
}
},
{
settings: {
react: {
version: 'detect'
}
}
},
pluginJs.configs.recommended, // https://github.com/eslint/eslint
importPlugin.flatConfigs.recommended, // https://github.com/import-js/eslint-plugin-import
...tseslint.configs.recommended, // https://github.com/typescript-eslint/typescript-eslint
pluginPromise.configs['flat/recommended'], // https://github.com/eslint-community/eslint-plugin-promise
pluginReact.configs.flat.recommended, // https://github.com/jsx-eslint/eslint-plugin-react
pluginReact.configs.flat['jsx-runtime'], // https://github.com/jsx-eslint/eslint-plugin-react
eslintConfigPrettier, // https://github.com/prettier/eslint-config-prettier
// ...tailwind.configs['flat/recommended'], // https://github.com/francoismassart/eslint-plugin-tailwindcss
{
rules: {
'no-unused-vars': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/exhaustive-deps': 'off',
'react/display-name': 'off',
'react/prop-types': 'off',
'newline-before-return': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'tailwindcss/no-custom-classname': 'off',
'tailwindcss/migration-from-tailwind-2': 'off',
'import/no-unresolved': 'off',
'import/no-named-as-default': 'off'
}
},
// No official solution available for new ESLint 9 flat config structure for Next.js
// https://github.com/vercel/next.js/discussions/49337?sort=top#discussioncomment-5998603
{
plugins: {
'@next/next': nextPlugin
},
rules: {
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs['core-web-vitals'].rules,
'@next/next/no-img-element': 'off'
}
},
{
ignores: ['.next/*']
}
]