Files
KnowStreaming/km-console/.eslintrc.js

36 lines
1.0 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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',
},
};