forked from Shopify/eslint-plugin-shopify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.js
45 lines (38 loc) · 1008 Bytes
/
react.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
const merge = require('merge');
module.exports = {
extends: 'plugin:shopify/esnext',
settings: {
react: {
version: 'detect',
},
},
env: {
browser: true,
},
parserOptions: {
ecmaFeatures: {jsx: true},
},
plugins: ['react', 'jsx-a11y', 'react-hooks', 'shopify'],
rules: merge(
require('./rules/react'),
require('./rules/react-hooks'),
require('./rules/jsx-a11y'),
{
'shopify/react-hooks-strict-return': 'error',
'shopify/react-initialize-state': 'error',
'shopify/react-no-multiple-render-methods': 'error',
'shopify/react-prefer-private-members': 'error',
'shopify/react-type-state': 'error',
'shopify/jsx-no-complex-expressions': 'error',
'shopify/jsx-no-hardcoded-content': 'error',
'shopify/jsx-prefer-fragment-wrappers': 'error',
'consistent-return': 'off',
},
),
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: require('./rules/react-typescript'),
},
],
};