diff --git a/.eslintrc b/.eslintrc index a80a79c..7b35bc4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -72,6 +72,7 @@ "quotes": ["error", "single", { "allowTemplateLiterals": true }], "require-jsdoc": "off", "require-unicode-regexp": "off", + "semi": "off", "sort-imports": "off", "sort-keys": "off", "sort-vars": "off", @@ -80,6 +81,8 @@ "react/jsx-indent": ["error", 2], "react/prop-types": "off", "react/react-in-jsx-scope": "off", + "@typescript-eslint/no-unused-vars": ["error", { args: "none" }], + "@typescript-eslint/semi": ["error"] } } diff --git a/package-lock.json b/package-lock.json index fad8e5c..00792ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -203,46 +203,45 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.7.0.tgz", - "integrity": "sha512-NUSz1aTlIzzTjFFVFyzrbo8oFjHg3K/M9MzYByqbMCxeFdErhLAcGITVfXzSz+Yvp5OOpMu3HkIttB0NyKl54Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.9.0.tgz", + "integrity": "sha512-FOgfBorxjlBGpDIw+0LaZIXRX6GEEUfzj8LXwaQIUCp+gDOvkI+1WgugJ7SmWiISqK9Vj5r8S7NDKO/LB+6X9A==", "dev": true, "requires": { - "@typescript-eslint/parser": "1.7.0", - "@typescript-eslint/typescript-estree": "1.7.0", + "@typescript-eslint/experimental-utils": "1.9.0", + "@typescript-eslint/parser": "1.9.0", "eslint-utils": "^1.3.1", + "functional-red-black-tree": "^1.0.1", "regexpp": "^2.0.1", "requireindex": "^1.2.0", "tsutils": "^3.7.0" } }, + "@typescript-eslint/experimental-utils": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-1.9.0.tgz", + "integrity": "sha512-1s2dY9XxBwtS9IlSnRIlzqILPyeMly5tz1bfAmQ84Ul687xBBve5YsH5A5EKeIcGurYYqY2w6RkHETXIwnwV0A==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "1.9.0" + } + }, "@typescript-eslint/parser": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.7.0.tgz", - "integrity": "sha512-1QFKxs2V940372srm12ovSE683afqc1jB6zF/f8iKhgLz1yoSjYeGHipasao33VXKI+0a/ob9okeogGdKGvvlg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.9.0.tgz", + "integrity": "sha512-CWgC1XrQ34H/+LwAU7vY5xteZDkNqeAkeidEpJnJgkKu0yqQ3ZhQ7S+dI6MX4vmmM1TKRbOrKuXc6W0fIHhdbA==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "1.7.0", + "@typescript-eslint/experimental-utils": "1.9.0", + "@typescript-eslint/typescript-estree": "1.9.0", "eslint-scope": "^4.0.0", "eslint-visitor-keys": "^1.0.0" - }, - "dependencies": { - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - } } }, "@typescript-eslint/typescript-estree": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.7.0.tgz", - "integrity": "sha512-K5uedUxVmlYrVkFbyV3htDipvLqTE3QMOUQEHYJaKtgzxj6r7c5Ca/DG1tGgFxX+fsbi9nDIrf4arq7Ib7H/Yw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.9.0.tgz", + "integrity": "sha512-7Eg0TEQpCkTsEwsl1lIzd6i7L3pJLQFWesV08dS87bNz0NeSjbL78gNAP1xCKaCejkds4PhpLnZkaAjx9SU8OA==", "dev": true, "requires": { "lodash.unescape": "4.0.1", @@ -2518,6 +2517,16 @@ } } }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, "eslint-utils": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", diff --git a/package.json b/package.json index d12779d..7feeea1 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@types/react-dom": "^16.8.4", "@types/react-redux": "^7.0.8", "@types/redux-promise": "^0.5.28", - "@typescript-eslint/eslint-plugin": "^1.7.0", + "@typescript-eslint/eslint-plugin": "^1.9.0", "chai": "^4.2.0", "css-loader": "^2.1.1", "eslint": "^5.16.0", diff --git a/src/background/domains/CompletionGroup.ts b/src/background/domains/CompletionGroup.ts index 1eea7d8..8e89bf0 100644 --- a/src/background/domains/CompletionGroup.ts +++ b/src/background/domains/CompletionGroup.ts @@ -3,5 +3,4 @@ import CompletionItem from './CompletionItem'; export default interface CompletionGroup { name: string; items: CompletionItem[]; - // eslint-disable-next-line semi } diff --git a/src/background/domains/CompletionItem.ts b/src/background/domains/CompletionItem.ts index 657efaa..96f6ee6 100644 --- a/src/background/domains/CompletionItem.ts +++ b/src/background/domains/CompletionItem.ts @@ -3,5 +3,4 @@ export default interface CompletionItem { readonly content?: string; readonly url?: string; readonly icon?: string; - // eslint-disable-next-line semi } diff --git a/src/background/domains/GlobalMark.ts b/src/background/domains/GlobalMark.ts index 1ae912e..b3fa26a 100644 --- a/src/background/domains/GlobalMark.ts +++ b/src/background/domains/GlobalMark.ts @@ -3,5 +3,4 @@ export default interface GlobalMark { readonly url: string; readonly x: number; readonly y: number; - // eslint-disable-next-line semi } diff --git a/src/console/components/Console.tsx b/src/console/components/Console.tsx index 68cc523..7da2f36 100644 --- a/src/console/components/Console.tsx +++ b/src/console/components/Console.tsx @@ -13,7 +13,7 @@ type StateProps = ReturnType; interface DispatchProps { dispatch: (action: any) => void, } -type Props = StateProps & DispatchProps +type Props = StateProps & DispatchProps; class Console extends React.Component { private input: React.RefObject; diff --git a/src/content/client/AddonIndicatorClient.ts b/src/content/client/AddonIndicatorClient.ts index afb9fa4..b5f7e6a 100644 --- a/src/content/client/AddonIndicatorClient.ts +++ b/src/content/client/AddonIndicatorClient.ts @@ -2,8 +2,6 @@ import * as messages from '../../shared/messages'; export default interface AddonIndicatorClient { setEnabled(enabled: boolean): Promise; - - // eslint-disable-next-line semi } export class AddonIndicatorClientImpl implements AddonIndicatorClient { diff --git a/src/content/client/ConsoleClient.ts b/src/content/client/ConsoleClient.ts index e7046e5..b4fbb04 100644 --- a/src/content/client/ConsoleClient.ts +++ b/src/content/client/ConsoleClient.ts @@ -3,8 +3,6 @@ import * as messages from '../../shared/messages'; export default interface ConsoleClient { info(text: string): Promise; error(text: string): Promise; - - // eslint-disable-next-line semi } export class ConsoleClientImpl implements ConsoleClient { diff --git a/src/content/client/FindClient.ts b/src/content/client/FindClient.ts index 22cd3cb..af0b427 100644 --- a/src/content/client/FindClient.ts +++ b/src/content/client/FindClient.ts @@ -4,8 +4,6 @@ export default interface FindClient { getGlobalLastKeyword(): Promise; setGlobalLastKeyword(keyword: string): Promise; - - // eslint-disable-next-line semi } export class FindClientImpl implements FindClient { diff --git a/src/content/client/FindMasterClient.ts b/src/content/client/FindMasterClient.ts index 0481ec1..9ed38dd 100644 --- a/src/content/client/FindMasterClient.ts +++ b/src/content/client/FindMasterClient.ts @@ -4,8 +4,6 @@ export default interface FindMasterClient { findNext(): void; findPrev(): void; - - // eslint-disable-next-line semi } export class FindMasterClientImpl implements FindMasterClient { diff --git a/src/content/client/FollowMasterClient.ts b/src/content/client/FollowMasterClient.ts index c841902..da75308 100644 --- a/src/content/client/FollowMasterClient.ts +++ b/src/content/client/FollowMasterClient.ts @@ -7,8 +7,6 @@ export default interface FollowMasterClient { responseHintCount(count: number): void; sendKey(key: Key): void; - - // eslint-disable-next-line semi } export class FollowMasterClientImpl implements FollowMasterClient { diff --git a/src/content/client/FollowSlaveClient.ts b/src/content/client/FollowSlaveClient.ts index 0905cd9..4360200 100644 --- a/src/content/client/FollowSlaveClient.ts +++ b/src/content/client/FollowSlaveClient.ts @@ -20,8 +20,6 @@ export default interface FollowSlaveClient { clearHints(): void; activateIfExists(tag: string, newTab: boolean, background: boolean): void; - - // eslint-disable-next-line semi } export class FollowSlaveClientImpl implements FollowSlaveClient { diff --git a/src/content/client/FollowSlaveClientFactory.ts b/src/content/client/FollowSlaveClientFactory.ts index cd331d4..166dfca 100644 --- a/src/content/client/FollowSlaveClientFactory.ts +++ b/src/content/client/FollowSlaveClientFactory.ts @@ -2,8 +2,6 @@ import FollowSlaveClient, { FollowSlaveClientImpl } from './FollowSlaveClient'; export default interface FollowSlaveClientFactory { create(window: Window): FollowSlaveClient; - - // eslint-disable-next-line semi } export class FollowSlaveClientFactoryImpl implements FollowSlaveClientFactory { diff --git a/src/content/client/MarkClient.ts b/src/content/client/MarkClient.ts index b7cf535..c6295c0 100644 --- a/src/content/client/MarkClient.ts +++ b/src/content/client/MarkClient.ts @@ -5,8 +5,6 @@ export default interface MarkClient { setGloablMark(key: string, mark: Mark): Promise; jumpGlobalMark(key: string): Promise; - - // eslint-disable-next-line semi } export class MarkClientImpl implements MarkClient { diff --git a/src/content/client/SettingClient.ts b/src/content/client/SettingClient.ts index c67f544..0850f11 100644 --- a/src/content/client/SettingClient.ts +++ b/src/content/client/SettingClient.ts @@ -3,8 +3,6 @@ import * as messages from '../../shared/messages'; export default interface SettingClient { load(): Promise; - - // eslint-disable-next-line semi } export class SettingClientImpl { diff --git a/src/content/client/TabsClient.ts b/src/content/client/TabsClient.ts index e1af078..39348df 100644 --- a/src/content/client/TabsClient.ts +++ b/src/content/client/TabsClient.ts @@ -2,8 +2,6 @@ import * as messages from '../../shared/messages'; export default interface TabsClient { openUrl(url: string, newTab: boolean, background?: boolean): Promise; - - // eslint-disable-next-line semi } export class TabsClientImpl implements TabsClient { diff --git a/src/content/domains/Key.ts b/src/content/domains/Key.ts index fbbb4bb..b25616e 100644 --- a/src/content/domains/Key.ts +++ b/src/content/domains/Key.ts @@ -4,8 +4,6 @@ export default interface Key { ctrlKey?: boolean; altKey?: boolean; metaKey?: boolean; - - // eslint-disable-next-line semi } const modifiedKeyName = (name: string): string => { diff --git a/src/content/domains/Mark.ts b/src/content/domains/Mark.ts index f1282fc..0c40988 100644 --- a/src/content/domains/Mark.ts +++ b/src/content/domains/Mark.ts @@ -1,6 +1,5 @@ export default interface Mark { x: number; y: number; - // eslint-disable-next-line semi } diff --git a/src/content/presenters/ConsoleFramePresenter.ts b/src/content/presenters/ConsoleFramePresenter.ts index 3c7477b..62db2bb 100644 --- a/src/content/presenters/ConsoleFramePresenter.ts +++ b/src/content/presenters/ConsoleFramePresenter.ts @@ -2,8 +2,6 @@ export default interface ConsoleFramePresenter { initialize(): void; blur(): void; - - // eslint-disable-next-line semi } export class ConsoleFramePresenterImpl implements ConsoleFramePresenter { diff --git a/src/content/presenters/FindPresenter.ts b/src/content/presenters/FindPresenter.ts index d9bc835..f171d2f 100644 --- a/src/content/presenters/FindPresenter.ts +++ b/src/content/presenters/FindPresenter.ts @@ -3,8 +3,6 @@ export default interface FindPresenter { find(keyword: string, backwards: boolean): boolean; clearSelection(): void; - - // eslint-disable-next-line semi } // window.find(aString, aCaseSensitive, aBackwards, aWrapAround, diff --git a/src/content/presenters/FocusPresenter.ts b/src/content/presenters/FocusPresenter.ts index 4cef5bf..7e20cd6 100644 --- a/src/content/presenters/FocusPresenter.ts +++ b/src/content/presenters/FocusPresenter.ts @@ -2,8 +2,6 @@ import * as doms from '../../shared/utils/dom'; export default interface FocusPresenter { focusFirstElement(): boolean; - - // eslint-disable-next-line semi } export class FocusPresenterImpl implements FocusPresenter { diff --git a/src/content/presenters/FollowPresenter.ts b/src/content/presenters/FollowPresenter.ts index f0d115c..0132621 100644 --- a/src/content/presenters/FollowPresenter.ts +++ b/src/content/presenters/FollowPresenter.ts @@ -69,12 +69,10 @@ export default interface FollowPresenter { clearHints(): void; getHint(tag: string): Hint | undefined; - - // eslint-disable-next-line semi } export class FollowPresenterImpl implements FollowPresenter { - private hints: Hint[] + private hints: Hint[]; constructor() { this.hints = []; diff --git a/src/content/presenters/NavigationPresenter.ts b/src/content/presenters/NavigationPresenter.ts index 66110e5..c141112 100644 --- a/src/content/presenters/NavigationPresenter.ts +++ b/src/content/presenters/NavigationPresenter.ts @@ -10,8 +10,6 @@ export default interface NavigationPresenter { openParent(): void; openRoot(): void; - - // eslint-disable-next-line semi } const REL_PATTERN: {[key: string]: RegExp} = { diff --git a/src/content/presenters/ScrollPresenter.ts b/src/content/presenters/ScrollPresenter.ts index 9286fb0..c06efca 100644 --- a/src/content/presenters/ScrollPresenter.ts +++ b/src/content/presenters/ScrollPresenter.ts @@ -106,8 +106,6 @@ export default interface ScrollPresenter { scrollToBottom(smooth: boolean): void; scrollToHome(smooth: boolean): void; scrollToEnd(smooth: boolean): void; - - // eslint-disable-next-line semi } export class ScrollPresenterImpl { diff --git a/src/content/repositories/AddonEnabledRepository.ts b/src/content/repositories/AddonEnabledRepository.ts index 4eaabb1..7921bdb 100644 --- a/src/content/repositories/AddonEnabledRepository.ts +++ b/src/content/repositories/AddonEnabledRepository.ts @@ -4,8 +4,6 @@ export default interface AddonEnabledRepository { set(on: boolean): void; get(): boolean; - - // eslint-disable-next-line semi } export class AddonEnabledRepositoryImpl implements AddonEnabledRepository { diff --git a/src/content/repositories/ClipboardRepository.ts b/src/content/repositories/ClipboardRepository.ts index 747ae6a..a046851 100644 --- a/src/content/repositories/ClipboardRepository.ts +++ b/src/content/repositories/ClipboardRepository.ts @@ -2,8 +2,6 @@ export default interface ClipboardRepository { read(): string; write(text: string): void; - - // eslint-disable-next-line semi } export class ClipboardRepositoryImpl { diff --git a/src/content/repositories/FindRepository.ts b/src/content/repositories/FindRepository.ts index 85eca40..aeb200f 100644 --- a/src/content/repositories/FindRepository.ts +++ b/src/content/repositories/FindRepository.ts @@ -2,8 +2,6 @@ export default interface FindRepository { getLastKeyword(): string | null; setLastKeyword(keyword: string): void; - - // eslint-disable-next-line semi } let current: string | null = null; diff --git a/src/content/repositories/FollowKeyRepository.ts b/src/content/repositories/FollowKeyRepository.ts index a671b5c..07ceec7 100644 --- a/src/content/repositories/FollowKeyRepository.ts +++ b/src/content/repositories/FollowKeyRepository.ts @@ -6,8 +6,6 @@ export default interface FollowKeyRepository { popKey(): void; clearKeys(): void; - - // eslint-disable-next-line semi } const current: { diff --git a/src/content/repositories/FollowMasterRepository.ts b/src/content/repositories/FollowMasterRepository.ts index a964953..da2402c 100644 --- a/src/content/repositories/FollowMasterRepository.ts +++ b/src/content/repositories/FollowMasterRepository.ts @@ -12,8 +12,6 @@ export default interface FollowMasterRepository { getCurrentNewTabMode(): boolean; getCurrentBackgroundMode(): boolean; - - // eslint-disable-next-line semi } const current: { diff --git a/src/content/repositories/FollowSlaveRepository.ts b/src/content/repositories/FollowSlaveRepository.ts index 4c2de72..42a0710 100644 --- a/src/content/repositories/FollowSlaveRepository.ts +++ b/src/content/repositories/FollowSlaveRepository.ts @@ -4,8 +4,6 @@ export default interface FollowSlaveRepository { disableFollowMode(): void; isFollowMode(): boolean; - - // eslint-disable-next-line semi } const current: { diff --git a/src/content/repositories/KeymapRepository.ts b/src/content/repositories/KeymapRepository.ts index 770ba0b..d7b5b7d 100644 --- a/src/content/repositories/KeymapRepository.ts +++ b/src/content/repositories/KeymapRepository.ts @@ -5,8 +5,6 @@ export default interface KeymapRepository { enqueueKey(key: Key): KeySequence; clear(): void; - - // eslint-disable-next-line semi } let current: KeySequence = KeySequence.from([]); diff --git a/src/content/repositories/MarkKeyRepository.ts b/src/content/repositories/MarkKeyRepository.ts index c24548a..0b24af2 100644 --- a/src/content/repositories/MarkKeyRepository.ts +++ b/src/content/repositories/MarkKeyRepository.ts @@ -10,8 +10,6 @@ export default interface MarkKeyRepository { enableJumpMode(): void; disabeJumpMode(): void; - - // eslint-disable-next-line semi } interface Mode { diff --git a/src/content/repositories/MarkRepository.ts b/src/content/repositories/MarkRepository.ts index ed5afe2..678abc4 100644 --- a/src/content/repositories/MarkRepository.ts +++ b/src/content/repositories/MarkRepository.ts @@ -4,8 +4,6 @@ export default interface MarkRepository { set(key: string, mark: Mark): void; get(key: string): Mark | null; - - // eslint-disable-next-line semi } const saved: {[key: string]: Mark} = {}; diff --git a/src/content/repositories/SettingRepository.ts b/src/content/repositories/SettingRepository.ts index 711b2a2..d718794 100644 --- a/src/content/repositories/SettingRepository.ts +++ b/src/content/repositories/SettingRepository.ts @@ -6,8 +6,6 @@ export default interface SettingRepository { set(setting: Settings): void; get(): Settings; - - // eslint-disable-next-line semi } export class SettingRepositoryImpl implements SettingRepository { diff --git a/src/settings/components/form/KeymapsForm.tsx b/src/settings/components/form/KeymapsForm.tsx index ad4d0e7..3cba0c0 100644 --- a/src/settings/components/form/KeymapsForm.tsx +++ b/src/settings/components/form/KeymapsForm.tsx @@ -15,7 +15,7 @@ class KeymapsForm extends React.Component { value: FormKeymaps.valueOf({}), onChange: () => {}, onBlur: () => {}, - } + }; render() { let values = this.props.value.toJSON(); diff --git a/src/settings/components/form/SearchForm.tsx b/src/settings/components/form/SearchForm.tsx index 67dbeba..cf78a69 100644 --- a/src/settings/components/form/SearchForm.tsx +++ b/src/settings/components/form/SearchForm.tsx @@ -15,7 +15,7 @@ class SearchForm extends React.Component { value: FormSearch.valueOf({ default: '', engines: []}), onChange: () => {}, onBlur: () => {}, - } + }; render() { let value = this.props.value.toJSON(); diff --git a/src/shared/Settings.ts b/src/shared/Settings.ts index e35094b..c1b5a51 100644 --- a/src/shared/Settings.ts +++ b/src/shared/Settings.ts @@ -19,7 +19,6 @@ export default interface Settings { search: Search; properties: Properties; blacklist: string[]; - // eslint-disable-next-line semi } const DefaultProperties: Properties = PropertyDefs.defs.reduce(