mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
Make JS X Again
* Configure the project to allow the use of JSX in .jsx files. * Add linting for JSX. * Rewrite most existing code that uses `createElement` to use JSX syntax. * Stop importing `createElement as e`. That's what the minifier is for. And we don't have to write it manually so much now because of JSX syntax.
This commit is contained in:
parent
57152e8ed5
commit
f506b512b4
31 changed files with 514 additions and 322 deletions
44
.eslintrc.js
44
.eslintrc.js
|
@ -7,11 +7,22 @@ module.exports = {
|
|||
"eslint:recommended",
|
||||
"plugin:vue/recommended"
|
||||
],
|
||||
"plugins": ["vue"],
|
||||
"plugins": [
|
||||
"vue",
|
||||
"react"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint",
|
||||
"ecmaVersion": 8,
|
||||
"sourceType": "module"
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"pragma": "createElement"
|
||||
}
|
||||
},
|
||||
"globals": {
|
||||
"import": false,
|
||||
|
@ -95,6 +106,7 @@ module.exports = {
|
|||
"allowTemplateLiterals": true
|
||||
}
|
||||
],
|
||||
|
||||
"vue/html-indent": [
|
||||
"warn",
|
||||
"tab"
|
||||
|
@ -108,6 +120,32 @@ module.exports = {
|
|||
"singleline": "never",
|
||||
"multiline": "always"
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
"jsx-quotes": ["error", "prefer-double"],
|
||||
"react/jsx-boolean-value": "error",
|
||||
"react/jsx-closing-bracket-location": ["error", "line-aligned"],
|
||||
//"react/jsx-closing-tag-location": "error" -- stupid rule that doesn't allow line-aligned
|
||||
"react/jsx-equals-spacing": "error",
|
||||
"react/jsx-filename-extension": "error",
|
||||
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
|
||||
"react/jsx-indent": ["warn", "tab"],
|
||||
"react/jsx-indent-props": ["warn", "tab"],
|
||||
"react/jsx-key": "warn",
|
||||
"react/jsx-no-bind": "error",
|
||||
"react/jsx-no-comment-textnodes": "error",
|
||||
"react/jsx-no-duplicate-props": "error",
|
||||
"react/jsx-no-literals": ["warn"],
|
||||
"react/jsx-no-target-blank": "error",
|
||||
"react/jsx-sort-props": ["error", {
|
||||
"callbacksLast": true,
|
||||
"reservedFirst": true,
|
||||
"noSortAlphabetically": true
|
||||
}],
|
||||
"react/jsx-tag-spacing": ["error", {
|
||||
"beforeClosing": "never"
|
||||
}],
|
||||
"react/jsx-uses-react": "error",
|
||||
"react/jsx-wrap-multilines": "error"
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue