-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy patheslint.config.ts
40 lines (39 loc) · 1.21 KB
/
eslint.config.ts
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
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import eslintPluginReact from 'eslint-plugin-react';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
eslintPluginPrettierRecommended,
{
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': 'error'
}
},
{
files: ['app/javascript/components/**/*.{ts,tsx,js,jsx}'],
...eslintPluginReact.configs.flat.recommended,
...eslintPluginReact.configs.flat['jsx-runtime']
},
{
files: ['app/javascript/components/**/*.{ts,tsx,js,jsx}'],
plugins: { 'react-hooks': eslintPluginReactHooks },
rules: {
...eslintPluginReactHooks.configs.recommended.rules,
'react/prop-types': 'off',
'react-hooks/exhaustive-deps': 'error'
}
},
{
files: ['app/javascript/**/*.{ts,tsx,js,jsx}'],
languageOptions: { globals: { ...globals.browser } }
},
{
files: ['*.config.{ts,js}'],
languageOptions: { globals: { ...globals.node } }
}
);