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"
}
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/12629931.html
未经授权禁止转载,违者必究!