Fix linter issues

This commit is contained in:
Ben Gotow 2016-11-21 14:00:32 -08:00
parent 7906e3303d
commit e87e67cea3
9 changed files with 57 additions and 21 deletions

View file

@ -2,7 +2,14 @@
"parser": "babel-eslint",
"extends": "airbnb",
"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": {
"browser": true,
@ -11,28 +18,57 @@
},
"rules": {
"arrow-body-style": "off",
"arrow-parens": "off",
"class-methods-use-this": "off",
"prefer-arrow-callback": ["error", {"allowNamedFunctions": true}],
"eqeqeq": ["error", "smart"],
"id-length": "off",
"object-curly-spacing": "off",
"max-len": "off",
"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-loop-func": "off",
"no-plusplus": "off",
"no-shadow": "error",
"no-underscore-dangle": "off",
"object-shorthand": "off",
"quotes": "off",
"global-require": "off",
"quote-props": ["error", "consistent-as-needed", { "keywords": true }],
"no-param-reassign": ["error", { "props": false }],
"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-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/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": {
"import/core-modules": [ "nylas-exports", "nylas-component-kit", "electron", "nylas-store", "nylas-observables" ],
"import/resolver": {"node": {"extensions": [".es6", ".jsx", ".coffee", ".json", ".cjsx", ".js"]}}
}
}

View file

@ -22,13 +22,13 @@
"utf7": "https://github.com/truebit/utf7/archive/1f753bac59b99d93b17a5ef11681e232465e2558.tar.gz"
},
"devDependencies": {
"babel-eslint": "6.x",
"eslint": "2.x",
"eslint-config-airbnb": "8.x",
"eslint-plugin-import": "1.x",
"eslint-plugin-jsx-a11y": "1.x",
"eslint-plugin-react": "5.x",
"eslint_d": "3.x",
"babel-eslint": "7.1.0",
"eslint": "3.10.1",
"eslint_d": "4.2.0",
"eslint-config-airbnb": "13.0.0",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.7.1",
"sqlite3": "https://github.com/bengotow/node-sqlite3/archive/bengotow/usleep-v3.1.4.tar.gz"
},
"scripts": {

View file

@ -37,7 +37,7 @@ class Dropdown extends React.Component {
);
// All options, not shown if dropdown is closed
let options = [];
const options = [];
let optionsWrapper = <span className="dropdown-options" />;
if (!this.state.closed) {
for (const opt of this.props.options) {

View file

@ -28,7 +28,7 @@ class ElapsedTime extends React.Component {
}
render() {
return <span ref="timestamp"></span>
return <span ref="timestamp" />
}
}

View file

@ -16,7 +16,7 @@ class MiniAccount extends React.Component {
render() {
let errorClass;
let style = {};
const style = {};
if (this.props.account.sync_error) {
errorClass = 'errored';
} else {
@ -28,7 +28,7 @@ class MiniAccount extends React.Component {
<div
className={`mini-account ${errorClass}`}
style={style}
></div>
/>
)
}
}

View file

@ -5,8 +5,8 @@ class Modal extends React.Component {
super(props);
this.state = {
open: false,
onOpen: props.onOpen || () => {},
onClose: props.onClose || () => {},
onOpen: props.onOpen || (() => {}),
onClose: props.onClose || (() => {}),
}
}

View file

@ -46,7 +46,7 @@ class SetAllSyncPolicies extends React.Component {
]}
>
<h3>Sync Policy</h3>
<textarea id="sync-policy-all"></textarea>
<textarea id="sync-policy-all" />
</Modal>
)
}

View file

@ -87,7 +87,7 @@ class SyncGraph extends React.Component {
height={SyncGraph.config.height + SyncGraph.config.labelFontSize + SyncGraph.config.labelTopMargin}
className="sync-graph"
syncTimestamps={this.props.syncTimestamps}
></canvas>
/>
)
}

View file

@ -91,7 +91,7 @@ class SyncbackRequestDetails extends React.Component {
title={`${this.state.counts.new} out of ${total}`}
>
{/* .new was throwing off my syntax higlighting, so ignoring linter*/}
{this.state.counts['new'] / total * 100}&#37; are still new
{this.state.counts.new / total * 100}&#37; are still new
</span>
</div>
)
@ -104,7 +104,7 @@ class SyncbackRequestDetails extends React.Component {
if (this.state.statusFilter !== 'all') {
reqs = reqs.filter((req) => req.status === this.state.statusFilter);
}
let rows = [];
const rows = [];
if (reqs.length === 0) {
rows.push(<tr><td>No results</td><td>-</td><td>-</td></tr>);
}