| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- {
- "env": {
- "browser": true,
- "es2021": true
- },
- "extends": [
- "eslint:recommended",
- "plugin:react/recommended",
- "plugin:@typescript-eslint/recommended",
- "prettier"
- ],
- "parser": "@typescript-eslint/parser",
- "parserOptions": {
- "ecmaFeatures": {
- "jsx": true
- },
- "ecmaVersion": 12,
- "sourceType": "module"
- },
- "plugins": ["react", "@typescript-eslint"],
- "rules": /* 校验规则 */ {
- "semi": /* 结尾分号 */ ["error", "always"], // [错误级别: off|0 关闭;warn|1 警告(不退出);error|2 错误(退出);]
- // "quotes": /* 引号方式 */ ["error", "double"],
- "curly": [1, "all"],
- "no-eval": [2],
- "eqeqeq": [2, "always"],
- "react/prop-types": 0, //防止在react组件定义中缺少props验证
- "no-unused-expressions": [1, { "allowTernary": true }],
- "jsx-quotes": [2, "prefer-double"],
- // "indent": [2, 2,{"SwitchCase":1}],
- "indent": [2, 2, { "ignoredNodes": ["ConditionalExpression"],"SwitchCase":1 }],
- "block-spacing": [2, "always"],
- "keyword-spacing": /* 关键字前后空格 */ [
- 2,
- { "before": true, "after": true }
- ],
- "space-infix-ops": /* 操作符前后空格 */ "error",
- "@typescript-eslint/explicit-module-boundary-types": "off",
- "@typescript-eslint/no-var-requires": 0,
- "react/display-name": 0
- },
- "settings": {
- "react": {
- "createClass": "createReactClass",
- "pragma": "React",
- "fragment": "Fragment",
- "version": "detect",
- "flowVersion": "0.53"
- }
- },
- "globals": {
- "process": true,
- "module": true,
- "require": true
- }
- }
|