diff --git a/.eslintrc.js b/.eslintrc.js index 89993b30..3b60fc0a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -58,11 +58,17 @@ module.exports = { "args": "none", "caughtErrors": "all", "ignoreRestSiblings": false, - }], + }], 'brace-style': 'off', 'no-throw-literal': 'error', 'no-var': 'error', 'prefer-const': 'error', + 'no-cond-assign': 'error', + 'no-multi-assign': 'error', + 'no-unused-expressions': ['error', { + "allowShortCircuit": true, + "allowTernary": true, + }], curly: 'error', eqeqeq: ['error', 'always'], semi: 'off', diff --git a/e2e/tests/auth.test.ts b/e2e/tests/auth.test.ts index 1fc0e7ca..e631c5ff 100644 --- a/e2e/tests/auth.test.ts +++ b/e2e/tests/auth.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-expressions */ import { expect } from 'chai'; import { before, after, EditorView, Workbench, By, ActivityBar, SideBarView } from 'vscode-extension-tester'; diff --git a/e2e/tests/no-auth.test.ts b/e2e/tests/no-auth.test.ts index 12079d0c..90ff5152 100644 --- a/e2e/tests/no-auth.test.ts +++ b/e2e/tests/no-auth.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-expressions */ import { expect } from 'chai'; import { before, ActivityBar, after, SideBarView, By, EditorView, Workbench } from 'vscode-extension-tester'; diff --git a/src/bitbucket/bitbucket-server/pullRequests.test.ts b/src/bitbucket/bitbucket-server/pullRequests.test.ts index bfa69c1f..0e3810e0 100644 --- a/src/bitbucket/bitbucket-server/pullRequests.test.ts +++ b/src/bitbucket/bitbucket-server/pullRequests.test.ts @@ -18,7 +18,7 @@ import { AxiosResponse } from 'axios'; describe('ServerPullRequestApi', () => { let api: ServerPullRequestApi; - let mockClient: HTTPClient = new HTTPClient('', '', '', async (errJson: AxiosResponse) => Error('some error')); + const mockClient: HTTPClient = new HTTPClient('', '', '', async (errJson: AxiosResponse) => Error('some error')); let site: BitbucketSite; beforeEach(() => { diff --git a/src/lib/.eslintrc.js b/src/lib/.eslintrc.js index 91c5d688..2f6ed61d 100644 --- a/src/lib/.eslintrc.js +++ b/src/lib/.eslintrc.js @@ -2,6 +2,11 @@ module.exports = { rules: { 'no-var': 'error', 'prefer-const': 'error', + 'no-multi-assign': 'error', + 'no-unused-expressions': ['error', { + "allowShortCircuit": true, + "allowTernary": true, + }], 'no-restricted-imports': [ 'error', { diff --git a/src/react/.eslintrc.js b/src/react/.eslintrc.js index 26e89ffa..895a05bc 100644 --- a/src/react/.eslintrc.js +++ b/src/react/.eslintrc.js @@ -2,6 +2,11 @@ module.exports = { rules: { 'no-var': 'error', 'prefer-const': 'error', + 'no-multi-assign': 'error', + 'no-unused-expressions': ['error', { + "allowShortCircuit": true, + "allowTernary": true, + }], 'no-restricted-imports': [ 'error', { diff --git a/src/webviews/components/issue/TextAreaEditor.tsx b/src/webviews/components/issue/TextAreaEditor.tsx index e15479d5..6aadb8c9 100644 --- a/src/webviews/components/issue/TextAreaEditor.tsx +++ b/src/webviews/components/issue/TextAreaEditor.tsx @@ -15,7 +15,8 @@ export const TextAreaEditor: React.FC = ({ value, disabled, placeholder, useEffect(() => { if (inputTextAreaRef.current && cursorPosition > 0) { - inputTextAreaRef.current.selectionStart = inputTextAreaRef.current.selectionEnd = cursorPosition; + inputTextAreaRef.current.selectionEnd = cursorPosition; + inputTextAreaRef.current.selectionStart = cursorPosition; inputTextAreaRef.current.focus(); } }, [inputTextAreaRef, cursorPosition]);