mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 03:42:07 +08:00
36 lines
1.0 KiB
JavaScript
36 lines
1.0 KiB
JavaScript
module.exports = {
|
||
env: {
|
||
browser: true,
|
||
node: true,
|
||
es2021: true,
|
||
},
|
||
extends: [
|
||
'eslint:recommended',
|
||
'plugin:react/recommended',
|
||
'plugin:@typescript-eslint/recommended',
|
||
'plugin:prettier/recommended', // 如果同时使用了eslint和prettier发生冲突了,会关闭掉与prettier有冲突的规则,也就是使用prettier认为对的规则
|
||
],
|
||
parser: '@typescript-eslint/parser',
|
||
parserOptions: {
|
||
ecmaFeatures: {
|
||
jsx: true,
|
||
},
|
||
ecmaVersion: 12,
|
||
sourceType: 'module',
|
||
},
|
||
plugins: [
|
||
'react',
|
||
'react-hooks',
|
||
'@typescript-eslint',
|
||
'prettier', // eslint 会使用pretter的规则对代码格式化
|
||
],
|
||
rules: {
|
||
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
|
||
'@typescript-eslint/no-var-requires': 0,
|
||
'prettier/prettier': 2, // 这项配置 对于不符合prettier规范的写法,eslint会提示报错
|
||
'no-console': 1,
|
||
'react/display-name': 0,
|
||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||
},
|
||
};
|