From a00aa08be1e90a11ec859d25257f96b2e85a4a7a Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Fri, 10 May 2019 20:09:14 +0100 Subject: [PATCH] typescript-eslint 1.8 (#1648) --- .eslintrc.js | 13 ++++++++----- package.json | 4 ++-- packages/react-data-grid/src/HeaderCell.tsx | 4 ++-- .../src/common/editors/EditorContainer.tsx | 2 +- .../react-data-grid/src/masks/InteractionMasks.tsx | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 98355fc45d..b5be5b6d65 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -164,7 +164,7 @@ const rules = { 'computed-property-spacing': 1, 'consistent-this': 0, 'eol-last': 1, - 'func-call-spacing': 1, + 'func-call-spacing': 0, 'func-name-matching': 0, 'func-names': 0, 'func-style': 0, @@ -227,7 +227,7 @@ const rules = { 'prefer-object-spread': 1, 'quote-props': [1, 'as-needed'], 'quotes': [1, 'single', { avoidEscape: true }], - 'semi': 1, + 'semi': 0, 'semi-spacing': 1, 'semi-style': 1, 'sort-keys': 0, @@ -409,12 +409,13 @@ const rules = { '@typescript-eslint/adjacent-overload-signatures': 1, '@typescript-eslint/array-type': 0, '@typescript-eslint/await-thenable': 0, - '@typescript-eslint/ban-types': 2, '@typescript-eslint/ban-ts-ignore': 1, + '@typescript-eslint/ban-types': 2, '@typescript-eslint/camelcase': 0, '@typescript-eslint/class-name-casing': 0, '@typescript-eslint/explicit-function-return-type': 0, '@typescript-eslint/explicit-member-accessibility': 0, + '@typescript-eslint/func-call-spacing': 1, '@typescript-eslint/generic-type-naming': 0, '@typescript-eslint/indent': [1, 2, { SwitchCase: 1 }], '@typescript-eslint/interface-name-prefix': 0, @@ -425,10 +426,11 @@ const rules = { '@typescript-eslint/no-array-constructor': 2, '@typescript-eslint/no-empty-interface': 2, '@typescript-eslint/no-explicit-any': 2, - '@typescript-eslint/no-extra-parens': 0, // https://github.com/typescript-eslint/typescript-eslint/issues/460 + '@typescript-eslint/no-extra-parens': 0, // https://github.com/typescript-eslint/typescript-eslint/issues/509 '@typescript-eslint/no-extraneous-class': 2, '@typescript-eslint/no-for-in-array': 0, - '@typescript-eslint/no-inferrable-types': 0, + '@typescript-eslint/no-inferrable-types': 1, + '@typescript-eslint/no-magic-numbers': 0, '@typescript-eslint/no-misused-new': 2, '@typescript-eslint/no-namespace': 2, '@typescript-eslint/no-non-null-assertion': 0, @@ -453,6 +455,7 @@ const rules = { '@typescript-eslint/promise-function-async': 0, '@typescript-eslint/require-array-sort-compare': 0, '@typescript-eslint/restrict-plus-operands': 0, + '@typescript-eslint/semi': 1, '@typescript-eslint/type-annotation-spacing': 1, '@typescript-eslint/unbound-method': 0, '@typescript-eslint/unified-signatures': 0 diff --git a/package.json b/package.json index bb763db00d..d4f0923ea2 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "@types/react-dom": "^16.8.3", "@types/react-is": "^16.7.1", "@types/shallowequal": "^1.1.1", - "@typescript-eslint/eslint-plugin": "^1.7.0", - "@typescript-eslint/parser": "^1.7.0", + "@typescript-eslint/eslint-plugin": "^1.8.0", + "@typescript-eslint/parser": "^1.8.0", "babel-loader": "^8.0.5", "clean-css": "^4.2.1", "css-loader": "^2.1.1", diff --git a/packages/react-data-grid/src/HeaderCell.tsx b/packages/react-data-grid/src/HeaderCell.tsx index b4b024169e..5c39c0c770 100644 --- a/packages/react-data-grid/src/HeaderCell.tsx +++ b/packages/react-data-grid/src/HeaderCell.tsx @@ -50,7 +50,7 @@ export default class HeaderCell extends React.Component { event.preventDefault(); window.addEventListener('mousemove', onMouseMove); window.addEventListener('mouseup', onMouseUp); - } + }; private onTouchStart = (event: React.TouchEvent) => { const touch = event.changedTouches[0]; @@ -86,7 +86,7 @@ export default class HeaderCell extends React.Component { window.addEventListener('touchmove', onTouchMove); window.addEventListener('touchend', onTouchEnd); - } + }; private onResize(x: number) { const { onResize } = this.props; diff --git a/packages/react-data-grid/src/common/editors/EditorContainer.tsx b/packages/react-data-grid/src/common/editors/EditorContainer.tsx index 90e369949b..34c0d6e7a3 100644 --- a/packages/react-data-grid/src/common/editors/EditorContainer.tsx +++ b/packages/react-data-grid/src/common/editors/EditorContainer.tsx @@ -243,7 +243,7 @@ export default class EditorContainer extends React.Component { const inputNode = this.getInputNode(); return inputNode instanceof HTMLInputElement && inputNode.selectionStart === inputNode.value.length; - } + }; handleRightClick = (e: React.MouseEvent) => { e.stopPropagation(); diff --git a/packages/react-data-grid/src/masks/InteractionMasks.tsx b/packages/react-data-grid/src/masks/InteractionMasks.tsx index f3df99fc4b..004681943f 100644 --- a/packages/react-data-grid/src/masks/InteractionMasks.tsx +++ b/packages/react-data-grid/src/masks/InteractionMasks.tsx @@ -588,7 +588,7 @@ export default class InteractionMasks extends React.Component { } return null; }); - } + }; handleDragEnd = () => { const { draggedPosition } = this.state;