From d185518911ac8d54c4b1b7e0e555f18c62ba51b1 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Sun, 17 Jun 2018 18:14:19 +0530 Subject: [PATCH] eslint fixes --- .eslintrc.json | 18 +- package.json | 2 +- src/components/Alerts.jsx | 1 - src/components/ContentWrap.jsx | 9 +- src/components/CssSettingsModal.jsx | 6 +- src/components/Footer.jsx | 8 +- src/components/HelpModal.jsx | 348 +++-- src/components/KeyboardShortcutsModal.jsx | 176 +-- src/components/Notifications.jsx | 1628 +++++++++++---------- src/components/Profile.jsx | 58 +- src/components/SavedItemPane.jsx | 2 +- src/components/SupportDeveloperModal.jsx | 14 +- src/components/app.jsx | 9 +- 13 files changed, 1207 insertions(+), 1072 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 639ad0e..1e445aa 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,7 +3,7 @@ "browser": true }, "parser": "babel-eslint", - "extends": "eslint:recommended", + "extends": ["eslint:recommended", "eslint-config-synacor"], "rules": { "accessor-pairs": "error", @@ -26,7 +26,13 @@ "eol-last": "off", "eqeqeq": "error", "func-names": "off", - "func-style": ["error", "declaration", { "allowArrowFunctions": true }], + "func-style": [ + "error", + "declaration", + { + "allowArrowFunctions": true + } + ], "generator-star-spacing": "error", "global-require": "off", "guard-for-in": "error", @@ -165,7 +171,7 @@ "before": false } ], - "sort-imports": "error", + "sort-imports": "off", "sort-vars": "off", "strict": ["error", "never"], "template-curly-spacing": "error", @@ -174,7 +180,11 @@ "vars-on-top": "off", "wrap-regex": "error", "yield-star-spacing": "error", - "yoda": ["error", "never"] + "yoda": ["error", "never"], + "brace-style": "off", + "lines-around-comment": "off", + "react/sort-comp": "off", + "react/jsx-no-bind": "off" }, "globals": { "ArrayBuffer": true, diff --git a/package.json b/package.json index 27593ee..12c1bc8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "preact build --template src/index.html --no-prerender", "serve": "preact build && preact serve", "dev": "preact watch --template src/index.html --https --no-prerender", - "lint": "eslint src", + "lint": "eslint src/components/*.jsx", "test": "jest ./tests", "precommit": "lint-staged" }, diff --git a/src/components/Alerts.jsx b/src/components/Alerts.jsx index 138309a..860a535 100644 --- a/src/components/Alerts.jsx +++ b/src/components/Alerts.jsx @@ -1,5 +1,4 @@ import { h, Component } from 'preact'; -import { log } from '../utils'; export class Alerts extends Component { shouldComponentUpdate(nextProps, nextState) { diff --git a/src/components/ContentWrap.jsx b/src/components/ContentWrap.jsx index aec5d0b..91ba47a 100644 --- a/src/components/ContentWrap.jsx +++ b/src/components/ContentWrap.jsx @@ -2,7 +2,7 @@ import { h, Component } from 'preact'; import UserCodeMirror from './UserCodeMirror.jsx'; import { computeHtml, computeCss, computeJs } from '../computes'; import { modes, HtmlModes, CssModes, JsModes } from '../codeModes'; -import { log, writeFile, loadJS, getCompleteHtml, BASE_PATH } from '../utils'; +import { log, writeFile, loadJS, getCompleteHtml } from '../utils'; import { SplitPane } from './SplitPane.jsx'; import { trackEvent } from '../analytics'; import CodeMirror from '../CodeMirror'; @@ -40,8 +40,8 @@ export default class ContentWrap extends Component { return ( this.state.isConsoleOpen !== nextState.isConsoleOpen || this.state.isCssSettingsModalOpen !== nextState.isCssSettingsModalOpen || - this.state.codeSplitSizes != nextState.codeSplitSizes || - this.state.mainSplitSizes != nextState.mainSplitSizes || + this.state.codeSplitSizes !== nextState.codeSplitSizes || + this.state.mainSplitSizes !== nextState.mainSplitSizes || this.props.currentLayoutMode !== nextProps.currentLayoutMode || this.props.currentItem !== nextProps.currentItem ); @@ -420,9 +420,8 @@ export default class ContentWrap extends Component { getCodeSplitSizes() { if (this.props.currentItem && this.props.currentItem.sizes) { return this.props.currentItem.sizes; - } else { - return [33.33, 33.33, 33.33]; } + return [33.33, 33.33, 33.33]; } mainSplitDragEndHandler() { diff --git a/src/components/CssSettingsModal.jsx b/src/components/CssSettingsModal.jsx index 4f41876..36e43a5 100644 --- a/src/components/CssSettingsModal.jsx +++ b/src/components/CssSettingsModal.jsx @@ -22,7 +22,11 @@ export default class CssSettingsModal extends Component {

Atomic CSS Settings

Configure Atomizer settings.{' '} - + Read more {' '} about available settings. diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index df873f7..c68eab7 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -148,7 +148,11 @@ export default class Footer extends Component { - +