首页 > 其他分享 >.eslintrc.json

.eslintrc.json

时间:2023-01-29 14:46:30浏览次数:46  
标签:typescript off no eslintrc react json eslint error

"extends": [
  "eslint:recommended",
  "plugin:react/recommended",
  "plugin:@typescript-eslint/recommended"
],
"rules": {
  "import/no-extraneous-dependencies": "off",
  // 'import/no-unresolved': 'error',
  "react/react-in-jsx-scope": "off",
  // "no-empty-interface": true,
  "react/no-unused-prop-types": "off",
  // '@typescript-eslint/no-explicit-any': 'off',
  "operator-linebreak": ["error", "after"],
  "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
  "implicit-arrow-linebreak": "off",
  "lines-between-class-members": "off",
  "react/jsx-closing-bracket-location": [1, "after-props"],
  "object-curly-newline": ["error", { "consistent": true }],
  "semi": ["error", "always"],
  "quotes": ["error", "single"],
  "indent": ["error", 2],
  "linebreak-style": [2, "unix"],
  "no-console": [0],
  "max-len": [1, 100],
  "import/order": "off",
  "prefer-const": 1,
  // 'sort-imports': ['error', { ignoreDeclarationSort: true }],
  "func-names": ["error", "as-needed"],
  "arrow-body-style": "off",
  "import/no-duplicates": "off",
  "import/no-self-import": "off",
  "import/no-cycle": "off",
  "import/no-named-as-default": "off",
  "import/no-named-as-default-member": "off",
  "react/require-default-props": [0],
  "react/jsx-one-expression-per-line": ["off"],
  "import/extensions": "off",
  "no-trailing-spaces": [2, { "skipBlankLines": false }],
  "arrow-spacing": [2, { "before": true, "after": true }],
  "import/no-dynamic-require": 0,
  "global-require": 0,
  "react/jsx-max-props-per-line": [0],
  "react/jsx-first-prop-new-line": [0, "multiline"],
  "react/jsx-boolean-value": [1],
  "newline-per-chained-call": [0],
  "react/jsx-props-no-spreading": "off",
  // reference from: https://github.com/airbnb/javascript
  "no-new-object": ["error"],
  "object-shorthand": ["error", "always", {
    "avoidQuotes": true,
    "avoidExplicitReturnArrows": false
  }],
  "quote-props": ["error", "as-needed"],
  "prefer-object-spread": ["error"],
  // 'prefer-destructuring': ['error'],
  "prefer-template": ["error"],
  "template-curly-spacing": ["error", "never"],
  "no-eval": ["error"],
  "func-style": ["error", "expression", {
    "allowArrowFunctions": true
  }],
  "no-param-reassign": ["error"],
  "prefer-arrow-callback": ["error"],
  "arrow-parens": ["error", "as-needed"],
  // 'implicit-arrow-linebreak': ['error'],
  "no-duplicate-imports": ["error"],
  // 'no-undef': ["error"],
  "no-plusplus": ["error"],
  "spaced-comment": ["error"],
  // react
  "react/no-array-index-key": ["error"],
  "no-multi-spaces": 2,
  // typescript
  "@typescript-eslint/no-unused-vars": "off",
  "@typescript-eslint/no-empty-interface": "off",
  "@typescript-eslint/no-empty-function": "off",
  "@typescript-eslint/no-explicit-any": "off",
  "@typescript-eslint/ban-ts-ignore": "off",
  "@typescript-eslint/ban-ts-comment": "off",
  "@typescript-eslint/no-inferrable-types": "off",
  "@typescript-eslint/no-shadow": ["off"],
  "@typescript-eslint/no-throw-literal": ["off"],
  "@typescript-eslint/explicit-module-boundary-types": "off",
  "@typescript-eslint/no-var-requires": "off",
  "@typescript-eslint/lines-between-class-members": ["off"]
}

标签:typescript,off,no,eslintrc,react,json,eslint,error
From: https://www.cnblogs.com/h6lianfu/p/17072610.html

相关文章

  • Json.NET 序列化解析
    Json.NET是一款.NET平台的JSON框架,它还有一个我们熟知的名字:Newtonsoft.Json。1.介绍Json.NET有如下功能及特点:灵活的JSON序列化器,用于.NET对象和JSON之间......
  • SpringBoot中读取JSON文件信息并转换为Map对象
    SpringBoot中读取JSON文件信息并转换为Map对象需要引入的依赖<dependency><groupId>com.alibaba.fastjson2</groupId><artifactId>fastjson2<......
  • node借助jsonwebtoken生成token以及验证token是否过期
    生成token使用jsonwebtoken插件我当时使用的版本"jsonwebtoken":"^9.0.0",cnpmijsonwebtoken-S登录后生成token//routes/index.js文件varexpress=require(......
  • MySQL 支持JSON类型字段
    MySQL支持JSON字段的基本操作、相关函数及索引使用JSON字段基本操作//示例数据//表的基本结构CREATETABLE`t`(`id`INTUNSIGNEDNOTNULL,`js`JSON......
  • C# 序列化Json时如何忽略JsonProperty(PropertyName =“ someName”)
    前言序列化大家都很常见,就是把一个对象序列化成一串Json字符串。最近对接第三方的时候遇到了一个情况,我们C#都是用骆驼命名,而他们呢需要接收的Json字符串的 key 是 ......
  • GRPC与JSON-RPC区别
      GRPC与JSON-RPC都是rpc的一种。 一.RPCRPC是什么RPC(RemoteProcedureCall)指的是远程过程调用,简单的说,RPC就是从一台机器上通过参数传递的方式调用另一台......
  • AJAX服务器响应JSON数据&设置响应体数据类型
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-scale=1.0"><title>JSON响......
  • PHP转Go实践:xjson解析神器「开源工具集」
    前言近期会更新一系列开源项目的文章,新的一年会和大家做更多的开源项目,也欢迎大家加入进来。xutil今天分享的文章源自于开源项目jinzaigo/xutil的封装。在封装过程中......
  • 扩展springboot的json数据返回使用的json序列化方式
    扩展springboot的json数据返回使用的json序列化方式可以指定时间类型json化后的返回样式可以指定特殊功能定义,Long类型转成字符串形式返回自定义序列化转换器,代码范......
  • 用 Vue.js 实现一个 JSON Viewer
    演示地址:http://json.imlht.com/vue-json-viewer-demo.html常用的JSON格式化工具JSON是一种轻量级的数据交换格式,相信大家用得比较多,平时也用了很多格式化工具......