diff --git a/.eslintrc.js b/.eslintrc.js index 06824da09..2cbf93753 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,10 +23,18 @@ module.exports = { 'consistent-return': 0, 'no-var': 2, 'prefer-const': [2, {destructuring: 'all'}], + 'prefer-spread': 1, + 'prefer-rest-params': 1, 'max-len': 0, // lets prettier take care of this indent: 0, // lets prettier take care of this 'no-console': 0, // we're setting window.console in App.js + 'no-multi-spaces': 2, 'prefer-promise-reject-errors': 1, + 'no-extra-boolean-cast': 2, + 'no-extra-semi': 2, + 'no-unsafe-negation': 2, + 'no-useless-computed-key': 2, + 'no-useless-rename': 2, // additional rules for this project 'header/header': [2, 'block', {pattern}], diff --git a/src/dispatcher/plugins.js b/src/dispatcher/plugins.js index 5f6e5532d..7ebe66e34 100644 --- a/src/dispatcher/plugins.js +++ b/src/dispatcher/plugins.js @@ -155,7 +155,7 @@ export const requirePlugin = ( if (plugin.default) { plugin = plugin.default; } - if (!plugin.prototype instanceof FlipperBasePlugin) { + if (!(plugin.prototype instanceof FlipperBasePlugin)) { throw new Error(`Plugin ${plugin.name} is not a FlipperBasePlugin`); } diff --git a/src/plugins/databases/index.js b/src/plugins/databases/index.js index 7497e5119..60d1add10 100644 --- a/src/plugins/databases/index.js +++ b/src/plugins/databases/index.js @@ -276,7 +276,7 @@ class PageInfo extends Component< onSubmit(e: SyntheticKeyboardEvent<>) { if (e.key === 'Enter') { - const rowNumber = parseInt(this.state.inputValue); + const rowNumber = parseInt(this.state.inputValue, 10); console.log(rowNumber); this.props.onChange(rowNumber - 1, this.props.count); this.setState({isOpen: false}); @@ -297,7 +297,7 @@ class PageInfo extends Component<
{this.state.isOpen ? (