Eslint tweaks (#696)
* make eslint styleguide into warnings & drop no-else-return * reintroduce max-warnings=0 * remove unnecessary eslint line disable * reintroduce no-else-return rule
This commit is contained in:
parent
2dd1796351
commit
b7a6ceba68
@ -7,7 +7,7 @@ const cli = new CLIEngine({});
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
"*.{js,ts,tsx}": files => {
|
"*.{js,ts,tsx}": files => {
|
||||||
return (
|
return (
|
||||||
"eslint --fix " + files.filter(file => !cli.isPathIgnored(file)).join(" ")
|
"eslint --max-warnings=0 --fix " + files.filter(file => !cli.isPathIgnored(file)).join(" ")
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
"*.{css,scss,json,md,html,yml}": ["prettier --write"],
|
"*.{css,scss,json,md,html,yml}": ["prettier --write"],
|
||||||
|
14
package.json
14
package.json
@ -39,9 +39,9 @@
|
|||||||
"prettier"
|
"prettier"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"curly": "error",
|
"curly": "warn",
|
||||||
"no-console": [
|
"no-console": [
|
||||||
"error",
|
"warn",
|
||||||
{
|
{
|
||||||
"allow": [
|
"allow": [
|
||||||
"warn",
|
"warn",
|
||||||
@ -50,16 +50,16 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"no-else-return": "error",
|
"no-else-return": "warn",
|
||||||
"no-useless-return": "error",
|
"no-useless-return": "warn",
|
||||||
"prefer-const": [
|
"prefer-const": [
|
||||||
"error",
|
"warn",
|
||||||
{
|
{
|
||||||
"destructuring": "all"
|
"destructuring": "all"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"prefer-template": "error",
|
"prefer-template": "warn",
|
||||||
"prettier/prettier": "error"
|
"prettier/prettier": "warn"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"homepage": "https://excalidraw.com",
|
"homepage": "https://excalidraw.com",
|
||||||
|
@ -62,10 +62,8 @@ export function parseClipboardEvent(
|
|||||||
const text = e.clipboardData?.getData("text/plain").trim();
|
const text = e.clipboardData?.getData("text/plain").trim();
|
||||||
if (text && !PREFER_APP_CLIPBOARD) {
|
if (text && !PREFER_APP_CLIPBOARD) {
|
||||||
return { text };
|
return { text };
|
||||||
// eslint-disable-next-line no-else-return
|
|
||||||
} else {
|
|
||||||
return getAppClipboard();
|
|
||||||
}
|
}
|
||||||
|
return getAppClipboard();
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user