-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
65 lines (64 loc) · 1.63 KB
/
eslint.config.js
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
const js = require('@eslint/js');
const globals = require('globals');
const react = require('eslint-plugin-react');
const jsdoc = require('eslint-plugin-jsdoc');
const babel = require('@babel/eslint-plugin');
const prettier = require('eslint-config-prettier');
const babelParser = require('@babel/eslint-parser');
module.exports = [
js.configs.recommended,
react.configs.flat.recommended,
jsdoc.configs['flat/recommended'],
prettier,
{
languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false, // Évite de devoir spécifier un fichier de configuration Babel
babelOptions: {
presets: ['@babel/preset-react'],
},
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
...globals.es2022,
...globals.mocha,
},
},
plugins: {
'react': react,
'jsdoc': jsdoc,
'@babel': babel,
},
rules: {
'eqeqeq': 'error',
'no-console': 'off',
'react/display-name': 'off',
'@babel/no-unused-expressions': 'error', // Utilisation de règles spécifiques à Babel
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
ignoreRestSiblings: true,
destructuredArrayIgnorePattern: '^_',
},
],
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns-description': 'off',
},
settings: {
react: {
version: 'detect',
},
jsdoc: {
mode: 'typescript',
},
},
},
];