mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-20 15:26:06 +08:00
Fix linter issues
This commit is contained in:
parent
7906e3303d
commit
e87e67cea3
44
.eslintrc
44
.eslintrc
|
@ -2,7 +2,14 @@
|
||||||
"parser": "babel-eslint",
|
"parser": "babel-eslint",
|
||||||
"extends": "airbnb",
|
"extends": "airbnb",
|
||||||
"globals": {
|
"globals": {
|
||||||
"NylasError": false,
|
"NylasEnv": false,
|
||||||
|
"$n": false,
|
||||||
|
"waitsForPromise": false,
|
||||||
|
"advanceClock": false,
|
||||||
|
"TEST_ACCOUNT_ID": false,
|
||||||
|
"TEST_ACCOUNT_NAME": false,
|
||||||
|
"TEST_ACCOUNT_EMAIL": false,
|
||||||
|
"TEST_ACCOUNT_ALIAS_EMAIL": false
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
|
@ -11,28 +18,57 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"arrow-body-style": "off",
|
"arrow-body-style": "off",
|
||||||
|
"arrow-parens": "off",
|
||||||
|
"class-methods-use-this": "off",
|
||||||
"prefer-arrow-callback": ["error", {"allowNamedFunctions": true}],
|
"prefer-arrow-callback": ["error", {"allowNamedFunctions": true}],
|
||||||
"eqeqeq": ["error", "smart"],
|
"eqeqeq": ["error", "smart"],
|
||||||
"id-length": "off",
|
"id-length": "off",
|
||||||
"object-curly-spacing": "off",
|
"object-curly-spacing": "off",
|
||||||
"max-len": "off",
|
"max-len": "off",
|
||||||
"new-cap": ["error", {"capIsNew": false}],
|
"new-cap": ["error", {"capIsNew": false}],
|
||||||
|
"newline-per-chained-call": "off",
|
||||||
|
"no-bitwise": "off",
|
||||||
|
"no-lonely-if": "off",
|
||||||
|
"no-console": "off",
|
||||||
|
"no-continue": "off",
|
||||||
"no-constant-condition": "off",
|
"no-constant-condition": "off",
|
||||||
"no-loop-func": "off",
|
"no-loop-func": "off",
|
||||||
|
"no-plusplus": "off",
|
||||||
"no-shadow": "error",
|
"no-shadow": "error",
|
||||||
"no-underscore-dangle": "off",
|
"no-underscore-dangle": "off",
|
||||||
"object-shorthand": "off",
|
"object-shorthand": "off",
|
||||||
"quotes": "off",
|
"quotes": "off",
|
||||||
"global-require": "off",
|
|
||||||
"quote-props": ["error", "consistent-as-needed", { "keywords": true }],
|
"quote-props": ["error", "consistent-as-needed", { "keywords": true }],
|
||||||
"no-param-reassign": ["error", { "props": false }],
|
"no-param-reassign": ["error", { "props": false }],
|
||||||
"semi": "off",
|
"semi": "off",
|
||||||
"import/no-unresolved": ["error", {"ignore": ["nylas-exports", "nylas-component-kit", "electron", "nylas-store", "react-dom/server", "nylas-observables", "windows-shortcuts", "moment-round", "chrono-node", "event-kit", "enzyme"]}],
|
"no-mixed-operators": "off",
|
||||||
|
"import/extensions": ["error", "never", { "json": "always" }],
|
||||||
|
"import/no-unresolved": ["error", {"ignore": ["nylas-exports", "nylas-component-kit", "electron", "nylas-store", "react-dom/server", "nylas-observables", "windows-shortcuts", "moment-round", "better-sqlite3", "chrono-node", "event-kit", "enzyme"]}],
|
||||||
|
"import/no-extraneous-dependencies": "off",
|
||||||
|
"import/newline-after-import": "off",
|
||||||
|
"import/prefer-default-export": "off",
|
||||||
"react/no-multi-comp": "off",
|
"react/no-multi-comp": "off",
|
||||||
|
"react/no-find-dom-node": "off",
|
||||||
|
"react/no-string-refs": "off",
|
||||||
|
"react/no-unused-prop-types": "off",
|
||||||
|
"react/forbid-prop-types": "off",
|
||||||
|
"jsx-a11y/no-static-element-interactions": "off",
|
||||||
"react/prop-types": ["error", {"ignore": ["children"]}],
|
"react/prop-types": ["error", {"ignore": ["children"]}],
|
||||||
"react/sort-comp": "error"
|
"react/sort-comp": "error",
|
||||||
|
"no-restricted-syntax": [
|
||||||
|
"error", "ForInStatement", "LabeledStatement", "WithStatement"
|
||||||
|
],
|
||||||
|
"comma-dangle": ["error", {
|
||||||
|
"arrays": "always-multiline",
|
||||||
|
"objects": "always-multiline",
|
||||||
|
"imports": "always-multiline",
|
||||||
|
"exports": "always-multiline",
|
||||||
|
"functions": "ignore"
|
||||||
|
}],
|
||||||
|
"no-useless-return": "off"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
|
"import/core-modules": [ "nylas-exports", "nylas-component-kit", "electron", "nylas-store", "nylas-observables" ],
|
||||||
"import/resolver": {"node": {"extensions": [".es6", ".jsx", ".coffee", ".json", ".cjsx", ".js"]}}
|
"import/resolver": {"node": {"extensions": [".es6", ".jsx", ".coffee", ".json", ".cjsx", ".js"]}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
14
package.json
14
package.json
|
@ -22,13 +22,13 @@
|
||||||
"utf7": "https://github.com/truebit/utf7/archive/1f753bac59b99d93b17a5ef11681e232465e2558.tar.gz"
|
"utf7": "https://github.com/truebit/utf7/archive/1f753bac59b99d93b17a5ef11681e232465e2558.tar.gz"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "6.x",
|
"babel-eslint": "7.1.0",
|
||||||
"eslint": "2.x",
|
"eslint": "3.10.1",
|
||||||
"eslint-config-airbnb": "8.x",
|
"eslint_d": "4.2.0",
|
||||||
"eslint-plugin-import": "1.x",
|
"eslint-config-airbnb": "13.0.0",
|
||||||
"eslint-plugin-jsx-a11y": "1.x",
|
"eslint-plugin-import": "2.2.0",
|
||||||
"eslint-plugin-react": "5.x",
|
"eslint-plugin-jsx-a11y": "2.2.3",
|
||||||
"eslint_d": "3.x",
|
"eslint-plugin-react": "6.7.1",
|
||||||
"sqlite3": "https://github.com/bengotow/node-sqlite3/archive/bengotow/usleep-v3.1.4.tar.gz"
|
"sqlite3": "https://github.com/bengotow/node-sqlite3/archive/bengotow/usleep-v3.1.4.tar.gz"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -37,7 +37,7 @@ class Dropdown extends React.Component {
|
||||||
);
|
);
|
||||||
|
|
||||||
// All options, not shown if dropdown is closed
|
// All options, not shown if dropdown is closed
|
||||||
let options = [];
|
const options = [];
|
||||||
let optionsWrapper = <span className="dropdown-options" />;
|
let optionsWrapper = <span className="dropdown-options" />;
|
||||||
if (!this.state.closed) {
|
if (!this.state.closed) {
|
||||||
for (const opt of this.props.options) {
|
for (const opt of this.props.options) {
|
||||||
|
|
|
@ -28,7 +28,7 @@ class ElapsedTime extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <span ref="timestamp"></span>
|
return <span ref="timestamp" />
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ class MiniAccount extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let errorClass;
|
let errorClass;
|
||||||
let style = {};
|
const style = {};
|
||||||
if (this.props.account.sync_error) {
|
if (this.props.account.sync_error) {
|
||||||
errorClass = 'errored';
|
errorClass = 'errored';
|
||||||
} else {
|
} else {
|
||||||
|
@ -28,7 +28,7 @@ class MiniAccount extends React.Component {
|
||||||
<div
|
<div
|
||||||
className={`mini-account ${errorClass}`}
|
className={`mini-account ${errorClass}`}
|
||||||
style={style}
|
style={style}
|
||||||
></div>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,8 @@ class Modal extends React.Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
open: false,
|
open: false,
|
||||||
onOpen: props.onOpen || () => {},
|
onOpen: props.onOpen || (() => {}),
|
||||||
onClose: props.onClose || () => {},
|
onClose: props.onClose || (() => {}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ class SetAllSyncPolicies extends React.Component {
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<h3>Sync Policy</h3>
|
<h3>Sync Policy</h3>
|
||||||
<textarea id="sync-policy-all"></textarea>
|
<textarea id="sync-policy-all" />
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ class SyncGraph extends React.Component {
|
||||||
height={SyncGraph.config.height + SyncGraph.config.labelFontSize + SyncGraph.config.labelTopMargin}
|
height={SyncGraph.config.height + SyncGraph.config.labelFontSize + SyncGraph.config.labelTopMargin}
|
||||||
className="sync-graph"
|
className="sync-graph"
|
||||||
syncTimestamps={this.props.syncTimestamps}
|
syncTimestamps={this.props.syncTimestamps}
|
||||||
></canvas>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ class SyncbackRequestDetails extends React.Component {
|
||||||
title={`${this.state.counts.new} out of ${total}`}
|
title={`${this.state.counts.new} out of ${total}`}
|
||||||
>
|
>
|
||||||
{/* .new was throwing off my syntax higlighting, so ignoring linter*/}
|
{/* .new was throwing off my syntax higlighting, so ignoring linter*/}
|
||||||
{this.state.counts['new'] / total * 100}% are still new
|
{this.state.counts.new / total * 100}% are still new
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
@ -104,7 +104,7 @@ class SyncbackRequestDetails extends React.Component {
|
||||||
if (this.state.statusFilter !== 'all') {
|
if (this.state.statusFilter !== 'all') {
|
||||||
reqs = reqs.filter((req) => req.status === this.state.statusFilter);
|
reqs = reqs.filter((req) => req.status === this.state.statusFilter);
|
||||||
}
|
}
|
||||||
let rows = [];
|
const rows = [];
|
||||||
if (reqs.length === 0) {
|
if (reqs.length === 0) {
|
||||||
rows.push(<tr><td>No results</td><td>-</td><td>-</td></tr>);
|
rows.push(<tr><td>No results</td><td>-</td><td>-</td></tr>);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue