/
.eslintrc.js
53 lines (52 loc) · 1.21 KB
/
.eslintrc.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
module.exports = {
extends: [ 'plugin:@woocommerce/eslint-plugin/recommended' ],
globals: {
jQuery: 'readonly',
wc_mnm_params: true,
WC_MNM_ADD_TO_CART_REACT_PARAMS: true,
},
rules: {
'woocommerce/feature-flag': 'off',
'react-hooks/exhaustive-deps': 'error',
'react/jsx-fragments': [ 'error', 'syntax' ],
'@wordpress/no-global-active-element': 'warn',
'@wordpress/i18n-text-domain': [
'error',
{
allowedTextDomain: [ 'wc-mnm-variable' ],
},
],
'@typescript-eslint/no-restricted-imports': [
'error',
{
paths: [
{
name: 'react',
message:
'Please use React API through `@wordpress/element` instead.',
allowTypeImports: true,
},
],
},
],
camelcase: [
'error',
{
properties: 'never',
ignoreGlobals: true,
// allow: [ 'wc_mnm_params', 'WC_MNM_ADD_TO_CART_REACT_PARAMS' ]
},
],
'react/react-in-jsx-scope': 'off',
// Turned off because conflicts with the ones above and does not support aliases
'node/no-missing-require': 'off',
'node/no-extraneous-import':'off',
},
settings: {
'import/resolver': {
"webpack": {
"config": "webpack.config.js"
}
}
},
};