xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

ESLint & jsx-quotes & quotes

ESLint & jsx-quotes & quotes

bug

{
    "jsx-quotes": [
      "error",
      "prefer-single",
    ],
    "jsx-quotes": 0,
}

jsx-quotes

https://eslint.org/docs/rules/jsx-quotes#prefer-single

{
   "jsx-quotes": ["error", "prefer-single"],
}

quotes

https://eslint.org/docs/rules/quotes

quotes: ["error", "single"]
quotes: ["error", "single"]
quotes: ["error", "backtick"]

quotes: ["error", "double", { "avoidEscape": true }]
quotes: ["error", "single", { "avoidEscape": true }]
quotes: ["error", "backtick", { "avoidEscape": true }]

quotes: ["error", "double", { "allowTemplateLiterals": true }]
quotes: ["error", "single", { "allowTemplateLiterals": true }]

// { "allowTemplateLiterals": false }


semi

https://eslint.org/docs/rules/semi

semi: ["error", "always"]
semi: ["error", "never"]

semi: ["error", "always", { "omitLastInOneLineBlock": true}]
semi: ["error", "never", { "beforeStatementContinuationChars": "always"}]
semi: ["error", "never", { "beforeStatementContinuationChars": "never"}]


refs

JavaScript Semicolon Insertion

https://blog.izs.me/2010/12/an-open-letter-to-javascript-leaders-regarding/

https://inimino.org/~inimino/blog/javascript_semicolons


{
  "extends": [
    "taro",
    "standard"
  ],
  "globals": {
    "wx": true,
    "my": true,
    "PAGES": true,
    "SUB_PAGES": true,
    "TAB_BAR": true,
    "sensorH5": true
  },
  "rules": {
    "no-unused-vars": [
      "error",
      {
        "varsIgnorePattern": "Taro"
      }
    ],
    "react/jsx-filename-extension": [
      1,
      {
        "extensions": [
          ".js",
          ".jsx",
          ".tsx"
        ]
      }
    ],
    "taro/this-props-function": 0,
    "comma-dangle": [
      "error",
      "always-multiline"
    ],
    "jsx-quotes": [
      "error",
      "prefer-double"
    ],
    "space-before-function-paren": [
      "error",
      "never"
    ],
    "no-shadow": [
      "off",
    ],
    "semi": [
      "off",
    ],
    "jsx-quotes": [
      "error",
      "prefer-single",
    ],
    "jsx-quotes": 0,
    "quotes": ["error", "single"],
  },
  "parser": "babel-eslint"
}


posted @ 2020-04-04 00:05  xgqfrms  阅读(1457)  评论(2编辑  收藏  举报