Style fixes (#494)

* Place multi-line expression parentheses on the correct line

* Add function-paren-newline eslint rule

* Add some additional eslint rules
This commit is contained in:
toasted-nutbread 2020-05-02 13:04:17 -04:00 committed by GitHub
parent c4ea9321dc
commit d581bffa15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -23,6 +23,7 @@
"eqeqeq": "error", "eqeqeq": "error",
"func-names": ["error", "always"], "func-names": ["error", "always"],
"guard-for-in": "error", "guard-for-in": "error",
"new-parens": "error",
"no-case-declarations": "error", "no-case-declarations": "error",
"no-const-assign": "error", "no-const-assign": "error",
"no-constant-condition": "off", "no-constant-condition": "off",
@ -31,6 +32,7 @@
"no-prototype-builtins": "error", "no-prototype-builtins": "error",
"no-shadow": ["error", {"builtinGlobals": false}], "no-shadow": ["error", {"builtinGlobals": false}],
"no-undef": "error", "no-undef": "error",
"no-unexpected-multiline": "error",
"no-unneeded-ternary": "error", "no-unneeded-ternary": "error",
"no-unused-vars": ["error", {"vars": "local", "args": "after-used", "argsIgnorePattern": "^_", "caughtErrors": "none"}], "no-unused-vars": ["error", {"vars": "local", "args": "after-used", "argsIgnorePattern": "^_", "caughtErrors": "none"}],
"no-unused-expressions": "error", "no-unused-expressions": "error",
@ -40,6 +42,7 @@
"quotes": ["error", "single", "avoid-escape"], "quotes": ["error", "single", "avoid-escape"],
"require-atomic-updates": "off", "require-atomic-updates": "off",
"semi": "error", "semi": "error",
"wrap-iife": ["error", "inside"],
// Whitespace rules // Whitespace rules
"brace-style": ["error", "1tbs", {"allowSingleLine": true}], "brace-style": ["error", "1tbs", {"allowSingleLine": true}],
@ -53,6 +56,7 @@
"comma-spacing": ["error", { "before": false, "after": true }], "comma-spacing": ["error", { "before": false, "after": true }],
"computed-property-spacing": ["error", "never"], "computed-property-spacing": ["error", "never"],
"func-call-spacing": ["error", "never"], "func-call-spacing": ["error", "never"],
"function-paren-newline": ["error", "multiline-arguments"],
"generator-star-spacing": ["error", "before"], "generator-star-spacing": ["error", "before"],
"key-spacing": ["error", {"beforeColon": false, "afterColon": true, "mode": "strict"}], "key-spacing": ["error", {"beforeColon": false, "afterColon": true, "mode": "strict"}],
"keyword-spacing": ["error", {"before": true, "after": true}], "keyword-spacing": ["error", {"before": true, "after": true}],
@ -61,6 +65,11 @@
"object-curly-spacing": ["error", "never"], "object-curly-spacing": ["error", "never"],
"rest-spread-spacing": ["error", "never"], "rest-spread-spacing": ["error", "never"],
"semi-spacing": ["error", {"before": false, "after": true}], "semi-spacing": ["error", {"before": false, "after": true}],
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"space-in-parens": ["error", "never"], "space-in-parens": ["error", "never"],
"space-unary-ops": "error", "space-unary-ops": "error",
"spaced-comment": ["error", "always"], "spaced-comment": ["error", "always"],

View File

@ -896,7 +896,9 @@ class Backend {
await Backend._focusTab(tab); await Backend._focusTab(tab);
if (queryParams.query) { if (queryParams.query) {
await new Promise((resolve) => chrome.tabs.sendMessage( await new Promise((resolve) => chrome.tabs.sendMessage(
tab.id, {action: 'searchQueryUpdate', params: {text: queryParams.query}}, resolve tab.id,
{action: 'searchQueryUpdate', params: {text: queryParams.query}},
resolve
)); ));
} }
return true; return true;

View File

@ -118,7 +118,8 @@ class TextSourceRange {
return !( return !(
style.visibility === 'hidden' || style.visibility === 'hidden' ||
style.display === 'none' || style.display === 'none' ||
parseFloat(style.fontSize) === 0); parseFloat(style.fontSize) === 0
);
} }
static getRubyElement(node) { static getRubyElement(node) {