-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
44 lines (44 loc) · 1.08 KB
/
.eslintrc.cjs
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
// .eslintrc.cjs
module.exports = {
root: true, // This tells ESLint to stop looking in parent folders for configurations
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended', // Make sure this is always the last element in the array.
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', 'react-hooks', '@typescript-eslint'],
rules: {
'react/react-in-jsx-scope': 'off', // Not needed with React 17+
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// Add any project specific rules here
},
settings: {
react: {
version: 'detect', // Automatically detect React version
},
},
overrides: [
{
// Configuration for test files
files: ['**/*.{test,spec}.{js,jsx,ts,tsx}'],
env: {
jest: true,
},
},
],
};