generated from funnyzak/taro-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
52 lines (51 loc) · 1.44 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
const { defineConfig } = require('eslint-define-config');
module.exports = defineConfig({
root: true,
env: {
browser: true,
es2017: true,
node: true
},
extends: [
// add more generic rulesets here, such as:
// 'eslint:recommended',
'taro/react',
'prettier'
],
plugins: ['import', 'react', '@typescript-eslint', 'react-hooks', 'jsx-a11y', 'html'],
parser: '@typescript-eslint/parser',
globals: {
_: 'readonly',
wxsdk: 'writable',
Component: 'readonly',
wx: 'readonly',
getCurrentPages: 'readonly',
Page: 'readonly'
},
rules: {
'semi': ['error', 'always'],
'comma-dangle': ['error', 'never'],
'jsx-quotes': ['error', 'prefer-double'],
'func-names': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-plusplus': 'off',
'camelcase': 'off',
'import/extensions': 'off',
'no-use-before-define': 'off',
'no-var-requires': 'off',
'import/no-commonjs': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'react/jsx-filename-extension': [
'warn',
{
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
]
}
});