From 50c84589b3f2aa46737b5f983428f1899da6a43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Mar=C3=A9chal?= Date: Fri, 10 Jan 2020 08:18:40 -0500 Subject: [PATCH] use tsc build mode + eslint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. use tsc build mode Packages are built in topological order, one after the other. Typescript recently added a "build" mode, that allows us to somewhat link all the packages together into one compilation step, speeding up compilation time. This commit makes use of this by rewiring the monorepo to use tsc build and incremental mode. Reworked a few scripts to accomodate with the new build method. 2. replace tslint with eslint Convert most tslint rules to eslint, changed most inline comments in the sources as well. Some tslint rules still work, hence why you will be able to see `// tslint` comments. Unfortunately, there is an outstanding issue regarding eslint performance on large typescript monorepos, so we should fallback to linting all packages individually until this is fixed. Signed-off-by: Paul Maréchal --- .eslintrc.js | 17 + .gitignore | 2 + .vscode/settings.json | 47 +- compile.tsconfig.json | 162 +++++ configs/base.eslintrc.json | 25 + configs/base.tsconfig.json | 2 +- configs/build.eslintrc.json | 6 + configs/build.tslint.json | 8 - configs/errors.eslintrc.json | 123 ++++ configs/errors.tslint.json | 159 ----- configs/warnings.eslintrc.json | 6 + configs/warnings.tslint.json | 15 - dev-packages/application-manager/.eslintrc.js | 9 + .../application-manager/compile.tsconfig.json | 8 +- dev-packages/application-manager/package.json | 4 +- .../src/generator/abstract-generator.ts | 2 +- .../src/generator/frontend-generator.ts | 4 +- dev-packages/application-package/.eslintrc.js | 9 + .../application-package/compile.tsconfig.json | 6 +- dev-packages/application-package/package.json | 4 +- .../src/application-package.ts | 2 +- .../src/application-props.ts | 4 +- .../application-package/src/environment.ts | 4 +- .../src/extension-package-collector.ts | 2 +- .../application-package/src/json-file.ts | 2 +- .../application-package/src/npm-registry.ts | 2 +- dev-packages/cli/.eslintrc.js | 9 + dev-packages/cli/compile.tsconfig.json | 11 +- dev-packages/cli/package.json | 10 +- dev-packages/cli/src/theia.ts | 2 +- dev-packages/electron/.eslintrc.js | 9 + dev-packages/ext-scripts/package.json | 28 +- .../ext-scripts/{theiaext => theia-ext.js} | 35 +- .../ext-scripts/{theia-run => theia-run.js} | 3 +- examples/api-samples/.eslintrc.js | 9 + examples/api-samples/compile.tsconfig.json | 6 + examples/api-samples/package.json | 5 +- .../src/browser/api-samples-contribution.ts | 2 +- examples/browser/.eslintrc.js | 9 + examples/browser/compile.tsconfig.json | 144 +++++ examples/browser/package.json | 5 +- .../test/left-panel/left-panel.ui-spec.ts | 2 +- .../test/main-page/main-page.ui-spec.ts | 2 +- .../test/right-panel/right-panel.ui-spec.ts | 2 +- .../test/top-panel/top-panel.ui-spec.ts | 2 +- examples/electron/.eslintrc.js | 9 + examples/electron/compile.tsconfig.json | 141 +++++ examples/electron/package.json | 5 +- examples/electron/test/basic-example.espec.ts | 2 +- package.json | 27 +- packages/callhierarchy/.eslintrc.js | 9 + packages/callhierarchy/compile.tsconfig.json | 31 +- packages/callhierarchy/package.json | 4 +- .../src/browser/callhierarchy-context.ts | 2 +- .../callhierarchy-tree-widget.tsx | 6 +- packages/console/.eslintrc.js | 9 + packages/console/compile.tsconfig.json | 9 + packages/console/package.json | 4 +- .../src/browser/console-contribution.ts | 4 +- .../console/src/browser/console-widget.ts | 4 +- packages/core/.eslintrc.js | 9 + packages/core/compile.tsconfig.json | 8 +- packages/core/package.json | 4 +- .../src/browser/browser-clipboard-service.ts | 16 +- packages/core/src/browser/browser.ts | 5 +- .../browser/common-frontend-contribution.ts | 246 ++++---- .../src/browser/connection-status-service.ts | 2 +- .../core/src/browser/context-key-service.ts | 2 +- .../core/src/browser/context-menu-renderer.ts | 2 +- packages/core/src/browser/dialogs.ts | 8 +- .../frontend-application-config-provider.ts | 4 +- packages/core/src/browser/keybinding.spec.ts | 2 +- .../browser-keyboard-layout-provider.spec.ts | 2 +- .../core/src/browser/keyboard/keys.spec.ts | 2 +- packages/core/src/browser/keyboard/keys.ts | 4 +- .../core/src/browser/label-parser.spec.ts | 2 +- packages/core/src/browser/label-provider.ts | 2 +- .../menu/browser-context-menu-renderer.ts | 2 +- .../src/browser/menu/browser-menu-plugin.ts | 2 +- packages/core/src/browser/navigatable.ts | 2 +- .../preferences/preference-contribution.ts | 7 +- .../preferences/preference-provider.ts | 2 +- .../preferences/preference-proxy.spec.ts | 4 +- .../browser/preferences/preference-proxy.ts | 2 +- .../preferences/preference-service.spec.ts | 4 +- .../browser/preferences/preference-service.ts | 5 +- .../test/mock-preference-provider.ts | 2 +- .../preferences/test/mock-preference-proxy.ts | 3 +- .../test/mock-preference-service.ts | 4 +- .../src/browser/quick-open/quick-title-bar.ts | 2 +- .../core/src/browser/quick-view-service.ts | 2 +- packages/core/src/browser/saveable.ts | 12 +- .../src/browser/shell/application-shell.ts | 10 +- .../browser/shell/shell-layout-restorer.ts | 6 +- .../src/browser/shell/side-panel-handler.ts | 12 +- .../core/src/browser/shell/split-panels.ts | 1 + .../src/browser/shell/tab-bar-toolbar.tsx | 10 +- packages/core/src/browser/shell/tab-bars.ts | 10 +- .../src/browser/shell/view-contribution.ts | 2 +- .../src/browser/source-tree/tree-source.ts | 4 +- .../src/browser/status-bar/status-bar.tsx | 4 +- packages/core/src/browser/storage-service.ts | 2 +- packages/core/src/browser/test/jsdom.ts | 4 +- .../src/browser/test/mock-storage-service.ts | 4 +- packages/core/src/browser/theming.ts | 4 +- packages/core/src/browser/tree/search-box.ts | 2 +- .../src/browser/tree/test/mock-tree-model.ts | 2 +- .../src/browser/tree/tree-decorator.spec.ts | 2 +- .../core/src/browser/tree/tree-decorator.ts | 8 +- .../src/browser/tree/tree-expansion.spec.ts | 2 +- .../src/browser/tree/tree-iterator.spec.ts | 4 +- .../browser/tree/tree-selection-state.spec.ts | 2 +- .../src/browser/tree/tree-widget-selection.ts | 2 +- .../core/src/browser/tree/tree-widget.tsx | 23 +- packages/core/src/browser/tree/tree.spec.ts | 4 +- packages/core/src/browser/view-container.ts | 8 +- .../core/src/browser/widget-manager.spec.ts | 2 +- packages/core/src/browser/widget-manager.ts | 2 +- packages/core/src/browser/widgets/widget.ts | 8 +- packages/core/src/common/application-error.ts | 2 +- packages/core/src/common/cancellation.ts | 2 +- packages/core/src/common/command.spec.ts | 2 +- packages/core/src/common/command.ts | 27 +- .../core/src/common/contribution-provider.ts | 3 +- packages/core/src/common/disposable.ts | 2 +- packages/core/src/common/event.ts | 9 +- packages/core/src/common/json-schema.ts | 8 +- packages/core/src/common/keybinding.ts | 4 +- packages/core/src/common/logger-protocol.ts | 4 +- packages/core/src/common/logger.spec.ts | 2 +- packages/core/src/common/logger.ts | 2 +- packages/core/src/common/lsp-types.ts | 2 +- packages/core/src/common/menu.spec.ts | 24 +- packages/core/src/common/menu.ts | 2 +- packages/core/src/common/message-service.ts | 10 +- .../messaging/connection-error-handler.ts | 2 +- .../common/messaging/proxy-factory.spec.ts | 2 +- .../src/common/messaging/proxy-factory.ts | 2 +- .../common/messaging/web-socket-channel.ts | 2 +- packages/core/src/common/objects.ts | 7 +- .../common/preferences/preference-schema.ts | 2 +- .../common/preferences/preference-scope.ts | 2 +- packages/core/src/common/promise-util.ts | 2 +- .../src/common/selection-command-handler.ts | 2 +- .../core/src/common/selection-service.spec.ts | 2 +- packages/core/src/common/selection-service.ts | 2 +- packages/core/src/common/selection.ts | 2 +- packages/core/src/common/test/expect.ts | 6 +- packages/core/src/common/test/mock-logger.ts | 2 +- .../core/src/common/uri-command-handler.ts | 14 +- ...lectron-keyboard-layout-change-notifier.ts | 2 +- .../menu/electron-context-menu-renderer.ts | 2 +- .../menu/electron-main-menu-factory.ts | 2 +- .../backend-application-config-provider.ts | 4 +- .../core/src/node/console-logger-server.ts | 2 +- packages/core/src/node/debug.ts | 2 +- packages/core/src/node/file-uri.ts | 2 +- .../messaging/connection-container-module.ts | 2 +- .../core/src/node/messaging/ipc-bootstrap.ts | 2 +- .../node/messaging/ipc-connection-provider.ts | 2 +- .../node/messaging/messaging-contribution.ts | 1 - packages/debug-nodejs/.eslintrc.js | 12 + packages/debug-nodejs/compile.tsconfig.json | 6 + packages/debug-nodejs/package.json | 4 +- .../node/node-debug-adapter-contribution.ts | 1 - packages/debug/.eslintrc.js | 9 + packages/debug/compile.tsconfig.json | 54 ++ packages/debug/package.json | 4 +- .../browser/breakpoint/breakpoint-manager.ts | 2 +- .../console/debug-console-contribution.tsx | 2 +- .../src/browser/debug-configuration-model.ts | 2 +- .../src/browser/debug-monaco-contribution.ts | 2 +- .../src/browser/debug-session-connection.ts | 2 +- .../src/browser/debug-session-manager.ts | 2 +- packages/debug/src/browser/debug-session.tsx | 2 +- .../editor/debug-breakpoint-widget.tsx | 2 +- .../src/browser/editor/debug-editor-model.ts | 2 +- .../editor/debug-expression-provider.ts | 4 +- .../src/browser/model/debug-breakpoint.tsx | 2 +- .../browser/model/debug-source-breakpoint.tsx | 2 +- .../launch-folder-preference-provider.ts | 2 +- .../preferences/launch-preferences.spec.ts | 34 +- .../view/debug-configuration-widget.tsx | 6 +- .../debug/src/common/debug-configuration.ts | 2 +- packages/debug/src/common/debug-service.ts | 2 +- .../debug/src/node/debug-adapter-factory.ts | 2 +- packages/editor-preview/.eslintrc.js | 9 + packages/editor-preview/compile.tsconfig.json | 9 + packages/editor-preview/package.json | 4 +- .../browser/editor-preview-factory.spec.ts | 6 +- .../browser/editor-preview-manager.spec.ts | 2 +- packages/editor/.eslintrc.js | 9 + packages/editor/compile.tsconfig.json | 14 +- packages/editor/package.json | 4 +- .../decorations/editor-decoration-style.ts | 2 +- .../editor/src/browser/editor-keybinding.ts | 4 +- .../editor/src/browser/editor-preferences.ts | 8 +- packages/editor/src/browser/editor.ts | 4 +- .../navigation-location-service.spec.ts | 2 +- .../navigation-location-similarity.spec.ts | 2 +- .../navigation-location-updater.spec.ts | 4 +- packages/editorconfig/.eslintrc.js | 9 + packages/editorconfig/compile.tsconfig.json | 15 + packages/editorconfig/package.json | 4 +- .../editorconfig-document-manager.spec.ts | 2 +- .../browser/editorconfig-document-manager.ts | 2 +- packages/file-search/.eslintrc.js | 9 + packages/file-search/compile.tsconfig.json | 20 +- packages/file-search/package.json | 4 +- .../browser/quick-file-open-contribution.ts | 2 +- .../src/browser/quick-file-open.ts | 1 + .../src/node/file-search-service-impl.spec.ts | 2 +- .../src/node/file-search-service-impl.ts | 2 +- packages/filesystem/.eslintrc.js | 9 + packages/filesystem/compile.tsconfig.json | 11 +- packages/filesystem/package.json | 4 +- .../browser/download/file-download-service.ts | 2 +- .../browser/file-dialog/file-dialog-tree.ts | 2 +- .../browser/file-dialog/file-dialog-widget.ts | 2 +- .../browser/file-tree/file-tree-widget.tsx | 4 +- .../src/browser/file-upload-service.ts | 2 +- .../src/browser/filesystem-proxy-factory.ts | 2 +- .../node/download/directory-archiver.spec.ts | 4 +- .../node/download/file-download-endpoint.ts | 3 +- .../filesystem/src/node/node-file-upload.ts | 2 +- .../src/node/node-filesystem.spec.ts | 4 +- .../filesystem/src/node/node-filesystem.ts | 4 +- .../filesystem/src/node/nsfw-watcher/index.ts | 2 +- .../nsfw-filesystem-watcher.spec.ts | 4 +- .../nsfw-watcher/nsfw-filesystem-watcher.ts | 2 +- packages/getting-started/.eslintrc.js | 9 + .../getting-started/compile.tsconfig.json | 15 + packages/getting-started/package.json | 4 +- packages/git/.eslintrc.js | 9 + packages/git/compile.tsconfig.json | 26 +- packages/git/package.json | 4 +- .../git/src/browser/diff/git-diff-widget.tsx | 4 +- packages/git/src/browser/git-error-handler.ts | 2 +- .../browser/git-repository-provider.spec.ts | 2 +- .../browser/history/git-history-widget.tsx | 20 +- packages/git/src/common/git-watcher.ts | 2 +- packages/git/src/common/git.ts | 18 +- .../src/electron-node/askpass/askpass-main.ts | 2 +- .../src/node/dugite-git-watcher.slow-spec.ts | 2 +- packages/git/src/node/dugite-git.slow-spec.ts | 2 +- packages/git/src/node/dugite-git.spec.ts | 4 +- packages/git/src/node/dugite-git.ts | 4 +- packages/git/src/node/git-exec-provider.ts | 6 +- .../src/node/git-locator/git-locator-impl.ts | 8 +- packages/git/src/node/test/binding-helper.ts | 2 +- packages/java-debug/.eslintrc.js | 9 + packages/java-debug/compile.tsconfig.json | 9 + packages/java-debug/package.json | 4 +- .../src/browser/java-debug-preferences.ts | 3 +- .../node/java-debug-adapter-contribution.ts | 6 +- packages/java/.eslintrc.js | 9 + packages/java/compile.tsconfig.json | 17 +- packages/java/package.json | 4 +- .../src/browser/java-client-contribution.ts | 1 + packages/java/src/browser/java-preferences.ts | 4 +- packages/java/src/browser/java-protocol.ts | 2 +- .../java/src/node/java-cli-contribution.ts | 2 +- packages/json/.eslintrc.js | 9 + packages/json/compile.tsconfig.json | 17 +- packages/json/package.json | 4 +- .../src/browser/json-client-contribution.ts | 2 +- packages/keymaps/.eslintrc.js | 9 + packages/keymaps/compile.tsconfig.json | 15 + packages/keymaps/package.json | 4 +- .../src/browser/keybindings-widget.tsx | 4 +- packages/languages/.eslintrc.js | 9 + packages/languages/compile.tsconfig.json | 20 +- packages/languages/package.json | 4 +- .../browser/language-client-contribution.ts | 10 +- .../src/browser/language-client-factory.ts | 2 +- .../semantic-highlighting-feature.ts | 2 +- .../typehierarchy/typehierarchy-feature.ts | 2 +- .../typehierarchy/typehierarchy-protocol.ts | 2 +- .../src/common/language-contribution.ts | 2 +- .../src/node/language-server-contribution.ts | 2 +- .../node/languages-backend-contribution.ts | 5 +- packages/markers/.eslintrc.js | 9 + packages/markers/compile.tsconfig.json | 17 +- packages/markers/package.json | 4 +- .../browser/problem/problem-manager.spec.ts | 2 +- packages/merge-conflicts/.eslintrc.js | 9 + .../merge-conflicts/compile.tsconfig.json | 14 +- packages/merge-conflicts/package.json | 4 +- .../browser/merge-conflicts-parser.spec.ts | 2 +- packages/messages/.eslintrc.js | 9 + packages/messages/compile.tsconfig.json | 8 +- packages/messages/package.json | 4 +- .../browser/notification-center-component.tsx | 4 +- .../src/browser/notification-component.tsx | 8 +- .../src/browser/notifications-contribution.ts | 1 + packages/metrics/.eslintrc.js | 9 + packages/metrics/compile.tsconfig.json | 9 + packages/metrics/package.json | 4 +- packages/metrics/src/node/prometheus.spec.ts | 2 +- packages/mini-browser/.eslintrc.js | 9 + packages/mini-browser/compile.tsconfig.json | 11 +- packages/mini-browser/package.json | 4 +- .../src/browser/mini-browser-content.ts | 11 +- .../mini-browser/src/browser/mini-browser.ts | 2 +- .../src/node/mini-browser-endpoint.ts | 4 +- packages/monaco/.eslintrc.js | 9 + packages/monaco/compile.tsconfig.json | 26 +- packages/monaco/package.json | 4 +- .../src/browser/monaco-command-registry.ts | 10 +- .../src/browser/monaco-command-service.ts | 4 +- packages/monaco/src/browser/monaco-command.ts | 4 +- .../src/browser/monaco-configurations.ts | 2 +- .../src/browser/monaco-editor-provider.ts | 4 +- .../src/browser/monaco-editor-zone-widget.ts | 2 +- packages/monaco/src/browser/monaco-editor.ts | 4 +- .../src/browser/monaco-frontend-module.ts | 2 +- .../monaco/src/browser/monaco-keycode-map.ts | 2 +- packages/monaco/src/browser/monaco-loader.ts | 2 +- .../browser/monaco-outline-contribution.ts | 1 + .../src/browser/monaco-quick-open-service.ts | 7 +- .../src/browser/monaco-resolved-keybinding.ts | 4 +- .../monaco-snippet-suggest-provider.ts | 5 +- .../src/browser/monaco-text-model-service.ts | 2 +- .../src/browser/monaco-theming-service.ts | 4 +- .../monaco/src/browser/monaco-workspace.ts | 20 +- .../browser/textmate/monaco-theme-registry.ts | 4 +- .../monaco-electron-module.ts | 2 +- packages/monaco/src/typings/monaco/index.d.ts | 2 +- packages/navigator/.eslintrc.js | 9 + packages/navigator/compile.tsconfig.json | 14 +- packages/navigator/package.json | 4 +- .../src/browser/navigator-contribution.ts | 2 +- .../src/browser/navigator-diff.spec.ts | 2 +- .../src/browser/navigator-model.spec.ts | 4 +- .../src/browser/navigator-preferences.ts | 2 - .../src/browser/navigator-tree.spec.ts | 4 +- .../src/browser/navigator-widget.tsx | 6 +- packages/outline-view/.eslintrc.js | 9 + packages/outline-view/compile.tsconfig.json | 8 +- packages/outline-view/package.json | 4 +- packages/output/.eslintrc.js | 9 + packages/output/compile.tsconfig.json | 8 +- packages/output/package.json | 4 +- .../browser/output-toolbar-contribution.tsx | 2 +- packages/plugin-dev/.eslintrc.js | 9 + packages/plugin-dev/compile.tsconfig.json | 25 +- packages/plugin-dev/package.json | 4 +- .../src/node/hosted-instance-manager.ts | 4 +- packages/plugin-ext-vscode/.eslintrc.js | 9 + .../plugin-ext-vscode/compile.tsconfig.json | 22 +- packages/plugin-ext-vscode/package.json | 4 +- .../plugin-vscode-commands-contribution.ts | 8 +- .../node/plugin-vscode-cli-contribution.ts | 2 +- .../src/node/plugin-vscode-init.ts | 4 +- .../src/node/plugin-vscode-resolver.ts | 2 +- packages/plugin-ext/.eslintrc.js | 12 + packages/plugin-ext/compile.tsconfig.json | 58 +- packages/plugin-ext/package.json | 4 +- packages/plugin-ext/src/common/assert.ts | 2 +- packages/plugin-ext/src/common/connection.ts | 4 +- packages/plugin-ext/src/common/glob.ts | 40 +- .../plugin-ext/src/common/known-commands.ts | 18 +- .../src/common/object-identifier.ts | 2 +- packages/plugin-ext/src/common/objects.ts | 2 +- packages/plugin-ext/src/common/paths.ts | 7 +- .../src/common/plugin-api-rpc-model.ts | 2 +- .../plugin-ext/src/common/plugin-api-rpc.ts | 4 +- .../src/common/plugin-message-reader.ts | 4 +- .../plugin-ext/src/common/plugin-protocol.ts | 6 +- .../plugin-ext/src/common/rpc-protocol.ts | 11 +- packages/plugin-ext/src/common/types.ts | 16 +- .../src/hosted/browser/hosted-plugin.ts | 4 +- .../src/hosted/browser/worker/debug-stub.ts | 2 +- .../src/hosted/browser/worker/worker-main.ts | 9 +- .../src/hosted/node/hosted-plugin-process.ts | 6 +- .../src/hosted/node/hosted-plugin.ts | 2 +- .../src/hosted/node/plugin-host-rpc.ts | 8 +- .../plugin-ext/src/hosted/node/plugin-host.ts | 8 +- .../src/hosted/node/plugin-manifest-loader.ts | 4 +- .../node/scanners/backend-init-theia.ts | 2 +- .../src/hosted/node/scanners/scanner-theia.ts | 2 +- .../src/main/browser/command-registry-main.ts | 2 +- .../src/main/browser/debug/debug-main.ts | 2 +- .../src/main/browser/documents-main.ts | 16 +- .../src/main/browser/languages-main.ts | 2 +- .../menus/menus-contribution-handler.spec.ts | 20 +- .../menus/menus-contribution-handler.ts | 2 +- .../browser/plugin-command-open-handler.ts | 2 +- .../browser/plugin-contribution-handler.ts | 7 +- .../main/browser/plugin-icon-theme-service.ts | 10 +- .../src/main/browser/plugin-shared-style.ts | 2 +- .../main/browser/preference-registry-main.ts | 4 +- .../src/main/browser/quick-open-main.ts | 10 +- .../src/main/browser/terminal-main.ts | 2 +- .../plugin-tree-view-node-label-provider.ts | 2 +- .../main/browser/view/tree-view-widget.tsx | 6 +- .../src/main/browser/view/tree-views-main.ts | 2 +- .../webview/webview-theme-data-provider.ts | 2 +- .../src/main/browser/webview/webview.ts | 4 +- .../src/main/browser/webviews-main.ts | 4 +- .../plugin-theia-directory-handler.ts | 2 +- .../src/main/node/plugin-cli-contribution.ts | 2 +- .../main/node/plugin-deployer-entry-impl.ts | 2 +- .../src/main/node/plugin-deployer-impl.ts | 2 +- .../plugin-deployer-resolver-context-impl.ts | 4 +- .../src/main/node/plugin-github-resolver.ts | 3 +- .../resolvers/plugin-local-dir-resolver.ts | 2 +- .../plugin-ext/src/plugin/command-registry.ts | 20 +- packages/plugin-ext/src/plugin/decorations.ts | 2 +- .../plugin-ext/src/plugin/document-data.ts | 2 +- packages/plugin-ext/src/plugin/documents.ts | 2 +- packages/plugin-ext/src/plugin/file-system.ts | 1 - .../src/plugin/known-commands.spec.ts | 2 +- packages/plugin-ext/src/plugin/languages.ts | 3 +- .../src/plugin/languages/code-action.ts | 8 +- .../src/plugin/languages/diagnostics.ts | 2 +- .../plugin/languages/document-formatting.ts | 2 +- .../plugin/languages/document-highlight.ts | 2 +- .../plugin-ext/src/plugin/languages/hover.ts | 2 +- .../plugin/languages/on-type-formatting.ts | 2 +- .../src/plugin/languages/range-formatting.ts | 2 +- .../plugin-ext/src/plugin/languages/rename.ts | 2 +- .../plugin-ext/src/plugin/languages/util.ts | 4 +- .../plugin-ext/src/plugin/markdown-string.ts | 2 +- .../plugin-ext/src/plugin/node/debug/debug.ts | 4 +- .../debug/plugin-debug-adapter-session.ts | 2 +- .../debug/plugin-debug-adapter-starter.ts | 2 +- .../debug/plugin-debug-adapter-tracker.ts | 2 +- .../plugin-ext/src/plugin/plugin-context.ts | 37 +- .../plugin-ext/src/plugin/plugin-manager.ts | 5 +- .../plugin-ext/src/plugin/plugin-storage.ts | 2 +- .../src/plugin/preference-registry.ts | 4 +- .../src/plugin/preferences/configuration.ts | 2 +- packages/plugin-ext/src/plugin/quick-open.ts | 4 +- packages/plugin-ext/src/plugin/scm.ts | 6 +- .../src/plugin/status-bar-message-registry.ts | 4 +- packages/plugin-ext/src/plugin/text-editor.ts | 8 +- .../plugin-ext/src/plugin/text-editors.ts | 2 +- .../plugin-ext/src/plugin/tree/tree-views.ts | 10 +- .../plugin-ext/src/plugin/type-converters.ts | 18 +- packages/plugin-ext/src/plugin/types-impl.ts | 12 +- packages/plugin-ext/src/plugin/webviews.ts | 12 +- packages/plugin-ext/src/plugin/workspace.ts | 2 +- packages/plugin-ext/src/typings/index.d.ts | 2 + packages/plugin-metrics/.eslintrc.js | 9 + packages/plugin-metrics/compile.tsconfig.json | 18 + packages/plugin-metrics/package.json | 4 +- .../src/browser/plugin-metrics-resolver.ts | 2 +- packages/plugin/.eslintrc.js | 12 + packages/plugin/compile.tsconfig.json | 6 +- packages/plugin/package.json | 4 +- packages/preferences/.eslintrc.js | 9 + packages/preferences/compile.tsconfig.json | 26 +- packages/preferences/package.json | 4 +- .../abstract-resource-preference-provider.ts | 6 +- .../browser/folders-preferences-provider.ts | 2 +- packages/preferences/src/browser/monaco.d.ts | 2 +- .../src/browser/preferences-decorator.ts | 2 +- .../src/browser/preferences-menu-factory.ts | 2 +- .../workspace-file-preference-provider.ts | 2 +- .../browser/workspace-preference-provider.ts | 2 +- packages/preview/.eslintrc.js | 9 + packages/preview/compile.tsconfig.json | 17 +- packages/preview/package.json | 4 +- .../markdown/markdown-preview-handler.spec.ts | 4 +- .../src/browser/preview-contribution.ts | 2 +- packages/process/.eslintrc.js | 9 + packages/process/compile.tsconfig.json | 6 + packages/process/package.json | 4 +- packages/process/src/node/dev-null-stream.ts | 4 +- .../src/node/multi-ring-buffer.spec.ts | 2 +- packages/process/src/node/process.ts | 4 +- .../process/src/node/terminal-process.spec.ts | 2 +- packages/process/src/node/terminal-process.ts | 2 +- packages/process/src/node/utils.ts | 4 +- packages/python/.eslintrc.js | 9 + packages/python/compile.tsconfig.json | 17 +- packages/python/package.json | 4 +- packages/scm/.eslintrc.js | 9 + packages/scm/compile.tsconfig.json | 15 + packages/scm/package.json | 4 +- .../src/browser/dirty-diff/content-lines.ts | 4 +- .../browser/dirty-diff/diff-computer.spec.ts | 2 +- .../src/browser/dirty-diff/diff-computer.ts | 10 +- .../scm/src/browser/scm-amend-component.tsx | 6 +- packages/scm/src/browser/scm-input.ts | 2 +- packages/scm/src/browser/scm-provider.ts | 4 +- packages/scm/src/browser/scm-repository.ts | 2 +- packages/scm/src/browser/scm-service.ts | 2 +- packages/scm/src/browser/scm-widget.tsx | 19 +- packages/search-in-workspace/.eslintrc.js | 9 + .../search-in-workspace/compile.tsconfig.json | 23 +- packages/search-in-workspace/package.json | 4 +- .../search-in-workspace-frontend-module.ts | 4 +- ...search-in-workspace-result-tree-widget.tsx | 14 +- .../browser/search-in-workspace-widget.tsx | 2 +- .../ripgrep-search-in-workspace-server.ts | 2 +- packages/task/.eslintrc.js | 9 + packages/task/compile.tsconfig.json | 35 +- packages/task/package.json | 4 +- packages/task/src/browser/quick-open-task.ts | 9 +- .../src/browser/task-configuration-manager.ts | 2 +- .../src/browser/task-configuration-model.ts | 2 +- .../task/src/browser/task-configurations.ts | 2 +- .../browser/task-definition-registry.spec.ts | 2 +- .../task-folder-preference-provider.ts | 2 +- .../src/browser/task-frontend-contribution.ts | 6 +- .../task/src/browser/task-schema-updater.ts | 4 +- packages/task/src/browser/task-service.ts | 2 +- packages/task/src/common/task-protocol.ts | 10 +- .../src/node/task-abstract-line-matcher.ts | 9 +- .../task/src/node/test/task-test-container.ts | 1 - packages/terminal/.eslintrc.js | 9 + packages/terminal/compile.tsconfig.json | 20 +- packages/terminal/package.json | 4 +- .../terminal-copy-on-selection-handler.ts | 8 +- .../browser/terminal-frontend-contribution.ts | 2 +- .../src/browser/terminal-linkmatcher-files.ts | 1 + .../src/browser/terminal-preferences.ts | 2 +- .../src/browser/terminal-theme-service.ts | 4 +- .../src/node/terminal-backend-module.ts | 2 +- .../src/node/test/terminal-test-container.ts | 1 - packages/textmate-grammars/.eslintrc.js | 9 + .../textmate-grammars/compile.tsconfig.json | 8 +- packages/textmate-grammars/package.json | 4 +- .../textmate-grammars/src/browser/monaco.d.ts | 2 +- packages/tslint/.eslintrc.js | 9 + packages/tslint/compile.tsconfig.json | 4 +- packages/tslint/package.json | 4 +- packages/typehierarchy/.eslintrc.js | 9 + packages/typehierarchy/compile.tsconfig.json | 26 +- packages/typehierarchy/package.json | 4 +- .../tree/typehierarchy-tree-widget.tsx | 2 +- .../src/browser/tree/typehierarchy-tree.ts | 4 +- packages/typescript/.eslintrc.js | 9 + packages/typescript/compile.tsconfig.json | 29 +- packages/typescript/package.json | 4 +- packages/typescript/src/browser/monaco.d.ts | 2 +- .../typescript-frontend-contribution.ts | 4 +- .../src/browser/typescript-preferences.ts | 4 +- .../typescript-version-service-impl.spec.ts | 2 +- .../node/typescript-version-service-impl.ts | 6 +- packages/userstorage/.eslintrc.js | 9 + packages/userstorage/compile.tsconfig.json | 11 +- packages/userstorage/package.json | 4 +- packages/variable-resolver/.eslintrc.js | 9 + .../variable-resolver/compile.tsconfig.json | 8 +- packages/variable-resolver/package.json | 4 +- .../browser/common-variable-contribution.ts | 2 +- .../src/browser/variable-input.ts | 2 +- ...ble-resolver-frontend-contribution.spec.ts | 4 +- .../src/browser/variable-resolver-service.ts | 5 +- .../src/browser/variable.spec.ts | 2 +- packages/workspace/.eslintrc.js | 9 + packages/workspace/compile.tsconfig.json | 14 +- packages/workspace/package.json | 4 +- .../src/browser/workspace-commands.ts | 6 +- .../workspace-frontend-contribution.spec.ts | 2 +- .../src/browser/workspace-service.spec.ts | 4 +- .../src/browser/workspace-service.ts | 6 +- .../workspace-uri-contribution.spec.ts | 10 +- .../src/node/default-workspace-server.ts | 2 +- scripts/compile-references.js | 201 ++++++ scripts/run-reverse-topo.js | 60 ++ scripts/skip-prepare.js | 36 -- tsconfig.json | 210 ++++--- tslint.json | 9 - yarn.lock | 590 +++++++++++++++++- 568 files changed, 3993 insertions(+), 1520 deletions(-) create mode 100644 .eslintrc.js create mode 100644 compile.tsconfig.json create mode 100644 configs/base.eslintrc.json create mode 100644 configs/build.eslintrc.json delete mode 100644 configs/build.tslint.json create mode 100644 configs/errors.eslintrc.json delete mode 100644 configs/errors.tslint.json create mode 100644 configs/warnings.eslintrc.json delete mode 100644 configs/warnings.tslint.json create mode 100644 dev-packages/application-manager/.eslintrc.js create mode 100644 dev-packages/application-package/.eslintrc.js create mode 100644 dev-packages/cli/.eslintrc.js create mode 100644 dev-packages/electron/.eslintrc.js rename dev-packages/ext-scripts/{theiaext => theia-ext.js} (67%) rename dev-packages/ext-scripts/{theia-run => theia-run.js} (99%) create mode 100644 examples/api-samples/.eslintrc.js create mode 100644 examples/browser/.eslintrc.js create mode 100644 examples/electron/.eslintrc.js create mode 100644 packages/callhierarchy/.eslintrc.js create mode 100644 packages/console/.eslintrc.js create mode 100644 packages/core/.eslintrc.js create mode 100644 packages/debug-nodejs/.eslintrc.js create mode 100644 packages/debug/.eslintrc.js create mode 100644 packages/editor-preview/.eslintrc.js create mode 100644 packages/editor/.eslintrc.js create mode 100644 packages/editorconfig/.eslintrc.js create mode 100644 packages/file-search/.eslintrc.js create mode 100644 packages/filesystem/.eslintrc.js create mode 100644 packages/getting-started/.eslintrc.js create mode 100644 packages/git/.eslintrc.js create mode 100644 packages/java-debug/.eslintrc.js create mode 100644 packages/java/.eslintrc.js create mode 100644 packages/json/.eslintrc.js create mode 100644 packages/keymaps/.eslintrc.js create mode 100644 packages/languages/.eslintrc.js create mode 100644 packages/markers/.eslintrc.js create mode 100644 packages/merge-conflicts/.eslintrc.js create mode 100644 packages/messages/.eslintrc.js create mode 100644 packages/metrics/.eslintrc.js create mode 100644 packages/mini-browser/.eslintrc.js create mode 100644 packages/monaco/.eslintrc.js create mode 100644 packages/navigator/.eslintrc.js create mode 100644 packages/outline-view/.eslintrc.js create mode 100644 packages/output/.eslintrc.js create mode 100644 packages/plugin-dev/.eslintrc.js create mode 100644 packages/plugin-ext-vscode/.eslintrc.js create mode 100644 packages/plugin-ext/.eslintrc.js create mode 100644 packages/plugin-metrics/.eslintrc.js create mode 100644 packages/plugin/.eslintrc.js create mode 100644 packages/preferences/.eslintrc.js create mode 100644 packages/preview/.eslintrc.js create mode 100644 packages/process/.eslintrc.js create mode 100644 packages/python/.eslintrc.js create mode 100644 packages/scm/.eslintrc.js create mode 100644 packages/search-in-workspace/.eslintrc.js create mode 100644 packages/task/.eslintrc.js create mode 100644 packages/terminal/.eslintrc.js create mode 100644 packages/textmate-grammars/.eslintrc.js create mode 100644 packages/tslint/.eslintrc.js create mode 100644 packages/typehierarchy/.eslintrc.js create mode 100644 packages/typescript/.eslintrc.js create mode 100644 packages/userstorage/.eslintrc.js create mode 100644 packages/variable-resolver/.eslintrc.js create mode 100644 packages/workspace/.eslintrc.js create mode 100644 scripts/compile-references.js create mode 100644 scripts/run-reverse-topo.js delete mode 100644 scripts/skip-prepare.js delete mode 100644 tslint.json diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000000..83766b3ab8efb --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + root: true, + extends: [ + './configs/base.eslintrc.json', + './configs/warnings.eslintrc.json', + './configs/errors.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: [ + 'compile.tsconfig.json', + 'dev-packages/*/compile.tsconfig.json', + 'packages/*/compile.tsconfig.json', + 'examples/*/compile.tsconfig.json' + ] + } +}; diff --git a/.gitignore b/.gitignore index ac180b8954dd6..68df6a29524ba 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ plugins gh-pages .vscode/ipch dev-packages/electron/compile_commands.json +*.tsbuildinfo +.eslintcache diff --git a/.vscode/settings.json b/.vscode/settings.json index 721ebe8d17014..2df5c1373f92f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,15 +1,27 @@ -// If one would like to add/remove/modify user preferences without modifying the content of the -// workspace settings file, then one would need to modify the `settings.json` under here: -// - Windows: %APPDATA%\Code\User\settings.json -// - Linux: $HOME/.config/Code/User/settings.json -// - Mac: $HOME/Library/Application Support/Code/User/settings.json { - "tslint.enable": true, + "typescript.tsdk": "node_modules/typescript/lib", "editor.formatOnSave": true, - "search.exclude": { - "**/node_modules": true, - "**/lib": true, - "**/coverage": true + "editor.insertSpaces": true, + "files.insertFinalNewline": true, + "clang-format.language.typescript.enable": false, + "editor.rulers": [ + 180 + ], // ESLint `max-len` rule. + "[typescript]": { + "editor.tabSize": 4, + "editor.defaultFormatter": "vscode.typescript-language-features", + }, + "[javascript]": { + "editor.tabSize": 4, + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[json]": { + "editor.tabSize": 2, + "editor.defaultFormatter": "vscode.json-language-features", + }, + "[jsonc]": { + "editor.tabSize": 2, + "editor.defaultFormatter": "vscode.json-language-features", }, "lcov.path": [ "packages/core/coverage/lcov.info", @@ -34,18 +46,5 @@ "pattern": "**/*.spec.ts", "command": "yarn test:theia" } - ], - "editor.insertSpaces": true, - "[typescript]": { - "editor.tabSize": 4 - }, - "[json]": { - "editor.tabSize": 2 - }, - "[jsonc]": { - "editor.tabSize": 2 - }, - "typescript.tsdk": "node_modules/typescript/lib", - "files.insertFinalNewline": true, - "clang-format.language.typescript.enable": false + ] } diff --git a/compile.tsconfig.json b/compile.tsconfig.json new file mode 100644 index 0000000000000..e3f4465a8cdc1 --- /dev/null +++ b/compile.tsconfig.json @@ -0,0 +1,162 @@ +{ + "extends": "./configs/base.tsconfig", + "include": [], + "references": [ + { + "path": "dev-packages/application-manager/compile.tsconfig.json" + }, + { + "path": "dev-packages/application-package/compile.tsconfig.json" + }, + { + "path": "dev-packages/cli/compile.tsconfig.json" + }, + { + "path": "packages/callhierarchy/compile.tsconfig.json" + }, + { + "path": "packages/console/compile.tsconfig.json" + }, + { + "path": "packages/core/compile.tsconfig.json" + }, + { + "path": "packages/debug-nodejs/compile.tsconfig.json" + }, + { + "path": "packages/debug/compile.tsconfig.json" + }, + { + "path": "packages/editor-preview/compile.tsconfig.json" + }, + { + "path": "packages/editor/compile.tsconfig.json" + }, + { + "path": "packages/editorconfig/compile.tsconfig.json" + }, + { + "path": "packages/file-search/compile.tsconfig.json" + }, + { + "path": "packages/filesystem/compile.tsconfig.json" + }, + { + "path": "packages/getting-started/compile.tsconfig.json" + }, + { + "path": "packages/git/compile.tsconfig.json" + }, + { + "path": "packages/java-debug/compile.tsconfig.json" + }, + { + "path": "packages/java/compile.tsconfig.json" + }, + { + "path": "packages/json/compile.tsconfig.json" + }, + { + "path": "packages/keymaps/compile.tsconfig.json" + }, + { + "path": "packages/languages/compile.tsconfig.json" + }, + { + "path": "packages/markers/compile.tsconfig.json" + }, + { + "path": "packages/merge-conflicts/compile.tsconfig.json" + }, + { + "path": "packages/messages/compile.tsconfig.json" + }, + { + "path": "packages/metrics/compile.tsconfig.json" + }, + { + "path": "packages/mini-browser/compile.tsconfig.json" + }, + { + "path": "packages/monaco/compile.tsconfig.json" + }, + { + "path": "packages/navigator/compile.tsconfig.json" + }, + { + "path": "packages/outline-view/compile.tsconfig.json" + }, + { + "path": "packages/output/compile.tsconfig.json" + }, + { + "path": "packages/plugin-dev/compile.tsconfig.json" + }, + { + "path": "packages/plugin-ext-vscode/compile.tsconfig.json" + }, + { + "path": "packages/plugin-ext/compile.tsconfig.json" + }, + { + "path": "packages/plugin-metrics/compile.tsconfig.json" + }, + { + "path": "packages/plugin/compile.tsconfig.json" + }, + { + "path": "packages/preferences/compile.tsconfig.json" + }, + { + "path": "packages/preview/compile.tsconfig.json" + }, + { + "path": "packages/process/compile.tsconfig.json" + }, + { + "path": "packages/python/compile.tsconfig.json" + }, + { + "path": "packages/scm/compile.tsconfig.json" + }, + { + "path": "packages/search-in-workspace/compile.tsconfig.json" + }, + { + "path": "packages/task/compile.tsconfig.json" + }, + { + "path": "packages/terminal/compile.tsconfig.json" + }, + { + "path": "packages/textmate-grammars/compile.tsconfig.json" + }, + { + "path": "packages/tslint/compile.tsconfig.json" + }, + { + "path": "packages/typehierarchy/compile.tsconfig.json" + }, + { + "path": "packages/typescript/compile.tsconfig.json" + }, + { + "path": "packages/userstorage/compile.tsconfig.json" + }, + { + "path": "packages/variable-resolver/compile.tsconfig.json" + }, + { + "path": "packages/workspace/compile.tsconfig.json" + }, + { + "path": "examples/api-samples/compile.tsconfig.json" + }, + { + "path": "examples/browser/compile.tsconfig.json" + }, + { + "path": "examples/electron/compile.tsconfig.json" + } + ] +} diff --git a/configs/base.eslintrc.json b/configs/base.eslintrc.json new file mode 100644 index 0000000000000..e843055aa7a64 --- /dev/null +++ b/configs/base.eslintrc.json @@ -0,0 +1,25 @@ +{ + "parser": "@typescript-eslint/parser", + "parserOptions": { + "sourceType": "module", + "ecmaVersion": 6, + "ecmaFeatures": { + "jsx": true + } + }, + "plugins": [ + "@typescript-eslint", + "@typescript-eslint/tslint", + "import", + "no-null" + ], + "env": { + "browser": true, + "mocha": true, + "node": true + }, + "ignorePatterns": [ + "node_modules", + "*.d.ts" + ] +} diff --git a/configs/base.tsconfig.json b/configs/base.tsconfig.json index e0f72aaadf52b..7175a17cf0299 100644 --- a/configs/base.tsconfig.json +++ b/configs/base.tsconfig.json @@ -22,4 +22,4 @@ ], "sourceMap": true } -} \ No newline at end of file +} diff --git a/configs/build.eslintrc.json b/configs/build.eslintrc.json new file mode 100644 index 0000000000000..c0a2c52c0f081 --- /dev/null +++ b/configs/build.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "./base.eslintrc.json", + "./errors.eslintrc.json" + ] +} diff --git a/configs/build.tslint.json b/configs/build.tslint.json deleted file mode 100644 index 21d557d1f9b51..0000000000000 --- a/configs/build.tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "//": [ - "Lint rules to use when building. We don't include warnings to avoid polluting the build output." - ], - "extends": [ - "./errors.tslint.json" - ] -} diff --git a/configs/errors.eslintrc.json b/configs/errors.eslintrc.json new file mode 100644 index 0000000000000..bed0d32724ec5 --- /dev/null +++ b/configs/errors.eslintrc.json @@ -0,0 +1,123 @@ +{ + "rules": { + "@typescript-eslint/class-name-casing": "error", + "@typescript-eslint/consistent-type-definitions": "error", + "@typescript-eslint/indent": "off", // temp + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/quotes": [ + "error", + "single", + { + "avoidEscape": true + } + ], + "@typescript-eslint/semi": [ + "error", + "always" + ], + "@typescript-eslint/type-annotation-spacing": "error", + "arrow-body-style": [ + "error", + "as-needed" + ], + "arrow-parens": [ + "error", + "as-needed" + ], + "camelcase": "off", + "comma-dangle": "off", + "curly": "error", + "eol-last": "error", + "eqeqeq": [ + "error", + "smart" + ], + "guard-for-in": "error", + "id-blacklist": "off", + "id-match": "off", + "import/no-deprecated": "error", + "import/no-extraneous-dependencies": "off", + "max-len": [ + "error", + { + "code": 180 + } + ], + "no-magic-numbers": "off", + "no-multiple-empty-lines": "error", + "no-new-wrappers": "error", + "no-null/no-null": "error", + "no-shadow": [ + "error", + { + "hoist": "all" + } + ], + "no-throw-literal": "error", + "no-trailing-spaces": "error", + "no-underscore-dangle": "off", + "no-unused-expressions": "error", + "no-var": "error", + "no-void": "off", // @theia/plugin-ext uses this? + "one-var": [ + "error", + "never" + ], + "prefer-const": [ + "error", + { + "destructuring": "all" + } + ], + "radix": "off", + "space-before-function-paren": [ + "error", + { + "anonymous": "always", + "named": "never", + "asyncArrow": "always" + } + ], + "spaced-comment": [ + "error", + "always", + { + "exceptions": ["*", "+", "-", "/"] + } + ], + "@typescript-eslint/tslint/config": [ + "error", { + "rules": { + "file-header": [ + true, + "SPDX-License-Identifier: EPL-2\\.0 OR GPL-2\\.0 WITH Classpath-exception-2\\.0" + ], + "jsdoc-format": [ + true, + "check-multiline-start" + ], + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "typedef": [ + true, + "call-signature", + "property-declaration" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ] + } + } + ] + } +} diff --git a/configs/errors.tslint.json b/configs/errors.tslint.json deleted file mode 100644 index d0d242cab873b..0000000000000 --- a/configs/errors.tslint.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "defaultSeverity": "error", - "rules": { - "arrow-parens": [ - true, - "ban-single-arg-parens" - ], - "arrow-return-shorthand": [ - true, - "multiline" - ], - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": true, - "eofline": true, - "file-header": [ - true, - "SPDX-License-Identifier: EPL-2\\.0 OR GPL-2\\.0 WITH Classpath-exception-2\\.0" - ], - "forin": true, - "indent": [ - true, - "spaces", - 4 - ], - "interface-over-type-literal": true, - "jsdoc-format": [ - true, - "check-multiline-start" - ], - "max-line-length": [ - true, - 180 - ], - "no-any": true, - "no-consecutive-blank-lines": true, - "no-construct": true, - "no-implicit-dependencies": { - "options": [ - true, - [ - "@phosphor/algorithm", - "@phosphor/commands", - "@phosphor/coreutils", - "@phosphor/domutils", - "@phosphor/dragdrop", - "@phosphor/messaging", - "@phosphor/properties", - "@phosphor/signaling", - "@phosphor/virtualdom", - "@phosphor/widgets", - "chai", - "chai-string", - "electron", - "express", - "fs-extra", - "inversify", - "jsdom", - "lodash.debounce", - "lodash.throttle", - "monaco-languageclient", - "native-keymap", - "nsfw", - "react", - "react-dom", - "react-virtualized", - "sinon", - "temp", - "typescript", - "uuid", - "vscode-jsonrpc", - "vscode-languageserver", - "vscode-languageserver-protocol", - "vscode-languageserver-types", - "vscode-uri", - "vscode-ws-jsonrpc", - "yargs" - ] - ] - }, - "no-magic-numbers": false, - "no-null-keyword": true, - "no-shadowed-variable": true, - "no-string-throw": true, - "no-trailing-whitespace": true, - "no-unused-expression": true, - "no-var-keyword": true, - "no-void-expression": { - "options": [ - "ignore-arrow-function-shorthand" - ] - }, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "one-variable-per-declaration": true, - "prefer-const": [ - true, - { - "destructuring": "all" - } - ], - "quotemark": [ - true, - "single", - "jsx-single", - "avoid-escape", - "avoid-template" - ], - "radix": false, - "semicolon": [ - true, - "always", - "ignore-interfaces" - ], - "space-before-function-paren": [ - true, - { - "anonymous": "always" - } - ], - "trailing-comma": false, - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef": [ - true, - "call-signature", - "property-declaration" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -} diff --git a/configs/warnings.eslintrc.json b/configs/warnings.eslintrc.json new file mode 100644 index 0000000000000..41c9ed548bcfc --- /dev/null +++ b/configs/warnings.eslintrc.json @@ -0,0 +1,6 @@ +{ + "rules": { + "@typescript-eslint/await-thenable": "warn", + "no-return-await": "warn" + } +} diff --git a/configs/warnings.tslint.json b/configs/warnings.tslint.json deleted file mode 100644 index 7bed2ac0a6457..0000000000000 --- a/configs/warnings.tslint.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "rules": { - "await-promise": { - "severity": "warning", - "options": [ - "Thenable", - "PromiseLike" - ] - }, - "deprecation": true, - "no-return-await": { - "severity": "warning" - } - } -} diff --git a/dev-packages/application-manager/.eslintrc.js b/dev-packages/application-manager/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/dev-packages/application-manager/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/dev-packages/application-manager/compile.tsconfig.json b/dev-packages/application-manager/compile.tsconfig.json index b8b72b49c8822..65064a6493638 100644 --- a/dev-packages/application-manager/compile.tsconfig.json +++ b/dev-packages/application-manager/compile.tsconfig.json @@ -1,10 +1,16 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../application-package/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/dev-packages/application-manager/package.json b/dev-packages/application-manager/package.json index a5deb04487b94..d96327ac6ef47 100644 --- a/dev-packages/application-manager/package.json +++ b/dev-packages/application-manager/package.json @@ -21,10 +21,10 @@ "main": "lib/index.js", "typings": "lib/index.d.ts", "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "dependencies": { diff --git a/dev-packages/application-manager/src/generator/abstract-generator.ts b/dev-packages/application-manager/src/generator/abstract-generator.ts index 93fe8dccfa287..2d449d94034d2 100644 --- a/dev-packages/application-manager/src/generator/abstract-generator.ts +++ b/dev-packages/application-manager/src/generator/abstract-generator.ts @@ -80,7 +80,7 @@ export abstract class AbstractGenerator { } protected prettyStringify(object: object): string { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return JSON.stringify(object, null, 4); } diff --git a/dev-packages/application-manager/src/generator/frontend-generator.ts b/dev-packages/application-manager/src/generator/frontend-generator.ts index 816d8bd5aad38..a1343f97ff574 100644 --- a/dev-packages/application-manager/src/generator/frontend-generator.ts +++ b/dev-packages/application-manager/src/generator/frontend-generator.ts @@ -69,7 +69,9 @@ require('reflect-metadata'); const { Container } = require('inversify'); const { FrontendApplication } = require('@theia/core/lib/browser'); const { frontendApplicationModule } = require('@theia/core/lib/browser/frontend-application-module'); -const { messagingFrontendModule } = require('@theia/core/lib/${this.pck.isBrowser() ? 'browser/messaging/messaging-frontend-module' : 'electron-browser/messaging/electron-messaging-frontend-module'}'); +const { messagingFrontendModule } = require('@theia/core/lib/${this.pck.isBrowser() + ? 'browser/messaging/messaging-frontend-module' + : 'electron-browser/messaging/electron-messaging-frontend-module'}'); const { loggerFrontendModule } = require('@theia/core/lib/browser/logger-frontend-module'); const { ThemeService } = require('@theia/core/lib/browser/theming'); const { FrontendApplicationConfigProvider } = require('@theia/core/lib/browser/frontend-application-config-provider'); diff --git a/dev-packages/application-package/.eslintrc.js b/dev-packages/application-package/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/dev-packages/application-package/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/dev-packages/application-package/compile.tsconfig.json b/dev-packages/application-package/compile.tsconfig.json index b8b72b49c8822..b973ddbc673a2 100644 --- a/dev-packages/application-package/compile.tsconfig.json +++ b/dev-packages/application-package/compile.tsconfig.json @@ -1,10 +1,12 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" - ] -} \ No newline at end of file + ], + "references": [] +} diff --git a/dev-packages/application-package/package.json b/dev-packages/application-package/package.json index 2fc6c132e380b..e7e60b4b84561 100644 --- a/dev-packages/application-package/package.json +++ b/dev-packages/application-package/package.json @@ -21,10 +21,10 @@ "main": "lib/index.js", "typings": "lib/index.d.ts", "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "dependencies": { diff --git a/dev-packages/application-package/src/application-package.ts b/dev-packages/application-package/src/application-package.ts index fff0fb8ced667..6d5344ff6257d 100644 --- a/dev-packages/application-package/src/application-package.ts +++ b/dev-packages/application-package/src/application-package.ts @@ -23,7 +23,7 @@ import { ApplicationProps } from './application-props'; // tslint:disable:no-implicit-dependencies -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export type ApplicationLog = (message?: any, ...optionalParams: any[]) => void; export class ApplicationPackageOptions { readonly projectPath: string; diff --git a/dev-packages/application-package/src/application-props.ts b/dev-packages/application-package/src/application-props.ts index cb1770d59d69b..7a539431ce08b 100644 --- a/dev-packages/application-package/src/application-props.ts +++ b/dev-packages/application-package/src/application-props.ts @@ -39,7 +39,7 @@ export namespace NpmRegistryProps { */ export interface ApplicationProps extends NpmRegistryProps { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly [key: string]: any; /** @@ -90,7 +90,7 @@ export namespace ApplicationProps { * Base configuration for the Theia application. */ export interface ApplicationConfig { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly [key: string]: any; } diff --git a/dev-packages/application-package/src/environment.ts b/dev-packages/application-package/src/environment.ts index c8b0fb2e97685..a6439ce4a5eec 100644 --- a/dev-packages/application-package/src/environment.ts +++ b/dev-packages/application-package/src/environment.ts @@ -46,7 +46,7 @@ class ElectronEnv { return this.is() && typeof process !== 'undefined' // `defaultApp` does not exist on the Node.js API, but on electron (`electron.d.ts`). - && ((process as any).defaultApp || /node_modules[/]electron[/]/.test(process.execPath)); // tslint:disable-line:no-any + && ((process as any).defaultApp || /node_modules[/]electron[/]/.test(process.execPath)); // eslint-disable-line @typescript-eslint/no-explicit-any } /** @@ -60,7 +60,7 @@ class ElectronEnv { * * Calling this function from the frontend does not make any sense, hence throw an error. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any runAsNodeEnv(env?: any): any & { ELECTRON_RUN_AS_NODE: 1 } { if (typeof process === 'undefined') { throw new Error("'process' cannot be undefined."); diff --git a/dev-packages/application-package/src/extension-package-collector.ts b/dev-packages/application-package/src/extension-package-collector.ts index 3347b3cfb0e6c..f44b72e387557 100644 --- a/dev-packages/application-package/src/extension-package-collector.ts +++ b/dev-packages/application-package/src/extension-package-collector.ts @@ -39,7 +39,7 @@ export class ExtensionPackageCollector { if (!pck.dependencies) { return; } - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const dependency in pck.dependencies) { const versionRange = pck.dependencies[dependency]!; this.collectPackage(dependency, versionRange); diff --git a/dev-packages/application-package/src/json-file.ts b/dev-packages/application-package/src/json-file.ts index c883ed8ef87a0..bc89783efdbd8 100644 --- a/dev-packages/application-package/src/json-file.ts +++ b/dev-packages/application-package/src/json-file.ts @@ -17,7 +17,7 @@ import * as fs from 'fs'; import writeJsonFile = require('write-json-file'); -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function readJsonFile(path: string): any { return JSON.parse(fs.readFileSync(path, { encoding: 'utf-8' })); } diff --git a/dev-packages/application-package/src/npm-registry.ts b/dev-packages/application-package/src/npm-registry.ts index 7816805004ba1..2210cee75c619 100644 --- a/dev-packages/application-package/src/npm-registry.ts +++ b/dev-packages/application-package/src/npm-registry.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as request from 'request'; const ChangesStream = require('changes-stream'); import { NpmRegistryProps } from './application-props'; diff --git a/dev-packages/cli/.eslintrc.js b/dev-packages/cli/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/dev-packages/cli/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/dev-packages/cli/compile.tsconfig.json b/dev-packages/cli/compile.tsconfig.json index b8b72b49c8822..9686bb1b2ef0c 100644 --- a/dev-packages/cli/compile.tsconfig.json +++ b/dev-packages/cli/compile.tsconfig.json @@ -1,10 +1,19 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../application-manager/compile.tsconfig.json" + }, + { + "path": "../application-package/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/dev-packages/cli/package.json b/dev-packages/cli/package.json index 9f83d3dc65604..fd43987a12dd0 100644 --- a/dev-packages/cli/package.json +++ b/dev-packages/cli/package.json @@ -23,11 +23,11 @@ "theia": "./bin/theia" }, "scripts": { - "prepare": "yarn run clean && yarn build", - "clean": "rimraf lib", - "build": "tsc -p compile.tsconfig.json", - "watch": "yarn build -w", - "test": "echo 'skip'" + "lint": "theiaext lint", + "build": "theiaext build", + "watch": "theiaext watch", + "clean": "theiaext clean", + "watch": "theiaext watch" }, "dependencies": { "@theia/application-manager": "^0.14.0", diff --git a/dev-packages/cli/src/theia.ts b/dev-packages/cli/src/theia.ts index 0c026d334ed82..760e174444d4b 100644 --- a/dev-packages/cli/src/theia.ts +++ b/dev-packages/cli/src/theia.ts @@ -142,7 +142,7 @@ function rebuildCommand(command: string, target: ApplicationProps.Target): yargs }); // see https://github.com/yargs/yargs/issues/287#issuecomment-314463783 - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const commands = (yargs as any).getCommandInstance().getCommands(); const argv = yargs.demandCommand(1).argv; const command = argv._[0]; diff --git a/dev-packages/electron/.eslintrc.js b/dev-packages/electron/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/dev-packages/electron/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/dev-packages/ext-scripts/package.json b/dev-packages/ext-scripts/package.json index 84c2bada13ec2..e2fdc62cd9e06 100644 --- a/dev-packages/ext-scripts/package.json +++ b/dev-packages/ext-scripts/package.json @@ -4,27 +4,21 @@ "version": "0.14.0", "license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0", "description": "NPM scripts for Theia packages.", - "files": [ - "theiaext" - ], "bin": { - "theiaext": "theiaext", - "run": "theia-run" + "theiaext": "theia-ext.js", + "run": "theia-run.js" }, - "scripts": { - "prepare": "echo 'skip'", - "clean": "echo 'skip'", - "build": "echo 'skip'", - "watch": "echo 'skip'", - "test": "echo 'skip'", - "ext:clean": "theiaext compile:clean && theiaext test:clean", + "theia-monorepo-scripts": { + "ext:clean": "theiaext compile:clean && theiaext lint:clean && theiaext test:clean", "ext:build": "concurrently -n compile,lint -c blue,green \"theiaext compile\" \"theiaext lint\"", - "ext:compile": "tsc -p compile.tsconfig.json", - "ext:compile:clean": "rimraf lib", - "ext:lint": "tslint -c ../../configs/build.tslint.json --project compile.tsconfig.json", - "ext:watch": "tsc -w -p compile.tsconfig.json", + "ext:compile": "tsc -b compile.tsconfig.json --verbose", + "ext:compile:clean": "rimraf lib *.tsbuildinfo", + "ext:lint": "eslint --cache=true --no-error-on-unmatched-pattern=true \"src/**/*.{ts,tsx}\" \"test/**/*.{ts,tsx}\"", + "ext:lint:clean": "rimraf .eslintcache", + "ext:watch": "tsc -p compile.tsconfig.json -w", + "ext:watch:slow": "tsc -b compile.tsconfig.json -w", "ext:test": "nyc mocha --opts ../../configs/mocha.opts \"./lib/**/*.*spec.js\"", "ext:test:watch": "mocha -w --opts ../../configs/mocha.opts \"./lib/**/*.*spec.js\"", - "ext:test:clean": "rimraf .nyc_output && rimraf coverage" + "ext:test:clean": "rimraf .nyc_output coverage" } } diff --git a/dev-packages/ext-scripts/theiaext b/dev-packages/ext-scripts/theia-ext.js similarity index 67% rename from dev-packages/ext-scripts/theiaext rename to dev-packages/ext-scripts/theia-ext.js index 03e48569562af..7837af4c0cd1a 100755 --- a/dev-packages/ext-scripts/theiaext +++ b/dev-packages/ext-scripts/theia-ext.js @@ -1,4 +1,5 @@ #!/usr/bin/env node + /******************************************************************************** * Copyright (C) 2017 TypeFox and others. * @@ -20,25 +21,34 @@ const cp = require('child_process'); const extScriptsPck = require(path.resolve(__dirname, 'package.json')); +/** + * Lookup the requested ext:script to run, returns the full command line to execute. + */ function getExtScript() { - const commandIndex = process.argv.findIndex(arg => arg.endsWith('theiaext')) + 1; - const args = process.argv.slice(commandIndex); + // process.argv are always like [0:node, 1:script, 2:...args] + const args = process.argv.slice(2); if (!args[0]) { throw new Error('Please specify the script that runs with theiaext command.'); } + const scripts = extScriptsPck['theia-monorepo-scripts']; const script = 'ext:' + args[0]; - if (!(script in extScriptsPck.scripts)) { + if (!(script in scripts)) { throw new Error('The ext script does not exist: ' + script); } - return [extScriptsPck.scripts[script], ...args.slice(1, args.length)].join(' '); + return [scripts[script], ...args.slice(1, args.length)].join(' '); } +/** + * Essentially wraps `child_process.exec` into a promise. + * + * @param script Command line to run as a shell command. + */ function run(script) { return new Promise((resolve, reject) => { const env = Object.assign({}, process.env); const scriptProcess = cp.exec(script, { + cwd: process.cwd(), env, - cwd: process.cwd() }); scriptProcess.stdout.pipe(process.stdout); scriptProcess.stderr.pipe(process.stderr); @@ -48,19 +58,26 @@ function run(script) { } (async () => { + /** @type {Error | number} */ let exitCode = 0; let extScript = undefined; try { extScript = getExtScript(); + console.debug(`$ ${extScript}`); exitCode = await run(extScript); } catch (err) { if (extScript) { - console.error(`Error occurred in theiaext when executing: '${extScript}'`, err); + console.error(`Error occurred in theiaext when executing: ${extScript}\n`); } else { - console.error('Error occurred in theiaext', err); + console.error('Error occurred in theiaext.'); } - console.log(`${err.name}: ${err.message}`); - exitCode = 1; + console.error(err); + exitCode = err; + } + if (typeof exitCode !== 'number') { + exitCode = 1; // Error happened without the process starting. + } else if (exitCode) { + console.error(`Exit with failure status (${exitCode}): ${extScript}`); } process.exit(exitCode); })(); diff --git a/dev-packages/ext-scripts/theia-run b/dev-packages/ext-scripts/theia-run.js similarity index 99% rename from dev-packages/ext-scripts/theia-run rename to dev-packages/ext-scripts/theia-run.js index 423553303bce2..ca1854487552b 100755 --- a/dev-packages/ext-scripts/theia-run +++ b/dev-packages/ext-scripts/theia-run.js @@ -1,4 +1,5 @@ #!/usr/bin/env node + /******************************************************************************** * Copyright (C) 2017 TypeFox and others. * @@ -22,4 +23,4 @@ const args = process.argv.slice(index + 1); const scopedArgs = args.length > 1 ? [args[0], '--scope', ...args.slice(1)] : args; process.argv = [...process.argv.slice(0, index + 1), 'run', ...scopedArgs]; -require(path.resolve(__dirname, '..', '..', 'scripts', 'lerna')); \ No newline at end of file +require(path.resolve(__dirname, '..', '..', 'scripts', 'lerna')); diff --git a/examples/api-samples/.eslintrc.js b/examples/api-samples/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/examples/api-samples/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/examples/api-samples/compile.tsconfig.json b/examples/api-samples/compile.tsconfig.json index a23513b5e6b13..4e5540e26056b 100644 --- a/examples/api-samples/compile.tsconfig.json +++ b/examples/api-samples/compile.tsconfig.json @@ -1,10 +1,16 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../../packages/core/compile.tsconfig.json" + } ] } diff --git a/examples/api-samples/package.json b/examples/api-samples/package.json index 9aea7623ab309..5b079094db6ba 100644 --- a/examples/api-samples/package.json +++ b/examples/api-samples/package.json @@ -28,9 +28,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", + "watch": "theiaext watch", + "clean": "theiaext clean", "watch": "theiaext watch" }, "devDependencies": { diff --git a/examples/api-samples/src/browser/api-samples-contribution.ts b/examples/api-samples/src/browser/api-samples-contribution.ts index 01092689a7e21..14c856fa1a848 100644 --- a/examples/api-samples/src/browser/api-samples-contribution.ts +++ b/examples/api-samples/src/browser/api-samples-contribution.ts @@ -47,7 +47,7 @@ export class ExampleLabelProviderCommandHandler implements CommandHandler { constructor(private readonly labelProviderContribution: SampleDynamicLabelProviderContribution) { } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute(...args: any[]): any { this.labelProviderContribution.toggle(); } diff --git a/examples/browser/.eslintrc.js b/examples/browser/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/examples/browser/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/examples/browser/compile.tsconfig.json b/examples/browser/compile.tsconfig.json index 89bf8fec966b4..6ccb7cfec635e 100644 --- a/examples/browser/compile.tsconfig.json +++ b/examples/browser/compile.tsconfig.json @@ -1,9 +1,153 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "outDir": "lib/test" }, "include": [ "test" + ], + "references": [ + { + "path": "../../dev-packages/cli/compile.tsconfig.json" + }, + { + "path": "../api-samples/compile.tsconfig.json" + }, + { + "path": "../../packages/callhierarchy/compile.tsconfig.json" + }, + { + "path": "../../packages/console/compile.tsconfig.json" + }, + { + "path": "../../packages/core/compile.tsconfig.json" + }, + { + "path": "../../packages/debug/compile.tsconfig.json" + }, + { + "path": "../../packages/debug-nodejs/compile.tsconfig.json" + }, + { + "path": "../../packages/editor/compile.tsconfig.json" + }, + { + "path": "../../packages/editor-preview/compile.tsconfig.json" + }, + { + "path": "../../packages/editorconfig/compile.tsconfig.json" + }, + { + "path": "../../packages/file-search/compile.tsconfig.json" + }, + { + "path": "../../packages/filesystem/compile.tsconfig.json" + }, + { + "path": "../../packages/getting-started/compile.tsconfig.json" + }, + { + "path": "../../packages/git/compile.tsconfig.json" + }, + { + "path": "../../packages/java/compile.tsconfig.json" + }, + { + "path": "../../packages/java-debug/compile.tsconfig.json" + }, + { + "path": "../../packages/json/compile.tsconfig.json" + }, + { + "path": "../../packages/keymaps/compile.tsconfig.json" + }, + { + "path": "../../packages/languages/compile.tsconfig.json" + }, + { + "path": "../../packages/markers/compile.tsconfig.json" + }, + { + "path": "../../packages/merge-conflicts/compile.tsconfig.json" + }, + { + "path": "../../packages/messages/compile.tsconfig.json" + }, + { + "path": "../../packages/metrics/compile.tsconfig.json" + }, + { + "path": "../../packages/mini-browser/compile.tsconfig.json" + }, + { + "path": "../../packages/monaco/compile.tsconfig.json" + }, + { + "path": "../../packages/navigator/compile.tsconfig.json" + }, + { + "path": "../../packages/outline-view/compile.tsconfig.json" + }, + { + "path": "../../packages/output/compile.tsconfig.json" + }, + { + "path": "../../packages/plugin-dev/compile.tsconfig.json" + }, + { + "path": "../../packages/plugin-ext/compile.tsconfig.json" + }, + { + "path": "../../packages/plugin-ext-vscode/compile.tsconfig.json" + }, + { + "path": "../../packages/plugin-metrics/compile.tsconfig.json" + }, + { + "path": "../../packages/preferences/compile.tsconfig.json" + }, + { + "path": "../../packages/preview/compile.tsconfig.json" + }, + { + "path": "../../packages/process/compile.tsconfig.json" + }, + { + "path": "../../packages/python/compile.tsconfig.json" + }, + { + "path": "../../packages/scm/compile.tsconfig.json" + }, + { + "path": "../../packages/search-in-workspace/compile.tsconfig.json" + }, + { + "path": "../../packages/task/compile.tsconfig.json" + }, + { + "path": "../../packages/terminal/compile.tsconfig.json" + }, + { + "path": "../../packages/textmate-grammars/compile.tsconfig.json" + }, + { + "path": "../../packages/tslint/compile.tsconfig.json" + }, + { + "path": "../../packages/typehierarchy/compile.tsconfig.json" + }, + { + "path": "../../packages/typescript/compile.tsconfig.json" + }, + { + "path": "../../packages/userstorage/compile.tsconfig.json" + }, + { + "path": "../../packages/variable-resolver/compile.tsconfig.json" + }, + { + "path": "../../packages/workspace/compile.tsconfig.json" + } ] } diff --git a/examples/browser/package.json b/examples/browser/package.json index f890769ca85f5..6cb23f4235043 100644 --- a/examples/browser/package.json +++ b/examples/browser/package.json @@ -62,9 +62,10 @@ "@theia/workspace": "^0.14.0" }, "scripts": { - "prepare": "yarn run clean && yarn build", + "lint": "theiaext lint", "clean": "theia clean && rimraf errorShots", - "build": "theiaext compile && theia build --mode development", + "build": "theiaext compile && yarn bundle", + "bundle": "theia build --mode development", "watch": "concurrently -n compile,bundle \"theiaext watch --preserveWatchOutput\" \"theia build --watch --mode development\"", "start": "theia start --plugins=local-dir:../../plugins", "start:debug": "yarn start --log-level=debug", diff --git a/examples/browser/test/left-panel/left-panel.ui-spec.ts b/examples/browser/test/left-panel/left-panel.ui-spec.ts index 4beae14bdb367..f16dad71a53d8 100644 --- a/examples/browser/test/left-panel/left-panel.ui-spec.ts +++ b/examples/browser/test/left-panel/left-panel.ui-spec.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -/* tslint:disable:no-unused-expression*/ +/* eslint-disable no-unused-expressions */ import { expect } from 'chai'; import { LeftPanel } from './left-panel'; import { MainPage } from '../main-page/main-page'; diff --git a/examples/browser/test/main-page/main-page.ui-spec.ts b/examples/browser/test/main-page/main-page.ui-spec.ts index 2a2bf70cabe5d..a325726cbcaa2 100644 --- a/examples/browser/test/main-page/main-page.ui-spec.ts +++ b/examples/browser/test/main-page/main-page.ui-spec.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -/* tslint:disable:no-unused-expression*/ +/* eslint-disable no-unused-expressions */ import { MainPage } from './main-page'; import { expect } from 'chai'; diff --git a/examples/browser/test/right-panel/right-panel.ui-spec.ts b/examples/browser/test/right-panel/right-panel.ui-spec.ts index ac6ce45d784e4..88024286778ab 100644 --- a/examples/browser/test/right-panel/right-panel.ui-spec.ts +++ b/examples/browser/test/right-panel/right-panel.ui-spec.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -/* tslint:disable:no-unused-expression*/ +/* eslint-disable no-unused-expressions */ import { expect } from 'chai'; import { RightPanel } from './right-panel'; import { MainPage } from '../main-page/main-page'; diff --git a/examples/browser/test/top-panel/top-panel.ui-spec.ts b/examples/browser/test/top-panel/top-panel.ui-spec.ts index 40bb67a132719..c54245055cd2c 100644 --- a/examples/browser/test/top-panel/top-panel.ui-spec.ts +++ b/examples/browser/test/top-panel/top-panel.ui-spec.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -/* tslint:disable:no-unused-expression*/ +/* eslint-disable no-unused-expressions */ import { expect } from 'chai'; import { TopPanel } from './top-panel'; import { BottomPanel } from '../bottom-panel/bottom-panel'; diff --git a/examples/electron/.eslintrc.js b/examples/electron/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/examples/electron/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/examples/electron/compile.tsconfig.json b/examples/electron/compile.tsconfig.json index 89bf8fec966b4..bca2abd876377 100644 --- a/examples/electron/compile.tsconfig.json +++ b/examples/electron/compile.tsconfig.json @@ -1,9 +1,150 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "outDir": "lib/test" }, "include": [ "test" + ], + "references": [ + { + "path": "../../dev-packages/cli/compile.tsconfig.json" + }, + { + "path": "../api-samples/compile.tsconfig.json" + }, + { + "path": "../../packages/callhierarchy/compile.tsconfig.json" + }, + { + "path": "../../packages/console/compile.tsconfig.json" + }, + { + "path": "../../packages/core/compile.tsconfig.json" + }, + { + "path": "../../packages/debug/compile.tsconfig.json" + }, + { + "path": "../../packages/debug-nodejs/compile.tsconfig.json" + }, + { + "path": "../../packages/editor/compile.tsconfig.json" + }, + { + "path": "../../packages/editor-preview/compile.tsconfig.json" + }, + { + "path": "../../packages/editorconfig/compile.tsconfig.json" + }, + { + "path": "../../packages/file-search/compile.tsconfig.json" + }, + { + "path": "../../packages/filesystem/compile.tsconfig.json" + }, + { + "path": "../../packages/getting-started/compile.tsconfig.json" + }, + { + "path": "../../packages/git/compile.tsconfig.json" + }, + { + "path": "../../packages/java/compile.tsconfig.json" + }, + { + "path": "../../packages/java-debug/compile.tsconfig.json" + }, + { + "path": "../../packages/json/compile.tsconfig.json" + }, + { + "path": "../../packages/keymaps/compile.tsconfig.json" + }, + { + "path": "../../packages/languages/compile.tsconfig.json" + }, + { + "path": "../../packages/markers/compile.tsconfig.json" + }, + { + "path": "../../packages/merge-conflicts/compile.tsconfig.json" + }, + { + "path": "../../packages/messages/compile.tsconfig.json" + }, + { + "path": "../../packages/metrics/compile.tsconfig.json" + }, + { + "path": "../../packages/mini-browser/compile.tsconfig.json" + }, + { + "path": "../../packages/monaco/compile.tsconfig.json" + }, + { + "path": "../../packages/navigator/compile.tsconfig.json" + }, + { + "path": "../../packages/outline-view/compile.tsconfig.json" + }, + { + "path": "../../packages/output/compile.tsconfig.json" + }, + { + "path": "../../packages/plugin-dev/compile.tsconfig.json" + }, + { + "path": "../../packages/plugin-ext/compile.tsconfig.json" + }, + { + "path": "../../packages/plugin-ext-vscode/compile.tsconfig.json" + }, + { + "path": "../../packages/preferences/compile.tsconfig.json" + }, + { + "path": "../../packages/preview/compile.tsconfig.json" + }, + { + "path": "../../packages/process/compile.tsconfig.json" + }, + { + "path": "../../packages/python/compile.tsconfig.json" + }, + { + "path": "../../packages/scm/compile.tsconfig.json" + }, + { + "path": "../../packages/search-in-workspace/compile.tsconfig.json" + }, + { + "path": "../../packages/task/compile.tsconfig.json" + }, + { + "path": "../../packages/terminal/compile.tsconfig.json" + }, + { + "path": "../../packages/textmate-grammars/compile.tsconfig.json" + }, + { + "path": "../../packages/tslint/compile.tsconfig.json" + }, + { + "path": "../../packages/typehierarchy/compile.tsconfig.json" + }, + { + "path": "../../packages/typescript/compile.tsconfig.json" + }, + { + "path": "../../packages/userstorage/compile.tsconfig.json" + }, + { + "path": "../../packages/variable-resolver/compile.tsconfig.json" + }, + { + "path": "../../packages/workspace/compile.tsconfig.json" + } ] } diff --git a/examples/electron/package.json b/examples/electron/package.json index 10763cd092a28..2806d1a875af8 100644 --- a/examples/electron/package.json +++ b/examples/electron/package.json @@ -59,9 +59,10 @@ "@theia/workspace": "^0.14.0" }, "scripts": { - "prepare": "yarn run clean && yarn build", + "lint": "theiaext lint", "clean": "theia clean", - "build": "theiaext compile && theia build --mode development", + "build": "theiaext compile && yarn bundle", + "bundle": "theia build --mode development", "watch": "concurrently -n compile,bundle \"theiaext watch --preserveWatchOutput\" \"theia build --watch --mode development\"", "start": "theia start --plugins=local-dir:../../plugins", "start:debug": "yarn start --log-level=debug", diff --git a/examples/electron/test/basic-example.espec.ts b/examples/electron/test/basic-example.espec.ts index e6547b704bfd4..35f4ad8dd36df 100644 --- a/examples/electron/test/basic-example.espec.ts +++ b/examples/electron/test/basic-example.espec.ts @@ -36,7 +36,7 @@ describe.skip('basic-example-spec', () => { mainWindow.webContents.openDevTools(); mainWindow.loadURL(`file://${path.join(__dirname, 'index.html')}`); - // tslint:disable-next-line:no-unused-expression + // eslint-disable-next-line no-unused-expressions expect(mainWindow.isVisible()).to.be.true; }); }); diff --git a/package.json b/package.json index 45919cd515932..bcb0921c65fb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "name": "parent", + "name": "@theia/monorepo", "version": "0.0.0", "engines": { "yarn": "1.0.x || >=1.2.1", @@ -20,10 +20,16 @@ "@types/temp": "^0.8.29", "@types/uuid": "^3.4.3", "@types/webdriverio": "^4.7.0", + "@typescript-eslint/eslint-plugin": "^2.16.0", + "@typescript-eslint/eslint-plugin-tslint": "^2.16.0", + "@typescript-eslint/parser": "^2.16.0", "chai": "^4.1.0", "chai-string": "^1.4.0", "concurrently": "^3.5.0", "electron-mocha": "~3.5.0", + "eslint": "^6.8.0", + "eslint-plugin-import": "^2.20.0", + "eslint-plugin-no-null": "^1.0.2", "ignore-styles": "^5.0.1", "istanbul": "^0.4.5", "istanbul-instrumenter-loader": "^3.0.1", @@ -36,7 +42,6 @@ "sinon": "^3.3.0", "temp": "^0.8.3", "tslint": "^5.12.0", - "tslint-language-service": "^0.9.9", "typedoc": "^0.15.0-0", "typedoc-plugin-external-module-map": "^1.0.0", "typescript": "~3.5.3", @@ -47,13 +52,18 @@ "webdriverio": "4.14.1" }, "scripts": { + "preinstall": "node-gyp install", "postinstall": "node scripts/post-install.js", - "prepare": "node scripts/skip-prepare || ( yarn prepare:travis && yarn rebuild:clean && yarn build:clean && yarn prepare:hoisting )", + "prepare": "yarn prepare:travis && yarn prepare:build && yarn prepare:hoisting", + "prepare:build": "yarn build && run lint && run bundle \"@theia/example-*\" --stream --parallel", "prepare:travis": "node scripts/prepare-travis", "prepare:hoisting": "theia check:hoisted -s", - "preinstall": "node-gyp install", - "build": "run build", - "build:clean": "run prepare", + "clean": "yarn lint:clean && node scripts/run-reverse-topo.js yarn clean", + "build": "tsc -b compile.tsconfig.json --verbose", + "watch": "tsc -b compile.tsconfig.json -w", + "lint": "run lint", + "lint:clean": "rimraf .eslintcache", + "lint:oneshot": "node --max-old-space-size=8192 node_modules/eslint/bin/eslint.js --cache=true \"dev-packages/*/src/**/*.{ts,tsx}\" \"packages/*/src/**/*.{ts,tsx}\" \"examples/**/*.{ts,tsx}\"", "docs": "rimraf gh-pages/docs/next && typedoc --tsconfig configs/typedoc-tsconfig.json --options configs/typedoc.json", "test": "yarn test:theia && yarn test:electron && yarn test:browser", "test:theia": "run test \"@theia/!(example-)*\" --stream --concurrency=1", @@ -63,14 +73,13 @@ "rebuild:browser": "theia rebuild:browser", "rebuild:electron": "theia rebuild:electron", "rebuild:electron:debug": "DEBUG=electron-rebuild && yarn rebuild:electron", - "watch": "lerna run watch --scope \"@theia/!(example-)*\" --parallel", "publish": "yarn && yarn test && yarn publish:latest", "publish:latest": "lerna publish && yarn publish:check", "publish:next": "yarn next:publish && yarn next:publish --skip-npm && yarn publish:check", "next:publish": "lerna publish --exact --canary=next --npm-tag=next --yes", "publish:check": "node scripts/check-publish.js", - "start:browser": "yarn rebuild:browser && run start \"@theia/example-browser\"", - "start:electron": "yarn rebuild:electron && run start \"@theia/example-electron\"" + "start:browser": "yarn rebuild:browser && yarn --cwd examples/browser start", + "start:electron": "yarn rebuild:electron && yarn --cwd examples/electron start" }, "workspaces": [ "dev-packages/*", diff --git a/packages/callhierarchy/.eslintrc.js b/packages/callhierarchy/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/callhierarchy/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/callhierarchy/compile.tsconfig.json b/packages/callhierarchy/compile.tsconfig.json index d60362fb6b118..c739919d36b13 100644 --- a/packages/callhierarchy/compile.tsconfig.json +++ b/packages/callhierarchy/compile.tsconfig.json @@ -1,10 +1,25 @@ { - "extends": "../../configs/base.tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "lib" + "extends": "../../configs/base.tsconfig.json", + "compilerOptions": { + "composite": true, + "rootDir": "src", + "outDir": "lib" + }, + "include": [ + "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" }, - "include": [ - "src" - ] -} \ No newline at end of file + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + } + ] +} diff --git a/packages/callhierarchy/package.json b/packages/callhierarchy/package.json index af77fb1956f84..f00dd4a199cf4 100644 --- a/packages/callhierarchy/package.json +++ b/packages/callhierarchy/package.json @@ -34,10 +34,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/callhierarchy/src/browser/callhierarchy-context.ts b/packages/callhierarchy/src/browser/callhierarchy-context.ts index 373e6de060260..0c252d3e04ce3 100644 --- a/packages/callhierarchy/src/browser/callhierarchy-context.ts +++ b/packages/callhierarchy/src/browser/callhierarchy-context.ts @@ -58,7 +58,7 @@ export class CallHierarchyContext implements Disposable { const { line, character } = location.range.start; // Definition can be null - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null let locations: Location | Location[] | LocationLink[] | null = null; try { locations = await this.languageClient.sendRequest(DefinitionRequest.type, { diff --git a/packages/callhierarchy/src/browser/callhierarchy-tree/callhierarchy-tree-widget.tsx b/packages/callhierarchy/src/browser/callhierarchy-tree/callhierarchy-tree-widget.tsx index 76065f0ee1bcc..1efa9a9106606 100644 --- a/packages/callhierarchy/src/browser/callhierarchy-tree/callhierarchy-tree-widget.tsx +++ b/packages/callhierarchy/src/browser/callhierarchy-tree/callhierarchy-tree-widget.tsx @@ -199,11 +199,11 @@ export class CallHierarchyTreeWidget extends TreeWidget { } restoreState(oldState: object): void { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any if ((oldState as any).root && (oldState as any).languageId) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.model.root = this.inflateFromStorage((oldState as any).root); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.model.initializeCallHierarchy((oldState as any).languageId, (this.model.root as DefinitionNode).definition.location); } } diff --git a/packages/console/.eslintrc.js b/packages/console/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/console/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/console/compile.tsconfig.json b/packages/console/compile.tsconfig.json index a23513b5e6b13..768a8850349fa 100644 --- a/packages/console/compile.tsconfig.json +++ b/packages/console/compile.tsconfig.json @@ -1,10 +1,19 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + } ] } diff --git a/packages/console/package.json b/packages/console/package.json index c2d51e8caa52b..3b401b0ca3502 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -32,10 +32,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/console/src/browser/console-contribution.ts b/packages/console/src/browser/console-contribution.ts index e57e830657bc6..989011fb8bdaa 100644 --- a/packages/console/src/browser/console-contribution.ts +++ b/packages/console/src/browser/console-contribution.ts @@ -115,7 +115,7 @@ export class ConsoleContribution implements FrontendApplicationContribution, Com } } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export type ConsoleExecuteFunction = (console: ConsoleWidget, ...args: any[]) => any; export class ConsoleCommandHandler implements CommandHandler { @@ -132,7 +132,7 @@ export class ConsoleCommandHandler implements CommandHandler { return !!this.manager.currentConsole; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute(...args: any[]): any { const { currentConsole } = this.manager; if (currentConsole) { diff --git a/packages/console/src/browser/console-widget.ts b/packages/console/src/browser/console-widget.ts index 48b7a9cf27a26..11c9a2940f2ec 100644 --- a/packages/console/src/browser/console-widget.ts +++ b/packages/console/src/browser/console-widget.ts @@ -244,12 +244,12 @@ export class ConsoleWidget extends BaseWidget implements StatefulWidget { restoreState(oldState: object): void { if ('history' in oldState) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.history.restore((oldState)['history']); } this.input.getControl().setValue(this.history.current || ''); if ('input' in oldState) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.input.restoreViewState((oldState)['input']); } } diff --git a/packages/core/.eslintrc.js b/packages/core/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/core/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/core/compile.tsconfig.json b/packages/core/compile.tsconfig.json index 4c867a02d2696..cf80413b1f375 100644 --- a/packages/core/compile.tsconfig.json +++ b/packages/core/compile.tsconfig.json @@ -1,11 +1,17 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "baseUrl": "." }, "include": [ "src" + ], + "references": [ + { + "path": "../../dev-packages/application-package/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/core/package.json b/packages/core/package.json index 21dd241e62ca4..f7958a6235365 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -80,10 +80,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test", "generate-layout": "electron ./scripts/generate-layout" }, diff --git a/packages/core/src/browser/browser-clipboard-service.ts b/packages/core/src/browser/browser-clipboard-service.ts index fd84ed6ab9e47..d5fd8e745606f 100644 --- a/packages/core/src/browser/browser-clipboard-service.ts +++ b/packages/core/src/browser/browser-clipboard-service.ts @@ -44,13 +44,13 @@ export class BrowserClipboardService implements ClipboardService { let permission; try { permission = await this.queryPermission('clipboard-read'); - } catch (e) { - this.logger.error('Failed checking a clipboard-read permission.', e); + } catch (e1) { + this.logger.error('Failed checking a clipboard-read permission.', e1); // in FireFox, Clipboard API isn't gated with the permissions try { return await this.getClipboardAPI().readText(); - } catch (e) { - this.logger.error('Failed reading clipboard content.', e); + } catch (e2) { + this.logger.error('Failed reading clipboard content.', e2); if (isFirefox) { this.messageService.warn(`Clipboard API is not available. It can be enabled by 'dom.events.testing.asyncClipboard' preference on 'about:config' page. Then reload Theia. @@ -71,14 +71,14 @@ export class BrowserClipboardService implements ClipboardService { let permission; try { permission = await this.queryPermission('clipboard-write'); - } catch (e) { - this.logger.error('Failed checking a clipboard-write permission.', e); + } catch (e1) { + this.logger.error('Failed checking a clipboard-write permission.', e1); // in FireFox, Clipboard API isn't gated with the permissions try { await this.getClipboardAPI().writeText(value); return; - } catch (e) { - this.logger.error('Failed writing to the clipboard.', e); + } catch (e2) { + this.logger.error('Failed writing to the clipboard.', e2); if (isFirefox) { this.messageService.warn(`Clipboard API is not available. It can be enabled by 'dom.events.testing.asyncClipboard' preference on 'about:config' page. Then reload Theia. diff --git a/packages/core/src/browser/browser.ts b/packages/core/src/browser/browser.ts index bed9e22319a4b..9a7d92f22aca3 100644 --- a/packages/core/src/browser/browser.ts +++ b/packages/core/src/browser/browser.ts @@ -30,9 +30,9 @@ export const isWebKit = (userAgent.indexOf('AppleWebKit') >= 0); export const isChrome = (userAgent.indexOf('Chrome') >= 0); export const isSafari = (userAgent.indexOf('Chrome') === -1) && (userAgent.indexOf('Safari') >= 0); export const isIPad = (userAgent.indexOf('iPad') >= 0); -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const isNative = typeof (window as any).process !== 'undefined'; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const isBasicWasmSupported = typeof (window as any).WebAssembly !== 'undefined'; /** @@ -88,6 +88,7 @@ interface ElementScroll { function getMonacoEditorScroll(elem: HTMLElement): ElementScroll | undefined { const linesContent = elem.querySelector('.lines-content') as HTMLElement; const viewLines = elem.querySelector('.view-lines') as HTMLElement; + // eslint-disable-next-line no-null/no-null if (linesContent === null || viewLines === null) { return undefined; } diff --git a/packages/core/src/browser/common-frontend-contribution.ts b/packages/core/src/browser/common-frontend-contribution.ts index e67ca2c0944bb..beea34092f3d1 100644 --- a/packages/core/src/browser/common-frontend-contribution.ts +++ b/packages/core/src/browser/common-frontend-contribution.ts @@ -14,6 +14,8 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ +/* eslint-disable max-len */ + import debounce = require('lodash.debounce'); import { injectable, inject, postConstruct } from 'inversify'; import { TabBar, Widget, Title } from '@phosphor/widgets'; @@ -808,16 +810,16 @@ export class CommonFrontendContribution implements FrontendApplicationContributi this.quickOpenService.open({ onType: (_, accept) => accept(items) }, { - placeholder: 'Select File Icon Theme', - fuzzyMatchLabel: true, - selectIndex: () => items.findIndex(item => item.id === this.iconThemes.current), - onClose: () => { - if (resetTo) { - previewTheme.cancel(); - this.iconThemes.current = resetTo; - } + placeholder: 'Select File Icon Theme', + fuzzyMatchLabel: true, + selectIndex: () => items.findIndex(item => item.id === this.iconThemes.current), + onClose: () => { + if (resetTo) { + previewTheme.cancel(); + this.iconThemes.current = resetTo; } - }); + } + }); } protected selectColorTheme(): void { @@ -847,19 +849,19 @@ export class CommonFrontendContribution implements FrontendApplicationContributi this.quickOpenService.open({ onType: (_, accept) => accept(items) }, { - placeholder: 'Select Color Theme (Up/Down Keys to Preview)', - fuzzyMatchLabel: true, - selectIndex: () => { - const current = this.themeService.getCurrentTheme().id; - return items.findIndex(item => item.id === current); - }, - onClose: () => { - if (resetTo) { - previewTheme.cancel(); - this.themeService.setCurrentTheme(resetTo); - } + placeholder: 'Select Color Theme (Up/Down Keys to Preview)', + fuzzyMatchLabel: true, + selectIndex: () => { + const current = this.themeService.getCurrentTheme().id; + return items.findIndex(item => item.id === current); + }, + onClose: () => { + if (resetTo) { + previewTheme.cancel(); + this.themeService.setCurrentTheme(resetTo); } - }); + } + }); } registerColors(colors: ColorRegistry): void { @@ -896,18 +898,18 @@ export class CommonFrontendContribution implements FrontendApplicationContributi hc: '#000000' }, description: 'Activity bar background color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.' }, { - id: 'activityBar.foreground', defaults: { - dark: Color.white, - light: Color.white, - hc: Color.white - }, description: 'Activity bar item foreground color when it is active. The activity bar is showing on the far left or right and allows to switch between views of the side bar.', - }, { - id: 'activityBar.inactiveForeground', defaults: { - dark: Color.transparent('activityBar.foreground', 0.4), - light: Color.transparent('activityBar.foreground', 0.4), - hc: Color.white - }, description: 'Activity bar item foreground color when it is inactive. The activity bar is showing on the far left or right and allows to switch between views of the side bar.' - }, + id: 'activityBar.foreground', defaults: { + dark: Color.white, + light: Color.white, + hc: Color.white + }, description: 'Activity bar item foreground color when it is active. The activity bar is showing on the far left or right and allows to switch between views of the side bar.', + }, { + id: 'activityBar.inactiveForeground', defaults: { + dark: Color.transparent('activityBar.foreground', 0.4), + light: Color.transparent('activityBar.foreground', 0.4), + hc: Color.white + }, description: 'Activity bar item foreground color when it is inactive. The activity bar is showing on the far left or right and allows to switch between views of the side bar.' + }, { id: 'activityBar.border', defaults: { hc: 'contrastBorder' @@ -1101,20 +1103,20 @@ export class CommonFrontendContribution implements FrontendApplicationContributi id: 'tab.hoverBackground', description: 'Tab background color when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.' }, { - id: 'tab.unfocusedHoverBackground', defaults: { - dark: Color.transparent('tab.hoverBackground', 0.5), - light: Color.transparent('tab.hoverBackground', 0.7) - }, description: 'Tab background color in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.' - }, + id: 'tab.unfocusedHoverBackground', defaults: { + dark: Color.transparent('tab.hoverBackground', 0.5), + light: Color.transparent('tab.hoverBackground', 0.7) + }, description: 'Tab background color in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.' + }, { id: 'tab.hoverBorder', description: 'Border to highlight tabs when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.' }, { - id: 'tab.unfocusedHoverBorder', defaults: { - dark: Color.transparent('tab.hoverBorder', 0.5), - light: Color.transparent('tab.hoverBorder', 0.7) - }, description: 'Border to highlight tabs in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.' - }, + id: 'tab.unfocusedHoverBorder', defaults: { + dark: Color.transparent('tab.hoverBorder', 0.5), + light: Color.transparent('tab.hoverBorder', 0.7) + }, description: 'Border to highlight tabs in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.' + }, { id: 'tab.activeModifiedBorder', defaults: { dark: '#3399CC', @@ -1271,21 +1273,21 @@ export class CommonFrontendContribution implements FrontendApplicationContributi light: Color.transparent('titleBar.activeForeground', 0.6) }, description: 'Title bar foreground when the window is inactive. Note that this color is currently only supported on macOS.' }, { - id: 'titleBar.activeBackground', defaults: { - dark: '#3C3C3C', - light: '#DDDDDD', - hc: '#000000' - }, description: 'Title bar background when the window is active. Note that this color is currently only supported on macOS.' - }, { - id: 'titleBar.inactiveBackground', defaults: { - dark: Color.transparent('titleBar.activeBackground', 0.6), - light: Color.transparent('titleBar.activeBackground', 0.6) - }, description: 'Title bar background when the window is inactive. Note that this color is currently only supported on macOS.' - }, { - id: 'titleBar.border', defaults: { - hc: 'contrastBorder' - }, description: 'Title bar border color. Note that this color is currently only supported on macOS.' - }, + id: 'titleBar.activeBackground', defaults: { + dark: '#3C3C3C', + light: '#DDDDDD', + hc: '#000000' + }, description: 'Title bar background when the window is active. Note that this color is currently only supported on macOS.' + }, { + id: 'titleBar.inactiveBackground', defaults: { + dark: Color.transparent('titleBar.activeBackground', 0.6), + light: Color.transparent('titleBar.activeBackground', 0.6) + }, description: 'Title bar background when the window is inactive. Note that this color is currently only supported on macOS.' + }, { + id: 'titleBar.border', defaults: { + hc: 'contrastBorder' + }, description: 'Title bar border color. Note that this color is currently only supported on macOS.' + }, // Menu Bar colors should be aligned with https://code.visualstudio.com/api/references/theme-color#menu-bar-colors { @@ -1295,33 +1297,33 @@ export class CommonFrontendContribution implements FrontendApplicationContributi hc: 'titleBar.activeForeground' }, description: 'Foreground color of the selected menu item in the menubar.' }, { - id: 'menubar.selectionBackground', defaults: { - dark: Color.transparent('#ffffff', 0.1), - light: Color.transparent('#000000', 0.1) - }, description: 'Background color of the selected menu item in the menubar.' - }, { - id: 'menubar.selectionBorder', defaults: { - hc: 'activeContrastBorder' - }, description: 'Border color of the selected menu item in the menubar.' - }, + id: 'menubar.selectionBackground', defaults: { + dark: Color.transparent('#ffffff', 0.1), + light: Color.transparent('#000000', 0.1) + }, description: 'Background color of the selected menu item in the menubar.' + }, { + id: 'menubar.selectionBorder', defaults: { + hc: 'activeContrastBorder' + }, description: 'Border color of the selected menu item in the menubar.' + }, { id: 'menu.border', defaults: { hc: 'contrastBorder' }, description: 'Border color of menus.' }, { - id: 'menu.foreground', defaults: { - dark: 'dropdown.foreground', light: 'foreground', hc: 'dropdown.foreground' - }, - description: 'Foreground color of menu items.' - }, { - id: 'menu.background', defaults: { - dark: 'dropdown.background', light: 'dropdown.background', hc: 'dropdown.background' - }, description: 'Background color of menu items.' - }, { - id: 'menu.selectionForeground', defaults: { - dark: 'list.activeSelectionForeground', light: 'list.activeSelectionForeground', hc: 'list.activeSelectionForeground' - }, description: 'Foreground color of the selected menu item in menus.' + id: 'menu.foreground', defaults: { + dark: 'dropdown.foreground', light: 'foreground', hc: 'dropdown.foreground' }, + description: 'Foreground color of menu items.' + }, { + id: 'menu.background', defaults: { + dark: 'dropdown.background', light: 'dropdown.background', hc: 'dropdown.background' + }, description: 'Background color of menu items.' + }, { + id: 'menu.selectionForeground', defaults: { + dark: 'list.activeSelectionForeground', light: 'list.activeSelectionForeground', hc: 'list.activeSelectionForeground' + }, description: 'Foreground color of the selected menu item in menus.' + }, { id: 'menu.selectionBackground', defaults: { dark: 'list.activeSelectionBackground', light: 'list.activeSelectionBackground', hc: 'list.activeSelectionBackground' }, @@ -1351,20 +1353,20 @@ export class CommonFrontendContribution implements FrontendApplicationContributi light: '#444444', dark: '#e7e7e7', hc: '#ffffff' }, description: 'The foreground color for a section header or active title.' }, { - id: 'settings.modifiedItemIndicator', defaults: { - light: Color.rgba(102, 175, 224), - dark: Color.rgba(12, 125, 157), - hc: Color.rgba(0, 73, 122) - }, description: 'The color of the modified setting indicator.' - }, { - id: 'settings.dropdownBackground', defaults: - { dark: 'dropdown.background', light: 'dropdown.background', hc: 'dropdown.background' }, - description: 'Settings editor dropdown background.' - }, { - id: 'settings.dropdownForeground', defaults: { - dark: 'dropdown.foreground', light: 'dropdown.foreground', hc: 'dropdown.foreground' - }, description: 'Settings editor dropdown foreground.' - }, + id: 'settings.modifiedItemIndicator', defaults: { + light: Color.rgba(102, 175, 224), + dark: Color.rgba(12, 125, 157), + hc: Color.rgba(0, 73, 122) + }, description: 'The color of the modified setting indicator.' + }, { + id: 'settings.dropdownBackground', defaults: + { dark: 'dropdown.background', light: 'dropdown.background', hc: 'dropdown.background' }, + description: 'Settings editor dropdown background.' + }, { + id: 'settings.dropdownForeground', defaults: { + dark: 'dropdown.foreground', light: 'dropdown.foreground', hc: 'dropdown.foreground' + }, description: 'Settings editor dropdown foreground.' + }, { id: 'settings.dropdownBorder', defaults: { dark: 'dropdown.border', light: 'dropdown.border', hc: 'dropdown.border' @@ -1380,35 +1382,35 @@ export class CommonFrontendContribution implements FrontendApplicationContributi dark: 'checkbox.background', light: 'checkbox.background', hc: 'checkbox.background' }, description: 'Settings editor checkbox background.' }, { - id: 'settings.checkboxForeground', defaults: { - dark: 'checkbox.foreground', light: 'checkbox.foreground', hc: 'checkbox.foreground' - }, description: 'Settings editor checkbox foreground.' - }, { - id: 'settings.checkboxBorder', defaults: - { - dark: 'checkbox.border', light: 'checkbox.border', hc: 'checkbox.border' - }, description: 'Settings editor checkbox border.' - }, { - id: 'settings.textInputBackground', defaults: { - dark: 'input.background', light: 'input.background', hc: 'input.background' - }, description: 'Settings editor text input box background.' - }, { - id: 'settings.textInputForeground', defaults: { - dark: 'input.foreground', light: 'input.foreground', hc: 'input.foreground' - }, description: 'Settings editor text input box foreground.' - }, { - id: 'settings.textInputBorder', defaults: { - dark: 'input.border', light: 'input.border', hc: 'input.border' - }, description: 'Settings editor text input box border.' - }, { - id: 'settings.numberInputBackground', defaults: { - dark: 'input.background', light: 'input.background', hc: 'input.background' - }, description: 'Settings editor number input box background.' - }, { - id: 'settings.numberInputForeground', defaults: { - dark: 'input.foreground', light: 'input.foreground', hc: 'input.foreground' - }, description: 'Settings editor number input box foreground.' - }, + id: 'settings.checkboxForeground', defaults: { + dark: 'checkbox.foreground', light: 'checkbox.foreground', hc: 'checkbox.foreground' + }, description: 'Settings editor checkbox foreground.' + }, { + id: 'settings.checkboxBorder', defaults: + { + dark: 'checkbox.border', light: 'checkbox.border', hc: 'checkbox.border' + }, description: 'Settings editor checkbox border.' + }, { + id: 'settings.textInputBackground', defaults: { + dark: 'input.background', light: 'input.background', hc: 'input.background' + }, description: 'Settings editor text input box background.' + }, { + id: 'settings.textInputForeground', defaults: { + dark: 'input.foreground', light: 'input.foreground', hc: 'input.foreground' + }, description: 'Settings editor text input box foreground.' + }, { + id: 'settings.textInputBorder', defaults: { + dark: 'input.border', light: 'input.border', hc: 'input.border' + }, description: 'Settings editor text input box border.' + }, { + id: 'settings.numberInputBackground', defaults: { + dark: 'input.background', light: 'input.background', hc: 'input.background' + }, description: 'Settings editor number input box background.' + }, { + id: 'settings.numberInputForeground', defaults: { + dark: 'input.foreground', light: 'input.foreground', hc: 'input.foreground' + }, description: 'Settings editor number input box foreground.' + }, { id: 'settings.numberInputBorder', defaults: { dark: 'input.border', light: 'input.border', hc: 'input.border' diff --git a/packages/core/src/browser/connection-status-service.ts b/packages/core/src/browser/connection-status-service.ts index d978443a01499..bfc9df6170a50 100644 --- a/packages/core/src/browser/connection-status-service.ts +++ b/packages/core/src/browser/connection-status-service.ts @@ -125,7 +125,7 @@ export abstract class AbstractConnectionStatusService implements ConnectionStatu this.statusChangeEmitter.fire(status); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected setTimeout(handler: (...args: any[]) => void, timeout: number): number { return window.setTimeout(handler, timeout); } diff --git a/packages/core/src/browser/context-key-service.ts b/packages/core/src/browser/context-key-service.ts index 120993f8e6705..7d1bec5b7cd1c 100644 --- a/packages/core/src/browser/context-key-service.ts +++ b/packages/core/src/browser/context-key-service.ts @@ -24,7 +24,7 @@ export interface ContextKey { } export namespace ContextKey { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export const None: ContextKey = Object.freeze({ set: () => { }, reset: () => { }, diff --git a/packages/core/src/browser/context-menu-renderer.ts b/packages/core/src/browser/context-menu-renderer.ts index b81bb493cf9dc..ae248d7d48ff2 100644 --- a/packages/core/src/browser/context-menu-renderer.ts +++ b/packages/core/src/browser/context-menu-renderer.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { MenuPath } from '../common/menu'; diff --git a/packages/core/src/browser/dialogs.ts b/packages/core/src/browser/dialogs.ts index 1dd1d872519de..43e7ce30bdb89 100644 --- a/packages/core/src/browser/dialogs.ts +++ b/packages/core/src/browser/dialogs.ts @@ -61,7 +61,7 @@ export class DialogOverlayService implements FrontendApplicationContribution { return DialogOverlayService.INSTANCE; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected readonly dialogs: AbstractDialog[] = []; constructor() { @@ -73,12 +73,12 @@ export class DialogOverlayService implements FrontendApplicationContribution { DialogOverlayService.INSTANCE = this; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected get currentDialog(): AbstractDialog | undefined { return this.dialogs[0]; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any push(dialog: AbstractDialog): Disposable { this.dialogs.unshift(dialog); return Disposable.create(() => { @@ -117,7 +117,7 @@ export abstract class AbstractDialog extends BaseWidget { protected readonly errorMessageNode: HTMLDivElement; protected resolve: undefined | ((value: T | undefined) => void); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected reject: undefined | ((reason: any) => void); protected closeButton: HTMLButtonElement | undefined; diff --git a/packages/core/src/browser/frontend-application-config-provider.ts b/packages/core/src/browser/frontend-application-config-provider.ts index f282faf9b0a55..d422dd2169993 100644 --- a/packages/core/src/browser/frontend-application-config-provider.ts +++ b/packages/core/src/browser/frontend-application-config-provider.ts @@ -32,14 +32,14 @@ export class FrontendApplicationConfigProvider { if (FrontendApplicationConfigProvider.doGet() !== undefined) { throw new Error('The configuration is already set.'); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const globalObject = window as any; const key = FrontendApplicationConfigProvider.KEY; globalObject[key] = config; } private static doGet(): FrontendApplicationConfig | undefined { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const globalObject = window as any; const key = FrontendApplicationConfigProvider.KEY; return globalObject[key]; diff --git a/packages/core/src/browser/keybinding.spec.ts b/packages/core/src/browser/keybinding.spec.ts index 545ba39719746..f295240f3d349 100644 --- a/packages/core/src/browser/keybinding.spec.ts +++ b/packages/core/src/browser/keybinding.spec.ts @@ -37,7 +37,7 @@ import { Emitter, Event } from '../common/event'; disableJSDOM(); -/* tslint:disable:no-unused-expression */ +/* eslint-disable no-unused-expressions */ const expect = chai.expect; diff --git a/packages/core/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts b/packages/core/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts index 7202409a11e9e..20f645346a6b1 100644 --- a/packages/core/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts +++ b/packages/core/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts @@ -46,7 +46,7 @@ describe('browser keyboard layout provider', function (): void { stubOSX = sinon.stub(os, 'isOSX').value(false); stubWindows = sinon.stub(os, 'isWindows').value(false); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any stubNavigator = sinon.stub(global, 'navigator' as any).value({}); const container = new Container(); container.bind(BrowserKeyboardLayoutProvider).toSelf(); diff --git a/packages/core/src/browser/keyboard/keys.spec.ts b/packages/core/src/browser/keyboard/keys.spec.ts index 5c1405a415902..b89f29b0ffa9a 100644 --- a/packages/core/src/browser/keyboard/keys.spec.ts +++ b/packages/core/src/browser/keyboard/keys.spec.ts @@ -24,7 +24,7 @@ import * as sinon from 'sinon'; disableJSDOM(); -/* tslint:disable:no-unused-expression */ +/* eslint-disable no-unused-expressions */ const expect = chai.expect; diff --git a/packages/core/src/browser/keyboard/keys.ts b/packages/core/src/browser/keyboard/keys.ts index b9749d4b2a17c..e3600614b2618 100644 --- a/packages/core/src/browser/keyboard/keys.ts +++ b/packages/core/src/browser/keyboard/keys.ts @@ -479,7 +479,7 @@ export namespace SpecialCases { export namespace Key { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isKey(arg: any): arg is Key { return typeof arg === 'object' && ('code' in arg) && ('keyCode' in arg); } @@ -618,7 +618,7 @@ export namespace Key { } -/*-------------------- Initialize the static key mappings --------------------*/ +/* -------------------- Initialize the static key mappings -------------------- */ (() => { // Set the default key mappings from the constants in the Key namespace Object.keys(Key).map(prop => Reflect.get(Key, prop)).filter(key => Key.isKey(key)).forEach(key => { diff --git a/packages/core/src/browser/label-parser.spec.ts b/packages/core/src/browser/label-parser.spec.ts index e07d1b073eb45..5dbc15376f261 100644 --- a/packages/core/src/browser/label-parser.spec.ts +++ b/packages/core/src/browser/label-parser.spec.ts @@ -18,7 +18,7 @@ import { CommandService } from './../common'; import { Container } from 'inversify'; import { expect } from 'chai'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ let statusBarEntryUtility: LabelParser; diff --git a/packages/core/src/browser/label-provider.ts b/packages/core/src/browser/label-provider.ts index 35b9b7017898f..ec548bce8f89c 100644 --- a/packages/core/src/browser/label-provider.ts +++ b/packages/core/src/browser/label-provider.ts @@ -94,7 +94,7 @@ export interface URIIconReference { uri?: URI } export namespace URIIconReference { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(element: any | undefined): element is URIIconReference { return !!element && typeof element === 'object' && 'kind' in element && element['kind'] === 'uriIconReference'; } diff --git a/packages/core/src/browser/menu/browser-context-menu-renderer.ts b/packages/core/src/browser/menu/browser-context-menu-renderer.ts index eb4a30a4ccf96..2a64ffe3f3591 100644 --- a/packages/core/src/browser/menu/browser-context-menu-renderer.ts +++ b/packages/core/src/browser/menu/browser-context-menu-renderer.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { inject, injectable } from 'inversify'; import { MenuPath } from '../../common/menu'; diff --git a/packages/core/src/browser/menu/browser-menu-plugin.ts b/packages/core/src/browser/menu/browser-menu-plugin.ts index 6b8d1bf388fc1..4f3fb147c0600 100644 --- a/packages/core/src/browser/menu/browser-menu-plugin.ts +++ b/packages/core/src/browser/menu/browser-menu-plugin.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, inject } from 'inversify'; import { MenuBar as MenuBarWidget, Menu as MenuWidget, Widget } from '@phosphor/widgets'; diff --git a/packages/core/src/browser/navigatable.ts b/packages/core/src/browser/navigatable.ts index dba2e8a860d22..6d033f29e10a1 100644 --- a/packages/core/src/browser/navigatable.ts +++ b/packages/core/src/browser/navigatable.ts @@ -72,7 +72,7 @@ export interface NavigatableWidgetOptions { } export namespace NavigatableWidgetOptions { export function is(arg: Object | undefined): arg is NavigatableWidgetOptions { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return !!arg && 'kind' in arg && (arg as any).kind === 'navigatable'; } } diff --git a/packages/core/src/browser/preferences/preference-contribution.ts b/packages/core/src/browser/preferences/preference-contribution.ts index e09040d5a4cf4..c38c8df747029 100644 --- a/packages/core/src/browser/preferences/preference-contribution.ts +++ b/packages/core/src/browser/preferences/preference-contribution.ts @@ -28,8 +28,7 @@ import { bindPreferenceConfigurations, PreferenceConfigurations } from './prefer export { PreferenceSchema, PreferenceSchemaProperties, PreferenceDataSchema, PreferenceItem, PreferenceSchemaProperty, PreferenceDataProperty, JsonType }; import { Mutable } from '../../common/types'; -// tslint:disable:no-any -// tslint:disable:forin +/* eslint-disable guard-for-in, @typescript-eslint/no-explicit-any */ export const PreferenceContribution = Symbol('PreferenceContribution'); export interface PreferenceContribution { @@ -47,7 +46,7 @@ export interface OverridePreferenceName { overrideIdentifier: string } export namespace OverridePreferenceName { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(arg: any): arg is OverridePreferenceName { return !!arg && typeof arg === 'object' && 'preferenceName' in arg && 'overrideIdentifier' in arg; } @@ -242,7 +241,7 @@ export class PreferenceSchemaProvider extends PreferenceProvider { case 'object': return {}; } - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } diff --git a/packages/core/src/browser/preferences/preference-provider.ts b/packages/core/src/browser/preferences/preference-provider.ts index 581e4defc97af..92cf9cf7ab7f2 100644 --- a/packages/core/src/browser/preferences/preference-provider.ts +++ b/packages/core/src/browser/preferences/preference-provider.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable } from 'inversify'; import { JSONExt, JSONValue } from '@phosphor/coreutils/lib/json'; diff --git a/packages/core/src/browser/preferences/preference-proxy.spec.ts b/packages/core/src/browser/preferences/preference-proxy.spec.ts index 561cb18bb43d5..97cb6c172c807 100644 --- a/packages/core/src/browser/preferences/preference-proxy.spec.ts +++ b/packages/core/src/browser/preferences/preference-proxy.spec.ts @@ -14,8 +14,8 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any -// tslint:disable:no-unused-expression +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable no-unused-expressions */ import { enableJSDOM } from '../test/jsdom'; diff --git a/packages/core/src/browser/preferences/preference-proxy.ts b/packages/core/src/browser/preferences/preference-proxy.ts index dac89517a687a..2769a8bf37539 100644 --- a/packages/core/src/browser/preferences/preference-proxy.ts +++ b/packages/core/src/browser/preferences/preference-proxy.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { Disposable, Event } from '../../common'; import { PreferenceService } from './preference-service'; diff --git a/packages/core/src/browser/preferences/preference-service.spec.ts b/packages/core/src/browser/preferences/preference-service.spec.ts index 4f47ecec3a563..11ed80b3c9ad2 100644 --- a/packages/core/src/browser/preferences/preference-service.spec.ts +++ b/packages/core/src/browser/preferences/preference-service.spec.ts @@ -14,8 +14,8 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any -// tslint:disable:no-unused-expression +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable no-unused-expressions */ import { enableJSDOM } from '../test/jsdom'; diff --git a/packages/core/src/browser/preferences/preference-service.ts b/packages/core/src/browser/preferences/preference-service.ts index 381c44dc72a47..be89886ffbd95 100644 --- a/packages/core/src/browser/preferences/preference-service.ts +++ b/packages/core/src/browser/preferences/preference-service.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, inject, postConstruct } from 'inversify'; import { Event, Emitter, DisposableCollection, Disposable, deepFreeze } from '../../common'; @@ -268,6 +268,7 @@ export class PreferenceServiceImpl implements PreferenceService { getBoolean(preferenceName: string, defaultValue: boolean, resourceUri: string): boolean; getBoolean(preferenceName: string, defaultValue?: boolean, resourceUri?: string): boolean | undefined { const value = resourceUri ? this.get(preferenceName, defaultValue, resourceUri) : this.get(preferenceName, defaultValue); + // eslint-disable-next-line no-null/no-null return value !== null && value !== undefined ? !!value : defaultValue; } @@ -276,6 +277,7 @@ export class PreferenceServiceImpl implements PreferenceService { getString(preferenceName: string, defaultValue: string, resourceUri: string): string; getString(preferenceName: string, defaultValue?: string, resourceUri?: string): string | undefined { const value = resourceUri ? this.get(preferenceName, defaultValue, resourceUri) : this.get(preferenceName, defaultValue); + // eslint-disable-next-line no-null/no-null if (value === null || value === undefined) { return defaultValue; } @@ -287,6 +289,7 @@ export class PreferenceServiceImpl implements PreferenceService { getNumber(preferenceName: string, defaultValue: number, resourceUri: string): number; getNumber(preferenceName: string, defaultValue?: number, resourceUri?: string): number | undefined { const value = resourceUri ? this.get(preferenceName, defaultValue, resourceUri) : this.get(preferenceName, defaultValue); + // eslint-disable-next-line no-null/no-null if (value === null || value === undefined) { return defaultValue; } diff --git a/packages/core/src/browser/preferences/test/mock-preference-provider.ts b/packages/core/src/browser/preferences/test/mock-preference-provider.ts index ee9819b900190..c0c892167bfaa 100644 --- a/packages/core/src/browser/preferences/test/mock-preference-provider.ts +++ b/packages/core/src/browser/preferences/test/mock-preference-provider.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { interfaces } from 'inversify'; import { PreferenceProvider } from '../'; diff --git a/packages/core/src/browser/preferences/test/mock-preference-proxy.ts b/packages/core/src/browser/preferences/test/mock-preference-proxy.ts index 3df7bdfa7b946..f07b985768e21 100644 --- a/packages/core/src/browser/preferences/test/mock-preference-proxy.ts +++ b/packages/core/src/browser/preferences/test/mock-preference-proxy.ts @@ -17,7 +17,7 @@ import { Emitter } from '../../../common'; import { PreferenceChange } from '../preference-service'; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export function createMockPreferenceProxy(preferences: { [p: string]: any }): any { const unsupportedOperation = (_: any, __: string) => { throw new Error('Unsupported operation'); @@ -33,6 +33,7 @@ export function createMockPreferenceProxy(preferences: { [p: string]: any }): an if (property === 'ready') { return Promise.resolve(); } + // eslint-disable-next-line no-null/no-null if (preferences[property] !== undefined && preferences[property] !== null) { return preferences[property]; } diff --git a/packages/core/src/browser/preferences/test/mock-preference-service.ts b/packages/core/src/browser/preferences/test/mock-preference-service.ts index d3c0439924e76..4cd04060890a1 100644 --- a/packages/core/src/browser/preferences/test/mock-preference-service.ts +++ b/packages/core/src/browser/preferences/test/mock-preference-service.ts @@ -46,7 +46,7 @@ export class MockPreferenceService implements PreferenceService { } | undefined { return undefined; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any set(preferenceName: string, value: any): Promise { return Promise.resolve(); } ready: Promise = Promise.resolve(); readonly onPreferenceChanged: Event = new Emitter().event; @@ -58,6 +58,6 @@ export class MockPreferenceService implements PreferenceService { return undefined; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any validate(name: string, value: any): boolean { return true; } } diff --git a/packages/core/src/browser/quick-open/quick-title-bar.ts b/packages/core/src/browser/quick-open/quick-title-bar.ts index 00d764eadcaff..1037199ede7bc 100644 --- a/packages/core/src/browser/quick-open/quick-title-bar.ts +++ b/packages/core/src/browser/quick-open/quick-title-bar.ts @@ -180,7 +180,7 @@ export class QuickTitleBar { return rightButtonDiv; } - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len public attachTitleBar(widgetNode: HTMLElement, title: string | undefined, step: number | undefined, totalSteps: number | undefined, buttons: ReadonlyArray | undefined): void { const div = this.createTitleBarDiv(); diff --git a/packages/core/src/browser/quick-view-service.ts b/packages/core/src/browser/quick-view-service.ts index f0b4b874390d3..c60741a02aa83 100644 --- a/packages/core/src/browser/quick-view-service.ts +++ b/packages/core/src/browser/quick-view-service.ts @@ -20,7 +20,7 @@ import { Disposable } from '../common/disposable'; export interface QuickViewItem { readonly label: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly open: () => any; } diff --git a/packages/core/src/browser/saveable.ts b/packages/core/src/browser/saveable.ts index 0a725c94238fb..778f552de5058 100644 --- a/packages/core/src/browser/saveable.ts +++ b/packages/core/src/browser/saveable.ts @@ -32,15 +32,15 @@ export interface SaveableSource { } export namespace Saveable { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isSource(arg: any): arg is SaveableSource { return !!arg && ('saveable' in arg); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(arg: any): arg is Saveable { return !!arg && ('dirty' in arg) && ('onDirtyChanged' in arg); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function get(arg: any): Saveable | undefined { if (is(arg)) { return arg; @@ -50,7 +50,7 @@ export namespace Saveable { } return undefined; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function getDirty(arg: any): Saveable | undefined { const saveable = get(arg); if (saveable && saveable.dirty) { @@ -58,11 +58,11 @@ export namespace Saveable { } return undefined; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isDirty(arg: any): boolean { return !!getDirty(arg); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export async function save(arg: any): Promise { const saveable = get(arg); if (saveable) { diff --git a/packages/core/src/browser/shell/application-shell.ts b/packages/core/src/browser/shell/application-shell.ts index 27f63b3034c98..ff646a5c4971a 100644 --- a/packages/core/src/browser/shell/application-shell.ts +++ b/packages/core/src/browser/shell/application-shell.ts @@ -338,6 +338,7 @@ export class ApplicationShell extends Widget { && clientX >= offsetLeft + clientWidth - this.options.rightPanel.expandThreshold; const expBottom = allowExpansion && !expLeft && !expRight && clientY <= offsetTop + clientHeight && clientY >= offsetTop + clientHeight - this.options.bottomPanel.expandThreshold; + // eslint-disable-next-line no-null/no-null if (expLeft && !state.leftExpanded && this.leftPanelHandler.tabBar.currentTitle === null) { // The mouse cursor is moved close to the left border this.leftPanelHandler.expand(); @@ -348,6 +349,7 @@ export class ApplicationShell extends Widget { this.leftPanelHandler.collapse(); state.leftExpanded = false; } + // eslint-disable-next-line no-null/no-null if (expRight && !state.rightExpanded && this.rightPanelHandler.tabBar.currentTitle === null) { // The mouse cursor is moved close to the right border this.rightPanelHandler.expand(); @@ -380,7 +382,7 @@ export class ApplicationShell extends Widget { const { clientX, clientY } = this.dragState.lastDragOver; const event = document.createEvent('MouseEvent'); event.initMouseEvent('mousemove', true, true, window, 0, 0, 0, - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null clientX, clientY, false, false, false, false, 0, null); document.dispatchEvent(event); } @@ -665,7 +667,7 @@ export class ApplicationShell extends Widget { this.bottomPanelState.pendingUpdate, this.leftPanelHandler.state.pendingUpdate, this.rightPanelHandler.state.pendingUpdate - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any ]) as Promise; } @@ -859,7 +861,7 @@ export class ApplicationShell extends Widget { w = w.parent; } // Reset the z-index to the default - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null this.setZIndex(oldValue.node, null); } if (newValue) { @@ -1597,7 +1599,7 @@ export namespace ApplicationShell { * Whether a widget should be opened to the side tab bar relatively to the reference widget. */ export type OpenToSideMode = 'open-to-left' | 'open-to-right'; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isOpenToSideMode(mode: OpenToSideMode | any): mode is OpenToSideMode { return mode === 'open-to-left' || mode === 'open-to-right'; } diff --git a/packages/core/src/browser/shell/shell-layout-restorer.ts b/packages/core/src/browser/shell/shell-layout-restorer.ts index dbd7f64761ed3..2320166cf5233 100644 --- a/packages/core/src/browser/shell/shell-layout-restorer.ts +++ b/packages/core/src/browser/shell/shell-layout-restorer.ts @@ -43,7 +43,7 @@ export interface StatefulWidget { } export namespace StatefulWidget { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(arg: any): arg is StatefulWidget { return arg !== undefined && typeof arg['storeState'] === 'function' && typeof arg['restoreState'] === 'function'; } @@ -223,7 +223,7 @@ export class ShellLayoutRestorer implements CommandContribution { const parseContext = new ShellLayoutRestorer.ParseContext(); const layout = this.parse(layoutData, parseContext); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let layoutVersion: number | any; try { layoutVersion = 'version' in layout && Number(layout.version); @@ -274,7 +274,7 @@ export class ShellLayoutRestorer implements CommandContribution { } return widgets; } else if (value && typeof value === 'object' && !Array.isArray(value)) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const copy: any = {}; for (const p in value) { if (this.isWidgetProperty(p)) { diff --git a/packages/core/src/browser/shell/side-panel-handler.ts b/packages/core/src/browser/shell/side-panel-handler.ts index 45e4eb82e618a..6b35e5cdabf79 100644 --- a/packages/core/src/browser/shell/side-panel-handler.ts +++ b/packages/core/src/browser/shell/side-panel-handler.ts @@ -232,6 +232,7 @@ export class SidePanelHandler { rank: SidePanelHandler.rankProperty.get(title.owner), expanded: title === currentTitle })); + // eslint-disable-next-line no-null/no-null const size = currentTitle !== null ? this.getPanelSize() : this.state.lastPanelSize; return { type: 'sidepanel', items, size }; } @@ -240,7 +241,7 @@ export class SidePanelHandler { * Apply a side panel layout that has been previously created with `getLayoutData`. */ setLayoutData(layoutData: SidePanel.LayoutData): void { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null this.tabBar.currentTitle = null; let currentTitle: Title | undefined; @@ -341,7 +342,7 @@ export class SidePanelHandler { */ collapse(): void { if (this.tabBar.currentTitle) { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null this.tabBar.currentTitle = null; } else { this.refresh(); @@ -364,7 +365,7 @@ export class SidePanelHandler { protected updateToolbarTitle = (): void => { const currentTitle = this.tabBar && this.tabBar.currentTitle; this.toolBar.toolbarTitle = currentTitle || undefined; - } + }; /** * Refresh the visibility of the side bar and dock panel. @@ -376,6 +377,7 @@ export class SidePanelHandler { const dockPanel = this.dockPanel; const isEmpty = tabBar.titles.length === 0; const currentTitle = tabBar.currentTitle; + // eslint-disable-next-line no-null/no-null const hideDockPanel = currentTitle === null; let relativeSizes: number[] | undefined; @@ -523,14 +525,14 @@ export class SidePanelHandler { sender.releaseMouse(); // Clone the selected tab and use that as drag image - // tslint:disable:no-null-keyword + /* eslint-disable no-null/no-null */ const clonedTab = tab.cloneNode(true) as HTMLElement; clonedTab.style.width = null; clonedTab.style.height = null; const label = clonedTab.getElementsByClassName('p-TabBar-tabLabel')[0] as HTMLElement; label.style.width = null; label.style.height = null; - // tslint:enable:no-null-keyword + /* eslint-enable no-null/no-null */ // Create and start a drag to move the selected tab to another panel const mimeData = new MimeData(); diff --git a/packages/core/src/browser/shell/split-panels.ts b/packages/core/src/browser/shell/split-panels.ts index 1678e7746db59..281d988786172 100644 --- a/packages/core/src/browser/shell/split-panels.ts +++ b/packages/core/src/browser/shell/split-panels.ts @@ -179,6 +179,7 @@ export class SplitPositionHandler { } else { pos = layout.handles[move.index].offsetTop; } + // eslint-disable-next-line no-null/no-null if (pos !== null) { return pos; } else { diff --git a/packages/core/src/browser/shell/tab-bar-toolbar.tsx b/packages/core/src/browser/shell/tab-bar-toolbar.tsx index d6ea91c708338..fba28e87ed00a 100644 --- a/packages/core/src/browser/shell/tab-bar-toolbar.tsx +++ b/packages/core/src/browser/shell/tab-bar-toolbar.tsx @@ -160,7 +160,7 @@ export class TabBarToolbar extends ReactWidget { anchor: event.nativeEvent, onHide: () => toDisposeOnHide.dispose() }); - } + }; shouldHandleMouseEvent(event: MouseEvent): boolean { return event.target instanceof Element && (!!this.inline.get(event.target.id) || event.target.id === '__more__'); @@ -178,17 +178,17 @@ export class TabBarToolbar extends ReactWidget { if (TabBarToolbarItem.is(item)) { this.commands.executeCommand(item.command, this.current); } - } + }; protected onMouseDownEvent = (e: React.MouseEvent) => { if (e.button === 0) { e.currentTarget.classList.add('active'); } - } + }; protected onMouseUpEvent = (e: React.MouseEvent) => { e.currentTarget.classList.remove('active'); - } + }; } @@ -335,7 +335,7 @@ export namespace TabBarToolbarItem { }; export function is(arg: Object | undefined): arg is TabBarToolbarItem { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return !!arg && 'command' in arg && typeof (arg as any).command === 'string'; } diff --git a/packages/core/src/browser/shell/tab-bars.ts b/packages/core/src/browser/shell/tab-bars.ts index 56479de17fcef..fbdc69a20efa7 100644 --- a/packages/core/src/browser/shell/tab-bars.ts +++ b/packages/core/src/browser/shell/tab-bars.ts @@ -234,7 +234,7 @@ export class TabBarRenderer extends TabBar.Renderer { */ protected getDecorations(title: Title): WidgetDecoration.Data[] { if (this.tabBar && this.decoratorService) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const owner: { resetTabBarDecorations?: () => void; } & Widget = title.owner; if (!owner.resetTabBarDecorations) { owner.resetTabBarDecorations = () => this.decorations.delete(title); @@ -416,7 +416,7 @@ export class TabBarRenderer extends TabBar.Renderer { if (this.tabBar) { const id = event.currentTarget.id; - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null const title = this.tabBar.titles.find(t => this.createTabId(t) === id) || null; this.tabBar.currentTitle = title; this.tabBar.activate(); @@ -427,19 +427,19 @@ export class TabBarRenderer extends TabBar.Renderer { this.contextMenuRenderer.render(this.contextMenuPath, event); } - } + }; protected handleDblClickEvent = (event: MouseEvent) => { if (this.tabBar && event.currentTarget instanceof HTMLElement) { const id = event.currentTarget.id; - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null const title = this.tabBar.titles.find(t => this.createTabId(t) === id) || null; const area = title && title.owner.parent; if (area instanceof TheiaDockPanel && (area.id === BOTTOM_AREA_ID || area.id === MAIN_AREA_ID)) { area.toggleMaximized(); } } - } + }; } diff --git a/packages/core/src/browser/shell/view-contribution.ts b/packages/core/src/browser/shell/view-contribution.ts index 64be46aead525..0efb389a6b3be 100644 --- a/packages/core/src/browser/shell/view-contribution.ts +++ b/packages/core/src/browser/shell/view-contribution.ts @@ -41,7 +41,7 @@ export interface ViewContributionOptions { toggleKeybinding?: string; } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function bindViewContribution>(bind: interfaces.Bind, identifier: interfaces.Newable): interfaces.BindingWhenOnSyntax { const syntax = bind(identifier).toSelf().inSingletonScope(); bind(CommandContribution).toService(identifier); diff --git a/packages/core/src/browser/source-tree/tree-source.ts b/packages/core/src/browser/source-tree/tree-source.ts index 9ac5898e5cbda..35af7486b4e5a 100644 --- a/packages/core/src/browser/source-tree/tree-source.ts +++ b/packages/core/src/browser/source-tree/tree-source.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { ReactNode } from 'react'; import { injectable, unmanaged } from 'inversify'; @@ -37,7 +37,7 @@ export interface CompositeTreeElement extends TreeElement { getElements(): MaybePromise> } export namespace CompositeTreeElement { - // tslint:disable:no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ export function is(element: CompositeTreeElement | any): element is CompositeTreeElement { return !!element && 'getElements' in element; } diff --git a/packages/core/src/browser/status-bar/status-bar.tsx b/packages/core/src/browser/status-bar/status-bar.tsx index d16f09f3c1b24..04410628b812f 100644 --- a/packages/core/src/browser/status-bar/status-bar.tsx +++ b/packages/core/src/browser/status-bar/status-bar.tsx @@ -40,7 +40,7 @@ export interface StatusBarEntry { className?: string; tooltip?: string; command?: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any arguments?: any[]; priority?: number; onclick?: (e: MouseEvent) => void; @@ -110,7 +110,7 @@ export class StatusBarImpl extends ReactWidget implements StatusBar { protected internalSetBackgroundColor(color?: string): void { this.backgroundColor = color; - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null this.node.style.backgroundColor = this.backgroundColor ? this.backgroundColor : null; } diff --git a/packages/core/src/browser/storage-service.ts b/packages/core/src/browser/storage-service.ts index 351ceeeb66b79..704f41e65603e 100644 --- a/packages/core/src/browser/storage-service.ts +++ b/packages/core/src/browser/storage-service.ts @@ -39,7 +39,7 @@ export interface StorageService { } interface LocalStorage { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any; } diff --git a/packages/core/src/browser/test/jsdom.ts b/packages/core/src/browser/test/jsdom.ts index 3d5837e082681..f6783bd4ebabe 100644 --- a/packages/core/src/browser/test/jsdom.ts +++ b/packages/core/src/browser/test/jsdom.ts @@ -24,8 +24,8 @@ import { JSDOM } from 'jsdom'; * ``` */ export function enableJSDOM(): () => void { - // tslint:disable:no-any - // tslint:disable:no-unused-expression + /* eslint-disable @typescript-eslint/no-explicit-any */ + /* eslint-disable no-unused-expressions */ // do nothing if running in browser try { diff --git a/packages/core/src/browser/test/mock-storage-service.ts b/packages/core/src/browser/test/mock-storage-service.ts index 28ef75b417f6c..aae8d4fafb2cc 100644 --- a/packages/core/src/browser/test/mock-storage-service.ts +++ b/packages/core/src/browser/test/mock-storage-service.ts @@ -24,10 +24,10 @@ import { injectable } from 'inversify'; export class MockStorageService implements StorageService { readonly data = new Map(); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any onSetDataCallback?: (key: string, data?: any) => void; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any onSetData(callback: (key: string, data?: any) => void): void { this.onSetDataCallback = callback; } diff --git a/packages/core/src/browser/theming.ts b/packages/core/src/browser/theming.ts index f724ce8c8e9da..3f58cafc6c7fd 100644 --- a/packages/core/src/browser/theming.ts +++ b/packages/core/src/browser/theming.ts @@ -46,7 +46,7 @@ export class ThemeService { readonly onThemeChange: Event = this.themeChange.event; static get(): ThemeService { - const global = window as any; // tslint:disable-line + const global = window as any; // eslint-disable-line @typescript-eslint/no-explicit-any return global[ThemeServiceSymbol] || new ThemeService(); } @@ -54,7 +54,7 @@ export class ThemeService { protected _defaultTheme: string | undefined = FrontendApplicationConfigProvider.get().defaultTheme, protected fallbackTheme: string = 'dark' ) { - const global = window as any; // tslint:disable-line + const global = window as any; // eslint-disable-line @typescript-eslint/no-explicit-any global[ThemeServiceSymbol] = this; } diff --git a/packages/core/src/browser/tree/search-box.ts b/packages/core/src/browser/tree/search-box.ts index 339c78bcc7801..fcda649472a2e 100644 --- a/packages/core/src/browser/tree/search-box.ts +++ b/packages/core/src/browser/tree/search-box.ts @@ -226,7 +226,7 @@ export class SearchBox extends BaseWidget { protected onAfterAttach(msg: Message): void { super.onAfterAttach(msg); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.addEventListener(this.input, 'selectstart' as any, () => false); } diff --git a/packages/core/src/browser/tree/test/mock-tree-model.ts b/packages/core/src/browser/tree/test/mock-tree-model.ts index e38636881ab28..c97c8092ec1b4 100644 --- a/packages/core/src/browser/tree/test/mock-tree-model.ts +++ b/packages/core/src/browser/tree/test/mock-tree-model.ts @@ -45,7 +45,7 @@ export namespace MockTreeModel { return node; } else { node.children = children; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (node as any).expanded = expanded; return node as CompositeTreeNode & SelectableTreeNode & ExpandableTreeNode; } diff --git a/packages/core/src/browser/tree/tree-decorator.spec.ts b/packages/core/src/browser/tree/tree-decorator.spec.ts index a00e1287d07b9..ab262639a9280 100644 --- a/packages/core/src/browser/tree/tree-decorator.spec.ts +++ b/packages/core/src/browser/tree/tree-decorator.spec.ts @@ -17,7 +17,7 @@ import { expect } from 'chai'; import { TreeDecoratorService, AbstractTreeDecoratorService, TreeDecoration } from './tree-decorator'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ class MockTreeDecoratorService extends AbstractTreeDecoratorService { diff --git a/packages/core/src/browser/tree/tree-decorator.ts b/packages/core/src/browser/tree/tree-decorator.ts index 83e51badd3b5b..909ee4d25c601 100644 --- a/packages/core/src/browser/tree/tree-decorator.ts +++ b/packages/core/src/browser/tree/tree-decorator.ts @@ -70,7 +70,7 @@ export interface TreeDecoratorService extends Disposable { * Counterpart of the [deflateDecorators](#deflateDecorators) method. Restores the argument into a Map * of tree node IDs and the corresponding decorations data array. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any inflateDecorators(state: any): Map; } @@ -89,7 +89,7 @@ export class NoopTreeDecoratorService implements TreeDecoratorService { this.emitter.dispose(); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any getDecorations(): Map { return new Map(); } @@ -143,7 +143,7 @@ export abstract class AbstractTreeDecoratorService implements TreeDecoratorServi } deflateDecorators(decorations: Map): object { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null const state = Object.create(null); for (const [id, data] of decorations) { state[id] = data; @@ -151,7 +151,7 @@ export abstract class AbstractTreeDecoratorService implements TreeDecoratorServi return state; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any inflateDecorators(state: any): Map { const decorators = new Map(); for (const id of Object.keys(state)) { diff --git a/packages/core/src/browser/tree/tree-expansion.spec.ts b/packages/core/src/browser/tree/tree-expansion.spec.ts index fb48441aa2bac..16cce8b020258 100644 --- a/packages/core/src/browser/tree/tree-expansion.spec.ts +++ b/packages/core/src/browser/tree/tree-expansion.spec.ts @@ -21,7 +21,7 @@ import { TreeNode, CompositeTreeNode } from './tree'; import { ExpandableTreeNode } from './tree-expansion'; import { createTreeTestContainer } from './test/tree-test-container'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ describe('TreeExpansionService', () => { let model: TreeModel; beforeEach(() => { diff --git a/packages/core/src/browser/tree/tree-iterator.spec.ts b/packages/core/src/browser/tree/tree-iterator.spec.ts index 6468f97dd7487..e99204910e700 100644 --- a/packages/core/src/browser/tree/tree-iterator.spec.ts +++ b/packages/core/src/browser/tree/tree-iterator.spec.ts @@ -22,8 +22,8 @@ import { DepthFirstTreeIterator, BreadthFirstTreeIterator, BottomUpTreeIterator, import { createTreeTestContainer } from './test/tree-test-container'; import { ExpandableTreeNode } from './tree-expansion'; -// tslint:disable:no-unused-expression -// tslint:disable:max-line-length +/* eslint-disable no-unused-expressions */ +/* eslint-disable max-len */ describe('tree-iterator', () => { diff --git a/packages/core/src/browser/tree/tree-selection-state.spec.ts b/packages/core/src/browser/tree/tree-selection-state.spec.ts index c4d6669185f1d..f17a7d63c1eb3 100644 --- a/packages/core/src/browser/tree/tree-selection-state.spec.ts +++ b/packages/core/src/browser/tree/tree-selection-state.spec.ts @@ -21,7 +21,7 @@ import { createTreeTestContainer } from './test/tree-test-container'; import { SelectableTreeNode, TreeSelection } from './tree-selection'; import { TreeModel } from './tree-model'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ namespace TreeSelectionState { diff --git a/packages/core/src/browser/tree/tree-widget-selection.ts b/packages/core/src/browser/tree/tree-widget-selection.ts index ea94af7cd66c8..1727396481d46 100644 --- a/packages/core/src/browser/tree/tree-widget-selection.ts +++ b/packages/core/src/browser/tree/tree-widget-selection.ts @@ -28,7 +28,7 @@ export namespace TreeWidgetSelection { return is(selection) ? selection.source : undefined; } export function is(selection: Object | undefined): selection is TreeWidgetSelection { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return Array.isArray(selection) && ('source' in selection) && selection['source'] instanceof TreeWidget; } export function create(source: TreeWidget): TreeWidgetSelection { diff --git a/packages/core/src/browser/tree/tree-widget.tsx b/packages/core/src/browser/tree/tree-widget.tsx index 62eac121c9e9a..0f48f32cfb79c 100644 --- a/packages/core/src/browser/tree/tree-widget.tsx +++ b/packages/core/src/browser/tree/tree-widget.tsx @@ -439,7 +439,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { handleScroll={this.handleScroll} />; } - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } @@ -467,7 +467,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { */ protected readonly handleScroll = (info: ScrollParams) => { this.node.scrollTop = info.scrollTop; - } + }; /** * Render the node row. @@ -486,7 +486,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { * @param props the node properties. */ protected renderIcon(node: TreeNode, props: NodeProps): React.ReactNode { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } @@ -514,7 +514,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { */ protected renderExpansionToggle(node: TreeNode, props: NodeProps): React.ReactNode { if (!this.isExpandable(node)) { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } const classes = [TREE_NODE_SEGMENT_CLASS, EXPANSION_TOGGLE_CLASS]; @@ -708,8 +708,9 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { * @param icon the icon. */ protected decorateIcon(node: TreeNode, icon: React.ReactNode | null): React.ReactNode { + // eslint-disable-next-line no-null/no-null if (icon === null) { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } @@ -975,7 +976,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { this.addKeyListener(this.node, up, event => this.handleUp(event)); this.addKeyListener(this.node, down, event => this.handleDown(event)); this.addKeyListener(this.node, Key.ENTER, event => this.handleEnter(event)); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.addEventListener(this.node, 'ps-scroll-y', (e: Event & { target: { scrollTop: number } }) => { if (this.view && this.view.list && this.view.list.Grid) { const { scrollTop } = e.target; @@ -1123,7 +1124,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { * Convert the tree node to context menu arguments. * @param node the selectable tree node. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected toContextMenuArgs(node: SelectableTreeNode): any[] | undefined { return undefined; } @@ -1158,7 +1159,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { * @param node the tree node. */ protected deflateForStorage(node: TreeNode): object { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const copy = Object.assign({}, node) as any; if (copy.parent) { delete copy.parent; @@ -1183,7 +1184,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { * @param node the tree node. * @param parent the optional tree node. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected inflateFromStorage(node: any, parent?: TreeNode): TreeNode { if (node.selected) { node.selected = false; @@ -1223,7 +1224,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { * @param oldState the old state object. */ restoreState(oldState: object): void { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { root, decorations, model } = (oldState as any); if (root) { this.model.root = this.inflateFromStorage(root); @@ -1332,6 +1333,6 @@ export namespace TreeWidget { rowIndex={index}>
{this.props.renderNodeRow(row)}
; - } + }; } } diff --git a/packages/core/src/browser/tree/tree.spec.ts b/packages/core/src/browser/tree/tree.spec.ts index e32e27619b67b..547ac7e96ed94 100644 --- a/packages/core/src/browser/tree/tree.spec.ts +++ b/packages/core/src/browser/tree/tree.spec.ts @@ -21,7 +21,7 @@ import { MockTreeModel } from './test/mock-tree-model'; import { expect } from 'chai'; import { createTreeTestContainer } from './test/tree-test-container'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ describe('Tree', () => { it('addChildren', () => { @@ -221,7 +221,7 @@ describe('Tree', () => { } function assertTreeNode(expectation: string, node: TreeNode): void { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any assert.deepStrictEqual(expectation, JSON.stringify(node, (key: keyof CompositeTreeNode, value: any) => { if (key === 'parent' || key === 'previousSibling' || key === 'nextSibling') { return value && value.id; diff --git a/packages/core/src/browser/view-container.ts b/packages/core/src/browser/view-container.ts index 0f047b3aae4d1..3846653dbc6c8 100644 --- a/packages/core/src/browser/view-container.ts +++ b/packages/core/src/browser/view-container.ts @@ -923,7 +923,7 @@ export class ViewContainerPart extends BaseWidget { protected onAfterAttach(msg: Message): void { if (!this.wrapped.isAttached) { MessageLoop.sendMessage(this.wrapped, Widget.Msg.BeforeAttach); - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null this.body.insertBefore(this.wrapped.node, null); MessageLoop.sendMessage(this.wrapped, Widget.Msg.AfterAttach); } @@ -1018,7 +1018,7 @@ export class ViewContainerLayout extends SplitLayout { } protected get items(): ReadonlyArray { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return (this as any)._items as Array; } @@ -1226,7 +1226,7 @@ export class ViewContainerLayout extends SplitLayout { } else { const minSize = `${this.options.headerSize + part.minSize}px`; style.minHeight = minSize; - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null style.maxHeight = null; } } @@ -1245,7 +1245,7 @@ export class ViewContainerLayout extends SplitLayout { referenceWidget: this.widgets[index], duration: 0 }; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return this.splitPositionHandler.setSplitHandlePosition(this.parent as SplitPanel, index, position, options) as Promise; } diff --git a/packages/core/src/browser/widget-manager.spec.ts b/packages/core/src/browser/widget-manager.spec.ts index ffcd45e8487df..37305c46c31c5 100644 --- a/packages/core/src/browser/widget-manager.spec.ts +++ b/packages/core/src/browser/widget-manager.spec.ts @@ -32,7 +32,7 @@ class TestWidgetFactory implements WidgetFactory { // create a mock Widget, since a real widget has deps to dom api const result = {} as Widget; result.id = name; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (result).disposed = new Signal(result); return result; } diff --git a/packages/core/src/browser/widget-manager.ts b/packages/core/src/browser/widget-manager.ts index 082714bd92551..4d2f343f8bcba 100644 --- a/packages/core/src/browser/widget-manager.ts +++ b/packages/core/src/browser/widget-manager.ts @@ -18,7 +18,7 @@ import { inject, named, injectable } from 'inversify'; import { Widget } from '@phosphor/widgets'; import { ILogger, Emitter, Event, ContributionProvider, MaybePromise } from '../common'; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export const WidgetFactory = Symbol('WidgetFactory'); /** * `OpenHandler` should be implemented to provide a new opener. diff --git a/packages/core/src/browser/widgets/widget.ts b/packages/core/src/browser/widgets/widget.ts index b06ef9ef50984..dca03f3ad47c9 100644 --- a/packages/core/src/browser/widgets/widget.ts +++ b/packages/core/src/browser/widgets/widget.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, decorate, unmanaged } from 'inversify'; import { Widget } from '@phosphor/widgets'; @@ -181,13 +181,13 @@ export function createIconButton(...classNames: string[]): HTMLSpanElement { return button; } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export type EventListener = (this: HTMLElement, event: HTMLElementEventMap[K]) => any; export interface EventListenerObject { handleEvent(evt: HTMLElementEventMap[K]): void; } export namespace EventListenerObject { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(listener: any | undefined): listener is EventListenerObject { return !!listener && 'handleEvent' in listener; } @@ -227,7 +227,7 @@ export function addKeyListener( })); for (const type of additionalEventTypes) { toDispose.push(addEventListener(element, type, e => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const event = (type as any)['keydown']; const result = action(event); if (typeof result !== 'boolean' || result) { diff --git a/packages/core/src/common/application-error.ts b/packages/core/src/common/application-error.ts index 76cfbe4f16558..5ce8936d0b2cd 100644 --- a/packages/core/src/common/application-error.ts +++ b/packages/core/src/common/application-error.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export interface ApplicationError extends Error { readonly code: C diff --git a/packages/core/src/common/cancellation.ts b/packages/core/src/common/cancellation.ts index ee450c2cfdb80..793d221b5b003 100644 --- a/packages/core/src/common/cancellation.ts +++ b/packages/core/src/common/cancellation.ts @@ -29,7 +29,7 @@ export interface CancellationToken { readonly onCancellationRequested: Event; } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any const shortcutEvent: Event = Object.freeze(Object.assign(function (callback: any, context?: any): any { const handle = setTimeout(callback.bind(context), 0); return { dispose(): void { clearTimeout(handle); } }; diff --git a/packages/core/src/common/command.spec.ts b/packages/core/src/common/command.spec.ts index 08aa483d6499e..4f15c463f5117 100644 --- a/packages/core/src/common/command.spec.ts +++ b/packages/core/src/common/command.spec.ts @@ -21,7 +21,7 @@ import * as chai from 'chai'; const expect = chai.expect; let commandRegistry: CommandRegistry; -/* tslint:disable:no-unused-expression */ +/* eslint-disable no-unused-expressions */ describe('Commands', () => { diff --git a/packages/core/src/common/command.ts b/packages/core/src/common/command.ts index f6482490029d5..1ceead5f8d8e3 100644 --- a/packages/core/src/common/command.ts +++ b/packages/core/src/common/command.ts @@ -45,7 +45,7 @@ export interface Command { export namespace Command { /* Determine whether object is a Command */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(arg: Command | any): arg is Command { return !!arg && arg === Object(arg) && 'id' in arg; } @@ -88,22 +88,22 @@ export interface CommandHandler { /** * Execute this handler. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute(...args: any[]): any; /** * Test whether this handler is enabled (active). */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isEnabled?(...args: any[]): boolean; /** * Test whether menu items for this handler should be visible. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isVisible?(...args: any[]): boolean; /** * Test whether menu items for this handler should be toggled. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isToggled?(...args: any[]): boolean; } @@ -133,7 +133,7 @@ export interface CommandService { * * Reject if a command cannot be executed. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any executeCommand(command: string, ...args: any[]): Promise; /** * An event is emitted when a command is about to be executed. @@ -242,7 +242,7 @@ export class CommandRegistry implements CommandService { /** * Test whether there is an active handler for the given command. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isEnabled(command: string, ...args: any[]): boolean { return typeof this.getActiveHandler(command, ...args) !== 'undefined'; } @@ -250,7 +250,7 @@ export class CommandRegistry implements CommandService { /** * Test whether there is a visible handler for the given command. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isVisible(command: string, ...args: any[]): boolean { return typeof this.getVisibleHandler(command, ...args) !== 'undefined'; } @@ -258,7 +258,7 @@ export class CommandRegistry implements CommandService { /** * Test whether there is a toggled handler for the given command. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isToggled(command: string, ...args: any[]): boolean { return typeof this.getToggledHandler(command, ...args) !== 'undefined'; } @@ -268,7 +268,7 @@ export class CommandRegistry implements CommandService { * * Reject if a command cannot be executed. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async executeCommand(commandId: string, ...args: any[]): Promise { await this.fireWillExecuteCommand(commandId); const handler = this.getActiveHandler(commandId, ...args); @@ -281,6 +281,7 @@ export class CommandRegistry implements CommandService { return result; } const argsMessage = args && args.length > 0 ? ` (args: ${JSON.stringify(args)})` : ''; + // eslint-disable-next-line max-len throw Object.assign(new Error(`The command '${commandId}' cannot be executed. There are no active handlers available for the command.${argsMessage}`), { code: 'NO_ACTIVE_HANDLER' }); } @@ -291,7 +292,7 @@ export class CommandRegistry implements CommandService { /** * Get a visible handler for the given command or `undefined`. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any getVisibleHandler(commandId: string, ...args: any[]): CommandHandler | undefined { const handlers = this._handlers[commandId]; if (handlers) { @@ -311,7 +312,7 @@ export class CommandRegistry implements CommandService { /** * Get an active handler for the given command or `undefined`. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any getActiveHandler(commandId: string, ...args: any[]): CommandHandler | undefined { const handlers = this._handlers[commandId]; if (handlers) { @@ -331,7 +332,7 @@ export class CommandRegistry implements CommandService { /** * Get a toggled handler for the given command or `undefined`. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any getToggledHandler(commandId: string, ...args: any[]): CommandHandler | undefined { const handlers = this._handlers[commandId]; if (handlers) { diff --git a/packages/core/src/common/contribution-provider.ts b/packages/core/src/common/contribution-provider.ts index 9cfc589e4481f..3a4605e3e4376 100644 --- a/packages/core/src/common/contribution-provider.ts +++ b/packages/core/src/common/contribution-provider.ts @@ -39,6 +39,7 @@ class ContainerBasedContributionProvider implements Contributi if (this.services === undefined) { const currentServices: T[] = []; let currentContainer: interfaces.Container | null = this.container; + // eslint-disable-next-line no-null/no-null while (currentContainer !== null) { if (currentContainer.isBound(this.serviceIdentifier)) { try { @@ -47,7 +48,7 @@ class ContainerBasedContributionProvider implements Contributi console.error(error); } } - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null currentContainer = recursive === true ? currentContainer.parent : null; } this.services = currentServices; diff --git a/packages/core/src/common/disposable.ts b/packages/core/src/common/disposable.ts index af29a3bac50d4..ad91967592c8a 100644 --- a/packages/core/src/common/disposable.ts +++ b/packages/core/src/common/disposable.ts @@ -23,7 +23,7 @@ export interface Disposable { } export namespace Disposable { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(arg: any): arg is Disposable { return !!arg && typeof arg === 'object' && 'dispose' in arg && typeof arg['dispose'] === 'function'; } diff --git a/packages/core/src/common/event.ts b/packages/core/src/common/event.ts index b00804b1d5fc4..816ddbefbb765 100644 --- a/packages/core/src/common/event.ts +++ b/packages/core/src/common/event.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { Disposable } from './disposable'; import { MaybePromise } from './types'; @@ -176,8 +176,7 @@ export class Emitter { this._callbacks.add(listener, thisArgs); this.checkMaxListeners(this._event.maxListeners); - let result: Disposable; - result = { + const result: Disposable = { dispose: () => { result.dispose = Emitter._noop; if (!this._disposed) { @@ -246,7 +245,7 @@ export class Emitter { } export interface WaitUntilEvent { - // tslint:disable:no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ /** * Allows to pause the event loop until the provided thenable resolved. * @@ -265,7 +264,7 @@ export namespace WaitUntilEvent { ): Promise { const waitables: Promise[] = []; const asyncEvent = Object.assign(event, { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any waitUntil: (thenable: Promise) => { if (Object.isFrozen(waitables)) { throw new Error('waitUntil cannot be called asynchronously.'); diff --git a/packages/core/src/common/json-schema.ts b/packages/core/src/common/json-schema.ts index 040a375ebb09b..a8adc50068311 100644 --- a/packages/core/src/common/json-schema.ts +++ b/packages/core/src/common/json-schema.ts @@ -33,7 +33,7 @@ export interface IJSONSchema { $schema?: string; type?: string | string[]; title?: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any default?: any; definitions?: IJSONSchemaMap; description?: string; @@ -62,12 +62,12 @@ export interface IJSONSchema { allOf?: IJSONSchema[]; oneOf?: IJSONSchema[]; not?: IJSONSchema; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any enum?: any[]; format?: string; // schema draft 06 - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const?: any; contains?: IJSONSchema; propertyNames?: IJSONSchema; @@ -97,7 +97,7 @@ export interface IJSONSchemaMap { export interface IJSONSchemaSnippet { label?: string; description?: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any body?: any; // a object that will be JSON stringified bodyText?: string; // an already stringified JSON object that can contain new lines (\n) and tabs (\t) } diff --git a/packages/core/src/common/keybinding.ts b/packages/core/src/common/keybinding.ts index 422d9cf633160..fa5639498e3ee 100644 --- a/packages/core/src/common/keybinding.ts +++ b/packages/core/src/common/keybinding.ts @@ -33,7 +33,7 @@ export interface Keybinding { /** * Specified when the command has arguments that are passed to the command handler. */ - // tslint:disable-next-line no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any args?: any; } export namespace Keybinding { @@ -57,7 +57,7 @@ export namespace Keybinding { } /* Determine whether object is a KeyBinding */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(arg: Keybinding | any): arg is Keybinding { return !!arg && arg === Object(arg) && 'command' in arg && 'keybinding' in arg; } diff --git a/packages/core/src/common/logger-protocol.ts b/packages/core/src/common/logger-protocol.ts index 2bdc0d7dbf42c..a972cf8a40dc0 100644 --- a/packages/core/src/common/logger-protocol.ts +++ b/packages/core/src/common/logger-protocol.ts @@ -24,7 +24,7 @@ export const loggerPath = '/services/logger'; export interface ILoggerServer extends JsonRpcServer { setLogLevel(name: string, logLevel: number): Promise; getLogLevel(name: string): Promise; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any log(name: string, logLevel: number, message: any, params: any[]): Promise; child(name: string): Promise; } @@ -86,7 +86,7 @@ export namespace LogLevel { } } -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export namespace ConsoleLogger { type Console = (message?: any, ...optionalParams: any[]) => void; const originalConsoleLog = console.log; diff --git a/packages/core/src/common/logger.spec.ts b/packages/core/src/common/logger.spec.ts index 3d0c811148033..244f4b3ca053a 100644 --- a/packages/core/src/common/logger.spec.ts +++ b/packages/core/src/common/logger.spec.ts @@ -18,7 +18,7 @@ import { expect } from 'chai'; import { MockLogger } from './test/mock-logger'; import { setRootLogger, unsetRootLogger } from './logger'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ describe('logger', () => { diff --git a/packages/core/src/common/logger.ts b/packages/core/src/common/logger.ts index 97991a7b6c654..5700e9947d6b4 100644 --- a/packages/core/src/common/logger.ts +++ b/packages/core/src/common/logger.ts @@ -18,7 +18,7 @@ import { inject, injectable } from 'inversify'; import { LoggerWatcher } from './logger-watcher'; import { ILoggerServer, LogLevel, ConsoleLogger, rootLoggerName } from './logger-protocol'; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export { LogLevel, rootLoggerName diff --git a/packages/core/src/common/lsp-types.ts b/packages/core/src/common/lsp-types.ts index 11730bc52e824..eeec8d31c64ee 100644 --- a/packages/core/src/common/lsp-types.ts +++ b/packages/core/src/common/lsp-types.ts @@ -23,7 +23,7 @@ export interface TextDocumentContentChangeDelta { } export namespace TextDocumentContentChangeDelta { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(arg: any): arg is TextDocumentContentChangeDelta { return !!arg && typeof arg['text'] === 'string' && (typeof arg['rangeLength'] === 'number' || typeof arg['rangeLength'] === 'undefined') && Range.is(arg['range']); } diff --git a/packages/core/src/common/menu.spec.ts b/packages/core/src/common/menu.spec.ts index 48753cb3f1dc4..1df88d4249788 100644 --- a/packages/core/src/common/menu.spec.ts +++ b/packages/core/src/common/menu.spec.ts @@ -37,17 +37,17 @@ describe('menu-model-registry', () => { }); } }, { - registerCommands(reg: CommandRegistry): void { - reg.registerCommand({ - id: 'open', - label: 'A' - }); - reg.registerCommand({ - id: 'open.with', - label: 'B' - }); - } - }); + registerCommands(reg: CommandRegistry): void { + reg.registerCommand({ + id: 'open', + label: 'A' + }); + reg.registerCommand({ + id: 'open.with', + label: 'B' + }); + } + }); const all = service.getMenu(); const main = all.children[0] as CompositeMenuNode; expect(main.children.length).equals(1); @@ -58,7 +58,7 @@ describe('menu-model-registry', () => { expect(file.label, 'File'); const openGroup = file.children[0] as CompositeMenuNode; expect(openGroup.children.length).equals(2); - // tslint:disable-next-line:no-unused-expression + // eslint-disable-next-line no-unused-expressions expect(openGroup.label).undefined; }); }); diff --git a/packages/core/src/common/menu.ts b/packages/core/src/common/menu.ts index 7f9fc0bb474f7..f9f025e3a3bd2 100644 --- a/packages/core/src/common/menu.ts +++ b/packages/core/src/common/menu.ts @@ -34,7 +34,7 @@ export interface MenuAction { export namespace MenuAction { /* Determine whether object is a MenuAction */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(arg: MenuAction | any): arg is MenuAction { return !!arg && arg === Object(arg) && 'commandId' in arg; } diff --git a/packages/core/src/common/message-service.ts b/packages/core/src/common/message-service.ts index 7aacbe4ec3ab7..cb5c86c90ac28 100644 --- a/packages/core/src/common/message-service.ts +++ b/packages/core/src/common/message-service.ts @@ -34,33 +34,33 @@ export class MessageService { log(message: string, ...actions: T[]): Promise; log(message: string, options?: MessageOptions, ...actions: T[]): Promise; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any log(message: string, ...args: any[]): Promise { return this.processMessage(MessageType.Log, message, args); } info(message: string, ...actions: T[]): Promise; info(message: string, options?: MessageOptions, ...actions: T[]): Promise; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any info(message: string, ...args: any[]): Promise { return this.processMessage(MessageType.Info, message, args); } warn(message: string, ...actions: T[]): Promise; warn(message: string, options?: MessageOptions, ...actions: T[]): Promise; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any warn(message: string, ...args: any[]): Promise { return this.processMessage(MessageType.Warning, message, args); } error(message: string, ...actions: T[]): Promise; error(message: string, options?: MessageOptions, ...actions: T[]): Promise; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any error(message: string, ...args: any[]): Promise { return this.processMessage(MessageType.Error, message, args); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected processMessage(type: MessageType, text: string, args?: any[]): Promise { if (!!args && args.length > 0) { const first = args[0]; diff --git a/packages/core/src/common/messaging/connection-error-handler.ts b/packages/core/src/common/messaging/connection-error-handler.ts index 6ba6a6c095c71..cb1458459b8bc 100644 --- a/packages/core/src/common/messaging/connection-error-handler.ts +++ b/packages/core/src/common/messaging/connection-error-handler.ts @@ -63,7 +63,7 @@ export class ConnectionErrorHandler { } const diff = this.restarts[this.restarts.length - 1] - this.restarts[0]; if (diff <= this.options.restartInterval * 60 * 1000) { - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len this.options.logger.error(`The ${this.options.serverName} server crashed ${this.options.maxRestarts} times in the last ${this.options.restartInterval} minutes. The server will not be restarted.`); return false; } diff --git a/packages/core/src/common/messaging/proxy-factory.spec.ts b/packages/core/src/common/messaging/proxy-factory.spec.ts index c9f9130e9d43c..8f4d8c7efcaeb 100644 --- a/packages/core/src/common/messaging/proxy-factory.spec.ts +++ b/packages/core/src/common/messaging/proxy-factory.spec.ts @@ -24,7 +24,7 @@ const expect = chai.expect; class NoTransform extends stream.Transform { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any public _transform(chunk: any, encoding: string, callback: Function): void { callback(undefined, chunk); } diff --git a/packages/core/src/common/messaging/proxy-factory.ts b/packages/core/src/common/messaging/proxy-factory.ts index 27676d312b29e..1777e81114eb4 100644 --- a/packages/core/src/common/messaging/proxy-factory.ts +++ b/packages/core/src/common/messaging/proxy-factory.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { MessageConnection, ResponseError } from 'vscode-jsonrpc'; import { ApplicationError } from '../application-error'; diff --git a/packages/core/src/common/messaging/web-socket-channel.ts b/packages/core/src/common/messaging/web-socket-channel.ts index 5c63de6458c79..37fb9127d0d12 100644 --- a/packages/core/src/common/messaging/web-socket-channel.ts +++ b/packages/core/src/common/messaging/web-socket-channel.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { IWebSocket } from 'vscode-ws-jsonrpc/lib/socket/socket'; import { Disposable, DisposableCollection } from '../disposable'; diff --git a/packages/core/src/common/objects.ts b/packages/core/src/common/objects.ts index 9375f36be16af..f2f2c3ce668d8 100644 --- a/packages/core/src/common/objects.ts +++ b/packages/core/src/common/objects.ts @@ -21,10 +21,10 @@ export function deepClone(obj: T): T { if (obj instanceof RegExp) { return obj; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const result: any = Array.isArray(obj) ? [] : {}; Object.keys(obj).forEach((key: string) => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const prop = (obj)[key]; if (prop && typeof prop === 'object') { result[key] = deepClone(prop); @@ -39,7 +39,7 @@ export function deepFreeze(obj: T): T { if (!obj || typeof obj !== 'object') { return obj; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const stack: any[] = [obj]; while (stack.length > 0) { const objectToFreeze = stack.shift(); @@ -59,6 +59,7 @@ export function deepFreeze(obj: T): T { const _hasOwnProperty = Object.prototype.hasOwnProperty; export function notEmpty(arg: T | undefined | null): arg is T { + // eslint-disable-next-line no-null/no-null return arg !== undefined && arg !== null; } diff --git a/packages/core/src/common/preferences/preference-schema.ts b/packages/core/src/common/preferences/preference-schema.ts index 985e9336797d9..1dcc1dd64effe 100644 --- a/packages/core/src/common/preferences/preference-schema.ts +++ b/packages/core/src/common/preferences/preference-schema.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { PreferenceScope } from './preference-scope'; diff --git a/packages/core/src/common/preferences/preference-scope.ts b/packages/core/src/common/preferences/preference-scope.ts index 8c2d6558ef16e..8af78ac3db241 100644 --- a/packages/core/src/common/preferences/preference-scope.ts +++ b/packages/core/src/common/preferences/preference-scope.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export enum PreferenceScope { Default, diff --git a/packages/core/src/common/promise-util.ts b/packages/core/src/common/promise-util.ts index 93a7373d36452..5d5d100ee743d 100644 --- a/packages/core/src/common/promise-util.ts +++ b/packages/core/src/common/promise-util.ts @@ -20,7 +20,7 @@ */ export class Deferred { resolve: (value?: T) => void; - reject: (err?: any) => void; // tslint:disable-line + reject: (err?: any) => void; // eslint-disable-line @typescript-eslint/no-explicit-any promise = new Promise((resolve, reject) => { this.resolve = resolve; diff --git a/packages/core/src/common/selection-command-handler.ts b/packages/core/src/common/selection-command-handler.ts index edb9c7d387942..563103a460264 100644 --- a/packages/core/src/common/selection-command-handler.ts +++ b/packages/core/src/common/selection-command-handler.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { CommandHandler } from './command'; import { SelectionService } from '../common/selection-service'; diff --git a/packages/core/src/common/selection-service.spec.ts b/packages/core/src/common/selection-service.spec.ts index 3c1114d16045d..bc245011e1234 100644 --- a/packages/core/src/common/selection-service.spec.ts +++ b/packages/core/src/common/selection-service.spec.ts @@ -24,7 +24,7 @@ describe('selection-service', () => { describe('01 #addListener and dispose', () => { it('Should be rejected when path argument is undefined.', () => { const service = createSelectionService(); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const events: any[] = []; const disposable = service.onSelectionChanged( e => events.push(e) diff --git a/packages/core/src/common/selection-service.ts b/packages/core/src/common/selection-service.ts index 21c41a2a1b1c7..c5af93baad853 100644 --- a/packages/core/src/common/selection-service.ts +++ b/packages/core/src/common/selection-service.ts @@ -17,7 +17,7 @@ import { injectable } from 'inversify'; import { Emitter, Event } from '../common/event'; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export interface SelectionProvider { onSelectionChanged: Event; diff --git a/packages/core/src/common/selection.ts b/packages/core/src/common/selection.ts index 93a99e42a494e..495c61a761076 100644 --- a/packages/core/src/common/selection.ts +++ b/packages/core/src/common/selection.ts @@ -23,7 +23,7 @@ export interface UriSelection { export namespace UriSelection { export function is(arg: Object | undefined): arg is UriSelection { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return typeof arg === 'object' && ('uri' in arg) && (arg)['uri'] instanceof URI; } diff --git a/packages/core/src/common/test/expect.ts b/packages/core/src/common/test/expect.ts index bf198377eeab7..c2b1d9a26d6df 100644 --- a/packages/core/src/common/test/expect.ts +++ b/packages/core/src/common/test/expect.ts @@ -16,11 +16,11 @@ import { expect } from 'chai'; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export async function expectThrowsAsync(actual: Promise, expected?: string | RegExp, message?: string): Promise; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export async function expectThrowsAsync(actual: Promise, constructor: Error | Function, expected?: string | RegExp, message?: string): Promise; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export async function expectThrowsAsync(promise: Promise, ...args: any[]): Promise { let synchronous = () => { }; try { diff --git a/packages/core/src/common/test/mock-logger.ts b/packages/core/src/common/test/mock-logger.ts index 2eb399082971c..a7dbf09b5e9ff 100644 --- a/packages/core/src/common/test/mock-logger.ts +++ b/packages/core/src/common/test/mock-logger.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable } from 'inversify'; import { ILogger, Loggable } from '../logger'; diff --git a/packages/core/src/common/uri-command-handler.ts b/packages/core/src/common/uri-command-handler.ts index 1f4579ee4f331..33b9b335599c9 100644 --- a/packages/core/src/common/uri-command-handler.ts +++ b/packages/core/src/common/uri-command-handler.ts @@ -22,13 +22,13 @@ import URI from './uri'; export interface UriCommandHandler> { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute(uri: T, ...args: any[]): any; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isEnabled?(uri: T, ...args: any[]): boolean; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isVisible?(uri: T, ...args: any[]): boolean; } @@ -77,7 +77,7 @@ export class UriAwareCommandHandler> implements Comman protected readonly options?: UriAwareCommandHandler.Options ) { } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected getUri(...args: any[]): T | undefined { if (args && args[0] instanceof URI) { // @ts-ignore we want to always return URIs @@ -91,13 +91,13 @@ export class UriAwareCommandHandler> implements Comman return uris as T; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute(...args: any[]): object | undefined { const uri = this.getUri(...args); return uri ? this.handler.execute(uri, ...args) : undefined; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isVisible(...args: any[]): boolean { const uri = this.getUri(...args); if (uri) { @@ -109,7 +109,7 @@ export class UriAwareCommandHandler> implements Comman return false; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isEnabled(...args: any[]): boolean { const uri = this.getUri(...args); if (uri) { diff --git a/packages/core/src/electron-browser/keyboard/electron-keyboard-layout-change-notifier.ts b/packages/core/src/electron-browser/keyboard/electron-keyboard-layout-change-notifier.ts index 1bce1911aa668..72a28a155bb57 100644 --- a/packages/core/src/electron-browser/keyboard/electron-keyboard-layout-change-notifier.ts +++ b/packages/core/src/electron-browser/keyboard/electron-keyboard-layout-change-notifier.ts @@ -34,7 +34,7 @@ export class ElectronKeyboardLayoutChangeNotifier implements KeyboardLayoutChang @postConstruct() protected initialize(): void { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any ipcRenderer.on('keyboardLayoutChanged', (event: Event, newLayout: NativeKeyboardLayout) => this.nativeLayoutChanged.fire(newLayout)); } diff --git a/packages/core/src/electron-browser/menu/electron-context-menu-renderer.ts b/packages/core/src/electron-browser/menu/electron-context-menu-renderer.ts index 5e15a4a95f9e8..9083c1d5def67 100644 --- a/packages/core/src/electron-browser/menu/electron-context-menu-renderer.ts +++ b/packages/core/src/electron-browser/menu/electron-context-menu-renderer.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { inject, injectable } from 'inversify'; import { MenuPath } from '../../common'; diff --git a/packages/core/src/electron-browser/menu/electron-main-menu-factory.ts b/packages/core/src/electron-browser/menu/electron-main-menu-factory.ts index 382b634e90c7a..2e55f3e0f18b8 100644 --- a/packages/core/src/electron-browser/menu/electron-main-menu-factory.ts +++ b/packages/core/src/electron-browser/menu/electron-main-menu-factory.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as electron from 'electron'; import { inject, injectable } from 'inversify'; diff --git a/packages/core/src/node/backend-application-config-provider.ts b/packages/core/src/node/backend-application-config-provider.ts index 9e3ce63b3622e..319a769107d9b 100644 --- a/packages/core/src/node/backend-application-config-provider.ts +++ b/packages/core/src/node/backend-application-config-provider.ts @@ -32,14 +32,14 @@ export class BackendApplicationConfigProvider { if (BackendApplicationConfigProvider.doGet() !== undefined) { throw new Error('The configuration is already set.'); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const globalObject = global as any; const key = BackendApplicationConfigProvider.KEY; globalObject[key] = config; } private static doGet(): BackendApplicationConfig | undefined { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const globalObject = global as any; const key = BackendApplicationConfigProvider.KEY; return globalObject[key]; diff --git a/packages/core/src/node/console-logger-server.ts b/packages/core/src/node/console-logger-server.ts index f791489222379..33d83d1d67759 100644 --- a/packages/core/src/node/console-logger-server.ts +++ b/packages/core/src/node/console-logger-server.ts @@ -52,7 +52,7 @@ export class ConsoleLoggerServer implements ILoggerServer { return this.cli.logLevelFor(name); } - // tslint:disable:no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ async log(name: string, logLevel: number, message: string, params: any[]): Promise { const configuredLogLevel = await this.getLogLevel(name); if (logLevel >= configuredLogLevel) { diff --git a/packages/core/src/node/debug.ts b/packages/core/src/node/debug.ts index 89aeabccb9d39..b943f6debd983 100644 --- a/packages/core/src/node/debug.ts +++ b/packages/core/src/node/debug.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable-next-line:no-any +// eslint-disable-next-line no-var, @typescript-eslint/no-explicit-any declare var v8debug: any; function isInDebugMode(): boolean { if (typeof v8debug === 'object') { diff --git a/packages/core/src/node/file-uri.ts b/packages/core/src/node/file-uri.ts index 3461d65af03c0..8878c6ae27539 100644 --- a/packages/core/src/node/file-uri.ts +++ b/packages/core/src/node/file-uri.ts @@ -46,7 +46,7 @@ export namespace FileUri { * (by, for example, the readdir function in the fs-extra module). * A backslash must be appended to the drive, eg c:\, to ensure the correct path. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const fsPathFromVsCodeUri = (uri as any).codeUri.fsPath; if (isWindows) { const isWindowsDriveRoot = windowsDriveRegex.exec(fsPathFromVsCodeUri); diff --git a/packages/core/src/node/messaging/connection-container-module.ts b/packages/core/src/node/messaging/connection-container-module.ts index 730cbe5dae75f..e38ddb45a6604 100644 --- a/packages/core/src/node/messaging/connection-container-module.ts +++ b/packages/core/src/node/messaging/connection-container-module.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { interfaces, ContainerModule } from 'inversify'; import { JsonRpcProxyFactory, ConnectionHandler, JsonRpcConnectionHandler, JsonRpcProxy } from '../../common'; diff --git a/packages/core/src/node/messaging/ipc-bootstrap.ts b/packages/core/src/node/messaging/ipc-bootstrap.ts index 130f94484f832..fa59146ea6f4b 100644 --- a/packages/core/src/node/messaging/ipc-bootstrap.ts +++ b/packages/core/src/node/messaging/ipc-bootstrap.ts @@ -26,7 +26,7 @@ const writer = new IPCMessageWriter(process); const logger = new ConsoleLogger(); const connection = createMessageConnection(reader, writer, logger); connection.trace(Trace.Off, { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any log: (message: any, data?: string) => console.log(message, data) }); diff --git a/packages/core/src/node/messaging/ipc-connection-provider.ts b/packages/core/src/node/messaging/ipc-connection-provider.ts index 1201ccfe2dc04..108d3eb666d09 100644 --- a/packages/core/src/node/messaging/ipc-connection-provider.ts +++ b/packages/core/src/node/messaging/ipc-connection-provider.ts @@ -84,7 +84,7 @@ export class IPCConnectionProvider { log: (message: string) => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${message}`) }); connection.trace(Trace.Off, { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any log: (message: any, data?: string) => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${message}` + (typeof data === 'string' ? ' ' + data : '')) }); return connection; diff --git a/packages/core/src/node/messaging/messaging-contribution.ts b/packages/core/src/node/messaging/messaging-contribution.ts index 5b7d47111bf01..944778efec06b 100644 --- a/packages/core/src/node/messaging/messaging-contribution.ts +++ b/packages/core/src/node/messaging/messaging-contribution.ts @@ -19,7 +19,6 @@ import * as url from 'url'; import * as http from 'http'; import * as https from 'https'; import { injectable, inject, named, postConstruct, interfaces } from 'inversify'; -// tslint:disable-next-line:no-implicit-dependencies import { MessageConnection } from 'vscode-jsonrpc'; import { createWebSocketConnection } from 'vscode-ws-jsonrpc/lib/socket/connection'; import { IConnection } from 'vscode-ws-jsonrpc/lib/server/connection'; diff --git a/packages/debug-nodejs/.eslintrc.js b/packages/debug-nodejs/.eslintrc.js new file mode 100644 index 0000000000000..31ff2a53f4e3c --- /dev/null +++ b/packages/debug-nodejs/.eslintrc.js @@ -0,0 +1,12 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + ignorePatterns: [ + 'download/' // Somehow ESLint *wants* to lint this folder? + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/debug-nodejs/compile.tsconfig.json b/packages/debug-nodejs/compile.tsconfig.json index a23513b5e6b13..b340ebd002c96 100644 --- a/packages/debug-nodejs/compile.tsconfig.json +++ b/packages/debug-nodejs/compile.tsconfig.json @@ -1,10 +1,16 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../debug/compile.tsconfig.json" + } ] } diff --git a/packages/debug-nodejs/package.json b/packages/debug-nodejs/package.json index dbbe025e7c162..33cafdb061d68 100644 --- a/packages/debug-nodejs/package.json +++ b/packages/debug-nodejs/package.json @@ -36,10 +36,10 @@ ], "scripts": { "postinstall": "download-debug-adapters", - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/debug-nodejs/src/node/node-debug-adapter-contribution.ts b/packages/debug-nodejs/src/node/node-debug-adapter-contribution.ts index 756f070bf23ee..9b9041eb3b293 100644 --- a/packages/debug-nodejs/src/node/node-debug-adapter-contribution.ts +++ b/packages/debug-nodejs/src/node/node-debug-adapter-contribution.ts @@ -17,7 +17,6 @@ import * as path from 'path'; const psList: () => Promise<[{ pid: number, cmd: string }]> = require('ps-list'); // FIXME use import, provide proper d.ts file import { injectable } from 'inversify'; -// tslint:disable-next-line:no-implicit-dependencies import { FileUri } from '@theia/core/lib/node'; import { DebugConfiguration } from '@theia/debug/lib/common/debug-configuration'; import { AbstractVSCodeDebugAdapterContribution } from '@theia/debug/lib/node/vscode/vscode-debug-adapter-contribution'; diff --git a/packages/debug/.eslintrc.js b/packages/debug/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/debug/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/debug/compile.tsconfig.json b/packages/debug/compile.tsconfig.json index a23513b5e6b13..e77a224fd48a5 100644 --- a/packages/debug/compile.tsconfig.json +++ b/packages/debug/compile.tsconfig.json @@ -1,10 +1,64 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../../dev-packages/application-package/compile.tsconfig.json" + }, + { + "path": "../console/compile.tsconfig.json" + }, + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../json/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../markers/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + }, + { + "path": "../output/compile.tsconfig.json" + }, + { + "path": "../preferences/compile.tsconfig.json" + }, + { + "path": "../process/compile.tsconfig.json" + }, + { + "path": "../task/compile.tsconfig.json" + }, + { + "path": "../terminal/compile.tsconfig.json" + }, + { + "path": "../userstorage/compile.tsconfig.json" + }, + { + "path": "../variable-resolver/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] } diff --git a/packages/debug/package.json b/packages/debug/package.json index 3ca487e33c90d..703ba75b8ed63 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -60,10 +60,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/debug/src/browser/breakpoint/breakpoint-manager.ts b/packages/debug/src/browser/breakpoint/breakpoint-manager.ts index 67549eccdc0e6..e29f87dc7f192 100644 --- a/packages/debug/src/browser/breakpoint/breakpoint-manager.ts +++ b/packages/debug/src/browser/breakpoint/breakpoint-manager.ts @@ -234,7 +234,7 @@ export class BreakpointManager extends MarkerManager { breakpoints: {} }); this._breakpointsEnabled = data.breakpointsEnabled; - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const uri in data.breakpoints) { this.setBreakpoints(new URI(uri), data.breakpoints[uri]); } diff --git a/packages/debug/src/browser/console/debug-console-contribution.tsx b/packages/debug/src/browser/console/debug-console-contribution.tsx index 8243aef86fdd3..9a3d31f6f42db 100644 --- a/packages/debug/src/browser/console/debug-console-contribution.tsx +++ b/packages/debug/src/browser/console/debug-console-contribution.tsx @@ -144,7 +144,7 @@ export class DebugConsoleContribution extends AbstractViewContribution) => { this.debugConsoleSession.severity = Severity.fromValue(event.target.value); - } + }; protected withWidget(widget: Widget | undefined = this.tryGetWidget(), fn: (widget: ConsoleWidget) => T): T | false { if (widget instanceof ConsoleWidget && widget.id === DebugConsoleContribution.options.id) { diff --git a/packages/debug/src/browser/debug-configuration-model.ts b/packages/debug/src/browser/debug-configuration-model.ts index 038552517dde7..1e7a2bba0cb82 100644 --- a/packages/debug/src/browser/debug-configuration-model.ts +++ b/packages/debug/src/browser/debug-configuration-model.ts @@ -64,7 +64,7 @@ export class DebugConfigurationModel implements Disposable { } protected parseConfigurations(): DebugConfigurationModel.JsonContent { const configurations: DebugConfiguration[] = []; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { configUri, value } = this.preferences.resolve('launch', undefined, this.workspaceFolderUri); if (value && typeof value === 'object' && 'configurations' in value) { if (Array.isArray(value.configurations)) { diff --git a/packages/debug/src/browser/debug-monaco-contribution.ts b/packages/debug/src/browser/debug-monaco-contribution.ts index 61800bcf52283..c0e9557e02873 100644 --- a/packages/debug/src/browser/debug-monaco-contribution.ts +++ b/packages/debug/src/browser/debug-monaco-contribution.ts @@ -18,7 +18,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { visit } from 'jsonc-parser'; import URI from '@theia/core/lib/common/uri'; diff --git a/packages/debug/src/browser/debug-session-connection.ts b/packages/debug/src/browser/debug-session-connection.ts index a2fa2d6d77c54..420c961ce83b1 100644 --- a/packages/debug/src/browser/debug-session-connection.ts +++ b/packages/debug/src/browser/debug-session-connection.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { DebugProtocol } from 'vscode-debugprotocol'; import { Deferred } from '@theia/core/lib/common/promise-util'; diff --git a/packages/debug/src/browser/debug-session-manager.ts b/packages/debug/src/browser/debug-session-manager.ts index 3fe233cfbed0e..e481df8aa5fb3 100644 --- a/packages/debug/src/browser/debug-session-manager.ts +++ b/packages/debug/src/browser/debug-session-manager.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { DisposableCollection, Emitter, Event, MessageService, ProgressService, WaitUntilEvent } from '@theia/core'; import { LabelProvider } from '@theia/core/lib/browser'; diff --git a/packages/debug/src/browser/debug-session.tsx b/packages/debug/src/browser/debug-session.tsx index dbcd527e1cc0e..f7dc84402dd29 100644 --- a/packages/debug/src/browser/debug-session.tsx +++ b/packages/debug/src/browser/debug-session.tsx @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as React from 'react'; import { LabelProvider } from '@theia/core/lib/browser'; diff --git a/packages/debug/src/browser/editor/debug-breakpoint-widget.tsx b/packages/debug/src/browser/editor/debug-breakpoint-widget.tsx index 86935e7db32db..7b809f37df798 100644 --- a/packages/debug/src/browser/editor/debug-breakpoint-widget.tsx +++ b/packages/debug/src/browser/editor/debug-breakpoint-widget.tsx @@ -211,7 +211,7 @@ export class DebugBreakpointWidget implements Disposable { if (this._input) { this._input.focus(); } - } + }; static PLACEHOLDER_DECORATION = 'placeholderDecoration'; protected updatePlaceholder(): void { diff --git a/packages/debug/src/browser/editor/debug-editor-model.ts b/packages/debug/src/browser/editor/debug-editor-model.ts index 58d913e41aeee..7ba295d9f2abe 100644 --- a/packages/debug/src/browser/editor/debug-editor-model.ts +++ b/packages/debug/src/browser/editor/debug-editor-model.ts @@ -370,7 +370,7 @@ export class DebugEditorModel implements Disposable { const targetType = mouseEvent.target.type; const stopKey = isOSX ? 'metaKey' : 'ctrlKey'; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any if (targetType === monaco.editor.MouseTargetType.CONTENT_WIDGET && mouseEvent.target.detail === this.hover.getId() && !(mouseEvent.event)[stopKey]) { // mouse moved on top of debug hover widget return; diff --git a/packages/debug/src/browser/editor/debug-expression-provider.ts b/packages/debug/src/browser/editor/debug-expression-provider.ts index cb9f7dc435542..e9c06c7f8e5d0 100644 --- a/packages/debug/src/browser/editor/debug-expression-provider.ts +++ b/packages/debug/src/browser/editor/debug-expression-provider.ts @@ -37,7 +37,7 @@ export class DebugExpressionProvider { // Some example supported expressions: myVar.prop, a.b.c.d, myVar?.prop, myVar->prop, MyClass::StaticProp, *myVar // Match any character except a set of characters which often break interesting sub-expressions const expression = /([^()\[\]{}<>\s+\-/%~#^;=|,`!]|\->)+/g; - // tslint:disable-next-line + // eslint-disable-next-line no-null/no-null let result: RegExpExecArray | null = null; // First find the full expression under the cursor @@ -56,7 +56,7 @@ export class DebugExpressionProvider { // For example in expression 'a.b.c.d', if the focus was under 'b', 'a.b' would be evaluated. if (matchingExpression) { const subExpression: RegExp = /\w+/g; - // tslint:disable-next-line + // eslint-disable-next-line no-null/no-null let subExpressionResult: RegExpExecArray | null = null; while (subExpressionResult = subExpression.exec(matchingExpression)) { const subEnd = subExpressionResult.index + 1 + startOffset + subExpressionResult[0].length; diff --git a/packages/debug/src/browser/model/debug-breakpoint.tsx b/packages/debug/src/browser/model/debug-breakpoint.tsx index 727114efa4dfb..5346771250c66 100644 --- a/packages/debug/src/browser/model/debug-breakpoint.tsx +++ b/packages/debug/src/browser/model/debug-breakpoint.tsx @@ -88,7 +88,7 @@ export abstract class DebugBreakpoint protected readonly setBreakpointEnabled = (event: React.ChangeEvent) => { this.setEnabled(event.target.checked); - } + }; render(): React.ReactNode { const classNames = ['theia-source-breakpoint']; diff --git a/packages/debug/src/browser/model/debug-source-breakpoint.tsx b/packages/debug/src/browser/model/debug-source-breakpoint.tsx index f7766145af2d7..87321c33be954 100644 --- a/packages/debug/src/browser/model/debug-source-breakpoint.tsx +++ b/packages/debug/src/browser/model/debug-source-breakpoint.tsx @@ -141,7 +141,7 @@ export class DebugSourceBreakpoint extends DebugBreakpoint imp protected readonly setBreakpointEnabled = (event: React.ChangeEvent) => { this.setEnabled(event.target.checked); - } + }; protected doRender(): React.ReactNode { return diff --git a/packages/debug/src/browser/preferences/launch-folder-preference-provider.ts b/packages/debug/src/browser/preferences/launch-folder-preference-provider.ts index b0d93f56c7898..7168ff266c42e 100644 --- a/packages/debug/src/browser/preferences/launch-folder-preference-provider.ts +++ b/packages/debug/src/browser/preferences/launch-folder-preference-provider.ts @@ -20,7 +20,7 @@ import { FolderPreferenceProvider } from '@theia/preferences/lib/browser/folder- @injectable() export class LaunchFolderPreferenceProvider extends FolderPreferenceProvider { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected parse(content: string): any { const launch = super.parse(content); if (launch === undefined) { diff --git a/packages/debug/src/browser/preferences/launch-preferences.spec.ts b/packages/debug/src/browser/preferences/launch-preferences.spec.ts index 86e82821f52e9..72d37dbccb8dc 100644 --- a/packages/debug/src/browser/preferences/launch-preferences.spec.ts +++ b/packages/debug/src/browser/preferences/launch-preferences.spec.ts @@ -14,8 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions, @typescript-eslint/no-explicit-any */ import { enableJSDOM } from '@theia/core/lib/browser/test/jsdom'; const disableJSDOM = enableJSDOM(); @@ -236,7 +235,7 @@ describe('Launch Preferences', () => { testSuite({ name: 'Null Bogus Launch Configuration', - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null launch: null, expectation: { 'compounds': [], @@ -246,7 +245,7 @@ describe('Launch Preferences', () => { testSuite({ name: 'Null Bogus Settings Configuration', settings: { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null 'launch': null }, expectation: {} @@ -333,12 +332,12 @@ describe('Launch Preferences', () => { function testLaunchAndSettingsSuite({ name, expectation, launch, only, configMode }: { - name: string, - expectation: any, - launch?: any, - only?: boolean, - configMode?: ConfigMode - }): void { + name: string, + expectation: any, + launch?: any, + only?: boolean, + configMode?: ConfigMode + }): void { testSuite({ name: name + ' Launch Configuration', launch, @@ -398,13 +397,13 @@ describe('Launch Preferences', () => { function testConfigSuite({ configMode, expectation, inspectExpectation, settings, launch, only }: { - configMode: ConfigMode - expectation: any, - inspectExpectation?: any, - launch?: any, - settings?: any, - only?: boolean - }): void { + configMode: ConfigMode + expectation: any, + inspectExpectation?: any, + launch?: any, + settings?: any, + only?: boolean + }): void { describe(JSON.stringify(configMode, undefined, 2), () => { @@ -625,6 +624,7 @@ describe('Launch Preferences', () => { } if (settings) { let _settingsLaunch = undefined; + // eslint-disable-next-line no-null/no-null if (typeof settingsLaunch === 'object' && !Array.isArray(settings['launch']) && settings['launch'] !== null) { _settingsLaunch = settingsLaunch; } else { diff --git a/packages/debug/src/browser/view/debug-configuration-widget.tsx b/packages/debug/src/browser/view/debug-configuration-widget.tsx index 3934b872b565f..5791f55af22f6 100644 --- a/packages/debug/src/browser/view/debug-configuration-widget.tsx +++ b/packages/debug/src/browser/view/debug-configuration-widget.tsx @@ -119,16 +119,16 @@ export class DebugConfigurationWidget extends ReactWidget { const [name, workspaceFolderUri] = value.split('__CONF__'); this.manager.current = this.manager.find(name, workspaceFolderUri); } - } + }; protected readonly start = () => { const configuration = this.manager.current; this.commandRegistry.executeCommand(DebugCommands.START.id, configuration); - } + }; protected readonly openConfiguration = () => this.manager.openConfiguration(); protected readonly openConsole = () => this.debugConsole.openView({ activate: true - }) + }); } diff --git a/packages/debug/src/common/debug-configuration.ts b/packages/debug/src/common/debug-configuration.ts index a8fe876d9cdd4..6b1d5e4b7cac9 100644 --- a/packages/debug/src/common/debug-configuration.ts +++ b/packages/debug/src/common/debug-configuration.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ import { TaskIdentifier } from '@theia/task/lib/common'; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export type DebugViewLocation = 'default' | 'left' | 'right' | 'bottom'; diff --git a/packages/debug/src/common/debug-service.ts b/packages/debug/src/common/debug-service.ts index 705276c71c1fb..c993dc4fb826e 100644 --- a/packages/debug/src/common/debug-service.ts +++ b/packages/debug/src/common/debug-service.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { Disposable } from '@theia/core'; import { ApplicationError } from '@theia/core/lib/common/application-error'; diff --git a/packages/debug/src/node/debug-adapter-factory.ts b/packages/debug/src/node/debug-adapter-factory.ts index 9075f59653c35..d4e34d35e2282 100644 --- a/packages/debug/src/node/debug-adapter-factory.ts +++ b/packages/debug/src/node/debug-adapter-factory.ts @@ -64,7 +64,7 @@ export class LaunchBasedDebugAdapterFactory implements DebugAdapterFactory { } private childProcess(executable: DebugAdapterExecutable): RawProcess { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const isForkOptions = (forkOptions: RawForkOptions | any): forkOptions is RawForkOptions => !!forkOptions && !!forkOptions.modulePath; diff --git a/packages/editor-preview/.eslintrc.js b/packages/editor-preview/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/editor-preview/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/editor-preview/compile.tsconfig.json b/packages/editor-preview/compile.tsconfig.json index a23513b5e6b13..9dabf53d7def5 100644 --- a/packages/editor-preview/compile.tsconfig.json +++ b/packages/editor-preview/compile.tsconfig.json @@ -1,10 +1,19 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + } ] } diff --git a/packages/editor-preview/package.json b/packages/editor-preview/package.json index ccda3a43f1bd3..ce502e56559ce 100644 --- a/packages/editor-preview/package.json +++ b/packages/editor-preview/package.json @@ -31,10 +31,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/editor-preview/src/browser/editor-preview-factory.spec.ts b/packages/editor-preview/src/browser/editor-preview-factory.spec.ts index 168a8bc5a06ec..57c37de6912a7 100644 --- a/packages/editor-preview/src/browser/editor-preview-factory.spec.ts +++ b/packages/editor-preview/src/browser/editor-preview-factory.spec.ts @@ -16,9 +16,9 @@ // This file is strictly for testing; disable no-any so we can mock out objects not under test // disable no-unused-expression for chai. -// tslint:disable:no-any no-unused-expression +/* eslint-disable no-unused-expressions, @typescript-eslint/no-explicit-any */ -import {enableJSDOM} from '@theia/core/lib/browser/test/jsdom'; +import { enableJSDOM } from '@theia/core/lib/browser/test/jsdom'; const disableJsDom = enableJSDOM(); import { Container } from 'inversify'; @@ -31,7 +31,7 @@ import * as previewFrontEndModule from './editor-preview-frontend-module'; const mockEditorWidget = sinon.createStubInstance(EditorWidget); const mockEditorManager = { - getOrCreateByUri: () => {} + getOrCreateByUri: () => { } }; const getOrCreateStub = sinon.stub(mockEditorManager, 'getOrCreateByUri').returns(mockEditorWidget); diff --git a/packages/editor-preview/src/browser/editor-preview-manager.spec.ts b/packages/editor-preview/src/browser/editor-preview-manager.spec.ts index d210df3c9e22f..1806d325faec8 100644 --- a/packages/editor-preview/src/browser/editor-preview-manager.spec.ts +++ b/packages/editor-preview/src/browser/editor-preview-manager.spec.ts @@ -16,7 +16,7 @@ // This file is strictly for testing; disable no-any so we can mock out objects not under test // disable no-unused-expression for chai. -// tslint:disable:no-any no-unused-expression +/* eslint-disable no-unused-expressions, @typescript-eslint/no-explicit-any */ import { enableJSDOM } from '@theia/core/lib/browser/test/jsdom'; const disableJsDom = enableJSDOM(); diff --git a/packages/editor/.eslintrc.js b/packages/editor/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/editor/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/editor/compile.tsconfig.json b/packages/editor/compile.tsconfig.json index b8b72b49c8822..04d9bb9f1e74e 100644 --- a/packages/editor/compile.tsconfig.json +++ b/packages/editor/compile.tsconfig.json @@ -1,10 +1,22 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../variable-resolver/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/editor/package.json b/packages/editor/package.json index abb1d89f9e731..4be8eeb4e2be5 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -34,10 +34,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/editor/src/browser/decorations/editor-decoration-style.ts b/packages/editor/src/browser/decorations/editor-decoration-style.ts index 06a01e15029b8..122f8ce559ac9 100644 --- a/packages/editor/src/browser/decorations/editor-decoration-style.ts +++ b/packages/editor/src/browser/decorations/editor-decoration-style.ts @@ -39,7 +39,7 @@ export namespace EditorDecorationStyle { export function copyStyle(from: CSSStyleDeclaration, to: CSSStyleDeclaration): void { Object.keys(from).forEach(key => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (to)[key] = (from)[key]; }); } diff --git a/packages/editor/src/browser/editor-keybinding.ts b/packages/editor/src/browser/editor-keybinding.ts index f27b8fa10e0da..b3b45af929952 100644 --- a/packages/editor/src/browser/editor-keybinding.ts +++ b/packages/editor/src/browser/editor-keybinding.ts @@ -26,11 +26,11 @@ export class EditorKeybindingContribution implements KeybindingContribution { registry.registerKeybindings( { command: EditorCommands.GO_BACK.id, - keybinding: isOSX ? 'ctrl+-' : isWindows ? 'alt+left' : /*isLinux*/ 'ctrl+alt+-' + keybinding: isOSX ? 'ctrl+-' : isWindows ? 'alt+left' : /* isLinux */ 'ctrl+alt+-' }, { command: EditorCommands.GO_FORWARD.id, - keybinding: isOSX ? 'ctrl+shift+-' : isWindows ? 'alt+right' : /*isLinux*/ 'ctrl+shift+-' + keybinding: isOSX ? 'ctrl+shift+-' : isWindows ? 'alt+right' : /* isLinux */ 'ctrl+shift+-' }, { command: EditorCommands.GO_LAST_EDIT.id, diff --git a/packages/editor/src/browser/editor-preferences.ts b/packages/editor/src/browser/editor-preferences.ts index 6e830109a0a8e..732de7e3d8b0d 100644 --- a/packages/editor/src/browser/editor-preferences.ts +++ b/packages/editor/src/browser/editor-preferences.ts @@ -59,7 +59,7 @@ export const EDITOR_MODEL_DEFAULTS = { largeFileOptimizations: true }; -// tslint:disable:no-null-keyword +/* eslint-disable no-null/no-null */ // should be in sync with https://github.com/TypeFox/vscode/blob/70b8db24a37fafc77247de7f7cb5bb0195120ed0/src/vs/editor/common/config/editorOptions.ts#L2612 // 1. Copy // 2. Inline values @@ -205,9 +205,9 @@ export const EDITOR_DEFAULTS = { codeActionsOnSaveTimeout: 750 }, }; -// tslint:enable:no-null-keyword +/* eslint-enable no-null/no-null */ -// tslint:disable:max-line-length +/* eslint-disable max-len */ // should be in sync with https://github.com/TypeFox/vscode/blob/70b8db24a37fafc77247de7f7cb5bb0195120ed0/src/vs/editor/common/config/commonEditorConfig.ts#L232 // 1. Copy // 2. Find -> Use Regular Expressions -> nls\.localize\(.*, "(.*)"\) -> "$1" @@ -1023,7 +1023,7 @@ const codeEditorPreferenceProperties = { 'description': 'Controls whether the diff editor shows +/- indicators for added/removed changes.' } }; -// tslint:enable:max-line-length +/* eslint-enable max-len */ export const editorPreferenceSchema: PreferenceSchema = { 'type': 'object', diff --git a/packages/editor/src/browser/editor.ts b/packages/editor/src/browser/editor.ts index 8e8fc2746d937..830b516bedcba 100644 --- a/packages/editor/src/browser/editor.ts +++ b/packages/editor/src/browser/editor.ts @@ -128,7 +128,7 @@ export interface MouseTarget { /** * Some extra detail. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly detail: any; } @@ -283,7 +283,7 @@ export interface ReplaceOperation { } export namespace TextEditorSelection { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(e: any): e is TextEditorSelection { return e && e['uri'] instanceof URI; } diff --git a/packages/editor/src/browser/navigation/navigation-location-service.spec.ts b/packages/editor/src/browser/navigation/navigation-location-service.spec.ts index 0e96184a93012..4afadf461a01c 100644 --- a/packages/editor/src/browser/navigation/navigation-location-service.spec.ts +++ b/packages/editor/src/browser/navigation/navigation-location-service.spec.ts @@ -31,7 +31,7 @@ import { NavigationLocationService } from './navigation-location-service'; disableJSDOM(); -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ describe('navigation-location-service', () => { diff --git a/packages/editor/src/browser/navigation/navigation-location-similarity.spec.ts b/packages/editor/src/browser/navigation/navigation-location-similarity.spec.ts index a40e082ddbdf8..9fa91b7903385 100644 --- a/packages/editor/src/browser/navigation/navigation-location-similarity.spec.ts +++ b/packages/editor/src/browser/navigation/navigation-location-similarity.spec.ts @@ -18,7 +18,7 @@ import { expect } from 'chai'; import { NavigationLocation } from './navigation-location'; import { NavigationLocationSimilarity } from './navigation-location-similarity'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ describe('navigation-location-similarity', () => { diff --git a/packages/editor/src/browser/navigation/navigation-location-updater.spec.ts b/packages/editor/src/browser/navigation/navigation-location-updater.spec.ts index 94ce315ba133c..5943d9382fa30 100644 --- a/packages/editor/src/browser/navigation/navigation-location-updater.spec.ts +++ b/packages/editor/src/browser/navigation/navigation-location-updater.spec.ts @@ -19,7 +19,7 @@ import { NavigationLocation, Range } from './navigation-location'; import { TextDocumentContentChangeDelta } from '../editor'; import { MockNavigationLocationUpdater } from './test/mock-navigation-location-updater'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ describe('navigation-location-updater', () => { @@ -137,7 +137,7 @@ describe('navigation-location-updater', () => { } else if (expected === undefined) { expect(actual).to.be.undefined; } else { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any expect((actual as any).context).to.be.deep.equal(expected); } }); diff --git a/packages/editorconfig/.eslintrc.js b/packages/editorconfig/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/editorconfig/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/editorconfig/compile.tsconfig.json b/packages/editorconfig/compile.tsconfig.json index be0740a43dc64..c83f2787a0093 100644 --- a/packages/editorconfig/compile.tsconfig.json +++ b/packages/editorconfig/compile.tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "lib": [ @@ -10,5 +11,19 @@ }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + } ] } diff --git a/packages/editorconfig/package.json b/packages/editorconfig/package.json index 3e946476b36fd..bb969959067c2 100644 --- a/packages/editorconfig/package.json +++ b/packages/editorconfig/package.json @@ -35,10 +35,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/editorconfig/src/browser/editorconfig-document-manager.spec.ts b/packages/editorconfig/src/browser/editorconfig-document-manager.spec.ts index 12ae0fe27e53e..a07fb315eec9f 100644 --- a/packages/editorconfig/src/browser/editorconfig-document-manager.spec.ts +++ b/packages/editorconfig/src/browser/editorconfig-document-manager.spec.ts @@ -16,7 +16,7 @@ import { enableJSDOM } from '@theia/core/lib/browser/test/jsdom'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ const disableJSDOM = enableJSDOM(); diff --git a/packages/editorconfig/src/browser/editorconfig-document-manager.ts b/packages/editorconfig/src/browser/editorconfig-document-manager.ts index 256758f200826..23010a3c0becb 100644 --- a/packages/editorconfig/src/browser/editorconfig-document-manager.ts +++ b/packages/editorconfig/src/browser/editorconfig-document-manager.ts @@ -126,7 +126,7 @@ export class EditorconfigDocumentManager { /** * Determines whether property is set. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isSet(property: any): boolean { if (!property || 'unset' === property) { return false; diff --git a/packages/file-search/.eslintrc.js b/packages/file-search/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/file-search/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/file-search/compile.tsconfig.json b/packages/file-search/compile.tsconfig.json index b8b72b49c8822..208e509b8dc1d 100644 --- a/packages/file-search/compile.tsconfig.json +++ b/packages/file-search/compile.tsconfig.json @@ -1,10 +1,28 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../process/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/file-search/package.json b/packages/file-search/package.json index f96924cfbe327..8cc0686a5e9ab 100644 --- a/packages/file-search/package.json +++ b/packages/file-search/package.json @@ -37,10 +37,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/file-search/src/browser/quick-file-open-contribution.ts b/packages/file-search/src/browser/quick-file-open-contribution.ts index 44e9dbc71d96b..e374b29389fbd 100644 --- a/packages/file-search/src/browser/quick-file-open-contribution.ts +++ b/packages/file-search/src/browser/quick-file-open-contribution.ts @@ -28,7 +28,7 @@ export class QuickFileOpenFrontendContribution implements CommandContribution, K registerCommands(commands: CommandRegistry): void { commands.registerCommand(quickFileOpen, { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute: (...args: any[]) => { let fileURI: string | undefined; if (args) { diff --git a/packages/file-search/src/browser/quick-file-open.ts b/packages/file-search/src/browser/quick-file-open.ts index ccbd1efe142bb..353d5b72dd985 100644 --- a/packages/file-search/src/browser/quick-file-open.ts +++ b/packages/file-search/src/browser/quick-file-open.ts @@ -247,6 +247,7 @@ export class QuickFileOpenService implements QuickOpenModel, QuickOpenHandler { */ function score(str: string): number { const match = fuzzy.match(query, str); + // eslint-disable-next-line no-null/no-null return (match === null) ? 0 : match.score; } diff --git a/packages/file-search/src/node/file-search-service-impl.spec.ts b/packages/file-search/src/node/file-search-service-impl.spec.ts index cdaddf1a62e2f..e31fecd89fd26 100644 --- a/packages/file-search/src/node/file-search-service-impl.spec.ts +++ b/packages/file-search/src/node/file-search-service-impl.spec.ts @@ -26,7 +26,7 @@ import processBackendModule from '@theia/process/lib/node/process-backend-module import URI from '@theia/core/lib/common/uri'; import { FileSearchService } from '../common/file-search-service'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ const testContainer = new Container(); diff --git a/packages/file-search/src/node/file-search-service-impl.ts b/packages/file-search/src/node/file-search-service-impl.ts index d80fc8e2e6eb2..838832ae0f58c 100644 --- a/packages/file-search/src/node/file-search-service-impl.ts +++ b/packages/file-search/src/node/file-search-service-impl.ts @@ -53,7 +53,7 @@ export class FileSearchServiceImpl implements FileSearchService { } } } - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const rootUri in roots) { const rootOptions = roots[rootUri]; if (opts.includePatterns) { diff --git a/packages/filesystem/.eslintrc.js b/packages/filesystem/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/filesystem/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/filesystem/compile.tsconfig.json b/packages/filesystem/compile.tsconfig.json index bad4f888c3da2..324e2d66da5ab 100644 --- a/packages/filesystem/compile.tsconfig.json +++ b/packages/filesystem/compile.tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "baseUrl": ".", @@ -15,5 +16,13 @@ }, "include": [ "src" + ], + "references": [ + { + "path": "../../dev-packages/application-package/compile.tsconfig.json" + }, + { + "path": "../core/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/filesystem/package.json b/packages/filesystem/package.json index 71412fc4db920..56a561ef7d90f 100644 --- a/packages/filesystem/package.json +++ b/packages/filesystem/package.json @@ -58,10 +58,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test", "test:watch": "theiaext test:watch" }, diff --git a/packages/filesystem/src/browser/download/file-download-service.ts b/packages/filesystem/src/browser/download/file-download-service.ts index c146dc0110767..a5141626c8e56 100644 --- a/packages/filesystem/src/browser/download/file-download-service.ts +++ b/packages/filesystem/src/browser/download/file-download-service.ts @@ -61,7 +61,7 @@ export class FileDownloadService { this.messageService.showProgress({ text: `Preparing download${copyLink ? ' link' : ''}...`, options: { cancelable: true } }, () => { cancel = true; }), - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any new Promise<{ response: Response, jsonResponse: any }>(async resolve => { const resp = await fetch(this.request(uris)); const jsonResp = await resp.json(); diff --git a/packages/filesystem/src/browser/file-dialog/file-dialog-tree.ts b/packages/filesystem/src/browser/file-dialog/file-dialog-tree.ts index 5c453893a5bde..fb0abb48d0d42 100644 --- a/packages/filesystem/src/browser/file-dialog/file-dialog-tree.ts +++ b/packages/filesystem/src/browser/file-dialog/file-dialog-tree.ts @@ -45,7 +45,7 @@ export class FileDialogTree extends FileTree { const result = await Promise.all( fileStat.children .filter(child => this.isVisible(child)) - .map(async child => await this.toNode(child, parent)) + .map(child => this.toNode(child, parent)) ); return result.sort(DirNode.compare); diff --git a/packages/filesystem/src/browser/file-dialog/file-dialog-widget.ts b/packages/filesystem/src/browser/file-dialog/file-dialog-widget.ts index 09227ececf4d9..0bdbdd3aab9dd 100644 --- a/packages/filesystem/src/browser/file-dialog/file-dialog-widget.ts +++ b/packages/filesystem/src/browser/file-dialog/file-dialog-widget.ts @@ -42,7 +42,7 @@ export class FileDialogWidget extends FileTreeWidget { } protected createNodeAttributes(node: TreeNode, props: NodeProps): React.Attributes & React.HTMLAttributes { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const attr = super.createNodeAttributes(node, props) as any; if (this.shouldDisableSelection(node)) { const keys = Object.keys(attr); diff --git a/packages/filesystem/src/browser/file-tree/file-tree-widget.tsx b/packages/filesystem/src/browser/file-tree/file-tree-widget.tsx index e29d975298f0f..57901a731e3d5 100644 --- a/packages/filesystem/src/browser/file-tree/file-tree-widget.tsx +++ b/packages/filesystem/src/browser/file-tree/file-tree-widget.tsx @@ -67,7 +67,7 @@ export class FileTreeWidget extends TreeWidget { if (icon) { return
; } - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } @@ -221,7 +221,7 @@ export class FileTreeWidget extends TreeWidget { protected renderExpansionToggle(node: TreeNode, props: NodeProps): React.ReactNode { if (this.hidesExplorerArrows) { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } return super.renderExpansionToggle(node, props); diff --git a/packages/filesystem/src/browser/file-upload-service.ts b/packages/filesystem/src/browser/file-upload-service.ts index 15b3efc498b84..ebc9dc12f5aba 100644 --- a/packages/filesystem/src/browser/file-upload-service.ts +++ b/packages/filesystem/src/browser/file-upload-service.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, inject, postConstruct } from 'inversify'; import URI from '@theia/core/lib/common/uri'; diff --git a/packages/filesystem/src/browser/filesystem-proxy-factory.ts b/packages/filesystem/src/browser/filesystem-proxy-factory.ts index f93a54eadabfb..978ac265036e0 100644 --- a/packages/filesystem/src/browser/filesystem-proxy-factory.ts +++ b/packages/filesystem/src/browser/filesystem-proxy-factory.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, inject } from 'inversify'; import { JsonRpcProxyFactory } from '@theia/core/lib/common/messaging/proxy-factory'; diff --git a/packages/filesystem/src/node/download/directory-archiver.spec.ts b/packages/filesystem/src/node/download/directory-archiver.spec.ts index 4370479a29b37..dda8cdf4dd755 100644 --- a/packages/filesystem/src/node/download/directory-archiver.spec.ts +++ b/packages/filesystem/src/node/download/directory-archiver.spec.ts @@ -23,7 +23,7 @@ import URI from '@theia/core/lib/common/uri'; import { MockDirectoryArchiver } from './test/mock-directory-archiver'; import { FileUri } from '@theia/core/lib/node/file-uri'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ const track = temp.track(); @@ -92,7 +92,7 @@ describe('directory-archiver', () => { }); function asString(map: Map): string { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const obj: any = {}; for (const key of Array.from(map.keys()).sort()) { const values = (map.get(key) || []).sort(); diff --git a/packages/filesystem/src/node/download/file-download-endpoint.ts b/packages/filesystem/src/node/download/file-download-endpoint.ts index 6066d28a0b47e..2d4182ba520c2 100644 --- a/packages/filesystem/src/node/download/file-download-endpoint.ts +++ b/packages/filesystem/src/node/download/file-download-endpoint.ts @@ -14,12 +14,11 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as url from 'url'; import { injectable, inject, named } from 'inversify'; import { json } from 'body-parser'; -// tslint:disable-next-line:no-implicit-dependencies import { Application, Router } from 'express'; import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application'; import { FileUri } from '@theia/core/lib/node/file-uri'; diff --git a/packages/filesystem/src/node/node-file-upload.ts b/packages/filesystem/src/node/node-file-upload.ts index 18b19567cc3d7..819537704da09 100644 --- a/packages/filesystem/src/node/node-file-upload.ts +++ b/packages/filesystem/src/node/node-file-upload.ts @@ -55,7 +55,7 @@ export class NodeFileUpload implements Disposable { } dispose(): void { - fs.unlink(this.uploadPath).catch(() => {/*no-op*/ }); + fs.unlink(this.uploadPath).catch(() => {/* no-op */ }); } } diff --git a/packages/filesystem/src/node/node-filesystem.spec.ts b/packages/filesystem/src/node/node-filesystem.spec.ts index 2e44e4acbf01d..6414463383318 100644 --- a/packages/filesystem/src/node/node-filesystem.spec.ts +++ b/packages/filesystem/src/node/node-filesystem.spec.ts @@ -25,7 +25,7 @@ import { FileSystem } from '../common/filesystem'; import { FileSystemNode } from './node-filesystem'; import { expectThrowsAsync } from '@theia/core/lib/common/test/expect'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ const expect = chai.expect; const track = temp.track(); @@ -812,7 +812,7 @@ describe('NodeFileSystem', function (): void { }); -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any process.on('unhandledRejection', (reason: any) => { console.error('Unhandled promise rejection: ' + reason); }); diff --git a/packages/filesystem/src/node/node-filesystem.ts b/packages/filesystem/src/node/node-filesystem.ts index 96ebe591adefe..c7abf9c58ddfe 100644 --- a/packages/filesystem/src/node/node-filesystem.ts +++ b/packages/filesystem/src/node/node-filesystem.ts @@ -299,7 +299,7 @@ export class FileSystemNode implements FileSystem { return this.createFile(uri); } else { return new Promise((resolve, reject) => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any touch(FileUri.fsPath(_uri), async (error: any) => { if (error) { reject(error); @@ -545,7 +545,7 @@ export class FileSystemNode implements FileSystem { } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function isErrnoException(error: any | NodeJS.ErrnoException): error is NodeJS.ErrnoException { return (error).code !== undefined && (error).errno !== undefined; } diff --git a/packages/filesystem/src/node/nsfw-watcher/index.ts b/packages/filesystem/src/node/nsfw-watcher/index.ts index 32a51f531c44b..3a72b3bba4927 100644 --- a/packages/filesystem/src/node/nsfw-watcher/index.ts +++ b/packages/filesystem/src/node/nsfw-watcher/index.ts @@ -20,7 +20,7 @@ import { FileSystemWatcherClient } from '../../common/filesystem-watcher-protoco import { NsfwFileSystemWatcherServer } from './nsfw-filesystem-watcher'; import { IPCEntryPoint } from '@theia/core/lib/node/messaging/ipc-protocol'; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ const options: { verbose: boolean diff --git a/packages/filesystem/src/node/nsfw-watcher/nsfw-filesystem-watcher.spec.ts b/packages/filesystem/src/node/nsfw-watcher/nsfw-filesystem-watcher.spec.ts index d00ac9fb68ac5..3fed295aba0f8 100644 --- a/packages/filesystem/src/node/nsfw-watcher/nsfw-filesystem-watcher.spec.ts +++ b/packages/filesystem/src/node/nsfw-watcher/nsfw-filesystem-watcher.spec.ts @@ -22,7 +22,7 @@ import URI from '@theia/core/lib/common/uri'; import { FileUri } from '@theia/core/lib/node'; import { NsfwFileSystemWatcherServer } from './nsfw-filesystem-watcher'; import { DidFilesChangedParams } from '../../common/filesystem-watcher-protocol'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ const expect = chai.expect; const track = temp.track(); @@ -126,7 +126,7 @@ describe('nsfw-filesystem-watcher', function (): void { }); -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any process.on('unhandledRejection', (reason: any) => { console.error('Unhandled promise rejection: ' + reason); }); diff --git a/packages/filesystem/src/node/nsfw-watcher/nsfw-filesystem-watcher.ts b/packages/filesystem/src/node/nsfw-watcher/nsfw-filesystem-watcher.ts index 6b554b6970d75..392449503f8bb 100644 --- a/packages/filesystem/src/node/nsfw-watcher/nsfw-filesystem-watcher.ts +++ b/packages/filesystem/src/node/nsfw-watcher/nsfw-filesystem-watcher.ts @@ -31,7 +31,7 @@ import { setInterval, clearInterval } from 'timers'; const debounce = require('lodash.debounce'); -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export interface WatcherOptions { ignored: IMinimatch[] diff --git a/packages/getting-started/.eslintrc.js b/packages/getting-started/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/getting-started/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/getting-started/compile.tsconfig.json b/packages/getting-started/compile.tsconfig.json index a23513b5e6b13..0c2e9041c4fad 100644 --- a/packages/getting-started/compile.tsconfig.json +++ b/packages/getting-started/compile.tsconfig.json @@ -1,10 +1,25 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../keymaps/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] } diff --git a/packages/getting-started/package.json b/packages/getting-started/package.json index f0097c8c75ca7..d333289f4871f 100644 --- a/packages/getting-started/package.json +++ b/packages/getting-started/package.json @@ -33,10 +33,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test", "test:watch": "theiaext test:watch" }, diff --git a/packages/git/.eslintrc.js b/packages/git/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/git/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/git/compile.tsconfig.json b/packages/git/compile.tsconfig.json index b8b72b49c8822..27197774821cb 100644 --- a/packages/git/compile.tsconfig.json +++ b/packages/git/compile.tsconfig.json @@ -1,10 +1,34 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../navigator/compile.tsconfig.json" + }, + { + "path": "../scm/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/git/package.json b/packages/git/package.json index 66ceea983345c..87559776f1447 100644 --- a/packages/git/package.json +++ b/packages/git/package.json @@ -55,10 +55,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test --no-cluster", "test:watch": "theiaext test:watch" }, diff --git a/packages/git/src/browser/diff/git-diff-widget.tsx b/packages/git/src/browser/diff/git-diff-widget.tsx index 4aad153daa8b3..5f452e8abc5eb 100644 --- a/packages/git/src/browser/diff/git-diff-widget.tsx +++ b/packages/git/src/browser/diff/git-diff-widget.tsx @@ -27,7 +27,7 @@ import { Deferred } from '@theia/core/lib/common/promise-util'; import * as React from 'react'; import { MaybePromise } from '@theia/core/lib/common/types'; -// tslint:disable:no-null-keyword +/* eslint-disable no-null/no-null */ export const GIT_DIFF = 'git-diff'; @injectable() @@ -109,7 +109,7 @@ export class GitDiffWidget extends GitNavigableListWidget imp }; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any restoreState(oldState: any): void { this.fileChangeNodes = oldState['fileChangeNodes']; this.options = oldState['options']; diff --git a/packages/git/src/browser/git-error-handler.ts b/packages/git/src/browser/git-error-handler.ts index 176ebd7c2e044..35d0bb62f0d59 100644 --- a/packages/git/src/browser/git-error-handler.ts +++ b/packages/git/src/browser/git-error-handler.ts @@ -22,7 +22,7 @@ export class GitErrorHandler { @inject(MessageService) protected readonly messageService: MessageService; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any public handleError(error: any): void { const message = error instanceof Error ? error.message : error; if (message) { diff --git a/packages/git/src/browser/git-repository-provider.spec.ts b/packages/git/src/browser/git-repository-provider.spec.ts index 0c2c3085a2e69..9ee30fa6348de 100644 --- a/packages/git/src/browser/git-repository-provider.spec.ts +++ b/packages/git/src/browser/git-repository-provider.spec.ts @@ -63,7 +63,7 @@ const repoB = { localUri: folderB.uri }; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ describe('GitRepositoryProvider', () => { let testContainer: Container; diff --git a/packages/git/src/browser/history/git-history-widget.tsx b/packages/git/src/browser/history/git-history-widget.tsx index ae19a65151baf..8a7d8d23db866 100644 --- a/packages/git/src/browser/history/git-history-widget.tsx +++ b/packages/git/src/browser/history/git-history-widget.tsx @@ -41,7 +41,7 @@ export interface GitCommitNode extends GitCommitDetails { } export namespace GitCommitNode { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(node: any): node is GitCommitNode { return !!node && 'commitSha' in node && 'commitMessage' in node && 'fileChangeNodes' in node; } @@ -101,7 +101,7 @@ export class GitHistoryWidget extends GitNavigableListWidget protected onAfterAttach(msg: Message): void { super.onAfterAttach(msg); this.addGitListNavigationKeyListeners(this.node); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.addEventListener(this.node, 'ps-scroll-y', (e: Event & { target: { scrollTop: number } }) => { if (this.listView && this.listView.list && this.listView.list.Grid) { const { scrollTop } = e.target; @@ -139,8 +139,7 @@ export class GitHistoryWidget extends GitNavigableListWidget } protected async addCommits(options?: Git.Options.Log): Promise { - let repository: Repository | undefined; - repository = this.repositoryProvider.findRepositoryOrSelected(options); + const repository: Repository | undefined = this.repositoryProvider.findRepositoryOrSelected(options); this.cancelIndicator.cancel(); this.cancelIndicator = new CancellationTokenSource(); @@ -233,7 +232,7 @@ export class GitHistoryWidget extends GitNavigableListWidget }; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any restoreState(oldState: any): void { this.options = oldState['options']; this.singleFileMode = oldState['singleFileMode']; @@ -258,9 +257,8 @@ export class GitHistoryWidget extends GitNavigableListWidget break; case 'error': + const reason: React.ReactNode = this.status.errorMessage; let path: React.ReactNode = ''; - let reason: React.ReactNode; - reason = this.status.errorMessage; if (this.options.uri) { const relPathEncoded = this.gitLabelProvider.relativePath(this.options.uri); const relPath = relPathEncoded ? `${decodeURIComponent(relPathEncoded)}` : ''; @@ -330,7 +328,7 @@ export class GitHistoryWidget extends GitNavigableListWidget } protected readonly loadMoreRows = (params: IndexRange) => this.doLoadMoreRows(params); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected doLoadMoreRows(params: IndexRange): Promise { let resolver: () => void; const promise = new Promise(resolve => resolver = resolve); @@ -494,7 +492,7 @@ export namespace GitHistoryList { readonly indexOfSelected: number readonly hasMoreRows: boolean readonly handleScroll: (info: { clientHeight: number; scrollHeight: number; scrollTop: number }) => void - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly loadMoreRows: (params: IndexRange) => Promise readonly renderCommit: (commit: GitCommitNode) => React.ReactNode readonly renderFileChangeList: (fileChange: GitFileChangeNode) => React.ReactNode @@ -566,7 +564,7 @@ export class GitHistoryList extends React.Component { {() => this.renderRow(params)} ); - } + }; protected renderRow: ListRowRenderer = ({ index, key, style }) => { if (this.checkIfRowIsLoaded({ index })) { @@ -586,5 +584,5 @@ export class GitHistoryList extends React.Component { ; } - } + }; } diff --git a/packages/git/src/common/git-watcher.ts b/packages/git/src/common/git-watcher.ts index 917164435a175..4dda3dbd76bc6 100644 --- a/packages/git/src/common/git-watcher.ts +++ b/packages/git/src/common/git-watcher.ts @@ -47,7 +47,7 @@ export namespace GitStatusChangeEvent { * `true` if the argument is a `GitStatusEvent`, otherwise `false`. * @param event the argument to check whether it is a Git status change event or not. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(event: any | undefined): event is GitStatusChangeEvent { return !!event && ('source' in event) && ('status' in event); } diff --git a/packages/git/src/common/git.ts b/packages/git/src/common/git.ts index 6ec2dcdb0f5a4..1845f97ae39cc 100644 --- a/packages/git/src/common/git.ts +++ b/packages/git/src/common/git.ts @@ -842,7 +842,7 @@ export interface Git extends Disposable { * @param uri the URI of the file to check. * @param options further options for the command executions. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any lsFiles(repository: Repository, uri: string, options?: Git.Options.LsFiles): Promise; } @@ -855,7 +855,7 @@ export namespace GitUtils { /** * `true` if the argument is an option for renaming an existing branch in the repository. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isBranchRename(arg: any | undefined): arg is Git.Options.BranchCommand.Rename { return !!arg && ('newName' in arg); } @@ -863,7 +863,7 @@ export namespace GitUtils { /** * `true` if the argument is an option for deleting an existing branch in the repository. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isBranchDelete(arg: any | undefined): arg is Git.Options.BranchCommand.Delete { return !!arg && ('toDelete' in arg); } @@ -871,7 +871,7 @@ export namespace GitUtils { /** * `true` if the argument is an option for creating a new branch in the repository. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isBranchCreate(arg: any | undefined): arg is Git.Options.BranchCommand.Create { return !!arg && ('toCreate' in arg); } @@ -879,7 +879,7 @@ export namespace GitUtils { /** * `true` if the argument is an option for listing the branches in a repository. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isBranchList(arg: any | undefined): arg is Git.Options.BranchCommand.List { return !!arg && ('type' in arg); } @@ -887,7 +887,7 @@ export namespace GitUtils { /** * `true` if the argument is an option for checking out a new local branch. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isBranchCheckout(arg: any | undefined): arg is Git.Options.Checkout.CheckoutBranch { return !!arg && ('branch' in arg); } @@ -895,7 +895,7 @@ export namespace GitUtils { /** * `true` if the argument is an option for checking out a working tree file. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isWorkingTreeFileCheckout(arg: any | undefined): arg is Git.Options.Checkout.WorkingTreeFile { return !!arg && ('paths' in arg); } @@ -909,12 +909,12 @@ export namespace GitUtils { * `true` if the argument is an error indicating the absence of a local Git repository. * Otherwise, `false`. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isRepositoryDoesNotExistError(error: any | undefined): boolean { // TODO this is odd here.This piece of code is already implementation specific, so this should go to the Git API. // But how can we ensure that the `any` type error is serializable? if (error instanceof Error && ('code' in error)) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return (error).code === RepositoryDoesNotExistErrorCode; } return false; diff --git a/packages/git/src/electron-node/askpass/askpass-main.ts b/packages/git/src/electron-node/askpass/askpass-main.ts index 44019bfc92d2f..ca8b554942b71 100644 --- a/packages/git/src/electron-node/askpass/askpass-main.ts +++ b/packages/git/src/electron-node/askpass/askpass-main.ts @@ -8,7 +8,7 @@ import * as url from 'url'; import * as http from 'http'; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function fatal(err: any): void { console.error('Missing or invalid credentials.'); console.error(err); diff --git a/packages/git/src/node/dugite-git-watcher.slow-spec.ts b/packages/git/src/node/dugite-git-watcher.slow-spec.ts index c04f56aa24fb7..b4919503d6774 100644 --- a/packages/git/src/node/dugite-git-watcher.slow-spec.ts +++ b/packages/git/src/node/dugite-git-watcher.slow-spec.ts @@ -27,7 +27,7 @@ import { DugiteGitWatcherServer } from './dugite-git-watcher'; import { bindGit, bindRepositoryWatcher } from './git-backend-module'; import { GitWatcherServer, GitStatusChangeEvent } from '../common/git-watcher'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ const track = temp.track(); diff --git a/packages/git/src/node/dugite-git.slow-spec.ts b/packages/git/src/node/dugite-git.slow-spec.ts index a9e40a85c886e..d5ff26f2cd6d7 100644 --- a/packages/git/src/node/dugite-git.slow-spec.ts +++ b/packages/git/src/node/dugite-git.slow-spec.ts @@ -20,7 +20,7 @@ import { FileUri } from '@theia/core/lib/node/file-uri'; import { GitFileStatus } from '../common'; import { createGit } from './test/binding-helper'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ const track = temp.track(); diff --git a/packages/git/src/node/dugite-git.spec.ts b/packages/git/src/node/dugite-git.spec.ts index d4d045b6017c3..5899200132888 100644 --- a/packages/git/src/node/dugite-git.spec.ts +++ b/packages/git/src/node/dugite-git.spec.ts @@ -14,7 +14,6 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable-next-line:no-implicit-dependencies import * as upath from 'upath'; import * as path from 'path'; @@ -28,8 +27,7 @@ import { WorkingDirectoryStatus, Repository, GitUtils, GitFileStatus, GitFileCha import { initRepository, createTestRepository } from 'dugite-extra/lib/command/test-helper'; import { createGit } from './test/binding-helper'; -// tslint:disable:no-unused-expression -// tslint:disable:max-line-length +/* eslint-disable max-len, no-unused-expressions */ const track = temp.track(); diff --git a/packages/git/src/node/dugite-git.ts b/packages/git/src/node/dugite-git.ts index f1ff64aab230d..a87e1827c330a 100644 --- a/packages/git/src/node/dugite-git.ts +++ b/packages/git/src/node/dugite-git.ts @@ -398,7 +398,7 @@ export class DugiteGit implements Git { async branch(repository: Repository, options: { type: 'current' }): Promise; async branch(repository: Repository, options: { type: 'local' | 'remote' | 'all' }): Promise; async branch(repository: Repository, options: Git.Options.BranchCommand.Create | Git.Options.BranchCommand.Rename | Git.Options.BranchCommand.Delete): Promise; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async branch(repository: any, options: any): Promise { await this.ready.promise; const [exec, env] = await Promise.all([this.execProvider.exec(), this.gitEnv.promise]); @@ -727,7 +727,7 @@ export class DugiteGit implements Git { return blame; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async lsFiles(repository: Repository, uri: string, options?: Git.Options.LsFiles): Promise { await this.ready.promise; const args = ['ls-files']; diff --git a/packages/git/src/node/git-exec-provider.ts b/packages/git/src/node/git-exec-provider.ts index 27b1b7ab8511d..75dbf82f794dd 100644 --- a/packages/git/src/node/git-exec-provider.ts +++ b/packages/git/src/node/git-exec-provider.ts @@ -27,7 +27,7 @@ import { IGitExecutionOptions } from 'dugite-extra/lib/core/git'; * @injectable() * export class GitSshExecProvider extends GitExecProvider { * - * // tslint:disable-next-line:no-any + * // eslint-disable-next-line @typescript-eslint/no-explicit-any * protected deferred = new Deferred(); * * @postConstruct() @@ -55,11 +55,11 @@ import { IGitExecutionOptions } from 'dugite-extra/lib/core/git'; * * const command = `${gitPath} ${args.join(' ')}`; * const { stdout, stderr, code } = await connection.execCommand(command, options); - * // tslint:disable-next-line:no-null-keyword + * // eslint-disable-next-line no-null/no-null * let error: Error | null = null; * if (code) { * error = new Error(stderr || `Unknown error when executing the Git command. ${args}.`); - * // tslint:disable-next-line:no-any + * // eslint-disable-next-line @typescript-eslint/no-explicit-any * (error as any).code = code; * } * callback(error, stdout, stderr); diff --git a/packages/git/src/node/git-locator/git-locator-impl.ts b/packages/git/src/node/git-locator/git-locator-impl.ts index e84da6088c6ec..6ee476be444df 100644 --- a/packages/git/src/node/git-locator/git-locator-impl.ts +++ b/packages/git/src/node/git-locator/git-locator-impl.ts @@ -29,16 +29,16 @@ export interface GitLocateContext { export class GitLocatorImpl implements GitLocator { protected readonly options: { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any info: (message: string, ...args: any[]) => void - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any error: (message: string, ...args: any[]) => void }; constructor(options?: { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any info?: (message: string, ...args: any[]) => void - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any error?: (message: string, ...args: any[]) => void }) { this.options = { diff --git a/packages/git/src/node/test/binding-helper.ts b/packages/git/src/node/test/binding-helper.ts index db8a85556e0ee..7229f3dd5c086 100644 --- a/packages/git/src/node/test/binding-helper.ts +++ b/packages/git/src/node/test/binding-helper.ts @@ -25,7 +25,7 @@ import { MessageService, LogLevel } from '@theia/core/lib/common'; import { MessageClient } from '@theia/core'; import { ILogger } from '@theia/core/lib/common/logger'; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function initializeBindings(): { container: Container, bind: interfaces.Bind } { const container = new Container(); const bind = container.bind.bind(container); diff --git a/packages/java-debug/.eslintrc.js b/packages/java-debug/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/java-debug/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/java-debug/compile.tsconfig.json b/packages/java-debug/compile.tsconfig.json index a23513b5e6b13..326e357d3df0f 100644 --- a/packages/java-debug/compile.tsconfig.json +++ b/packages/java-debug/compile.tsconfig.json @@ -1,10 +1,19 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../debug/compile.tsconfig.json" + }, + { + "path": "../java/compile.tsconfig.json" + } ] } diff --git a/packages/java-debug/package.json b/packages/java-debug/package.json index dd12f77b42bff..6ccd9787266e8 100644 --- a/packages/java-debug/package.json +++ b/packages/java-debug/package.json @@ -37,10 +37,10 @@ ], "scripts": { "postinstall": "download-debug-adapters", - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/java-debug/src/browser/java-debug-preferences.ts b/packages/java-debug/src/browser/java-debug-preferences.ts index a8ce2f5af272c..a60b83ddaa9f8 100644 --- a/packages/java-debug/src/browser/java-debug-preferences.ts +++ b/packages/java-debug/src/browser/java-debug-preferences.ts @@ -27,7 +27,6 @@ import { PreferenceContribution, PreferenceSchema, PreferenceChangeEvent - // tslint:disable-next-line:no-implicit-dependencies } from '@theia/core/lib/browser/preferences'; export const javaDebugPreferenceSchema: PreferenceSchema = { @@ -61,7 +60,7 @@ export const javaDebugPreferenceSchema: PreferenceSchema = { }, 'java.debug.settings.maxStringLength': { 'type': 'number', - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len 'description': 'The maximum length of strings displayed in \"Variables\" or \"Debug Console\" viewlet, strings longer than this length will be trimmed, if 0 no trim is performed.', 'default': 0 }, diff --git a/packages/java-debug/src/node/java-debug-adapter-contribution.ts b/packages/java-debug/src/node/java-debug-adapter-contribution.ts index c25c4740744d4..f973c81241cee 100644 --- a/packages/java-debug/src/node/java-debug-adapter-contribution.ts +++ b/packages/java-debug/src/node/java-debug-adapter-contribution.ts @@ -19,16 +19,14 @@ // https://github.com/Microsoft/vscode-java-debug/blob/master/src/configurationProvider.ts adjusted to Theia APIs -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as path from 'path'; import * as _ from 'lodash'; import { injectable, inject } from 'inversify'; import { DebugConfiguration } from '@theia/debug/lib/common/debug-configuration'; import { JavaExtensionContribution } from '@theia/java/lib/node'; -// tslint:disable-next-line:no-implicit-dependencies import { MessageService, CommandService } from '@theia/core/lib/common'; -// tslint:disable-next-line:no-implicit-dependencies import { QuickPickService, QuickPickItem } from '@theia/core/lib/common/quick-pick-service'; import { AbstractVSCodeDebugAdapterContribution } from '@theia/debug/lib/node/vscode/vscode-debug-adapter-contribution'; @@ -70,7 +68,7 @@ export class JavaDebugExtensionContribution extends AbstractVSCodeDebugAdapterCo async getExtensionBundles(): Promise { const debuggerContribution: { contributes: { javaExtensions: string[] } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any } = (await this.pck); return debuggerContribution.contributes.javaExtensions.map(javaExtPath => path.resolve(this.extensionPath, javaExtPath) diff --git a/packages/java/.eslintrc.js b/packages/java/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/java/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/java/compile.tsconfig.json b/packages/java/compile.tsconfig.json index b8b72b49c8822..3004925b2dd3b 100644 --- a/packages/java/compile.tsconfig.json +++ b/packages/java/compile.tsconfig.json @@ -1,10 +1,25 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/java/package.json b/packages/java/package.json index 6a5127cf72fa1..5ab340577fe65 100644 --- a/packages/java/package.json +++ b/packages/java/package.json @@ -18,11 +18,11 @@ "@theia/ext-scripts": "^0.14.0" }, "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "postinstall": "node ./scripts/download-jdt-ls.js", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test", "dev-server": "node ./scripts/get-dev-server.js" }, diff --git a/packages/java/src/browser/java-client-contribution.ts b/packages/java/src/browser/java-client-contribution.ts index df25187d1591b..cb4ab14c0452a 100644 --- a/packages/java/src/browser/java-client-contribution.ts +++ b/packages/java/src/browser/java-client-contribution.ts @@ -140,6 +140,7 @@ export class JavaClientContribution extends BaseLanguageClientContribution { return; } const vmargs = vmargsLine.match(/(?:[^\s"]+|"[^"]*")+/g); + // eslint-disable-next-line no-null/no-null if (vmargs === null) { return; } diff --git a/packages/java/src/browser/java-preferences.ts b/packages/java/src/browser/java-preferences.ts index 684fc3c427167..eedaf803362a6 100644 --- a/packages/java/src/browser/java-preferences.ts +++ b/packages/java/src/browser/java-preferences.ts @@ -18,8 +18,7 @@ // Licensed under EPL-1.0 license // some preferences copied from https://github.com/redhat-developer/vscode-java/blob/68d4bede335b194e8d8f44add1d868e3250cda22/package.json#L56-L264 -// tslint:disable:max-line-length -// tslint:disable:no-null-keyword +/* eslint-disable max-len, no-null/no-null */ import { interfaces } from 'inversify'; import { @@ -29,7 +28,6 @@ import { PreferenceContribution, PreferenceSchema, PreferenceChangeEvent - // tslint:disable-next-line:no-implicit-dependencies } from '@theia/core/lib/browser/preferences'; export const javaDebugPreferenceSchema: PreferenceSchema = { diff --git a/packages/java/src/browser/java-protocol.ts b/packages/java/src/browser/java-protocol.ts index 01f2eb64ca424..0619951291d13 100644 --- a/packages/java/src/browser/java-protocol.ts +++ b/packages/java/src/browser/java-protocol.ts @@ -28,7 +28,7 @@ export namespace StatusNotification { export interface ActionableMessage { severity: MessageType; message: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any data?: any; commands?: Command[]; } diff --git a/packages/java/src/node/java-cli-contribution.ts b/packages/java/src/node/java-cli-contribution.ts index edf2ed3ca8252..8fc1c882923a0 100644 --- a/packages/java/src/node/java-cli-contribution.ts +++ b/packages/java/src/node/java-cli-contribution.ts @@ -41,7 +41,7 @@ export class JavaCliContribution implements CliContribution { return this._lsPort; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected setLsPort(port: any): void { if (port !== undefined) { const error = new Error(`The port for the Java LS must be an integer between 1 and 65535. It was: ${port}.`); diff --git a/packages/json/.eslintrc.js b/packages/json/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/json/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/json/compile.tsconfig.json b/packages/json/compile.tsconfig.json index b8b72b49c8822..5a0676b3d30f5 100644 --- a/packages/json/compile.tsconfig.json +++ b/packages/json/compile.tsconfig.json @@ -1,10 +1,25 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../../dev-packages/application-package/compile.tsconfig.json" + }, + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/json/package.json b/packages/json/package.json index 6b14cc224b3df..f2b20c478ace6 100644 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -13,10 +13,10 @@ "@theia/ext-scripts": "^0.14.0" }, "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "publishConfig": { diff --git a/packages/json/src/browser/json-client-contribution.ts b/packages/json/src/browser/json-client-contribution.ts index 1fc1c21614699..f3ff43d151240 100644 --- a/packages/json/src/browser/json-client-contribution.ts +++ b/packages/json/src/browser/json-client-contribution.ts @@ -126,6 +126,6 @@ interface SchemaData { description: string; fileMatch?: string[]; url: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any schema: any; } diff --git a/packages/keymaps/.eslintrc.js b/packages/keymaps/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/keymaps/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/keymaps/compile.tsconfig.json b/packages/keymaps/compile.tsconfig.json index a23513b5e6b13..7d3605e161c00 100644 --- a/packages/keymaps/compile.tsconfig.json +++ b/packages/keymaps/compile.tsconfig.json @@ -1,10 +1,25 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + }, + { + "path": "../userstorage/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] } diff --git a/packages/keymaps/package.json b/packages/keymaps/package.json index b47710715584b..76ce59ef903c5 100644 --- a/packages/keymaps/package.json +++ b/packages/keymaps/package.json @@ -43,10 +43,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "nyc": { diff --git a/packages/keymaps/src/browser/keybindings-widget.tsx b/packages/keymaps/src/browser/keybindings-widget.tsx index 1aa86d8a17c66..cfe23577407f5 100644 --- a/packages/keymaps/src/browser/keybindings-widget.tsx +++ b/packages/keymaps/src/browser/keybindings-widget.tsx @@ -21,7 +21,9 @@ import { injectable, inject, postConstruct } from 'inversify'; import { Emitter, Event } from '@theia/core/lib/common/event'; import { CommandRegistry, Command } from '@theia/core/lib/common/command'; import { ReactWidget } from '@theia/core/lib/browser/widgets/react-widget'; -import { KeybindingRegistry, SingleTextInputDialog, KeySequence, ConfirmDialog, Message, KeybindingScope, SingleTextInputDialogProps, Key, ScopedKeybinding } from '@theia/core/lib/browser'; +import { + KeybindingRegistry, SingleTextInputDialog, KeySequence, ConfirmDialog, Message, KeybindingScope, SingleTextInputDialogProps, Key, ScopedKeybinding +} from '@theia/core/lib/browser'; import { KeymapsService } from './keymaps-service'; import { AlertMessage } from '@theia/core/lib/browser/widgets/alert-message'; diff --git a/packages/languages/.eslintrc.js b/packages/languages/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/languages/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/languages/compile.tsconfig.json b/packages/languages/compile.tsconfig.json index b8b72b49c8822..e8fc9b805ddcb 100644 --- a/packages/languages/compile.tsconfig.json +++ b/packages/languages/compile.tsconfig.json @@ -1,10 +1,28 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../../dev-packages/application-package/compile.tsconfig.json" + }, + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../output/compile.tsconfig.json" + }, + { + "path": "../process/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/languages/package.json b/packages/languages/package.json index daaa902ea69e1..151c64dca9d78 100644 --- a/packages/languages/package.json +++ b/packages/languages/package.json @@ -39,10 +39,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/languages/src/browser/language-client-contribution.ts b/packages/languages/src/browser/language-client-contribution.ts index 2d78963f12143..04d5b9c56152f 100644 --- a/packages/languages/src/browser/language-client-contribution.ts +++ b/packages/languages/src/browser/language-client-contribution.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, inject } from 'inversify'; import { MaybePromise, MessageService, CommandRegistry } from '@theia/core'; @@ -70,9 +70,9 @@ export abstract class BaseLanguageClientContribution implements LanguageClientCo return this._languageClient ? Promise.resolve(this._languageClient) : this.ready; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any waitForActivation(app: FrontendApplication): Promise { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const activationPromises: Promise[] = []; const workspaceContains = this.workspaceContains; if (workspaceContains.length !== 0) { @@ -236,7 +236,7 @@ export abstract class BaseLanguageClientContribution implements LanguageClientCo return undefined; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected get initializationOptions(): any | (() => any) | undefined { return undefined; } @@ -274,7 +274,7 @@ export abstract class BaseLanguageClientContribution implements LanguageClientCo /** * Check to see if one of the paths is in the current workspace. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected async waitForItemInWorkspace(): Promise { const doesContain = await this.workspaceService.containsSome(this.workspaceContains); if (!doesContain) { diff --git a/packages/languages/src/browser/language-client-factory.ts b/packages/languages/src/browser/language-client-factory.ts index e5bfb9759e3ca..166d8eee5ebf0 100644 --- a/packages/languages/src/browser/language-client-factory.ts +++ b/packages/languages/src/browser/language-client-factory.ts @@ -45,7 +45,7 @@ export class LanguageClientFactory { }); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected registerCommand(id: string, callback: (...args: any[]) => any, thisArg?: any): Disposable { const execute = callback.bind(thisArg); return this.registry.registerCommand({ id }, { execute }); diff --git a/packages/languages/src/browser/semantic-highlighting/semantic-highlighting-feature.ts b/packages/languages/src/browser/semantic-highlighting/semantic-highlighting-feature.ts index feafa0c213680..b0b6b6ce95af4 100644 --- a/packages/languages/src/browser/semantic-highlighting/semantic-highlighting-feature.ts +++ b/packages/languages/src/browser/semantic-highlighting/semantic-highlighting-feature.ts @@ -49,7 +49,7 @@ export class SemanticHighlightFeature extends TextDocumentFeature<{}, TextDocume if (!capabilities.textDocument) { capabilities.textDocument = {}; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (capabilities.textDocument as any).semanticHighlightingCapabilities = { semanticHighlighting: true }; diff --git a/packages/languages/src/browser/typehierarchy/typehierarchy-feature.ts b/packages/languages/src/browser/typehierarchy/typehierarchy-feature.ts index 36536c55ab052..209481c1e766d 100644 --- a/packages/languages/src/browser/typehierarchy/typehierarchy-feature.ts +++ b/packages/languages/src/browser/typehierarchy/typehierarchy-feature.ts @@ -43,7 +43,7 @@ export class TypeHierarchyFeature extends TextDocumentFeature<{}, TextDocumentRe if (!capabilities.textDocument) { capabilities.textDocument = {}; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (capabilities.textDocument as any).typeHierarchy = { dynamicRegistration: true }; diff --git a/packages/languages/src/browser/typehierarchy/typehierarchy-protocol.ts b/packages/languages/src/browser/typehierarchy/typehierarchy-protocol.ts index b74d3feba00ef..dbb6ab14c079c 100644 --- a/packages/languages/src/browser/typehierarchy/typehierarchy-protocol.ts +++ b/packages/languages/src/browser/typehierarchy/typehierarchy-protocol.ts @@ -193,6 +193,6 @@ export interface TypeHierarchyItem { /** * An optional data field can be used to identify a type hierarchy item in a resolve request. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any data?: any; } diff --git a/packages/languages/src/common/language-contribution.ts b/packages/languages/src/common/language-contribution.ts index da847e8d51ba9..1a3dbb337b251 100644 --- a/packages/languages/src/common/language-contribution.ts +++ b/packages/languages/src/common/language-contribution.ts @@ -26,7 +26,7 @@ export namespace LanguageContribution { } export const Service = Symbol('LanguageContributionService'); export interface Service { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any create(contributionId: string, parameters: any): Promise; destroy(sessionId: string): Promise; } diff --git a/packages/languages/src/node/language-server-contribution.ts b/packages/languages/src/node/language-server-contribution.ts index 33c3b2779b1df..728f90fc34985 100644 --- a/packages/languages/src/node/language-server-contribution.ts +++ b/packages/languages/src/node/language-server-contribution.ts @@ -38,7 +38,7 @@ export { export interface LanguageServerStartOptions { sessionId: string - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any parameters?: any } diff --git a/packages/languages/src/node/languages-backend-contribution.ts b/packages/languages/src/node/languages-backend-contribution.ts index 3096c42983cb2..618389e81ad51 100644 --- a/packages/languages/src/node/languages-backend-contribution.ts +++ b/packages/languages/src/node/languages-backend-contribution.ts @@ -14,12 +14,11 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, inject, named } from 'inversify'; import { ContributionProvider, ILogger } from '@theia/core/lib/common'; import { IConnection } from 'vscode-ws-jsonrpc/lib/server'; -// tslint:disable-next-line:no-implicit-dependencies import { ResponseError, ErrorCodes, ResponseMessage, Message, isRequestMessage } from 'vscode-jsonrpc/lib/messages'; import { InitializeRequest, ShutdownRequest } from 'vscode-languageserver-protocol'; import { MessagingService } from '@theia/core/lib/node/messaging/messaging-service'; @@ -79,7 +78,7 @@ export class LanguagesBackendContribution implements MessagingService.Contributi } else if (method === ShutdownRequest.type.method) { // The client expects a `null` as the response. // https://microsoft.github.io/language-server-protocol/specification#shutdown - const data = null; // tslint:disable-line:no-null-keyword + const data = null; // eslint-disable-line no-null/no-null connection.writer.write({ jsonrpc, id, diff --git a/packages/markers/.eslintrc.js b/packages/markers/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/markers/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/markers/compile.tsconfig.json b/packages/markers/compile.tsconfig.json index b8b72b49c8822..15ab7b366a4f3 100644 --- a/packages/markers/compile.tsconfig.json +++ b/packages/markers/compile.tsconfig.json @@ -1,10 +1,25 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../navigator/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/markers/package.json b/packages/markers/package.json index dc8ecff1f3660..64f44fcfa9ed1 100644 --- a/packages/markers/package.json +++ b/packages/markers/package.json @@ -33,10 +33,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/markers/src/browser/problem/problem-manager.spec.ts b/packages/markers/src/browser/problem/problem-manager.spec.ts index 3b59efb98daaa..c6ac8f0e4c51a 100644 --- a/packages/markers/src/browser/problem/problem-manager.spec.ts +++ b/packages/markers/src/browser/problem/problem-manager.spec.ts @@ -39,7 +39,7 @@ before(() => { testContainer.bind(ILogger).to(MockLogger); testContainer.bind(StorageService).to(LocalStorageService).inSingletonScope(); testContainer.bind(LocalStorageService).toSelf().inSingletonScope(); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any testContainer.bind(FileSystemWatcher).toConstantValue({ onFilesChanged: Event.None } as FileSystemWatcher); diff --git a/packages/merge-conflicts/.eslintrc.js b/packages/merge-conflicts/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/merge-conflicts/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/merge-conflicts/compile.tsconfig.json b/packages/merge-conflicts/compile.tsconfig.json index 4c867a02d2696..38961cb2fb279 100644 --- a/packages/merge-conflicts/compile.tsconfig.json +++ b/packages/merge-conflicts/compile.tsconfig.json @@ -1,11 +1,23 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "baseUrl": "." }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/merge-conflicts/package.json b/packages/merge-conflicts/package.json index 511995bb0b8eb..ac36a0ca81699 100644 --- a/packages/merge-conflicts/package.json +++ b/packages/merge-conflicts/package.json @@ -32,10 +32,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/merge-conflicts/src/browser/merge-conflicts-parser.spec.ts b/packages/merge-conflicts/src/browser/merge-conflicts-parser.spec.ts index bdec7f081545c..51e5c43b2ba13 100644 --- a/packages/merge-conflicts/src/browser/merge-conflicts-parser.spec.ts +++ b/packages/merge-conflicts/src/browser/merge-conflicts-parser.spec.ts @@ -28,7 +28,7 @@ before(() => { parser = new MergeConflictsParser(); }); -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ function parse(contents: string): MergeConflict[] { const splitted = contents.split('\n'); diff --git a/packages/messages/.eslintrc.js b/packages/messages/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/messages/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/messages/compile.tsconfig.json b/packages/messages/compile.tsconfig.json index 4c867a02d2696..528abd3b10cc7 100644 --- a/packages/messages/compile.tsconfig.json +++ b/packages/messages/compile.tsconfig.json @@ -1,11 +1,17 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "baseUrl": "." }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/messages/package.json b/packages/messages/package.json index 371c97ab1a284..5e0582d8f1d42 100644 --- a/packages/messages/package.json +++ b/packages/messages/package.json @@ -34,10 +34,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/messages/src/browser/notification-center-component.tsx b/packages/messages/src/browser/notification-center-component.tsx index 765cab9895c57..5da00eea22848 100644 --- a/packages/messages/src/browser/notification-center-component.tsx +++ b/packages/messages/src/browser/notification-center-component.tsx @@ -80,10 +80,10 @@ export class NotificationCenterComponent extends React.Component { this.props.manager.hideCenter(); - } + }; protected onClearAll = () => { this.props.manager.clearAll(); - } + }; } diff --git a/packages/messages/src/browser/notification-component.tsx b/packages/messages/src/browser/notification-component.tsx index 1e5341a2b0105..53565e85e25d1 100644 --- a/packages/messages/src/browser/notification-component.tsx +++ b/packages/messages/src/browser/notification-component.tsx @@ -36,7 +36,7 @@ export class NotificationComponent extends React.Component { if (event.target instanceof HTMLElement) { @@ -45,7 +45,7 @@ export class NotificationComponent extends React.Component { if (event.target instanceof HTMLElement) { @@ -55,7 +55,7 @@ export class NotificationComponent extends React.Component { if (event.target instanceof HTMLAnchorElement) { @@ -64,7 +64,7 @@ export class NotificationComponent extends React.Component { /* According to https://prometheus.io/docs/concepts/data_model/ */ diff --git a/packages/mini-browser/.eslintrc.js b/packages/mini-browser/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/mini-browser/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/mini-browser/compile.tsconfig.json b/packages/mini-browser/compile.tsconfig.json index 4c867a02d2696..8202bdd8795b7 100644 --- a/packages/mini-browser/compile.tsconfig.json +++ b/packages/mini-browser/compile.tsconfig.json @@ -1,11 +1,20 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "baseUrl": "." }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/mini-browser/package.json b/packages/mini-browser/package.json index 250e46b2dd875..284c8b76d4165 100644 --- a/packages/mini-browser/package.json +++ b/packages/mini-browser/package.json @@ -35,10 +35,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/mini-browser/src/browser/mini-browser-content.ts b/packages/mini-browser/src/browser/mini-browser-content.ts index f0bce73e65242..8aaefbf3d2086 100644 --- a/packages/mini-browser/src/browser/mini-browser-content.ts +++ b/packages/mini-browser/src/browser/mini-browser-content.ts @@ -193,7 +193,7 @@ export class MiniBrowserContent extends BaseWidget { protected readonly loadIndicator: HTMLElement; protected readonly errorBar: HTMLElement & Readonly<{ message: HTMLElement }>; protected readonly frame: HTMLIFrameElement; - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len // XXX This is a hack to be able to tack the mouse events when drag and dropping the widgets. On `mousedown` we put a transparent div over the `iframe` to avoid losing the mouse tacking. protected readonly transparentOverlay: HTMLElement; // XXX It is a hack. Instead of loading the PDF in an iframe we use `PDFObject` to render it in a div. @@ -290,7 +290,7 @@ export class MiniBrowserContent extends BaseWidget { return !this.props.startPage ? 'show' : this.props.toolbar || 'show'; } - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len protected createContentArea(parent: HTMLElement): HTMLElement & Readonly<{ frame: HTMLIFrameElement, loadIndicator: HTMLElement, errorBar: HTMLElement & Readonly<{ message: HTMLElement }>, pdfContainer: HTMLElement, transparentOverlay: HTMLElement }> { const contentArea = document.createElement('div'); contentArea.classList.add(MiniBrowserContentStyle.CONTENT_AREA); @@ -506,7 +506,7 @@ export class MiniBrowserContent extends BaseWidget { return button; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected onClick(element: HTMLElement, emitter: Emitter): HTMLElement { this.toDispose.push(addEventListener(element, 'click', () => { if (!element.classList.contains(MiniBrowserContentStyle.DISABLED)) { @@ -545,6 +545,7 @@ export class MiniBrowserContent extends BaseWidget { protected contentDocument(): Document | null { try { let { contentDocument } = this.frame; + // eslint-disable-next-line no-null/no-null if (contentDocument === null) { const { contentWindow } = this.frame; if (contentWindow) { @@ -553,7 +554,7 @@ export class MiniBrowserContent extends BaseWidget { } return contentDocument; } catch { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } } @@ -586,7 +587,7 @@ export class MiniBrowserContent extends BaseWidget { this.pdfContainer.style.display = 'block'; this.frame.style.display = 'none'; PDFObject.embed(url, this.pdfContainer, { - // tslint:disable-next-line:max-line-length quotemark + // eslint-disable-next-line max-len, @typescript-eslint/quotes fallbackLink: `

Your browser does not support inline PDFs. Click on this link to open the PDF in a new tab.

` }); clearTimeout(this.frameLoadTimeout); diff --git a/packages/mini-browser/src/browser/mini-browser.ts b/packages/mini-browser/src/browser/mini-browser.ts index dce647158e62a..a8b58fe6b4354 100644 --- a/packages/mini-browser/src/browser/mini-browser.ts +++ b/packages/mini-browser/src/browser/mini-browser.ts @@ -102,7 +102,7 @@ export class MiniBrowser extends BaseWidget implements NavigatableWidget, Statef return; } if ('props' in oldState) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.setProps((oldState)['props']); } } diff --git a/packages/mini-browser/src/node/mini-browser-endpoint.ts b/packages/mini-browser/src/node/mini-browser-endpoint.ts index 492324dcbfa57..bdb22d8b28a58 100644 --- a/packages/mini-browser/src/node/mini-browser-endpoint.ts +++ b/packages/mini-browser/src/node/mini-browser-endpoint.ts @@ -146,9 +146,9 @@ export class MiniBrowserEndpoint implements BackendApplicationContribution, Mini return this.fileSystem.resolveContent(uri); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected errorHandler(): (error: any, uri: string, response: Response) => MaybePromise { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return async (error: any, uri: string, response: Response) => { const details = error.toString ? error.toString() : error; this.logger.error(`Error occurred while handling request for ${uri}. Details: ${details}`); diff --git a/packages/monaco/.eslintrc.js b/packages/monaco/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/monaco/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/monaco/compile.tsconfig.json b/packages/monaco/compile.tsconfig.json index b8b72b49c8822..26ccf608caf5b 100644 --- a/packages/monaco/compile.tsconfig.json +++ b/packages/monaco/compile.tsconfig.json @@ -1,10 +1,34 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../markers/compile.tsconfig.json" + }, + { + "path": "../outline-view/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/monaco/package.json b/packages/monaco/package.json index 761edf1584071..7e0e3f62f88aa 100644 --- a/packages/monaco/package.json +++ b/packages/monaco/package.json @@ -46,10 +46,10 @@ "data" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/monaco/src/browser/monaco-command-registry.ts b/packages/monaco/src/browser/monaco-command-registry.ts index d51b7debdcf90..83b587a25e2ff 100644 --- a/packages/monaco/src/browser/monaco-command-registry.ts +++ b/packages/monaco/src/browser/monaco-command-registry.ts @@ -21,9 +21,9 @@ import { MonacoEditor } from './monaco-editor'; import { MonacoEditorProvider } from './monaco-editor-provider'; export interface MonacoEditorCommandHandler { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute(editor: MonacoEditor, ...args: any[]): any; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any isEnabled?(editor: MonacoEditor, ...args: any[]): boolean; } @injectable() @@ -59,7 +59,7 @@ export class MonacoCommandRegistry { }; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected execute(monacoHandler: MonacoEditorCommandHandler, ...args: any[]): any { const editor = this.monacoEditors.current; if (editor) { @@ -69,13 +69,13 @@ export class MonacoCommandRegistry { return Promise.resolve(); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected isEnabled(monacoHandler: MonacoEditorCommandHandler, ...args: any[]): boolean { const editor = this.monacoEditors.current; return !!editor && (!monacoHandler.isEnabled || monacoHandler.isEnabled(editor, ...args)); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected isVisible(monacoHandler: MonacoEditorCommandHandler, ...args: any[]): boolean { return TextEditorSelection.is(this.selectionService.selection); } diff --git a/packages/monaco/src/browser/monaco-command-service.ts b/packages/monaco/src/browser/monaco-command-service.ts index f24c318d94489..982fc76a2b23a 100644 --- a/packages/monaco/src/browser/monaco-command-service.ts +++ b/packages/monaco/src/browser/monaco-command-service.ts @@ -50,7 +50,7 @@ export class MonacoCommandService implements ICommandService { } } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async executeCommand(commandId: any, ...args: any[]): Promise { const handler = this.commandRegistry.getActiveHandler(commandId, ...args); if (handler) { @@ -60,7 +60,7 @@ export class MonacoCommandService implements ICommandService { return this.executeMonacoCommand(commandId, ...args); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async executeMonacoCommand(commandId: any, ...args: any[]): Promise { if (this.delegate) { return this.delegate.executeCommand(commandId, ...args); diff --git a/packages/monaco/src/browser/monaco-command.ts b/packages/monaco/src/browser/monaco-command.ts index e4a05b30d7f67..f9963f4de4bc7 100644 --- a/packages/monaco/src/browser/monaco-command.ts +++ b/packages/monaco/src/browser/monaco-command.ts @@ -122,7 +122,7 @@ export class MonacoEditorCommandHandlers implements CommandContribution { id: command }, { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute: (...args: any) => instantiationService.invokeFunction( monacoCommands.get(command)!.handler, ...args @@ -134,7 +134,7 @@ export class MonacoEditorCommandHandlers implements CommandContribution { } protected registerCommonCommandHandlers(): void { - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const action in MonacoCommands.COMMON_ACTIONS) { const command = MonacoCommands.COMMON_ACTIONS[action]; const handler = this.newCommonActionHandler(action); diff --git a/packages/monaco/src/browser/monaco-configurations.ts b/packages/monaco/src/browser/monaco-configurations.ts index ed8157bed0378..e747f51b79143 100644 --- a/packages/monaco/src/browser/monaco-configurations.ts +++ b/packages/monaco/src/browser/monaco-configurations.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, inject, postConstruct } from 'inversify'; import { JSONValue } from '@phosphor/coreutils'; diff --git a/packages/monaco/src/browser/monaco-editor-provider.ts b/packages/monaco/src/browser/monaco-editor-provider.ts index 64d965f56f2c4..b1705dc74ec0f 100644 --- a/packages/monaco/src/browser/monaco-editor-provider.ts +++ b/packages/monaco/src/browser/monaco-editor-provider.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import URI from '@theia/core/lib/common/uri'; import { EditorPreferenceChange, EditorPreferences, TextEditor, DiffNavigator } from '@theia/editor/lib/browser'; import { DiffUris } from '@theia/core/lib/browser/diff-uris'; @@ -84,7 +84,7 @@ export class MonacoEditorProvider { }); if (staticServices.resourcePropertiesService) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const original = staticServices.resourcePropertiesService.get() as any; original.getEOL = () => { const eol = this.editorPreferences['files.eol']; diff --git a/packages/monaco/src/browser/monaco-editor-zone-widget.ts b/packages/monaco/src/browser/monaco-editor-zone-widget.ts index e5d5831d81551..595a1ceb9a1c6 100644 --- a/packages/monaco/src/browser/monaco-editor-zone-widget.ts +++ b/packages/monaco/src/browser/monaco-editor-zone-widget.ts @@ -95,7 +95,7 @@ export class MonacoEditorZoneWidget implements Disposable { const widget: monaco.editor.IOverlayWidget = { getId: () => 'editor-zone-widget-' + id, getDomNode: () => this.zoneNode, - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null getPosition: () => null! }; this.editor.addOverlayWidget(widget); diff --git a/packages/monaco/src/browser/monaco-editor.ts b/packages/monaco/src/browser/monaco-editor.ts index 11fd880a200b0..3f9728ab879d1 100644 --- a/packages/monaco/src/browser/monaco-editor.ts +++ b/packages/monaco/src/browser/monaco-editor.ts @@ -322,7 +322,7 @@ export class MonacoEditor extends MonacoEditorServices implements TextEditor { this.toDispose.dispose(); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any trigger(source: string, handlerId: string, payload: any): void { this.editor.trigger(source, handlerId, payload); } @@ -345,7 +345,7 @@ export class MonacoEditor extends MonacoEditorServices implements TextEditor { protected autoresize(): void { if (this.autoSizing) { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null this.resize(null); } } diff --git a/packages/monaco/src/browser/monaco-frontend-module.ts b/packages/monaco/src/browser/monaco-frontend-module.ts index b57a653b3a582..f10de89d8299d 100644 --- a/packages/monaco/src/browser/monaco-frontend-module.ts +++ b/packages/monaco/src/browser/monaco-frontend-module.ts @@ -152,7 +152,7 @@ export function createMonacoConfigurationService(container: interfaces.Container _configuration.getValue = (section, overrides, workspace) => { const overrideIdentifier = overrides && 'overrideIdentifier' in overrides && overrides['overrideIdentifier'] as string || undefined; const resourceUri = overrides && 'resource' in overrides && overrides['resource'].toString(); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const proxy = createPreferenceProxy<{ [key: string]: any }>(preferences, preferenceSchemaProvider.getCombinedSchema(), { resourceUri, overrideIdentifier, style: 'both' }); diff --git a/packages/monaco/src/browser/monaco-keycode-map.ts b/packages/monaco/src/browser/monaco-keycode-map.ts index 5d7aefc640674..8883c61bd0172 100644 --- a/packages/monaco/src/browser/monaco-keycode-map.ts +++ b/packages/monaco/src/browser/monaco-keycode-map.ts @@ -22,7 +22,7 @@ import * as browser from '@theia/core/lib/browser'; const KeyCode = monaco.KeyCode; -export let KEY_CODE_MAP: monaco.KeyCode[] = []; +export const KEY_CODE_MAP: monaco.KeyCode[] = []; (function (): void { KEY_CODE_MAP[3] = KeyCode.PauseBreak; // VK_CANCEL 0x03 Control-break processing KEY_CODE_MAP[8] = KeyCode.Backspace; diff --git a/packages/monaco/src/browser/monaco-loader.ts b/packages/monaco/src/browser/monaco-loader.ts index cf97c381a36f1..f0089c6f0f8ab 100644 --- a/packages/monaco/src/browser/monaco-loader.ts +++ b/packages/monaco/src/browser/monaco-loader.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export function loadVsRequire(context: any): Promise { // Monaco uses a custom amd loader that over-rides node's require. diff --git a/packages/monaco/src/browser/monaco-outline-contribution.ts b/packages/monaco/src/browser/monaco-outline-contribution.ts index 14fec858971c8..3a30df4d6374e 100644 --- a/packages/monaco/src/browser/monaco-outline-contribution.ts +++ b/packages/monaco/src/browser/monaco-outline-contribution.ts @@ -136,6 +136,7 @@ export class MonacoOutlineContribution implements FrontendApplicationContributio this.roots.forEach(resetSelection); } else { this.roots = []; + // eslint-disable-next-line @typescript-eslint/await-thenable const providers = await DocumentSymbolProviderRegistry.all(model); if (token.isCancellationRequested) { return []; diff --git a/packages/monaco/src/browser/monaco-quick-open-service.ts b/packages/monaco/src/browser/monaco-quick-open-service.ts index 7b5591ebe7d68..95b7e96386a1b 100644 --- a/packages/monaco/src/browser/monaco-quick-open-service.ts +++ b/packages/monaco/src/browser/monaco-quick-open-service.ts @@ -113,6 +113,7 @@ export class MonacoQuickOpenService extends QuickOpenService { } internalOpen(opts: MonacoQuickOpenControllerOpts): void { + // eslint-disable-next-line no-null/no-null if (this.widgetNode && this.widgetNode.offsetParent !== null) { this.hide(); } @@ -515,7 +516,7 @@ export class MonacoQuickOpenAction implements monaco.quickOpen.IAction { return this.action.radio || false; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any run(entry: QuickOpenEntry | QuickOpenEntryGroup): PromiseLike { return this.action.run(entry.item); } @@ -528,12 +529,12 @@ export class MonacoQuickOpenAction implements monaco.quickOpen.IAction { export class MonacoQuickOpenActionProvider implements monaco.quickOpen.IActionProvider { constructor(public readonly provider: QuickOpenActionProvider) { } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any hasActions(element: any, entry: QuickOpenEntry | QuickOpenEntryGroup): boolean { return this.provider.hasActions(entry.item); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any getActions(element: any, entry: QuickOpenEntry | QuickOpenEntryGroup): ReadonlyArray { const actions = this.provider.getActions(entry.item); return actions.map(action => new MonacoQuickOpenAction(action)); diff --git a/packages/monaco/src/browser/monaco-resolved-keybinding.ts b/packages/monaco/src/browser/monaco-resolved-keybinding.ts index 4825f42e3c334..e7eb37f656816 100644 --- a/packages/monaco/src/browser/monaco-resolved-keybinding.ts +++ b/packages/monaco/src/browser/monaco-resolved-keybinding.ts @@ -26,7 +26,7 @@ export class MonacoResolvedKeybinding extends monaco.keybindings.ResolvedKeybind constructor(protected readonly keySequence: KeySequence, keybindingService: KeybindingRegistry) { super(); this.parts = keySequence.map(keyCode => { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null const keyLabel = keyCode.key ? keybindingService.acceleratorForKey(keyCode.key) : null; const keyAriaLabel = keyLabel; return new monaco.keybindings.ResolvedKeybindingPart( @@ -51,7 +51,7 @@ export class MonacoResolvedKeybinding extends monaco.keybindings.ResolvedKeybind public getElectronAccelerator(): string | null { if (this.isChord) { // Electron cannot handle chords - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } return monaco.keybindings.ElectronAcceleratorLabelProvider.toLabel(monaco.platform.OS, this.parts, p => p.keyLabel); diff --git a/packages/monaco/src/browser/monaco-snippet-suggest-provider.ts b/packages/monaco/src/browser/monaco-snippet-suggest-provider.ts index 396a6d391312e..a9665b74ef4e0 100644 --- a/packages/monaco/src/browser/monaco-snippet-suggest-provider.ts +++ b/packages/monaco/src/browser/monaco-snippet-suggest-provider.ts @@ -53,7 +53,6 @@ export class MonacoSnippetSuggestProvider implements monaco.languages.Completion await this.loadSnippets(languageId); const snippetsForLanguage = this.snippets.get(languageId) || []; - let suggestions: MonacoSnippetSuggestion[]; const pos = { lineNumber: position.lineNumber, column: 1 }; const lineOffsets: number[] = []; const linePrefixLow = model.getLineContent(position.lineNumber).substr(0, position.column - 1).toLowerCase(); @@ -80,7 +79,7 @@ export class MonacoSnippetSuggestProvider implements monaco.languages.Completion const availableSnippets = new Set(); snippetsForLanguage.forEach(availableSnippets.add, availableSnippets); - suggestions = []; + const suggestions: MonacoSnippetSuggestion[] = []; for (const start of lineOffsets) { availableSnippets.forEach(snippet => { if (this.isPatternInWord(linePrefixLow, start, linePrefixLow.length, snippet.prefix.toLowerCase(), 0, snippet.prefix.length)) { @@ -190,7 +189,7 @@ export class MonacoSnippetSuggestProvider implements monaco.languages.Completion } protected parseSnippets(snippets: JsonSerializedSnippets | undefined, accept: (name: string, snippet: JsonSerializedSnippet) => void): void { if (typeof snippets === 'object') { - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const name in snippets) { const scopeOrTemplate = snippets[name]; if (JsonSerializedSnippet.is(scopeOrTemplate)) { diff --git a/packages/monaco/src/browser/monaco-text-model-service.ts b/packages/monaco/src/browser/monaco-text-model-service.ts index 2ede3881a36f7..154ac739b3a27 100644 --- a/packages/monaco/src/browser/monaco-text-model-service.ts +++ b/packages/monaco/src/browser/monaco-text-model-service.ts @@ -88,7 +88,7 @@ export class MonacoTextModelService implements monaco.editor.ITextModelService { const modelOption = this.modelOptions[change.preferenceName]; if (modelOption) { const options: monaco.editor.ITextModelUpdateOptions = {}; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any options[modelOption] = change.newValue as any; model.textEditorModel.updateOptions(options); } diff --git a/packages/monaco/src/browser/monaco-theming-service.ts b/packages/monaco/src/browser/monaco-theming-service.ts index a77932964896c..abed2c41164d2 100644 --- a/packages/monaco/src/browser/monaco-theming-service.ts +++ b/packages/monaco/src/browser/monaco-theming-service.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as idb from 'idb'; import { injectable, inject } from 'inversify'; @@ -72,7 +72,7 @@ export class MonacoThemingService { @inject(FileSystem) protected readonly fileSystem: FileSystem; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any register(theme: MonacoTheme, pending: { [uri: string]: Promise } = {}): Disposable { const toDispose = new DisposableCollection(Disposable.create(() => { /* mark as not disposed */ })); this.doRegister(theme, pending, toDispose); diff --git a/packages/monaco/src/browser/monaco-workspace.ts b/packages/monaco/src/browser/monaco-workspace.ts index cb9d5cd8cc539..ef552149c166f 100644 --- a/packages/monaco/src/browser/monaco-workspace.ts +++ b/packages/monaco/src/browser/monaco-workspace.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-null-keyword +/* eslint-disable no-null/no-null */ import Uri from 'vscode-uri'; import { injectable, inject, postConstruct } from 'inversify'; @@ -60,8 +60,8 @@ export interface CreateResourceEdit extends ResourceEdit { export namespace CreateResourceEdit { export function is(arg: Edit): arg is CreateResourceEdit { return 'newUri' in arg - && typeof (arg as any).newUri === 'string' // tslint:disable-line:no-any - && (!('oldUri' in arg) || typeof (arg as any).oldUri === 'undefined'); // tslint:disable-line:no-any + && typeof (arg as any).newUri === 'string' // eslint-disable-line @typescript-eslint/no-explicit-any + && (!('oldUri' in arg) || typeof (arg as any).oldUri === 'undefined'); // eslint-disable-line @typescript-eslint/no-explicit-any } } @@ -71,8 +71,8 @@ export interface DeleteResourceEdit extends ResourceEdit { export namespace DeleteResourceEdit { export function is(arg: Edit): arg is DeleteResourceEdit { return 'oldUri' in arg - && typeof (arg as any).oldUri === 'string' // tslint:disable-line:no-any - && (!('newUri' in arg) || typeof (arg as any).newUri === 'undefined'); // tslint:disable-line:no-any + && typeof (arg as any).oldUri === 'string' // eslint-disable-line @typescript-eslint/no-explicit-any + && (!('newUri' in arg) || typeof (arg as any).newUri === 'undefined'); // eslint-disable-line @typescript-eslint/no-explicit-any } } @@ -83,9 +83,9 @@ export interface RenameResourceEdit extends ResourceEdit { export namespace RenameResourceEdit { export function is(arg: Edit): arg is RenameResourceEdit { return 'oldUri' in arg - && typeof (arg as any).oldUri === 'string' // tslint:disable-line:no-any + && typeof (arg as any).oldUri === 'string' // eslint-disable-line @typescript-eslint/no-explicit-any && 'newUri' in arg - && typeof (arg as any).newUri === 'string'; // tslint:disable-line:no-any + && typeof (arg as any).newUri === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any } } @@ -97,7 +97,7 @@ export interface TextEdits { export namespace TextEdits { export function is(arg: Edit): arg is TextEdits { return 'uri' in arg - && typeof (arg as any).uri === 'string'; // tslint:disable-line:no-any + && typeof (arg as any).uri === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any } export function isVersioned(arg: TextEdits): boolean { return is(arg) && arg.version !== undefined; @@ -111,7 +111,7 @@ export namespace EditsByEditor { export function is(arg: Edit): arg is EditsByEditor { return TextEdits.is(arg) && 'editor' in arg - && (arg as any).editor instanceof MonacoEditor; // tslint:disable-line:no-any + && (arg as any).editor instanceof MonacoEditor; // eslint-disable-line @typescript-eslint/no-explicit-any } } @@ -496,7 +496,7 @@ export class MonacoWorkspace implements lang.Workspace { } protected isResourceFileEdit(edit: monaco.languages.ResourceFileEdit | monaco.languages.ResourceTextEdit): edit is monaco.languages.ResourceTextEdit { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return 'resource' in edit && (edit as any).resource instanceof monaco.Uri; } diff --git a/packages/monaco/src/browser/textmate/monaco-theme-registry.ts b/packages/monaco/src/browser/textmate/monaco-theme-registry.ts index 1c419017cdd4f..610ead0383450 100644 --- a/packages/monaco/src/browser/textmate/monaco-theme-registry.ts +++ b/packages/monaco/src/browser/textmate/monaco-theme-registry.ts @@ -15,7 +15,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { IRawTheme, Registry } from 'vscode-textmate'; @@ -73,7 +73,7 @@ export class MonacoThemeRegistry { reg.setTheme(result); result.encodedTokensColors = reg.getColorMap(); // index 0 has to be set to null as it is 'undefined' by default, but monaco code expects it to be null - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null result.encodedTokensColors[0] = null!; // index 1 and 2 are the default colors if (result.colors && result.colors['editor.foreground']) { diff --git a/packages/monaco/src/electron-browser/monaco-electron-module.ts b/packages/monaco/src/electron-browser/monaco-electron-module.ts index a3a0481ae7163..090d52056df74 100644 --- a/packages/monaco/src/electron-browser/monaco-electron-module.ts +++ b/packages/monaco/src/electron-browser/monaco-electron-module.ts @@ -20,7 +20,7 @@ import { loadVsRequire, loadMonaco } from '../browser/monaco-loader'; export { ContainerModule }; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any const s = self; /** diff --git a/packages/monaco/src/typings/monaco/index.d.ts b/packages/monaco/src/typings/monaco/index.d.ts index 6d558fc055410..f95ba7f3f79a5 100644 --- a/packages/monaco/src/typings/monaco/index.d.ts +++ b/packages/monaco/src/typings/monaco/index.d.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ /// declare module monaco.instantiation { diff --git a/packages/navigator/.eslintrc.js b/packages/navigator/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/navigator/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/navigator/compile.tsconfig.json b/packages/navigator/compile.tsconfig.json index b8b72b49c8822..7f099ca696f57 100644 --- a/packages/navigator/compile.tsconfig.json +++ b/packages/navigator/compile.tsconfig.json @@ -1,10 +1,22 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/navigator/package.json b/packages/navigator/package.json index b981034fb31fd..295829e88a710 100644 --- a/packages/navigator/package.json +++ b/packages/navigator/package.json @@ -34,10 +34,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/navigator/src/browser/navigator-contribution.ts b/packages/navigator/src/browser/navigator-contribution.ts index 9f231f4ecd469..7b30a5ac28378 100644 --- a/packages/navigator/src/browser/navigator-contribution.ts +++ b/packages/navigator/src/browser/navigator-contribution.ts @@ -427,7 +427,7 @@ export class FileNavigatorContribution extends AbstractViewContribution) => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const args = ['-SIGTERM', this.hostedInstanceProcess.pid.toString()].concat(children.map((p: any) => p.PID)); cp.spawn('kill', args); }); diff --git a/packages/plugin-ext-vscode/.eslintrc.js b/packages/plugin-ext-vscode/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/plugin-ext-vscode/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/plugin-ext-vscode/compile.tsconfig.json b/packages/plugin-ext-vscode/compile.tsconfig.json index d517de4098e43..9a77f8339bea3 100644 --- a/packages/plugin-ext-vscode/compile.tsconfig.json +++ b/packages/plugin-ext-vscode/compile.tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "lib": [ @@ -11,6 +12,25 @@ }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + }, + { + "path": "../plugin/compile.tsconfig.json" + }, + { + "path": "../plugin-ext/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] } - diff --git a/packages/plugin-ext-vscode/package.json b/packages/plugin-ext-vscode/package.json index 8ea6c184dd03e..b70d345a17df1 100644 --- a/packages/plugin-ext-vscode/package.json +++ b/packages/plugin-ext-vscode/package.json @@ -38,10 +38,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts index 01524587c49db..cc768ba11bd41 100644 --- a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts +++ b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts @@ -103,7 +103,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution { commands.registerCommand(VscodeCommands.DIFF, { isVisible: () => false, - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute: async (left: URI, right: URI, label?: string, options?: TextDocumentShowOptions) => { if (!left || !right) { throw new Error(`${VscodeCommands.DIFF} command requires at least two URI arguments. Found left=${left}, right=${right} as arguments`); @@ -123,7 +123,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution { commands.registerCommand(VscodeCommands.SET_CONTEXT, { isVisible: () => false, - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute: (contextKey: any, contextValue: any) => { this.contextKeyService.createKey(String(contextKey), contextValue); } @@ -325,7 +325,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution { // Register built-in language service commands // see https://code.visualstudio.com/api/references/commands - // tslint:disable: no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ commands.registerCommand( { id: 'vscode.executeDocumentSymbolProvider' @@ -333,7 +333,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution { { execute: (resource: URI) => commands.executeCommand('_executeDocumentSymbolProvider', { resource: monaco.Uri.parse(resource.toString()) } - ).then((value: any) => { + ).then((value: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any if (!Array.isArray(value) || value === undefined) { return undefined; } diff --git a/packages/plugin-ext-vscode/src/node/plugin-vscode-cli-contribution.ts b/packages/plugin-ext-vscode/src/node/plugin-vscode-cli-contribution.ts index 1cc721621c0b5..d6e7ac85fd18c 100644 --- a/packages/plugin-ext-vscode/src/node/plugin-vscode-cli-contribution.ts +++ b/packages/plugin-ext-vscode/src/node/plugin-vscode-cli-contribution.ts @@ -31,7 +31,7 @@ export class PluginVsCodeCliContribution implements CliContribution, PluginHostE configure(conf: Argv): void { conf.option(PluginVsCodeCliContribution.VSCODE_API_VERSION, { - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len description: `Overrides the version returned by VSCode API 'vscode.version'. Example: --${PluginVsCodeCliContribution.VSCODE_API_VERSION}=. Default [${VSCODE_DEFAULT_API_VERSION}]`, type: 'string', nargs: 1 diff --git a/packages/plugin-ext-vscode/src/node/plugin-vscode-init.ts b/packages/plugin-ext-vscode/src/node/plugin-vscode-init.ts index 601607dca3d85..00e21a331cfc0 100644 --- a/packages/plugin-ext-vscode/src/node/plugin-vscode-init.ts +++ b/packages/plugin-ext-vscode/src/node/plugin-vscode-init.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as theia from '@theia/plugin'; import { BackendInitializationFn, PluginAPIFactory, Plugin, emptyPlugin } from '@theia/plugin-ext'; @@ -87,7 +87,7 @@ function overrideInternalLoad(): void { const internalLoad = module._load; // if we try to resolve theia module, return the filename entry to use cache. - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any module._load = function (request: string, parent: any, isMain: {}): any { if (request !== vscodeModuleName) { return internalLoad.apply(this, arguments); diff --git a/packages/plugin-ext-vscode/src/node/plugin-vscode-resolver.ts b/packages/plugin-ext-vscode/src/node/plugin-vscode-resolver.ts index e69bd5005c4ab..0c84a5a304b6f 100644 --- a/packages/plugin-ext-vscode/src/node/plugin-vscode-resolver.ts +++ b/packages/plugin-ext-vscode/src/node/plugin-vscode-resolver.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { PluginDeployerResolver, PluginDeployerResolverContext } from '@theia/plugin-ext'; import { injectable } from 'inversify'; diff --git a/packages/plugin-ext/.eslintrc.js b/packages/plugin-ext/.eslintrc.js new file mode 100644 index 0000000000000..ce6cd5e33c64f --- /dev/null +++ b/packages/plugin-ext/.eslintrc.js @@ -0,0 +1,12 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + }, + rules: { + 'no-null/no-null': 'off', + } +}; diff --git a/packages/plugin-ext/compile.tsconfig.json b/packages/plugin-ext/compile.tsconfig.json index d517de4098e43..81864b9f26461 100644 --- a/packages/plugin-ext/compile.tsconfig.json +++ b/packages/plugin-ext/compile.tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "lib": [ @@ -11,6 +12,61 @@ }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../debug/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../file-search/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../markers/compile.tsconfig.json" + }, + { + "path": "../messages/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + }, + { + "path": "../navigator/compile.tsconfig.json" + }, + { + "path": "../output/compile.tsconfig.json" + }, + { + "path": "../plugin/compile.tsconfig.json" + }, + { + "path": "../preferences/compile.tsconfig.json" + }, + { + "path": "../scm/compile.tsconfig.json" + }, + { + "path": "../search-in-workspace/compile.tsconfig.json" + }, + { + "path": "../task/compile.tsconfig.json" + }, + { + "path": "../terminal/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] } - diff --git a/packages/plugin-ext/package.json b/packages/plugin-ext/package.json index 8abac391dd6a9..9d73cc5768f56 100644 --- a/packages/plugin-ext/package.json +++ b/packages/plugin-ext/package.json @@ -68,10 +68,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/plugin-ext/src/common/assert.ts b/packages/plugin-ext/src/common/assert.ts index 5f151ee0ad0e2..632390d8a7a41 100644 --- a/packages/plugin-ext/src/common/assert.ts +++ b/packages/plugin-ext/src/common/assert.ts @@ -15,7 +15,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function ok(val?: any, message?: string): void { if (!val || val === null) { throw new Error(message ? `Assertion failed (${message})` : 'Assertion failed'); diff --git a/packages/plugin-ext/src/common/connection.ts b/packages/plugin-ext/src/common/connection.ts index b806b74988186..140376bad2270 100644 --- a/packages/plugin-ext/src/common/connection.ts +++ b/packages/plugin-ext/src/common/connection.ts @@ -62,12 +62,12 @@ export class PluginWebSocketChannel implements IWebSocket { this.connection.writer.write(content); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any onMessage(cb: (data: any) => void): void { this.connection.reader.listen(cb); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any onError(cb: (reason: any) => void): void { this.connection.reader.onError(e => cb(e)); } diff --git a/packages/plugin-ext/src/common/glob.ts b/packages/plugin-ext/src/common/glob.ts index 2692da08e002e..155c4638d0fd4 100644 --- a/packages/plugin-ext/src/common/glob.ts +++ b/packages/plugin-ext/src/common/glob.ts @@ -23,9 +23,9 @@ import * as strings from './strings'; import * as paths from './paths'; import { CharCode } from './char-code'; -/* tslint:disable:no-null-keyword no-shadowed-variable one-variable-per-declaration */ +/* eslint-disable no-shadow, no-null/no-null */ export interface IExpression { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any [pattern: string]: boolean | SiblingClause | any; } @@ -120,7 +120,7 @@ function parseRegExp(pattern: string): string { let regEx = ''; // Split up into segments for each slash found - // tslint:disable-next-line:prefer-const + // eslint-disable-next-line prefer-const let segments = splitGlobAware(pattern, GLOB_SPLIT); // Special case where we only have globstars @@ -205,11 +205,11 @@ function parseRegExp(pattern: string): string { continue; case '}': - // tslint:disable-next-line:prefer-const + // eslint-disable-next-line prefer-const let choices = splitGlobAware(braceVal, ','); // Converts {foo,bar} => [foo|bar] - // tslint:disable-next-line:prefer-const + // eslint-disable-next-line prefer-const let braceRegExp = `(?:${choices.map(c => parseRegExp(c)).join('|')})`; regEx += braceRegExp; @@ -268,7 +268,7 @@ const T5 = /^([\w\.-]+(\/[\w\.-]+)*)\/?$/; // export type ParsedPattern = (path: string, basename?: string) => boolean; // The ParsedExpression returns a Promise iff hasSibling returns a Promise. -// tslint:disable-next-line:max-line-length +// eslint-disable-next-line max-len export type ParsedExpression = (path: string, basename?: string, hasSibling?: (name: string) => boolean | Promise) => string | Promise /* the matching pattern */; export interface IGlobOptions { @@ -428,10 +428,10 @@ function trivia3(pattern: string, options: IGlobOptions): ParsedStringPattern { function trivia4and5(path: string, pattern: string, matchPathEnds: boolean): ParsedStringPattern { const nativePath = paths.nativeSep !== paths.sep ? path.replace(ALL_FORWARD_SLASHES, paths.nativeSep) : path; const nativePathEnd = paths.nativeSep + nativePath; - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow const parsedPattern: ParsedStringPattern = matchPathEnds ? function (path, basename): string { return path && (path === nativePath || strings.endsWith(path, nativePathEnd)) ? pattern : null!; - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow } : function (path, basename): string { return path && path === nativePath ? pattern : null!; }; @@ -461,7 +461,7 @@ function toRegExp(pattern: string): ParsedStringPattern { */ export function match(pattern: string | IRelativePattern, path: string): boolean; export function match(expression: IExpression, path: string, hasSibling?: (name: string) => boolean): string /* the matching pattern */; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function match(arg1: string | IExpression | IRelativePattern, path: string, hasSibling?: (name: string) => boolean): any { if (!arg1 || !path) { return false; @@ -480,7 +480,7 @@ export function match(arg1: string | IExpression | IRelativePattern, path: strin */ export function parse(pattern: string | IRelativePattern, options?: IGlobOptions): ParsedPattern; export function parse(expression: IExpression, options?: IGlobOptions): ParsedExpression; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function parse(arg1: string | IExpression | IRelativePattern, options: IGlobOptions = {}): any { if (!arg1) { return FALSE; @@ -496,11 +496,11 @@ export function parse(arg1: string | IExpression | IRelativePattern, options: IG return !!parsedPattern(path, basename); }; if (parsedPattern.allBasenames) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (resultPattern).allBasenames = parsedPattern.allBasenames; } if (parsedPattern.allPaths) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (resultPattern).allPaths = parsedPattern.allPaths; } return resultPattern; @@ -548,7 +548,7 @@ function listToMap(list: string[]): Record { return map; } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function isRelativePattern(obj: any): obj is IRelativePattern { const rp = obj as IRelativePattern; @@ -559,7 +559,7 @@ export function isRelativePattern(obj: any): obj is IRelativePattern { * Same as `parse`, but the ParsedExpression is guaranteed to return a Promise */ export function parseToAsync(expression: IExpression, options?: IGlobOptions): ParsedExpression { - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow const parsedExpression = parse(expression, options); return (path: string, basename?: string, hasSibling?: (name: string) => boolean | Promise): string | Promise => { const result = parsedExpression(path, basename, hasSibling); @@ -590,9 +590,9 @@ function parsedExpression(expression: IExpression, options: IGlobOptions): Parse return parsedPatterns[0]; } - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow const resultExpression: ParsedStringPattern = function (path: string, basename: string): string | Promise { - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow // tslint:disable-next-line:one-variable-per-declaration for (let i = 0, n = parsedPatterns.length; i < n; i++) { // Pattern matches path @@ -605,13 +605,13 @@ function parsedExpression(expression: IExpression, options: IGlobOptions): Parse return null!; }; - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow const withBasenames = parsedPatterns.find(pattern => !!(pattern).allBasenames); if (withBasenames) { resultExpression.allBasenames = (withBasenames).allBasenames; } - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); if (allPaths.length) { resultExpression.allPaths = allPaths; @@ -623,7 +623,7 @@ function parsedExpression(expression: IExpression, options: IGlobOptions): Parse const resultExpression: ParsedStringPattern = function (path: string, basename: string, hasSibling?: (name: string) => boolean | Promise): string | Promise { let name: string = null!; - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow for (let i = 0, n = parsedPatterns.length; i < n; i++) { // Pattern matches path const parsedPattern = (parsedPatterns[i]); @@ -657,7 +657,7 @@ function parsedExpression(expression: IExpression, options: IGlobOptions): Parse return resultExpression; } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function parseExpressionPattern(pattern: string, value: any, options: IGlobOptions): (ParsedStringPattern | ParsedExpressionPattern) { if (value === false) { return NULL; // pattern is disabled diff --git a/packages/plugin-ext/src/common/known-commands.ts b/packages/plugin-ext/src/common/known-commands.ts index 8dd548ad58b2e..97bdbcc23f033 100644 --- a/packages/plugin-ext/src/common/known-commands.ts +++ b/packages/plugin-ext/src/common/known-commands.ts @@ -28,7 +28,7 @@ export namespace KnownCommands { * Commands that you want to apply custom conversions to rather than pass through the automatic args converter. * Would be useful in the case where theia provides some command and you need to provide custom conversions */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const mappings: { [id: string]: [string, (args: any[] | undefined) => any[] | undefined] } = {}; mappings['editor.action.showReferences'] = ['textEditor.commands.showReferences', createConversionFunction( (uri: URI) => uri.toString(), @@ -41,14 +41,14 @@ export namespace KnownCommands { * incoming arguments from vscode api types to monaco types */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const MONACO_CONVERSION_IDENTITY = (args: any[] | undefined) => { if (!args) { return args; } const argStack: ConversionFunction[] = []; args.forEach(_ => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any argStack.push((arg: any) => monacoArgsConverter(arg)); }); if (args) { @@ -251,7 +251,7 @@ export namespace KnownCommands { mappings['goToNextReference'] = ['goToNextReference', MONACO_CONVERSION_IDENTITY]; mappings['goToPreviousReference'] = ['goToPreviousReference', MONACO_CONVERSION_IDENTITY]; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function map(id: string, args: any[] | undefined, toDo: (mappedId: string, mappedArgs: any[] | undefined) => T): T { if (mappings[id]) { return toDo(mappings[id][0], mappings[id][1](args)); @@ -264,16 +264,16 @@ export namespace KnownCommands { return !!mappings[id]; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any type ConversionFunction = ((parameter: any) => any) | undefined; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any function createConversionFunction(...conversions: ConversionFunction[]): (args: any[] | undefined) => any[] | undefined { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return function (args: any[] | undefined): any[] | undefined { if (!args) { return args; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return args.map(function (arg: any, index: number): any { if (index < conversions.length) { const conversion = conversions[index]; @@ -298,7 +298,7 @@ export namespace KnownCommands { return L.create(l.uri.toString(), fromRangeToR(l.range)); } - // tslint:disable-next-line:no-any typedef + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/tslint/config function monacoArgsConverter(args: any[]) { // tslint:disable-next-line:typedef return cloneAndChange(args, function (value) { diff --git a/packages/plugin-ext/src/common/object-identifier.ts b/packages/plugin-ext/src/common/object-identifier.ts index 979ca4d7c0555..be3c7139c1245 100644 --- a/packages/plugin-ext/src/common/object-identifier.ts +++ b/packages/plugin-ext/src/common/object-identifier.ts @@ -26,7 +26,7 @@ export namespace ObjectIdentifier { return obj; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function of(obj: any): number { return obj[name]; } diff --git a/packages/plugin-ext/src/common/objects.ts b/packages/plugin-ext/src/common/objects.ts index 958f6ec8365e6..19276605a8ee4 100644 --- a/packages/plugin-ext/src/common/objects.ts +++ b/packages/plugin-ext/src/common/objects.ts @@ -1,4 +1,4 @@ -// tslint:disable +/* eslint-disable */ // copied from https://github.com/microsoft/vscode/blob/1.37.0/src/vs/base/common/objects.ts /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/packages/plugin-ext/src/common/paths.ts b/packages/plugin-ext/src/common/paths.ts index 6abe90c9d4cad..839e49b1ef9cf 100644 --- a/packages/plugin-ext/src/common/paths.ts +++ b/packages/plugin-ext/src/common/paths.ts @@ -67,7 +67,6 @@ export function extname(path: string): string { } export function normalize(path: string, toOSPath?: boolean): string { - if (path === null || path === void 0) { return path; } @@ -82,7 +81,7 @@ export function normalize(path: string, toOSPath?: boolean): string { return path; } - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow const sep = wantsBackslash ? '\\' : '/'; const root = getRoot(path, sep); @@ -132,7 +131,7 @@ function streql(value: string, start: number, end: number, other: string): boole * `getRoot('files:///files/path') === files:///`, * or `getRoot('\\server\shares\path') === \\server\shares\` */ -// tslint:disable-next-line:no-shadowed-variable +// eslint-disable-next-line no-shadow export function getRoot(path: string, sep: string = '/'): string { if (!path) { @@ -149,7 +148,7 @@ export function getRoot(path: string, sep: string = '/'): string { // ^^^^^^^^^^^^^^^^^^^ code = path.charCodeAt(2); if (code !== CharCode.Slash && code !== CharCode.Backslash) { - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow let pos = 3; const start = pos; for (; pos < len; pos++) { diff --git a/packages/plugin-ext/src/common/plugin-api-rpc-model.ts b/packages/plugin-ext/src/common/plugin-api-rpc-model.ts index 3d7726de816c0..01a39cf8dd7f2 100644 --- a/packages/plugin-ext/src/common/plugin-api-rpc-model.ts +++ b/packages/plugin-ext/src/common/plugin-api-rpc-model.ts @@ -156,7 +156,7 @@ export interface Command { id: string; title: string; tooltip?: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any arguments?: any[]; } diff --git a/packages/plugin-ext/src/common/plugin-api-rpc.ts b/packages/plugin-ext/src/common/plugin-api-rpc.ts index 00f51d3c668b0..d4eddf919ed1a 100644 --- a/packages/plugin-ext/src/common/plugin-api-rpc.ts +++ b/packages/plugin-ext/src/common/plugin-api-rpc.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -/* tslint:disable:no-any */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { createProxyIdentifier, ProxyIdentifier, RPCProtocol } from './rpc-protocol'; import * as theia from '@theia/plugin'; @@ -1123,7 +1123,7 @@ export interface TaskDto { label: string; source?: string; scope?: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any; } diff --git a/packages/plugin-ext/src/common/plugin-message-reader.ts b/packages/plugin-ext/src/common/plugin-message-reader.ts index c7060cd02514c..4ddb1f0e2ee0f 100644 --- a/packages/plugin-ext/src/common/plugin-message-reader.ts +++ b/packages/plugin-ext/src/common/plugin-message-reader.ts @@ -23,7 +23,7 @@ import { AbstractMessageReader, DataCallback } from 'vscode-jsonrpc/lib/messageR export class PluginMessageReader extends es5ClassCompat(AbstractMessageReader) { protected state: 'initial' | 'listening' | 'closed' = 'initial'; protected callback: DataCallback | undefined; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected readonly events: { message?: any, error?: any }[] = []; constructor() { @@ -56,7 +56,7 @@ export class PluginMessageReader extends es5ClassCompat(AbstractMessageReader) { } } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any fireError(error: any): void { if (this.state === 'initial') { this.events.splice(0, 0, { error }); diff --git a/packages/plugin-ext/src/common/plugin-protocol.ts b/packages/plugin-ext/src/common/plugin-protocol.ts index 226d5b0ace56c..376a19abf0398 100644 --- a/packages/plugin-ext/src/common/plugin-protocol.ts +++ b/packages/plugin-ext/src/common/plugin-protocol.ts @@ -219,7 +219,7 @@ export interface PluginTaskDefinitionContribution { [name: string]: { type: string; description?: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any [additionalProperty: string]: any; } } @@ -726,9 +726,9 @@ export interface PluginServer { export const ServerPluginRunner = Symbol('ServerPluginRunner'); export interface ServerPluginRunner { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any acceptMessage(jsonMessage: any): boolean; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any onMessage(jsonMessage: any): void; setClient(client: HostedPluginClient): void; setDefault(defaultRunner: ServerPluginRunner): void; diff --git a/packages/plugin-ext/src/common/rpc-protocol.ts b/packages/plugin-ext/src/common/rpc-protocol.ts index 89b31cddffc2e..c96b79fef7a5f 100644 --- a/packages/plugin-ext/src/common/rpc-protocol.ts +++ b/packages/plugin-ext/src/common/rpc-protocol.ts @@ -20,7 +20,7 @@ // copied from https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/services/extensions/node/rpcProtocol.ts // with small modifications -/* tslint:disable:no-any */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { Event } from '@theia/core/lib/common/event'; import { DisposableCollection, Disposable } from '@theia/core/lib/common/disposable'; @@ -130,7 +130,6 @@ export class RPCProtocolImpl implements RPCProtocol { return target[name]; } }; - // tslint:disable-next-line:no-null-keyword return new Proxy(Object.create(null), handler); } @@ -203,7 +202,7 @@ export class RPCProtocolImpl implements RPCProtocol { const callId = msg.id; const proxyId = msg.proxyId; // convert `null` to `undefined`, since we don't use `null` in internal plugin APIs - const args = msg.args.map(arg => arg === null ? undefined : arg); + const args = msg.args.map(arg => arg === null ? undefined : arg); // eslint-disable-line no-null/no-null const addToken = args.length && args[args.length - 1] === 'add.cancellation.token' ? args.pop() : false; if (addToken) { @@ -388,7 +387,7 @@ class MessageFactory { */ namespace ObjectsTransferrer { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function replacer(key: string | undefined, value: any): any { if (value instanceof URI) { return { @@ -424,7 +423,7 @@ namespace ObjectsTransferrer { return value; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function reviver(key: string | undefined, value: any): any { if (isSerializedObject(value)) { switch (value.$type) { @@ -433,7 +432,7 @@ namespace ObjectsTransferrer { case SerializedObjectType.VSCODE_URI: return VSCodeURI.parse(value.data); case SerializedObjectType.THEIA_RANGE: - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const obj: any = JSON.parse(value.data); const start = new Position(obj.start.line, obj.start.character); const end = new Position(obj.end.line, obj.end.character); diff --git a/packages/plugin-ext/src/common/types.ts b/packages/plugin-ext/src/common/types.ts index 74fc2e3f6784b..4ff9b843ee204 100644 --- a/packages/plugin-ext/src/common/types.ts +++ b/packages/plugin-ext/src/common/types.ts @@ -22,16 +22,16 @@ /** * Returns `true` if the parameter has type "object" and not null, an array, a regexp, a date. */ -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function isObject(obj: any): boolean { return typeof obj === 'object' - && obj !== null + && obj !== null // eslint-disable-line @typescript-eslint/no-explicit-any && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function mixin(destination: any, source: any, overwrite: boolean = true): any { if (!isObject(destination)) { return source; @@ -65,14 +65,14 @@ export interface LogPart { type: LogType; } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export interface KeysToAnyValues { [key: string]: any } export interface KeysToKeysToAnyValue { [key: string]: KeysToAnyValues } -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ /** copied from https://github.com/TypeFox/vscode/blob/70b8db24a37fafc77247de7f7cb5bb0195120ed0/src/vs/workbench/api/common/extHostTypes.ts#L18-L27 */ export function es5ClassCompat(target: T): T { - /// @ts-ignore + // @ts-ignore function _(): any { return Reflect.construct(target, arguments, this.constructor); } Object.defineProperty(_, 'name', Object.getOwnPropertyDescriptor(target, 'name')!); Object.setPrototypeOf(_, target); @@ -87,7 +87,7 @@ const _typeof = { object: 'object', function: 'function' }; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ /** * @returns whether the provided parameter is a JavaScript Array or not. */ @@ -114,5 +114,5 @@ export function isUndefined(obj: any): obj is undefined { * @returns whether the provided parameter is undefined or null. */ export function isUndefinedOrNull(obj: any): obj is undefined | null { - return isUndefined(obj) || obj === null; + return isUndefined(obj) || obj === null; // eslint-disable-line no-null/no-null } diff --git a/packages/plugin-ext/src/hosted/browser/hosted-plugin.ts b/packages/plugin-ext/src/hosted/browser/hosted-plugin.ts index 10c3f2c342fe6..690af1a04b976 100644 --- a/packages/plugin-ext/src/hosted/browser/hosted-plugin.ts +++ b/packages/plugin-ext/src/hosted/browser/hosted-plugin.ts @@ -19,7 +19,7 @@ *--------------------------------------------------------------------------------------------*/ // some code copied and modified from https://github.com/microsoft/vscode/blob/da5fb7d5b865aa522abc7e82c10b746834b98639/src/vs/workbench/api/node/extHostExtensionService.ts -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import debounce = require('lodash.debounce'); import { UUID } from '@phosphor/coreutils'; @@ -638,10 +638,12 @@ export class HostedPluginSupport { await this.activateByEvent(`onWebviewPanel:${webview.viewType}`); const restore = this.webviewRevivers.get(webview.viewType); if (!restore) { + /* eslint-disable max-len */ webview.setHTML(this.getDeserializationFailedContents(`

The extension providing '${webview.viewType}' view is not capable of restoring it.

Want to help fix this? Please inform the extension developer to register a reviver.

`)); + /* eslint-enable max-len */ return; } try { diff --git a/packages/plugin-ext/src/hosted/browser/worker/debug-stub.ts b/packages/plugin-ext/src/hosted/browser/worker/debug-stub.ts index 97511c08d4756..581002868edad 100644 --- a/packages/plugin-ext/src/hosted/browser/worker/debug-stub.ts +++ b/packages/plugin-ext/src/hosted/browser/worker/debug-stub.ts @@ -17,7 +17,7 @@ import { DebugExtImpl } from '../../../plugin/node/debug/debug'; import { RPCProtocol } from '../../../common/rpc-protocol'; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export function createDebugExtStub(rpc: RPCProtocol): DebugExtImpl { return new Proxy(new DebugExtImpl(rpc), { apply: function (target, that, args): void { diff --git a/packages/plugin-ext/src/hosted/browser/worker/worker-main.ts b/packages/plugin-ext/src/hosted/browser/worker/worker-main.ts index 3271f319cbb60..a088f67eb7dd4 100644 --- a/packages/plugin-ext/src/hosted/browser/worker/worker-main.ts +++ b/packages/plugin-ext/src/hosted/browser/worker/worker-main.ts @@ -32,7 +32,7 @@ import { ClipboardExt } from '../../../plugin/clipboard-ext'; import { KeyValueStorageProxy } from '../../../plugin/plugin-storage'; import { WebviewsExtImpl } from '../../../plugin/webviews'; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any const ctx = self as any; const pluginsApiImpl = new Map(); @@ -45,7 +45,7 @@ const rpc = new RPCProtocolImpl({ ctx.postMessage(m); } }); -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any addEventListener('message', (message: any) => { emitter.fire(message.data); }); @@ -63,7 +63,7 @@ const clipboardExt = new ClipboardExt(rpc); const webviewExt = new WebviewsExtImpl(rpc, workspaceExt); const pluginManager = new PluginManagerExtImpl({ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any loadPlugin(plugin: Plugin): any { if (isElectron()) { ctx.importScripts(plugin.pluginPath); @@ -150,7 +150,7 @@ const apiFactory = createAPIFactory( let defaultApi: typeof theia; const handler = { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any get: (target: any, name: string) => { const plugin = pluginsModulesNames.get(name); if (plugin) { @@ -165,7 +165,6 @@ const handler = { return defaultApi; } }; -// tslint:disable-next-line:no-null-keyword ctx['theia'] = new Proxy(Object.create(null), handler); rpc.set(MAIN_RPC_CONTEXT.HOSTED_PLUGIN_MANAGER_EXT, pluginManager); diff --git a/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts b/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts index 2874edb3c41af..783e44b1ebd05 100644 --- a/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts +++ b/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts @@ -71,12 +71,12 @@ export class HostedPluginProcess implements ServerPluginRunner { } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any public acceptMessage(jsonMessage: any): boolean { return jsonMessage.type !== undefined && jsonMessage.id; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any public onMessage(jsonMessage: any): void { if (this.childProcess) { this.childProcess.send(JSON.stringify(jsonMessage)); @@ -89,7 +89,7 @@ export class HostedPluginProcess implements ServerPluginRunner { } this.terminatingPluginServer = true; - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow const cp = this.childProcess; this.childProcess = undefined; diff --git a/packages/plugin-ext/src/hosted/node/hosted-plugin.ts b/packages/plugin-ext/src/hosted/node/hosted-plugin.ts index 70c6ee49992cc..7b7c1101266ea 100644 --- a/packages/plugin-ext/src/hosted/node/hosted-plugin.ts +++ b/packages/plugin-ext/src/hosted/node/hosted-plugin.ts @@ -74,7 +74,7 @@ export class HostedPluginSupport { onMessage(message: string): void { // need to perform routing - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const jsonMessage: any = JSON.parse(message); if (this.pluginRunners.length > 0) { this.pluginRunners.forEach(runner => { diff --git a/packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts b/packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts index e0c05570c856f..7071bfd3df3d0 100644 --- a/packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts +++ b/packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts @@ -40,7 +40,7 @@ export class PluginHostRPC { private pluginManager: PluginManagerExtImpl; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(protected readonly rpc: any) { } @@ -76,7 +76,7 @@ export class PluginHostRPC { ); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any initContext(contextPath: string, plugin: Plugin): any { const { name, version } = plugin.rawModel; console.log('PLUGIN_HOST(' + process.pid + '): initializing(' + name + '@' + version + ' with ' + contextPath + ')'); @@ -90,7 +90,7 @@ export class PluginHostRPC { createPluginManager( envExt: EnvExtImpl, storageProxy: KeyValueStorageProxy, preferencesManager: PreferenceRegistryExtImpl, webview: WebviewsExtImpl, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any rpc: any): PluginManagerExtImpl { const { extensionTestsPath } = process.env; const self = this; @@ -195,7 +195,7 @@ export class PluginHostRPC { } }, loadTests: extensionTestsPath ? async () => { - // tslint:disable:no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ // Require the test runner via node require from the provided path let testRunner: any; let requireError: Error | undefined; diff --git a/packages/plugin-ext/src/hosted/node/plugin-host.ts b/packages/plugin-ext/src/hosted/node/plugin-host.ts index a08ed238d70eb..2b1a70a9f3815 100644 --- a/packages/plugin-ext/src/hosted/node/plugin-host.ts +++ b/packages/plugin-ext/src/hosted/node/plugin-host.ts @@ -26,7 +26,7 @@ process.exit = function (code?: number): void { } as (code?: number) => never; // same for 'crash'(works only in electron) -// tslint:disable-next-line: no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any const proc = process as any; if (proc.crash) { proc.crash = function (): void { @@ -39,10 +39,10 @@ process.on('uncaughtException', (err: Error) => { console.error(err); }); -// tslint:disable-next-line: no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any const unhandledPromises: Promise[] = []; -// tslint:disable-next-line: no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any process.on('unhandledRejection', (reason: any, promise: Promise) => { unhandledPromises.push(promise); setTimeout(() => { @@ -59,7 +59,7 @@ process.on('unhandledRejection', (reason: any, promise: Promise) => { }, 1000); }); -// tslint:disable-next-line: no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any process.on('rejectionHandled', (promise: Promise) => { const index = unhandledPromises.indexOf(promise); if (index >= 0) { diff --git a/packages/plugin-ext/src/hosted/node/plugin-manifest-loader.ts b/packages/plugin-ext/src/hosted/node/plugin-manifest-loader.ts index 46feb067dffac..39cea8b802508 100644 --- a/packages/plugin-ext/src/hosted/node/plugin-manifest-loader.ts +++ b/packages/plugin-ext/src/hosted/node/plugin-manifest-loader.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as path from 'path'; import * as fs from 'fs-extra'; @@ -66,7 +66,7 @@ function localize(value: any, translations: { } if (typeof value === 'object') { const result: { [key: string]: any } = {}; - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const propertyName in value) { result[propertyName] = localize(value[propertyName], translations); } diff --git a/packages/plugin-ext/src/hosted/node/scanners/backend-init-theia.ts b/packages/plugin-ext/src/hosted/node/scanners/backend-init-theia.ts index 6c6dfaaf8f4d2..fbfb27be1e955 100644 --- a/packages/plugin-ext/src/hosted/node/scanners/backend-init-theia.ts +++ b/packages/plugin-ext/src/hosted/node/scanners/backend-init-theia.ts @@ -45,7 +45,7 @@ function overrideInternalLoad(): void { const internalLoad = module._load; // if we try to resolve theia module, return the filename entry to use cache. - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any module._load = function (request: string, parent: any, isMain: {}): any { if (request !== '@theia/plugin') { return internalLoad.apply(this, arguments); diff --git a/packages/plugin-ext/src/hosted/node/scanners/scanner-theia.ts b/packages/plugin-ext/src/hosted/node/scanners/scanner-theia.ts index 09a88f5c6667d..66df74e63b3e7 100644 --- a/packages/plugin-ext/src/hosted/node/scanners/scanner-theia.ts +++ b/packages/plugin-ext/src/hosted/node/scanners/scanner-theia.ts @@ -426,7 +426,7 @@ export class TheiaPluginScanner implements PluginScanner { } } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private readConfiguration(rawConfiguration: RecursivePartial, pluginPath: string): PreferenceSchema | undefined { return PreferenceSchema.is(rawConfiguration) ? rawConfiguration : undefined; } diff --git a/packages/plugin-ext/src/main/browser/command-registry-main.ts b/packages/plugin-ext/src/main/browser/command-registry-main.ts index 916f959c717d2..f017306a2a17e 100644 --- a/packages/plugin-ext/src/main/browser/command-registry-main.ts +++ b/packages/plugin-ext/src/main/browser/command-registry-main.ts @@ -71,7 +71,7 @@ export class CommandRegistryMainImpl implements CommandRegistryMain, Disposable } } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async $executeCommand(id: string, ...args: any[]): Promise { if (!this.delegate.getCommand(id)) { throw new Error(`Command with id '${id}' is not registered.`); diff --git a/packages/plugin-ext/src/main/browser/debug/debug-main.ts b/packages/plugin-ext/src/main/browser/debug/debug-main.ts index 52607cff3b8ba..cab3e34ad054b 100644 --- a/packages/plugin-ext/src/main/browser/debug/debug-main.ts +++ b/packages/plugin-ext/src/main/browser/debug/debug-main.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { interfaces } from 'inversify'; import { RPCProtocol } from '../../../common/rpc-protocol'; diff --git a/packages/plugin-ext/src/main/browser/documents-main.ts b/packages/plugin-ext/src/main/browser/documents-main.ts index 918611e1e37ca..cf94a6cbe8aeb 100644 --- a/packages/plugin-ext/src/main/browser/documents-main.ts +++ b/packages/plugin-ext/src/main/browser/documents-main.ts @@ -51,20 +51,18 @@ export class ModelReferenceCollection { add(ref: Reference): void { const length = ref.object.textEditorModel.getValueLength(); - // tslint:disable-next-line: no-any - let handle: any; - let entry: { length: number, dispose(): void }; - const _dispose = () => { - const idx = this.data.indexOf(entry); + const handle = setTimeout(_dispose, this.maxAge); + const entry = { length, dispose: _dispose }; + const self = this; + function _dispose(): void { + const idx = self.data.indexOf(entry); if (idx >= 0) { - this.length -= length; + self.length -= length; ref.dispose(); clearTimeout(handle); - this.data.splice(idx, 1); + self.data.splice(idx, 1); } }; - handle = setTimeout(_dispose, this.maxAge); - entry = { length, dispose: _dispose }; this.data.push(entry); this.length += length; diff --git a/packages/plugin-ext/src/main/browser/languages-main.ts b/packages/plugin-ext/src/main/browser/languages-main.ts index 15246b40d0564..8c1a95e704d72 100644 --- a/packages/plugin-ext/src/main/browser/languages-main.ts +++ b/packages/plugin-ext/src/main/browser/languages-main.ts @@ -428,7 +428,7 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable { return this.proxy.$resolveCodeLens(handle, model.uri, codeLens, token); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any $emitCodeLensEvent(eventHandle: number, event?: any): void { const obj = this.services.get(eventHandle); if (obj instanceof Emitter) { diff --git a/packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.spec.ts b/packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.spec.ts index b8bfd17737b1d..ddea0bcb0e531 100644 --- a/packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.spec.ts +++ b/packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.spec.ts @@ -61,17 +61,17 @@ describe.skip('MenusContributionHandler', () => { bind(CommandRegistry).toSelf().inSingletonScope(); bind(ContextKeyService).toSelf().inSingletonScope(); bind(MenusContributionPointHandler).toSelf(); - // tslint:disable-next-line:no-any mock QuickCommandService - bind(QuickCommandService).toConstantValue({} as any); - // tslint:disable-next-line:no-any mock TabBarToolbarRegistry - bind(TabBarToolbarRegistry).toConstantValue({} as any); - // tslint:disable-next-line:no-any mock PluginSharedStyle - bind(PluginSharedStyle).toConstantValue({} as any); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bind(QuickCommandService).toConstantValue({} as any); // mock QuickCommandService + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bind(TabBarToolbarRegistry).toConstantValue({} as any); // mock TabBarToolbarRegistry + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bind(PluginSharedStyle).toConstantValue({} as any); // mock PluginSharedStyle bind(SelectionService).toSelf().inSingletonScope(); - // tslint:disable-next-line:no-any mock ScmService - bind(ScmService).toConstantValue({} as any); - // tslint:disable-next-line:no-any mock ScmService - bind(ResourceContextKey).toConstantValue({} as any); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bind(ScmService).toConstantValue({} as any); // mock ScmService + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bind(ResourceContextKey).toConstantValue({} as any); // mock ScmService }); testContainer.load(module); diff --git a/packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.ts b/packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.ts index 108ee70b2f5a2..4378ba5575599 100644 --- a/packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.ts +++ b/packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import CodeUri from 'vscode-uri'; import { injectable, inject } from 'inversify'; diff --git a/packages/plugin-ext/src/main/browser/plugin-command-open-handler.ts b/packages/plugin-ext/src/main/browser/plugin-command-open-handler.ts index 4d685ab30a446..c91bdaa8f1843 100644 --- a/packages/plugin-ext/src/main/browser/plugin-command-open-handler.ts +++ b/packages/plugin-ext/src/main/browser/plugin-command-open-handler.ts @@ -33,7 +33,7 @@ export class PluginCommandOpenHandler implements OpenHandler { } async open(uri: URI): Promise { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let args: any = []; try { args = JSON.parse(uri.query); diff --git a/packages/plugin-ext/src/main/browser/plugin-contribution-handler.ts b/packages/plugin-ext/src/main/browser/plugin-contribution-handler.ts index e0366a9113b24..b54a1d78a7b81 100644 --- a/packages/plugin-ext/src/main/browser/plugin-contribution-handler.ts +++ b/packages/plugin-ext/src/main/browser/plugin-contribution-handler.ts @@ -223,7 +223,7 @@ export class PluginContributionHandler { } } if (contributions.views) { - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const location in contributions.views) { for (const view of contributions.views[location]) { pushContribution(`views.${view.id}`, @@ -361,7 +361,7 @@ export class PluginContributionHandler { title: 'Default Configuration Overrides', properties: {} }; - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const key in configurationDefaults) { const defaultValue = configurationDefaults[key]; if (this.preferenceSchemaProvider.testOverrideValue(key, defaultValue)) { @@ -420,7 +420,6 @@ export class PluginContributionHandler { if (typeof tokenTypes === 'undefined' || tokenTypes === null) { return undefined; } - // tslint:disable-next-line:no-null-keyword const result = Object.create(null); const scopes = Object.keys(tokenTypes); const len = scopes.length; @@ -446,8 +445,6 @@ export class PluginContributionHandler { if (typeof languages === 'undefined' || languages === null) { return undefined; } - - // tslint:disable-next-line:no-null-keyword const result = Object.create(null); const scopes = Object.keys(languages); const len = scopes.length; diff --git a/packages/plugin-ext/src/main/browser/plugin-icon-theme-service.ts b/packages/plugin-ext/src/main/browser/plugin-icon-theme-service.ts index f5184b657adbe..8f9a43646535b 100644 --- a/packages/plugin-ext/src/main/browser/plugin-icon-theme-service.ts +++ b/packages/plugin-ext/src/main/browser/plugin-icon-theme-service.ts @@ -410,7 +410,7 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh } const folderNames = associations.folderNames; if (folderNames) { - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const folderName in folderNames) { accept(folderNames[folderName]!, this.folderNameIcon(folderName), this.folderIcon); this.hasFolderIcons = true; @@ -418,7 +418,7 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh } const folderNamesExpanded = associations.folderNamesExpanded; if (folderNamesExpanded) { - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const folderName in folderNamesExpanded) { accept(folderNamesExpanded[folderName]!, this.expandedFolderNameIcon(folderName), this.folderExpandedIcon); this.hasFolderIcons = true; @@ -429,7 +429,7 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh if (!languageIds.jsonc && languageIds.json) { languageIds.jsonc = languageIds.json; } - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const languageId in languageIds) { accept(languageIds[languageId]!, this.languageIcon(languageId), this.fileIcon); this.hasFileIcons = true; @@ -437,7 +437,7 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh } const fileExtensions = associations.fileExtensions; if (fileExtensions) { - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const fileExtension in fileExtensions) { accept(fileExtensions[fileExtension]!, ...this.fileExtensionIcon(fileExtension), this.fileIcon); this.hasFileIcons = true; @@ -445,7 +445,7 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh } const fileNames = associations.fileNames; if (fileNames) { - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const fileName in fileNames) { accept(fileNames[fileName]!, ...this.fileNameIcon(fileName), this.fileIcon); this.hasFileIcons = true; diff --git a/packages/plugin-ext/src/main/browser/plugin-shared-style.ts b/packages/plugin-ext/src/main/browser/plugin-shared-style.ts index b6561344ee095..908ebfd54854a 100644 --- a/packages/plugin-ext/src/main/browser/plugin-shared-style.ts +++ b/packages/plugin-ext/src/main/browser/plugin-shared-style.ts @@ -85,7 +85,7 @@ export class PluginSharedStyle { const rules = sheet.rules || sheet.cssRules || []; for (let i = rules.length - 1; i >= 0; i--) { const rule = rules[i]; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any if ((rule).selectorText.indexOf(selector) !== -1) { sheet.deleteRule(i); } diff --git a/packages/plugin-ext/src/main/browser/preference-registry-main.ts b/packages/plugin-ext/src/main/browser/preference-registry-main.ts index abe9afad27af2..9a8dbfb20422b 100644 --- a/packages/plugin-ext/src/main/browser/preference-registry-main.ts +++ b/packages/plugin-ext/src/main/browser/preference-registry-main.ts @@ -36,7 +36,7 @@ import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposa export function getPreferences(preferenceProviderProvider: PreferenceProviderProvider, rootFolders: FileStat[]): PreferenceData { const folders = rootFolders.map(root => root.uri.toString()); - /* tslint:disable-next-line:no-any */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any return PreferenceScope.getScopes().reduce((result: { [key: number]: any }, scope: PreferenceScope) => { result[scope] = {}; const provider = preferenceProviderProvider(scope); @@ -83,7 +83,7 @@ export class PreferenceRegistryMainImpl implements PreferenceRegistryMain, Dispo this.toDispose.dispose(); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async $updateConfigurationOption(target: boolean | ConfigurationTarget | undefined, key: string, value: any, resource?: string): Promise { const scope = this.parseConfigurationTarget(target); await this.preferenceService.set(key, value, scope, resource); diff --git a/packages/plugin-ext/src/main/browser/quick-open-main.ts b/packages/plugin-ext/src/main/browser/quick-open-main.ts index 919ae356ca94e..8e6170e72a192 100644 --- a/packages/plugin-ext/src/main/browser/quick-open-main.ts +++ b/packages/plugin-ext/src/main/browser/quick-open-main.ts @@ -102,12 +102,12 @@ export class QuickOpenMainImpl implements QuickOpenMain, QuickOpenModel, Disposa }); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any $setItems(items: PickOpenItem[]): Promise { this.items = []; for (const i of items) { let item: QuickOpenItem | QuickOpenGroupItem; - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const options: any = { label: i.label, description: i.description, @@ -153,7 +153,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, QuickOpenModel, Disposa return convertedItems; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any $setError(error: Error): Promise { throw new Error('Method not implemented.'); } @@ -252,7 +252,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, QuickOpenModel, Disposa }); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private findChangedKey(key: string, value: any): void { switch (key) { case 'title': { @@ -294,7 +294,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, QuickOpenModel, Disposa } } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any $setQuickInputChanged(changed: any): void { for (const key in changed) { if (changed.hasOwnProperty(key)) { diff --git a/packages/plugin-ext/src/main/browser/terminal-main.ts b/packages/plugin-ext/src/main/browser/terminal-main.ts index 0297dbd292e00..735ddae33ac67 100644 --- a/packages/plugin-ext/src/main/browser/terminal-main.ts +++ b/packages/plugin-ext/src/main/browser/terminal-main.ts @@ -69,7 +69,7 @@ export class TerminalServiceMainImpl implements TerminalServiceMain, Disposable const updateProcessId = () => terminal.processId.then( processId => this.extProxy.$terminalOpened(terminal.id, processId), - () => {/*no-op*/ } + () => {/* no-op */ } ); updateProcessId(); this.toDispose.push(terminal.onDidOpen(() => updateProcessId())); diff --git a/packages/plugin-ext/src/main/browser/view/plugin-tree-view-node-label-provider.ts b/packages/plugin-ext/src/main/browser/view/plugin-tree-view-node-label-provider.ts index d7fb7de6b8c57..3cba13e34fc6d 100644 --- a/packages/plugin-ext/src/main/browser/view/plugin-tree-view-node-label-provider.ts +++ b/packages/plugin-ext/src/main/browser/view/plugin-tree-view-node-label-provider.ts @@ -30,7 +30,7 @@ export class PluginTreeViewNodeLabelProvider implements LabelProviderContributio @inject(TreeLabelProvider) protected readonly treeLabelProvider: TreeLabelProvider; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any canHandle(element: TreeViewNode | any): number { if (TreeNode.is(element) && ('resourceUri' in element || 'themeIconId' in element)) { return this.treeLabelProvider.canHandle(element) + 1; diff --git a/packages/plugin-ext/src/main/browser/view/tree-view-widget.tsx b/packages/plugin-ext/src/main/browser/view/tree-view-widget.tsx index 79dec87100ef8..f9d6a2ecce33f 100644 --- a/packages/plugin-ext/src/main/browser/view/tree-view-widget.tsx +++ b/packages/plugin-ext/src/main/browser/view/tree-view-widget.tsx @@ -58,7 +58,7 @@ export interface TreeViewNode extends SelectableTreeNode { resourceUri?: string; themeIconId?: 'folder' | 'file'; tooltip?: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any description?: string | boolean | any; } export namespace TreeViewNode { @@ -68,7 +68,7 @@ export namespace TreeViewNode { } export interface CompositeTreeViewNode extends TreeViewNode, ExpandableTreeNode, CompositeTreeNode { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any description?: string | boolean | any; } export namespace CompositeTreeViewNode { @@ -307,7 +307,7 @@ export class TreeViewWidget extends TreeWidget { return { treeViewId: this.id, treeItemId: node.id }; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected renderInlineCommand(node: ActionMenuNode, index: number, arg: any): React.ReactNode { const { icon } = node; if (!icon || !this.commands.isVisible(node.action.commandId, arg) || !this.contextKeys.match(node.action.when)) { diff --git a/packages/plugin-ext/src/main/browser/view/tree-views-main.ts b/packages/plugin-ext/src/main/browser/view/tree-views-main.ts index 48d82d4bea1ed..15f3eab001e35 100644 --- a/packages/plugin-ext/src/main/browser/view/tree-views-main.ts +++ b/packages/plugin-ext/src/main/browser/view/tree-views-main.ts @@ -96,7 +96,7 @@ export class TreeViewsMainImpl implements TreeViewsMain, Disposable { } } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async $reveal(treeViewId: string, treeItemId: string): Promise { const viewPanel = await this.viewRegistry.openView(treeViewId); const widget = viewPanel && viewPanel.widgets[0]; diff --git a/packages/plugin-ext/src/main/browser/webview/webview-theme-data-provider.ts b/packages/plugin-ext/src/main/browser/webview/webview-theme-data-provider.ts index e544767c925dc..8afc728f4c060 100644 --- a/packages/plugin-ext/src/main/browser/webview/webview-theme-data-provider.ts +++ b/packages/plugin-ext/src/main/browser/webview/webview-theme-data-provider.ts @@ -82,7 +82,7 @@ export class WebviewThemeDataProvider { protected computeThemeData(): WebviewThemeData { const styles: { [key: string]: string | number; } = {}; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const addStyle = (id: string, rawValue: any) => { if (rawValue) { const value = typeof rawValue === 'number' || typeof rawValue === 'string' ? rawValue : String(rawValue); diff --git a/packages/plugin-ext/src/main/browser/webview/webview.ts b/packages/plugin-ext/src/main/browser/webview/webview.ts index 1e7a84167c5d1..93162847c1e49 100644 --- a/packages/plugin-ext/src/main/browser/webview/webview.ts +++ b/packages/plugin-ext/src/main/browser/webview/webview.ts @@ -49,7 +49,7 @@ import { Endpoint } from '@theia/core/lib/browser/endpoint'; // Style from core const TRANSPARENT_OVERLAY_STYLE = 'theia-transparent-overlay'; -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export const enum WebviewMessageChannels { onmessage = 'onmessage', @@ -92,7 +92,7 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget { protected element: HTMLIFrameElement | undefined; - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len // XXX This is a hack to be able to tack the mouse events when drag and dropping the widgets. // On `mousedown` we put a transparent div over the `iframe` to avoid losing the mouse tacking. protected transparentOverlay: HTMLElement; diff --git a/packages/plugin-ext/src/main/browser/webviews-main.ts b/packages/plugin-ext/src/main/browser/webviews-main.ts index 06185115bcd8b..dd33874d30ae8 100644 --- a/packages/plugin-ext/src/main/browser/webviews-main.ts +++ b/packages/plugin-ext/src/main/browser/webviews-main.ts @@ -175,7 +175,7 @@ export class WebviewsMainImpl implements WebviewsMain, Disposable { }); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async $postMessage(handle: string, value: any): Promise { const webview = await this.getWebview(handle); webview.sendMessage(value); @@ -234,7 +234,7 @@ export class WebviewsMainImpl implements WebviewsMain, Disposable { this.viewColumnService.updateViewColumns(); viewState.position = this.viewColumnService.getViewColumn(widget.id) || 0; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any if (JSONExt.deepEqual(viewState, widget.viewState)) { return; } diff --git a/packages/plugin-ext/src/main/node/handlers/plugin-theia-directory-handler.ts b/packages/plugin-ext/src/main/node/handlers/plugin-theia-directory-handler.ts index 3ffc9af9213aa..d70c6ecaf94ed 100644 --- a/packages/plugin-ext/src/main/node/handlers/plugin-theia-directory-handler.ts +++ b/packages/plugin-ext/src/main/node/handlers/plugin-theia-directory-handler.ts @@ -60,7 +60,7 @@ export class PluginTheiaDirectoryHandler implements PluginDeployerDirectoryHandl } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any handle(context: PluginDeployerDirectoryHandlerContext): Promise { const types: PluginDeployerEntryType[] = []; const packageJson: PluginPackage = context.pluginEntry().getValue('package.json'); diff --git a/packages/plugin-ext/src/main/node/plugin-cli-contribution.ts b/packages/plugin-ext/src/main/node/plugin-cli-contribution.ts index f0bc9749dc51d..a05b1595d0803 100644 --- a/packages/plugin-ext/src/main/node/plugin-cli-contribution.ts +++ b/packages/plugin-ext/src/main/node/plugin-cli-contribution.ts @@ -28,7 +28,7 @@ export class PluginCliContribution implements CliContribution { configure(conf: Argv): void { conf.option(PluginCliContribution.PLUGINS, { - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len description: `Provides further refinement for the plugins. Example: --${PluginCliContribution.PLUGINS}=${LocalDirectoryPluginDeployerResolver.LOCAL_DIR}:path/to/your/plugins`, type: 'string', nargs: 1 diff --git a/packages/plugin-ext/src/main/node/plugin-deployer-entry-impl.ts b/packages/plugin-ext/src/main/node/plugin-deployer-entry-impl.ts index 9b2cf632f4a6f..6c6c86aba6684 100644 --- a/packages/plugin-ext/src/main/node/plugin-deployer-entry-impl.ts +++ b/packages/plugin-ext/src/main/node/plugin-deployer-entry-impl.ts @@ -23,7 +23,7 @@ export class PluginDeployerEntryImpl implements PluginDeployerEntry { private currentPath: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private map: Map; private resolved: boolean; diff --git a/packages/plugin-ext/src/main/node/plugin-deployer-impl.ts b/packages/plugin-ext/src/main/node/plugin-deployer-impl.ts index d4bb7b49e0ebf..644262978a88f 100644 --- a/packages/plugin-ext/src/main/node/plugin-deployer-impl.ts +++ b/packages/plugin-ext/src/main/node/plugin-deployer-impl.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, optional, multiInject, inject } from 'inversify'; import { diff --git a/packages/plugin-ext/src/main/node/plugin-deployer-resolver-context-impl.ts b/packages/plugin-ext/src/main/node/plugin-deployer-resolver-context-impl.ts index 558cdc3231eb5..ebe64670dfb44 100644 --- a/packages/plugin-ext/src/main/node/plugin-deployer-resolver-context-impl.ts +++ b/packages/plugin-ext/src/main/node/plugin-deployer-resolver-context-impl.ts @@ -22,14 +22,14 @@ export class PluginDeployerResolverContextImpl implements PluginDeployerResol /** * Name of the resolver for this context */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private resolverName: any; private pluginEntries: PluginDeployerEntry[]; constructor(resolver: T, private readonly sourceId: string) { this.pluginEntries = []; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.resolverName = (resolver as any).constructor.name; } diff --git a/packages/plugin-ext/src/main/node/plugin-github-resolver.ts b/packages/plugin-ext/src/main/node/plugin-github-resolver.ts index 4a4a7e47f8360..cee6a98a76d04 100644 --- a/packages/plugin-ext/src/main/node/plugin-github-resolver.ts +++ b/packages/plugin-ext/src/main/node/plugin-github-resolver.ts @@ -51,7 +51,6 @@ export class GithubPluginDeployerResolver implements PluginDeployerResolver { return new Promise((resolve, reject) => { // extract data const extracted = /^github:(.*)\/(.*)\/(.*)$/gm.exec(pluginResolverContext.getOriginId()); - if (!extracted || extracted === null || extracted.length !== 4) { reject(new Error('Invalid extension' + pluginResolverContext.getOriginId())); return; @@ -115,7 +114,7 @@ export class GithubPluginDeployerResolver implements PluginDeployerResolver { * Grab the github file specified by the plugin's ID */ protected grabGithubFile(pluginResolverContext: PluginDeployerResolverContext, orgName: string, repoName: string, filename: string, version: string, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any resolve: (value?: void | PromiseLike) => void, reject: (reason?: any) => void): void { const unpackedPath = path.resolve(this.unpackedFolder, path.basename(version + filename)); diff --git a/packages/plugin-ext/src/main/node/resolvers/plugin-local-dir-resolver.ts b/packages/plugin-ext/src/main/node/resolvers/plugin-local-dir-resolver.ts index 23e96a3d57cc2..5d7e001591323 100644 --- a/packages/plugin-ext/src/main/node/resolvers/plugin-local-dir-resolver.ts +++ b/packages/plugin-ext/src/main/node/resolvers/plugin-local-dir-resolver.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { PluginDeployerResolver, PluginDeployerResolverContext } from '../../../common/plugin-protocol'; import { injectable } from 'inversify'; diff --git a/packages/plugin-ext/src/plugin/command-registry.ts b/packages/plugin-ext/src/plugin/command-registry.ts index 307dbc55ffe8d..b18997e5fc224 100644 --- a/packages/plugin-ext/src/plugin/command-registry.ts +++ b/packages/plugin-ext/src/plugin/command-registry.ts @@ -26,11 +26,11 @@ import { Disposable } from './types-impl'; import { DisposableCollection } from '@theia/core'; import { KnownCommands } from '../common/known-commands'; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export type Handler = (...args: any[]) => T | PromiseLike; export interface ArgumentProcessor { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any processArgument(arg: any): any; } @@ -52,7 +52,7 @@ export class CommandRegistryImpl implements CommandRegistryExt { return this.commandsConverter; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any registerCommand(command: theia.CommandDescription, handler?: Handler, thisArg?: any): Disposable { if (this.commands.has(command.id)) { throw new Error(`Command ${command.id} already exist`); @@ -71,13 +71,13 @@ export class CommandRegistryImpl implements CommandRegistryExt { return Disposable.from(...toDispose); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any registerHandler(commandId: string, handler: Handler, thisArg?: any): Disposable { if (this.handlers.has(commandId)) { throw new Error(`Command "${commandId}" already has handler`); } this.proxy.$registerHandler(commandId); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.handlers.set(commandId, (...args: any[]) => handler.apply(thisArg, args)); return Disposable.create(() => { this.handlers.delete(commandId); @@ -89,7 +89,7 @@ export class CommandRegistryImpl implements CommandRegistryExt { throw new Error('Method not implemented.'); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any $executeCommand(id: string, ...args: any[]): PromiseLike { if (this.handlers.has(id)) { return this.executeLocalCommand(id, ...args); @@ -98,7 +98,7 @@ export class CommandRegistryImpl implements CommandRegistryExt { } } - // tslint:disable:no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ executeCommand(id: string, ...args: any[]): PromiseLike { if (this.handlers.has(id)) { return this.executeLocalCommand(id, ...args); @@ -116,7 +116,7 @@ export class CommandRegistryImpl implements CommandRegistryExt { return this.proxy.$getKeyBinding(commandId); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private async executeLocalCommand(id: string, ...args: any[]): Promise { const handler = this.handlers.get(id); if (handler) { @@ -188,7 +188,7 @@ export class CommandsConverter { protected toInternalCommand(external: theia.Command): model.Command { // we're deprecating Command.id, so it has to be optional. // Existing code will have compiled against a non - optional version of the field, so asserting it to exist is ok - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return KnownCommands.map((external.command || external.id)!, external.arguments, (mappedId: string, mappedArgs: any[]) => ({ id: mappedId, @@ -198,7 +198,7 @@ export class CommandsConverter { })); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private executeSafeCommand(...args: any[]): PromiseLike { const command = this.commandsMap.get(args[0]); if (!command || !command.command) { diff --git a/packages/plugin-ext/src/plugin/decorations.ts b/packages/plugin-ext/src/plugin/decorations.ts index 27da4686c5fa2..e0dddf4a147c3 100644 --- a/packages/plugin-ext/src/plugin/decorations.ts +++ b/packages/plugin-ext/src/plugin/decorations.ts @@ -55,7 +55,7 @@ export class DecorationsExtImpl implements DecorationsExt { if (res) { let color; if (res.color) { - // tslint:disable:no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ const ob: any = res.color; color = { id: ob.id }; } diff --git a/packages/plugin-ext/src/plugin/document-data.ts b/packages/plugin-ext/src/plugin/document-data.ts index bec13ce1b5798..10bc1b978410f 100644 --- a/packages/plugin-ext/src/plugin/document-data.ts +++ b/packages/plugin-ext/src/plugin/document-data.ts @@ -362,6 +362,6 @@ export function regExpLeadsToEndlessLoop(regexp: RegExp): boolean { // We check against an empty string. If the regular expression doesn't advance // (e.g. ends in an endless loop) it will match an empty string. const match = regexp.exec(''); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return (match && regexp.lastIndex === 0)!; } diff --git a/packages/plugin-ext/src/plugin/documents.ts b/packages/plugin-ext/src/plugin/documents.ts index 7eb590cfa12c9..4ddb1530d84b3 100644 --- a/packages/plugin-ext/src/plugin/documents.ts +++ b/packages/plugin-ext/src/plugin/documents.ts @@ -120,7 +120,7 @@ export class DocumentsExtImpl implements DocumentsExt { return operations; } - // tslint:disable:no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ protected async fireTextDocumentWillSaveEvent({ document, reason, fireEvent, accept }: { diff --git a/packages/plugin-ext/src/plugin/file-system.ts b/packages/plugin-ext/src/plugin/file-system.ts index d7c6bdcec82da..52e9fd44b149b 100644 --- a/packages/plugin-ext/src/plugin/file-system.ts +++ b/packages/plugin-ext/src/plugin/file-system.ts @@ -85,7 +85,6 @@ export class FileSystemExtImpl implements FileSystemExt { $writeFile(handle: number, resource: UriComponents, content: string, options?: { encoding?: string }): Promise { this.checkProviderExists(handle); - const uri = URI.revive(resource); const encoding = options === null ? undefined : options && options.encoding; const buffer = Buffer.from(content, encoding); diff --git a/packages/plugin-ext/src/plugin/known-commands.spec.ts b/packages/plugin-ext/src/plugin/known-commands.spec.ts index 569fc4f289c05..fb7d1ffcde44e 100644 --- a/packages/plugin-ext/src/plugin/known-commands.spec.ts +++ b/packages/plugin-ext/src/plugin/known-commands.spec.ts @@ -34,7 +34,7 @@ describe('Known Command Conversions', () => { assert.ok(KnownCommands.mapped(commandID)); // when - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any KnownCommands.map(commandID, [uri, position], (mappedID: string, mappedArgs: any[]) => { // then diff --git a/packages/plugin-ext/src/plugin/languages.ts b/packages/plugin-ext/src/plugin/languages.ts index 1fe2d19ea2ac4..bfeaae2a44d56 100644 --- a/packages/plugin-ext/src/plugin/languages.ts +++ b/packages/plugin-ext/src/plugin/languages.ts @@ -149,7 +149,6 @@ export class LanguagesExtImpl implements LanguagesExt { if (wordPattern) { this.documents.setWordDefinitionFor(language, wordPattern); } else { - // tslint:disable-next-line:no-null-keyword this.documents.setWordDefinitionFor(language, null); } @@ -184,7 +183,7 @@ export class LanguagesExtImpl implements LanguagesExt { return callId; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private withAdapter(handle: number, ctor: { new(...args: any[]): A }, callback: (adapter: A) => Promise): Promise { const adapter = this.adaptersMap.get(handle); if (!(adapter instanceof ctor)) { diff --git a/packages/plugin-ext/src/plugin/languages/code-action.ts b/packages/plugin-ext/src/plugin/languages/code-action.ts index ca01bf3f72dff..3b706fd2cf7e8 100644 --- a/packages/plugin-ext/src/plugin/languages/code-action.ts +++ b/packages/plugin-ext/src/plugin/languages/code-action.ts @@ -79,10 +79,10 @@ export class CodeActionAdapter { } else { if (codeActionContext.only) { if (!candidate.kind) { - /* tslint:disable-next-line:max-line-length */ + /* eslint-disable-next-line max-len */ console.warn(`${this.pluginId} - Code actions of kind '${codeActionContext.only.value}' requested but returned code action does not have a 'kind'. Code action will be dropped. Please set 'CodeAction.kind'.`); } else if (!codeActionContext.only.contains(candidate.kind)) { - /* tslint:disable-next-line:max-line-length */ + /* eslint-disable-next-line max-len */ console.warn(`${this.pluginId} - Code actions of kind '${codeActionContext.only.value}' requested but returned code action is of kind '${candidate.kind.value}'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code action.`); } } @@ -100,12 +100,12 @@ export class CodeActionAdapter { return result; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private static _isCommand(smth: any): smth is theia.Command { return typeof (smth).command === 'string' || typeof (smth).id === 'string'; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private static _isSelection(obj: any): obj is Selection { return ( obj diff --git a/packages/plugin-ext/src/plugin/languages/diagnostics.ts b/packages/plugin-ext/src/plugin/languages/diagnostics.ts index ee0ea6e3b80f1..f619e52428602 100644 --- a/packages/plugin-ext/src/plugin/languages/diagnostics.ts +++ b/packages/plugin-ext/src/plugin/languages/diagnostics.ts @@ -126,7 +126,7 @@ export class DiagnosticCollection implements theia.DiagnosticCollection { this.proxy.$clearDiagnostics(this.name); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any forEach(callback: (uri: URI, diagnostics: theia.Diagnostic[], collection: theia.DiagnosticCollection) => any, thisArg?: any): void { this.ensureNotDisposed(); this.diagnostics.forEach((diagnostics, uriString) => { diff --git a/packages/plugin-ext/src/plugin/languages/document-formatting.ts b/packages/plugin-ext/src/plugin/languages/document-formatting.ts index 49c7c2491eef6..1a8cfa6a6b374 100644 --- a/packages/plugin-ext/src/plugin/languages/document-formatting.ts +++ b/packages/plugin-ext/src/plugin/languages/document-formatting.ts @@ -35,7 +35,7 @@ export class DocumentFormattingAdapter { const doc = document.document; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return Promise.resolve(this.provider.provideDocumentFormattingEdits(doc, options, token)).then(value => { if (Array.isArray(value)) { return value.map(Converter.fromTextEdit); diff --git a/packages/plugin-ext/src/plugin/languages/document-highlight.ts b/packages/plugin-ext/src/plugin/languages/document-highlight.ts index a9cb47cfb2737..3e6a426a965c0 100644 --- a/packages/plugin-ext/src/plugin/languages/document-highlight.ts +++ b/packages/plugin-ext/src/plugin/languages/document-highlight.ts @@ -55,7 +55,7 @@ export class DocumentHighlightAdapter { }); } - /* tslint:disable-next-line:no-any */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any private isDocumentHighlightArray(array: any): array is types.DocumentHighlight[] { return Array.isArray(array) && array.length > 0 && array[0] instanceof types.DocumentHighlight; } diff --git a/packages/plugin-ext/src/plugin/languages/hover.ts b/packages/plugin-ext/src/plugin/languages/hover.ts index 5e1b36c2e0507..20a3acfbe2981 100644 --- a/packages/plugin-ext/src/plugin/languages/hover.ts +++ b/packages/plugin-ext/src/plugin/languages/hover.ts @@ -40,7 +40,7 @@ export class HoverAdapter { const pos = Converter.toPosition(position); return Promise.resolve(this.provider.provideHover(doc, pos, token)).then(value => { - /* tslint:disable-next-line:no-any */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any if (!value || !Array.isArray(value.contents) || (value.contents as Array).length === 0) { return undefined; } diff --git a/packages/plugin-ext/src/plugin/languages/on-type-formatting.ts b/packages/plugin-ext/src/plugin/languages/on-type-formatting.ts index 79f33a0a2ac80..5bbd2f91a540f 100644 --- a/packages/plugin-ext/src/plugin/languages/on-type-formatting.ts +++ b/packages/plugin-ext/src/plugin/languages/on-type-formatting.ts @@ -38,7 +38,7 @@ export class OnTypeFormattingAdapter { const doc = document.document; const pos = Converter.toPosition(position); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return Promise.resolve(this.provider.provideOnTypeFormattingEdits(doc, pos, ch, options, token)).then(value => { if (Array.isArray(value)) { return value.map(Converter.fromTextEdit); diff --git a/packages/plugin-ext/src/plugin/languages/range-formatting.ts b/packages/plugin-ext/src/plugin/languages/range-formatting.ts index 8872faafac673..2435f363a576e 100644 --- a/packages/plugin-ext/src/plugin/languages/range-formatting.ts +++ b/packages/plugin-ext/src/plugin/languages/range-formatting.ts @@ -36,7 +36,7 @@ export class RangeFormattingAdapter { const doc = document.document; const ran = Converter.toRange(range); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return Promise.resolve(this.provider.provideDocumentRangeFormattingEdits(doc, ran, options, token)).then(value => { if (Array.isArray(value)) { return value.map(Converter.fromTextEdit); diff --git a/packages/plugin-ext/src/plugin/languages/rename.ts b/packages/plugin-ext/src/plugin/languages/rename.ts index 8beee6ad22bbb..5cb7f176e775e 100644 --- a/packages/plugin-ext/src/plugin/languages/rename.ts +++ b/packages/plugin-ext/src/plugin/languages/rename.ts @@ -117,7 +117,7 @@ export class RenameAdapter { }); } - /* tslint:disable-next-line:no-any */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any private static asMessage(err: any): string | undefined { if (typeof err === 'string') { return err; diff --git a/packages/plugin-ext/src/plugin/languages/util.ts b/packages/plugin-ext/src/plugin/languages/util.ts index a838dacdd2114..d856c9ea2d662 100644 --- a/packages/plugin-ext/src/plugin/languages/util.ts +++ b/packages/plugin-ext/src/plugin/languages/util.ts @@ -17,12 +17,12 @@ import * as theia from '@theia/plugin'; import * as types from '../types-impl'; -/* tslint:disable-next-line:no-any */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function isLocationArray(array: any): array is types.Location[] { return Array.isArray(array) && array.length > 0 && array[0] instanceof types.Location; } -/* tslint:disable-next-line:no-any */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function isDefinitionLinkArray(array: any): array is theia.DefinitionLink[] { return Array.isArray(array) && array.length > 0 && array[0].hasOwnProperty('targetUri') && array[0].hasOwnProperty('targetRange'); } diff --git a/packages/plugin-ext/src/plugin/markdown-string.ts b/packages/plugin-ext/src/plugin/markdown-string.ts index 05b634263fa55..40565527f351a 100644 --- a/packages/plugin-ext/src/plugin/markdown-string.ts +++ b/packages/plugin-ext/src/plugin/markdown-string.ts @@ -46,7 +46,7 @@ export class MarkdownString { } } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function isMarkdownString(thing: any): thing is IMarkdownString { if (thing instanceof MarkdownString) { return true; diff --git a/packages/plugin-ext/src/plugin/node/debug/debug.ts b/packages/plugin-ext/src/plugin/node/debug/debug.ts index e36457a58fd03..fed9f10c12910 100644 --- a/packages/plugin-ext/src/plugin/node/debug/debug.ts +++ b/packages/plugin-ext/src/plugin/node/debug/debug.ts @@ -32,7 +32,7 @@ import { connectDebugAdapter, startDebugAdapter } from './plugin-debug-adapter-s import { PluginDebugAdapterTracker } from './plugin-debug-adapter-tracker'; import uuid = require('uuid'); -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ // TODO: rename file to `debug-ext.ts` @@ -189,7 +189,7 @@ export class DebugExtImpl implements DebugExt { providers.add(provider); return Disposable.create(() => { - // tslint:disable-next-line:no-shadowed-variable + // eslint-disable-next-line no-shadow const providers = this.configurationProviders.get(debugType); if (providers) { providers.delete(provider); diff --git a/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-session.ts b/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-session.ts index 11c3b0866f472..3e0eb502f3e38 100644 --- a/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-session.ts +++ b/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-session.ts @@ -19,7 +19,7 @@ import { DebugAdapterSessionImpl } from '@theia/debug/lib/node/debug-adapter-ses import * as theia from '@theia/plugin'; import { IWebSocket } from 'vscode-ws-jsonrpc/lib/socket/socket'; -// tslint:disable: no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ /** * Server debug adapter session. diff --git a/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-starter.ts b/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-starter.ts index af3f7c513515d..5003ef00446df 100644 --- a/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-starter.ts +++ b/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-starter.ts @@ -23,7 +23,7 @@ import { ChildProcess, spawn, fork } from 'child_process'; * Starts debug adapter process. */ export function startDebugAdapter(executable: theia.DebugAdapterExecutable): CommunicationProvider { - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const options: any = { stdio: ['pipe', 'pipe', 2] }; if (executable.options) { diff --git a/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-tracker.ts b/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-tracker.ts index 5385dd17564aa..72b03dbac36e0 100644 --- a/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-tracker.ts +++ b/packages/plugin-ext/src/plugin/node/debug/plugin-debug-adapter-tracker.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable: no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as theia from '@theia/plugin'; diff --git a/packages/plugin-ext/src/plugin/plugin-context.ts b/packages/plugin-ext/src/plugin/plugin-context.ts index 3c222f9e5323e..14092f170045e 100644 --- a/packages/plugin-ext/src/plugin/plugin-context.ts +++ b/packages/plugin-ext/src/plugin/plugin-context.ts @@ -14,7 +14,8 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* tslint:disable:typedef */ import * as theia from '@theia/plugin'; import { CommandRegistryImpl } from './command-registry'; @@ -176,11 +177,11 @@ export function createAPIFactory( return function (plugin: InternalPlugin): typeof theia { const commands: typeof theia.commands = { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any registerCommand(command: theia.CommandDescription, handler?: (...args: any[]) => T | Thenable, thisArg?: any): Disposable { return commandRegistry.registerCommand(command, handler, thisArg); }, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any executeCommand(commandId: string, ...args: any[]): PromiseLike { return commandRegistry.executeCommand(commandId, ...args); }, @@ -204,7 +205,7 @@ export function createAPIFactory( }); }); }, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any registerHandler(commandId: string, handler: (...args: any[]) => any, thisArg?: any): Disposable { return commandRegistry.registerHandler(commandId, handler, thisArg); }, @@ -239,27 +240,21 @@ export function createAPIFactory( return terminalExt.terminals; }, onDidChangeActiveTerminal, - // tslint:disable-next-line:typedef onDidChangeActiveTextEditor(listener, thisArg?, disposables?) { return editors.onDidChangeActiveTextEditor(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidChangeVisibleTextEditors(listener, thisArg?, disposables?) { return editors.onDidChangeVisibleTextEditors(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidChangeTextEditorSelection(listener, thisArg?, disposables?) { return editors.onDidChangeTextEditorSelection(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidChangeTextEditorOptions(listener, thisArg?, disposables?) { return editors.onDidChangeTextEditorOptions(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidChangeTextEditorViewColumn(listener, thisArg?, disposables?) { return editors.onDidChangeTextEditorViewColumn(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidChangeTextEditorVisibleRanges(listener, thisArg?, disposables?) { return editors.onDidChangeTextEditorVisibleRanges(listener, thisArg, disposables); }, @@ -293,7 +288,7 @@ export function createAPIFactory( throw new Error(`Failed to show text document ${documentArg.toString()}`); } }, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any showQuickPick(items: any, options: theia.QuickPickOptions, token?: theia.CancellationToken): any { if (token) { const coreEvent = Object.assign(token.onCancellationRequested, { maxListeners: 0 }); @@ -321,7 +316,7 @@ export function createAPIFactory( showUploadDialog(options: theia.UploadDialogOptions): PromiseLike { return dialogsExt.showUploadDialog(options); }, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any setStatusBarMessage(text: string, arg?: number | PromiseLike): Disposable { return statusBarMessageRegistryExt.setStatusBarMessage(text, arg); }, @@ -403,23 +398,18 @@ export function createAPIFactory( get textDocuments(): theia.TextDocument[] { return documents.getAllDocumentData().map(data => data.document); }, - // tslint:disable-next-line:typedef onDidChangeTextDocument(listener, thisArg?, disposables?) { return documents.onDidChangeDocument(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidCloseTextDocument(listener, thisArg?, disposables?) { return documents.onDidRemoveDocument(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidOpenTextDocument(listener, thisArg?, disposables?) { return documents.onDidAddDocument(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onWillSaveTextDocument(listener, thisArg?, disposables?) { return documents.onWillSaveTextDocument(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidSaveTextDocument(listener, thisArg?, disposables?) { return documents.onDidSaveTextDocument(listener, thisArg, disposables); }, @@ -542,9 +532,8 @@ export function createAPIFactory( get onDidChangeDiagnostics(): theia.Event { return languagesExt.onDidChangeDiagnostics; }, - // tslint:disable-next-line:typedef getDiagnostics(resource?: Uri) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return languagesExt.getDiagnostics(resource); }, createDiagnosticCollection(name?: string): theia.DiagnosticCollection { @@ -633,11 +622,11 @@ export function createAPIFactory( }; const plugins: typeof theia.plugins = { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any get all(): theia.Plugin[] { return pluginManager.getAllPlugins().map(plg => new Plugin(pluginManager, plg)); }, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any getPlugin(pluginId: string): theia.Plugin | undefined { const plg = pluginManager.getPluginById(pluginId.toLowerCase()); if (plg) { @@ -714,19 +703,15 @@ export function createAPIFactory( get taskExecutions(): ReadonlyArray { return tasksExt.taskExecutions; }, - // tslint:disable-next-line:typedef onDidStartTask(listener, thisArg?, disposables?) { return tasksExt.onDidStartTask(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidEndTask(listener, thisArg?, disposables?) { return tasksExt.onDidEndTask(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidStartTaskProcess(listener, thisArg?, disposables?) { return tasksExt.onDidStartTaskProcess(listener, thisArg, disposables); }, - // tslint:disable-next-line:typedef onDidEndTaskProcess(listener, thisArg?, disposables?) { return tasksExt.onDidEndTaskProcess(listener, thisArg, disposables); } @@ -870,7 +855,7 @@ export function createAPIFactory( class Plugin implements theia.Plugin { id: string; pluginPath: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any packageJSON: any; pluginType: theia.PluginType; constructor(private readonly pluginManager: PluginManager, plugin: InternalPlugin) { diff --git a/packages/plugin-ext/src/plugin/plugin-manager.ts b/packages/plugin-ext/src/plugin/plugin-manager.ts index 704fea2f167e4..9f0f8a299900c 100644 --- a/packages/plugin-ext/src/plugin/plugin-manager.ts +++ b/packages/plugin-ext/src/plugin/plugin-manager.ts @@ -43,7 +43,7 @@ import { WebviewsExtImpl } from './webviews'; export interface PluginHost { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any loadPlugin(plugin: Plugin): any; init(data: PluginMetadata[]): Promise<[Plugin[], Plugin[]]> | [Plugin[], Plugin[]]; @@ -268,7 +268,7 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager { } } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private async startPlugin(plugin: Plugin, configStorage: ConfigStorage, pluginMain: any): Promise { const subscriptions: theia.Disposable[] = []; const asAbsolutePath = (relativePath: string): string => join(plugin.pluginFolder, relativePath); @@ -368,6 +368,5 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager { // for electron function getGlobal(): Window | NodeJS.Global | null { - // tslint:disable-next-line:no-null-keyword return typeof self === 'undefined' ? typeof global === 'undefined' ? null : global : self; } diff --git a/packages/plugin-ext/src/plugin/plugin-storage.ts b/packages/plugin-ext/src/plugin/plugin-storage.ts index b817e073829d9..b39d5bcf0c17a 100644 --- a/packages/plugin-ext/src/plugin/plugin-storage.ts +++ b/packages/plugin-ext/src/plugin/plugin-storage.ts @@ -49,7 +49,7 @@ export class Memento implements theia.Memento { } } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any update(key: string, value: any): Promise { this.cache[key] = value; return this.storage.setPerPluginData(this.pluginId, this.cache, this.isPluginGlobalData).then(_ => undefined); diff --git a/packages/plugin-ext/src/plugin/preference-registry.ts b/packages/plugin-ext/src/plugin/preference-registry.ts index 3d50d8915c419..cf6facdf32a51 100644 --- a/packages/plugin-ext/src/plugin/preference-registry.ts +++ b/packages/plugin-ext/src/plugin/preference-registry.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -/* tslint:disable:no-any */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { Emitter, Event } from '@theia/core/lib/common/event'; import * as theia from '@theia/plugin'; @@ -52,7 +52,7 @@ interface ConfigurationInspect { workspaceFolderValue?: T; } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function lookUp(tree: any, key: string): any { if (!key) { return; diff --git a/packages/plugin-ext/src/plugin/preferences/configuration.ts b/packages/plugin-ext/src/plugin/preferences/configuration.ts index 55a44b84ca0d0..97d07a6839a1e 100644 --- a/packages/plugin-ext/src/plugin/preferences/configuration.ts +++ b/packages/plugin-ext/src/plugin/preferences/configuration.ts @@ -19,7 +19,7 @@ import { isObject } from '../../common/types'; import cloneDeep = require('lodash.clonedeep'); import URI from 'vscode-uri'; -/* tslint:disable:no-any */ +/* eslint-disable @typescript-eslint/no-explicit-any */ export class Configuration { diff --git a/packages/plugin-ext/src/plugin/quick-open.ts b/packages/plugin-ext/src/plugin/quick-open.ts index 085c5667e5f07..17d1864a18951 100644 --- a/packages/plugin-ext/src/plugin/quick-open.ts +++ b/packages/plugin-ext/src/plugin/quick-open.ts @@ -54,10 +54,10 @@ export class QuickOpenExtImpl implements QuickOpenExt { } showQuickPick(promiseOrItems: QuickPickItem[] | PromiseLike, options?: QuickPickOptions, token?: CancellationToken): PromiseLike; - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len showQuickPick(promiseOrItems: QuickPickItem[] | PromiseLike, options?: QuickPickOptions & { canSelectMany: true; }, token?: CancellationToken): PromiseLike; showQuickPick(promiseOrItems: string[] | PromiseLike, options?: QuickPickOptions, token?: CancellationToken): PromiseLike; - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len showQuickPick(promiseOrItems: Item[] | PromiseLike, options?: QuickPickOptions, token: CancellationToken = CancellationToken.None): PromiseLike { this.selectItemHandler = undefined; const itemPromise = Promise.resolve(promiseOrItems); diff --git a/packages/plugin-ext/src/plugin/scm.ts b/packages/plugin-ext/src/plugin/scm.ts index ed8b0b2fcc7e1..0e33b3444d993 100644 --- a/packages/plugin-ext/src/plugin/scm.ts +++ b/packages/plugin-ext/src/plugin/scm.ts @@ -34,7 +34,7 @@ export class ScmExtImpl implements ScmExt { constructor(readonly rpc: RPCProtocol, private readonly commands: CommandRegistryImpl) { this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.SCM_MAIN); commands.registerArgumentProcessor({ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any processArgument: (arg: any) => { if (!ScmCommandArg.is(arg)) { return arg; @@ -85,7 +85,7 @@ export class ScmExtImpl implements ScmExt { const sourceControl = this.sourceControlMap.get(sourceControlHandle); console.log(sourceControl); if (sourceControl && sourceControl.quickDiffProvider && sourceControl.quickDiffProvider.provideOriginalResource) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const newUri: any = new URI(uri); newUri.fsPath = uri; return sourceControl.quickDiffProvider.provideOriginalResource(newUri, token); @@ -343,7 +343,7 @@ class SourceControlResourceGroupImpl implements theia.SourceControlResourceGroup decorations = { strikeThrough, faded, tooltip, iconPath }; } this.resourceStatesMap.set(handle, resourceState); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const resource: any = resourceState; return { handle, resourceUri: resourceState.resourceUri.path, command: resourceCommand, decorations, letter: resource.letter, colorId: resource.color.id }; })); diff --git a/packages/plugin-ext/src/plugin/status-bar-message-registry.ts b/packages/plugin-ext/src/plugin/status-bar-message-registry.ts index a8183b4af6be6..6a7bee16e9013 100644 --- a/packages/plugin-ext/src/plugin/status-bar-message-registry.ts +++ b/packages/plugin-ext/src/plugin/status-bar-message-registry.ts @@ -38,10 +38,10 @@ export class StatusBarMessageRegistryExt { } // copied from https://github.com/Microsoft/vscode/blob/6c8f02b41db9ae5c4d15df767d47755e5c73b9d5/src/vs/workbench/api/node/extHostStatusBar.ts#L174 - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any setStatusBarMessage(text: string, timeoutOrThenable?: number | PromiseLike): Disposable { const d = this.statusMessage.setMessage(text); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let handle: any; if (typeof timeoutOrThenable === 'number') { diff --git a/packages/plugin-ext/src/plugin/text-editor.ts b/packages/plugin-ext/src/plugin/text-editor.ts index 8c9499eb722a3..3109637fa3421 100644 --- a/packages/plugin-ext/src/plugin/text-editor.ts +++ b/packages/plugin-ext/src/plugin/text-editor.ts @@ -133,7 +133,7 @@ export class TextEditorExt implements theia.TextEditor { this._viewColumn = value; } - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len edit(callback: (editBuilder: theia.TextEditorEdit) => void, options: { undoStopBefore: boolean; undoStopAfter: boolean; } = { undoStopBefore: true, undoStopAfter: true }): Promise { if (this.disposed) { return Promise.reject(new Error('TextEditor#edit not possible on closed editor')); @@ -143,7 +143,7 @@ export class TextEditorExt implements theia.TextEditor { callback(edit); return this.applyEdit(edit); } - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len insertSnippet(snippet: SnippetString, location?: Position | Range | Position[] | Range[], options: { undoStopBefore: boolean; undoStopAfter: boolean; } = { undoStopBefore: true, undoStopAfter: true }): Promise { if (this.disposed) { return Promise.reject(new Error('TextEditor#insertSnippet not possible on closed editors')); @@ -249,7 +249,7 @@ export class TextEditorExt implements theia.TextEditor { }); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private runOnProxy(callback: () => Promise): Promise { if (this.disposed) { console.warn('TextEditor is disposed!'); @@ -503,7 +503,7 @@ export class TextEditorEdit { } } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function warnOnError(promise: Promise): void { promise.then(undefined, err => { console.warn(err); diff --git a/packages/plugin-ext/src/plugin/text-editors.ts b/packages/plugin-ext/src/plugin/text-editors.ts index e120addcd2ed4..c0ba52d917dd7 100644 --- a/packages/plugin-ext/src/plugin/text-editors.ts +++ b/packages/plugin-ext/src/plugin/text-editors.ts @@ -140,7 +140,7 @@ export class TextEditorDecorationType implements theia.TextEditorDecorationType constructor(proxy: TextEditorsMain, options: theia.DecorationRenderOptions) { this.key = TextEditorDecorationType.Keys.nextId(); this.proxy = proxy; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.proxy.$registerTextEditorDecorationType(this.key, Converters.DecorationRenderOptions.from(options)); } diff --git a/packages/plugin-ext/src/plugin/tree/tree-views.ts b/packages/plugin-ext/src/plugin/tree/tree-views.ts index 4ee502b7faffd..84cb45a238e69 100644 --- a/packages/plugin-ext/src/plugin/tree/tree-views.ts +++ b/packages/plugin-ext/src/plugin/tree/tree-views.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { TreeDataProvider, TreeView, TreeViewExpansionEvent, TreeItem2, TreeItemLabel, @@ -69,30 +69,26 @@ export class TreeViewsExtImpl implements TreeViewsExt { this.treeViews.set(treeViewId, treeView); return { - // tslint:disable-next-line:typedef + // tslint:disable:typedef get onDidExpandElement() { return treeView.onDidExpandElement; }, - // tslint:disable-next-line:typedef get onDidCollapseElement() { return treeView.onDidCollapseElement; }, - // tslint:disable-next-line:typedef get selection() { return treeView.selectedElements; }, - // tslint:disable-next-line:typedef get onDidChangeSelection() { return treeView.onDidChangeSelection; }, - // tslint:disable-next-line:typedef get visible() { return treeView.visible; }, - // tslint:disable-next-line:typedef get onDidChangeVisibility() { return treeView.onDidChangeVisibility; }, + // tslint:enable:typedef reveal: (element: T, selectionOptions: { select?: boolean }): Thenable => treeView.reveal(element, selectionOptions), diff --git a/packages/plugin-ext/src/plugin/type-converters.ts b/packages/plugin-ext/src/plugin/type-converters.ts index 8198967c3dfd6..5d69adaac842c 100644 --- a/packages/plugin-ext/src/plugin/type-converters.ts +++ b/packages/plugin-ext/src/plugin/type-converters.ts @@ -18,7 +18,10 @@ import * as theia from '@theia/plugin'; import { Position as P, Range as R, SymbolInformation, SymbolKind as S } from 'vscode-languageserver-types'; import URI from 'vscode-uri'; import * as rpc from '../common/plugin-api-rpc'; -import { DecorationOptions, EditorPosition, PickOpenItem, Plugin, Position, ResourceFileEditDto, ResourceTextEditDto, Selection, TaskDto, WorkspaceEditDto } from '../common/plugin-api-rpc'; +import { + DecorationOptions, EditorPosition, PickOpenItem, Plugin, Position, ResourceFileEditDto, + ResourceTextEditDto, Selection, TaskDto, WorkspaceEditDto +} from '../common/plugin-api-rpc'; import * as model from '../common/plugin-api-rpc-model'; import { LanguageFilter, LanguageSelector, RelativePattern } from './languages'; import { isMarkdownString, MarkdownString } from './markdown-string'; @@ -135,7 +138,7 @@ export function toPosition(position: Position): types.Position { return new types.Position(position.lineNumber - 1, position.column - 1); } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function isDecorationOptions(something: any): something is theia.DecorationOptions { return (typeof something.range !== 'undefined'); } @@ -162,7 +165,7 @@ export function fromRangeOrRangeWithMessage(ranges: theia.Range[] | theia.Decora return { range: fromRange(r.range)!, hoverMessage: hoverMessage, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any renderOptions: /* URI vs Uri */r.renderOptions }; }); @@ -183,7 +186,7 @@ interface Codeblock { value: string; } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function isCodeblock(thing: any): thing is Codeblock { return thing && typeof thing === 'object' && typeof (thing).language === 'string' @@ -495,7 +498,7 @@ export namespace SignatureHelp { } } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function fromWorkspaceEdit(value: theia.WorkspaceEdit, documents?: any): WorkspaceEditDto { const result: WorkspaceEditDto = { edits: [] @@ -515,7 +518,6 @@ export function fromWorkspaceEdit(value: theia.WorkspaceEdit, documents?: any): } export namespace SymbolKind { - // tslint:disable-next-line:no-null-keyword const fromMapping: { [kind: number]: model.SymbolKind } = Object.create(null); fromMapping[model.SymbolKind.File] = model.SymbolKind.File; fromMapping[model.SymbolKind.Module] = model.SymbolKind.Module; @@ -749,9 +751,9 @@ export function getShellArgs(args: undefined | (string | theia.ShellQuotedString return result; } -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function getShellExecutionOptions(options: theia.ShellExecutionOptions): { [key: string]: any } { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const result = {} as { [key: string]: any }; const env = options.env; diff --git a/packages/plugin-ext/src/plugin/types-impl.ts b/packages/plugin-ext/src/plugin/types-impl.ts index f2a730f123965..71d19abc07c69 100644 --- a/packages/plugin-ext/src/plugin/types-impl.ts +++ b/packages/plugin-ext/src/plugin/types-impl.ts @@ -19,6 +19,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +/* eslint-disable no-null/no-null */ + import { UUID } from '@phosphor/coreutils/lib/uuid'; import { illegalArgument } from '../common/errors'; import * as theia from '@theia/plugin'; @@ -32,7 +34,7 @@ import { SymbolKind } from '../common/plugin-api-rpc-model'; export class Disposable { private disposable: undefined | (() => void); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any static from(...disposables: { dispose(): any }[]): Disposable { return new Disposable(() => { if (disposables) { @@ -716,7 +718,7 @@ export enum CompletionItemKind { Enum = 12, Keyword = 13, Snippet = 14, - Color = 15, + Color = 15, // eslint-disable-line no-shadow File = 16, Reference = 17, Folder = 18, @@ -1132,7 +1134,7 @@ export class WorkspaceEdit implements theia.WorkspaceEdit { return this.entries().length; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJSON(): any { return this.entries(); } @@ -1203,7 +1205,7 @@ export class SymbolInformation { SymbolInformation.validate(this); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJSON(): any { return { name: this.name, @@ -1620,7 +1622,7 @@ export class Task { problemMatchers?: string | string[], ); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(...args: any[]) { let taskDefinition: theia.TaskDefinition; let scope: theia.WorkspaceFolder | theia.TaskScope.Global | theia.TaskScope.Workspace | undefined; diff --git a/packages/plugin-ext/src/plugin/webviews.ts b/packages/plugin-ext/src/plugin/webviews.ts index eeda7354eb984..8c2a385f91262 100644 --- a/packages/plugin-ext/src/plugin/webviews.ts +++ b/packages/plugin-ext/src/plugin/webviews.ts @@ -46,7 +46,7 @@ export class WebviewsExtImpl implements WebviewsExt { this.initData = initData; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any $onMessage(handle: string, message: any): void { const panel = this.getWebviewPanel(handle); if (panel) { @@ -76,7 +76,7 @@ export class WebviewsExtImpl implements WebviewsExt { $deserializeWebviewPanel(viewId: string, viewType: string, title: string, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any state: any, viewState: WebviewPanelViewState, options: theia.WebviewOptions & theia.WebviewPanelOptions): PromiseLike { @@ -148,10 +148,10 @@ export class WebviewImpl implements theia.Webview { private _html: string; private _options: theia.WebviewOptions; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any public readonly onMessageEmitter = new Emitter(); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any public readonly onDidReceiveMessage: Event = this.onMessageEmitter.event; constructor( @@ -210,7 +210,7 @@ export class WebviewImpl implements theia.Webview { this._options = newOptions; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any postMessage(message: any): PromiseLike { this.checkIsDisposed(); return this.proxy.$postMessage(this.viewId, message); @@ -378,7 +378,7 @@ export class WebviewPanelImpl implements theia.WebviewPanel { }); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any postMessage(message: any): PromiseLike { this.checkIsDisposed(); return this.proxy.$postMessage(this.viewId, message); diff --git a/packages/plugin-ext/src/plugin/workspace.ts b/packages/plugin-ext/src/plugin/workspace.ts index afec4016678b4..3cdc769925ddf 100644 --- a/packages/plugin-ext/src/plugin/workspace.ts +++ b/packages/plugin-ext/src/plugin/workspace.ts @@ -362,7 +362,7 @@ export class WorkspaceExtImpl implements WorkspaceExt { this.workspaceDidRenameFileEmitter.fire(Object.freeze({ oldUri: URI.revive(event.oldUri), newUri: URI.revive(event.newUri) })); } - /* tslint:disable-next-line:no-any */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any $onWillRename(event: FileWillMoveEvent): Promise { return this.workspaceWillRenameFileEmitter.fire({ oldUri: URI.revive(event.oldUri), diff --git a/packages/plugin-ext/src/typings/index.d.ts b/packages/plugin-ext/src/typings/index.d.ts index 0b503cf3f8a91..1d71b1feeede4 100644 --- a/packages/plugin-ext/src/typings/index.d.ts +++ b/packages/plugin-ext/src/typings/index.d.ts @@ -14,6 +14,8 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ +/* eslint-disable @typescript-eslint/no-explicit-any */ + declare module 'macaddress' { export type MacAddresCallback = (err: any, data: any) => void; export type MacAddressOneCallback = (err: any, mac: string) => void; diff --git a/packages/plugin-metrics/.eslintrc.js b/packages/plugin-metrics/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/plugin-metrics/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/plugin-metrics/compile.tsconfig.json b/packages/plugin-metrics/compile.tsconfig.json index a23513b5e6b13..695df6b7e0c0d 100644 --- a/packages/plugin-metrics/compile.tsconfig.json +++ b/packages/plugin-metrics/compile.tsconfig.json @@ -1,10 +1,28 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../metrics/compile.tsconfig.json" + }, + { + "path": "../plugin/compile.tsconfig.json" + }, + { + "path": "../plugin-ext/compile.tsconfig.json" + } ] } diff --git a/packages/plugin-metrics/package.json b/packages/plugin-metrics/package.json index 3316d40c10186..a7eac93cde61b 100644 --- a/packages/plugin-metrics/package.json +++ b/packages/plugin-metrics/package.json @@ -36,10 +36,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/plugin-metrics/src/browser/plugin-metrics-resolver.ts b/packages/plugin-metrics/src/browser/plugin-metrics-resolver.ts index abc4f67957de4..01ca37bc1dc2e 100644 --- a/packages/plugin-metrics/src/browser/plugin-metrics-resolver.ts +++ b/packages/plugin-metrics/src/browser/plugin-metrics-resolver.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, inject } from 'inversify'; import { PluginMetricsCreator } from './plugin-metrics-creator'; diff --git a/packages/plugin/.eslintrc.js b/packages/plugin/.eslintrc.js new file mode 100644 index 0000000000000..0b12829bbb1e5 --- /dev/null +++ b/packages/plugin/.eslintrc.js @@ -0,0 +1,12 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + ignorePatterns: [ + 'src/theia.d.ts' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/plugin/compile.tsconfig.json b/packages/plugin/compile.tsconfig.json index 797c60148d07b..2e73fc348ff58 100644 --- a/packages/plugin/compile.tsconfig.json +++ b/packages/plugin/compile.tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "lib": [ @@ -11,5 +12,6 @@ }, "include": [ "src" - ] -} \ No newline at end of file + ], + "references": [] +} diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 4bb12a292612c..73e480d5e8798 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -19,10 +19,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/preferences/.eslintrc.js b/packages/preferences/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/preferences/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/preferences/compile.tsconfig.json b/packages/preferences/compile.tsconfig.json index b8b72b49c8822..288616ec65f18 100644 --- a/packages/preferences/compile.tsconfig.json +++ b/packages/preferences/compile.tsconfig.json @@ -1,10 +1,34 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../json/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + }, + { + "path": "../userstorage/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/preferences/package.json b/packages/preferences/package.json index a9171ae05432c..40bf2f565e46d 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -37,10 +37,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/preferences/src/browser/abstract-resource-preference-provider.ts b/packages/preferences/src/browser/abstract-resource-preference-provider.ts index 91fa0d8a539a5..81ef6222cf3ce 100644 --- a/packages/preferences/src/browser/abstract-resource-preference-provider.ts +++ b/packages/preferences/src/browser/abstract-resource-preference-provider.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as jsoncparser from 'jsonc-parser'; import { JSONExt } from '@phosphor/coreutils/lib/json'; @@ -148,11 +148,11 @@ export abstract class AbstractResourcePreferenceProvider extends PreferenceProvi if (typeof jsonData !== 'object') { return preferences; } - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const preferenceName in jsonData) { const preferenceValue = jsonData[preferenceName]; if (this.schemaProvider.testOverrideValue(preferenceName, preferenceValue)) { - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const overriddenPreferenceName in preferenceValue) { const overriddenValue = preferenceValue[overriddenPreferenceName]; preferences[`${preferenceName}.${overriddenPreferenceName}`] = overriddenValue; diff --git a/packages/preferences/src/browser/folders-preferences-provider.ts b/packages/preferences/src/browser/folders-preferences-provider.ts index 4630aa6e1fdd6..48a3014decbd2 100644 --- a/packages/preferences/src/browser/folders-preferences-provider.ts +++ b/packages/preferences/src/browser/folders-preferences-provider.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { inject, injectable, postConstruct } from 'inversify'; import URI from '@theia/core/lib/common/uri'; diff --git a/packages/preferences/src/browser/monaco.d.ts b/packages/preferences/src/browser/monaco.d.ts index ad8ef7c744a72..c00ec81986742 100644 --- a/packages/preferences/src/browser/monaco.d.ts +++ b/packages/preferences/src/browser/monaco.d.ts @@ -1 +1 @@ -/// \ No newline at end of file +/// diff --git a/packages/preferences/src/browser/preferences-decorator.ts b/packages/preferences/src/browser/preferences-decorator.ts index 2c11c39b5c7cb..00ce44b3a4ef5 100644 --- a/packages/preferences/src/browser/preferences-decorator.ts +++ b/packages/preferences/src/browser/preferences-decorator.ts @@ -74,7 +74,7 @@ export class PreferencesDecorator implements TreeDecorator { this.fireDidChangeDecorations(this.preferences); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private getPreferenceDisplayValue(storedValue: any, defaultValue: any): any { if (storedValue !== undefined) { if (typeof storedValue === 'string') { diff --git a/packages/preferences/src/browser/preferences-menu-factory.ts b/packages/preferences/src/browser/preferences-menu-factory.ts index 5638058f49cff..db06d89545e4a 100644 --- a/packages/preferences/src/browser/preferences-menu-factory.ts +++ b/packages/preferences/src/browser/preferences-menu-factory.ts @@ -23,7 +23,7 @@ import { PreferenceDataProperty } from '@theia/core/lib/browser'; @injectable() export class PreferencesMenuFactory { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any createPreferenceContextMenu(id: string, savedPreference: any, property: PreferenceDataProperty, execute: (property: string, value: any) => void): Menu { const commands = new CommandRegistry(); const menu = new Menu({ commands }); diff --git a/packages/preferences/src/browser/workspace-file-preference-provider.ts b/packages/preferences/src/browser/workspace-file-preference-provider.ts index d0c4f3332b6fd..37b79d9a15eed 100644 --- a/packages/preferences/src/browser/workspace-file-preference-provider.ts +++ b/packages/preferences/src/browser/workspace-file-preference-provider.ts @@ -41,7 +41,7 @@ export class WorkspaceFilePreferenceProvider extends AbstractResourcePreferenceP return this.options.workspaceUri; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected parse(content: string): any { const data = super.parse(content); if (WorkspaceData.is(data)) { diff --git a/packages/preferences/src/browser/workspace-preference-provider.ts b/packages/preferences/src/browser/workspace-preference-provider.ts index d3cdd9fd58033..49d4071f1edf5 100644 --- a/packages/preferences/src/browser/workspace-preference-provider.ts +++ b/packages/preferences/src/browser/workspace-preference-provider.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { inject, injectable, postConstruct, named } from 'inversify'; import URI from '@theia/core/lib/common/uri'; diff --git a/packages/preview/.eslintrc.js b/packages/preview/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/preview/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/preview/compile.tsconfig.json b/packages/preview/compile.tsconfig.json index 4c867a02d2696..e13e015786bad 100644 --- a/packages/preview/compile.tsconfig.json +++ b/packages/preview/compile.tsconfig.json @@ -1,11 +1,26 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "baseUrl": "." }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../mini-browser/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/preview/package.json b/packages/preview/package.json index ca864a70b7553..f43f60d0070b1 100644 --- a/packages/preview/package.json +++ b/packages/preview/package.json @@ -39,10 +39,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/preview/src/browser/markdown/markdown-preview-handler.spec.ts b/packages/preview/src/browser/markdown/markdown-preview-handler.spec.ts index 3e681caa3ada2..01bf61e9bfaeb 100644 --- a/packages/preview/src/browser/markdown/markdown-preview-handler.spec.ts +++ b/packages/preview/src/browser/markdown/markdown-preview-handler.spec.ts @@ -31,7 +31,7 @@ let previewHandler: MarkdownPreviewHandler; before(() => { previewHandler = new MarkdownPreviewHandler(); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (previewHandler as any).linkNormalizer = { normalizeLink: (documentUri: URI, link: string) => 'endpoint/' + documentUri.parent.resolve(link).path.toString().substr(1) @@ -194,7 +194,7 @@ function mockOffsetProperties(): void { get: () => 0 }, offsetTop: { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any get: function (): any { const element = this as HTMLElement; const line = Number.parseInt(element.getAttribute('data-line') || '0'); diff --git a/packages/preview/src/browser/preview-contribution.ts b/packages/preview/src/browser/preview-contribution.ts index 7261ca9e647a7..b735b33736a07 100644 --- a/packages/preview/src/browser/preview-contribution.ts +++ b/packages/preview/src/browser/preview-contribution.ts @@ -50,7 +50,7 @@ export interface PreviewOpenerOptions extends WidgetOpenerOptions { } @injectable() -// tslint:disable-next-line:max-line-length +// eslint-disable-next-line max-len export class PreviewContribution extends NavigatableWidgetOpenHandler implements CommandContribution, MenuContribution, FrontendApplicationContribution, TabBarToolbarContribution { readonly id = PreviewUri.id; diff --git a/packages/process/.eslintrc.js b/packages/process/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/process/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/process/compile.tsconfig.json b/packages/process/compile.tsconfig.json index d62fc353c9c7b..8e1f7e1cf5fcf 100644 --- a/packages/process/compile.tsconfig.json +++ b/packages/process/compile.tsconfig.json @@ -1,11 +1,17 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib", "strictFunctionTypes": true }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + } ] } diff --git a/packages/process/package.json b/packages/process/package.json index 9117f96bd07de..47f3d8e7f896c 100644 --- a/packages/process/package.json +++ b/packages/process/package.json @@ -32,10 +32,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/process/src/node/dev-null-stream.ts b/packages/process/src/node/dev-null-stream.ts index 024b1774b76d2..91c5aec3eae7f 100644 --- a/packages/process/src/node/dev-null-stream.ts +++ b/packages/process/src/node/dev-null-stream.ts @@ -35,13 +35,13 @@ export class DevNullStream extends stream.Duplex { } } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any _write(chunk: any, encoding: string, callback: (err?: Error) => void): void { callback(); } _read(size: number): void { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null this.push(null); } } diff --git a/packages/process/src/node/multi-ring-buffer.spec.ts b/packages/process/src/node/multi-ring-buffer.spec.ts index 6cf4692397d5f..51991c2cd05ca 100644 --- a/packages/process/src/node/multi-ring-buffer.spec.ts +++ b/packages/process/src/node/multi-ring-buffer.spec.ts @@ -25,7 +25,7 @@ describe('MultiRingBuffer', function (): void { const size = 2; const compareTo = Buffer.from('0000', 'hex'); const ringBuffer = new MultiRingBuffer({ size }); - // tslint:disable-next-line:no-unused-expression + // eslint-disable-next-line no-unused-expressions expect(ringBuffer['buffer'].equals(compareTo)).to.be.true; }); diff --git a/packages/process/src/node/process.ts b/packages/process/src/node/process.ts index 25faf89334831..f00a5437f893f 100644 --- a/packages/process/src/node/process.ts +++ b/packages/process/src/node/process.ts @@ -60,7 +60,7 @@ export interface ProcessOptions { readonly command: string, args?: T[], options?: { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any } } @@ -192,7 +192,7 @@ export abstract class Process { this.logger.error(error); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected isForkOptions(options: any): options is ForkOptions { return !!options && !!options.modulePath; } diff --git a/packages/process/src/node/terminal-process.spec.ts b/packages/process/src/node/terminal-process.spec.ts index 8caa9dfe0c4c0..93c836f295cfe 100644 --- a/packages/process/src/node/terminal-process.spec.ts +++ b/packages/process/src/node/terminal-process.spec.ts @@ -121,7 +121,7 @@ if (process.platform !== 'win32' || process.env.THEIA_PROCESS_TEST_OVERRIDE) { output: string; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async function checkOutput(proc: TerminalProcess, pattern?: RegExp): Promise { return new Promise((resolve, reject) => { let output = ''; diff --git a/packages/process/src/node/terminal-process.ts b/packages/process/src/node/terminal-process.ts index b557709df98f2..7a7e20ae3166b 100644 --- a/packages/process/src/node/terminal-process.ts +++ b/packages/process/src/node/terminal-process.ts @@ -43,7 +43,7 @@ export const ShellQuoting = { * Map of `Runtime (string) -> ShellQuoting`, trying to cover the * different ways in which each runtime manages quoting and escaping. */ -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const RuntimeQuotingMap: { [key in string]: RuntimeQuotingTypes | undefined } = { 'bash': ShellQuoting, 'sh': ShellQuoting, diff --git a/packages/process/src/node/utils.ts b/packages/process/src/node/utils.ts index a912fb29952e9..9c0603fae251e 100644 --- a/packages/process/src/node/utils.ts +++ b/packages/process/src/node/utils.ts @@ -30,12 +30,12 @@ export function parseArgs(line: string | undefined): string[] { } // Polyfill for Object.entries, until we upgrade to ES2017. -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function objectEntries(obj: any): any[] { const props = Object.keys(obj); const result = new Array(props.length); for (let i = 0; i < props.length; i++) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any result[i] = [props[i], obj[props[i]]]; } diff --git a/packages/python/.eslintrc.js b/packages/python/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/python/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/python/compile.tsconfig.json b/packages/python/compile.tsconfig.json index b8b72b49c8822..29071fec6e8ce 100644 --- a/packages/python/compile.tsconfig.json +++ b/packages/python/compile.tsconfig.json @@ -1,10 +1,25 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + }, + { + "path": "../process/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/python/package.json b/packages/python/package.json index d901f88045217..573ac523dc88a 100644 --- a/packages/python/package.json +++ b/packages/python/package.json @@ -35,10 +35,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/scm/.eslintrc.js b/packages/scm/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/scm/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/scm/compile.tsconfig.json b/packages/scm/compile.tsconfig.json index a23513b5e6b13..248855a0ffb31 100644 --- a/packages/scm/compile.tsconfig.json +++ b/packages/scm/compile.tsconfig.json @@ -1,10 +1,25 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../navigator/compile.tsconfig.json" + } ] } diff --git a/packages/scm/package.json b/packages/scm/package.json index 859052e5b0fab..81e403c2e4c21 100644 --- a/packages/scm/package.json +++ b/packages/scm/package.json @@ -39,10 +39,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "docs": "theiaext docs" }, "devDependencies": { diff --git a/packages/scm/src/browser/dirty-diff/content-lines.ts b/packages/scm/src/browser/dirty-diff/content-lines.ts index a9f0de73b068c..5fa84c4d57314 100644 --- a/packages/scm/src/browser/dirty-diff/content-lines.ts +++ b/packages/scm/src/browser/dirty-diff/content-lines.ts @@ -71,7 +71,7 @@ export namespace ContentLines { function getProxyHandler(): ProxyHandler { return { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any get(target: ContentLines, p: PropertyKey): any { switch (p) { case 'prototype': @@ -92,7 +92,7 @@ export namespace ContentLines { } }; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const index = Number.parseInt(p as any); if (Number.isInteger(index)) { if (index >= 0 && index < target.length) { diff --git a/packages/scm/src/browser/dirty-diff/diff-computer.spec.ts b/packages/scm/src/browser/dirty-diff/diff-computer.spec.ts index 877a4c7f45cc8..c649cba0d22a7 100644 --- a/packages/scm/src/browser/dirty-diff/diff-computer.spec.ts +++ b/packages/scm/src/browser/dirty-diff/diff-computer.spec.ts @@ -27,7 +27,7 @@ before(() => { diffComputer = new DiffComputer(); }); -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ describe('dirty-diff-computer', () => { diff --git a/packages/scm/src/browser/dirty-diff/diff-computer.ts b/packages/scm/src/browser/dirty-diff/diff-computer.ts index a259d4230d823..fb2a4d0abae9a 100644 --- a/packages/scm/src/browser/dirty-diff/diff-computer.ts +++ b/packages/scm/src/browser/dirty-diff/diff-computer.ts @@ -76,15 +76,15 @@ export class DiffComputer { } class ArrayDiff extends jsdiff.Diff { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any tokenize(value: any): any { return value; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any join(value: any): any { return value; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any removeEmpty(value: any): any { return value; } @@ -95,9 +95,9 @@ const arrayDiff = new ArrayDiff(); /** * Computes diff without copying data. */ -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any function diffArrays(oldArr: ContentLinesArrayLike, newArr: ContentLinesArrayLike): DiffResult[] { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return arrayDiff.diff(oldArr as any, newArr as any) as any; } diff --git a/packages/scm/src/browser/scm-amend-component.tsx b/packages/scm/src/browser/scm-amend-component.tsx index c7921075e4cc7..a5c193a8ed566 100644 --- a/packages/scm/src/browser/scm-amend-component.tsx +++ b/packages/scm/src/browser/scm-amend-component.tsx @@ -70,7 +70,7 @@ export class ScmAmendComponent extends React.Component => { if (this.state.transition.state !== 'none' && this.transitionHint !== 'none') { @@ -251,7 +251,7 @@ export class ScmAmendComponent extends React.Component { const message = commitToUseForMessage diff --git a/packages/scm/src/browser/scm-input.ts b/packages/scm/src/browser/scm-input.ts index fb2792973aae6..baba275686500 100644 --- a/packages/scm/src/browser/scm-input.ts +++ b/packages/scm/src/browser/scm-input.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as debounce from 'p-debounce'; import { Disposable, DisposableCollection, Emitter } from '@theia/core/lib/common'; diff --git a/packages/scm/src/browser/scm-provider.ts b/packages/scm/src/browser/scm-provider.ts index 65dd792632494..129a0f13ae3d3 100644 --- a/packages/scm/src/browser/scm-provider.ts +++ b/packages/scm/src/browser/scm-provider.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { Disposable, Event } from '@theia/core/lib/common'; import URI from '@theia/core/lib/common/uri'; @@ -64,7 +64,7 @@ export interface ScmCommand { title: string; tooltip?: string; command?: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any arguments?: any[]; } diff --git a/packages/scm/src/browser/scm-repository.ts b/packages/scm/src/browser/scm-repository.ts index e28c5aa7f19dd..f266e7f00ffe4 100644 --- a/packages/scm/src/browser/scm-repository.ts +++ b/packages/scm/src/browser/scm-repository.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { Disposable, DisposableCollection, Emitter } from '@theia/core/lib/common'; import { ScmInput, ScmInputOptions } from './scm-input'; diff --git a/packages/scm/src/browser/scm-service.ts b/packages/scm/src/browser/scm-service.ts index 89429527ade6c..d41d98a1373af 100644 --- a/packages/scm/src/browser/scm-service.ts +++ b/packages/scm/src/browser/scm-service.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { DisposableCollection, Emitter } from '@theia/core/lib/common'; import { injectable, inject } from 'inversify'; diff --git a/packages/scm/src/browser/scm-widget.tsx b/packages/scm/src/browser/scm-widget.tsx index d0c961a45ad59..97aca251b5ea1 100644 --- a/packages/scm/src/browser/scm-widget.tsx +++ b/packages/scm/src/browser/scm-widget.tsx @@ -14,8 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any -// tslint:disable:no-null-keyword +/* eslint-disable no-null/no-null, @typescript-eslint/no-explicit-any */ import * as React from 'react'; import TextareaAutosize from 'react-autosize-textarea'; @@ -145,7 +144,7 @@ export class ScmWidget extends ReactWidget implements StatefulWidget { if (container) { this.addScmListNavigationKeyListeners(container); } - } + }; protected render(): React.ReactNode { const repository = this.scmService.selectedRepository; @@ -237,7 +236,7 @@ export class ScmWidget extends ReactWidget implements StatefulWidget { if (repository) { repository.input.value = typeof event === 'string' ? event : event.currentTarget.value; } - } + }; protected acceptInput = () => this.commands.executeCommand('scm.acceptInput'); @@ -408,7 +407,7 @@ export abstract class ScmElement

this.setState({ hover }); }); } - } + }; protected showHover = () => this.setState({ hover: true }); protected hideHover = () => this.setState({ hover: false }); @@ -426,7 +425,7 @@ export abstract class ScmElement

} finally { contextKeys.scmResourceGroup.set(currentScmResourceGroup); } - } + }; protected abstract get contextMenuPath(): MenuPath; protected abstract get contextMenuArgs(): any[]; @@ -504,7 +503,7 @@ export class ScmResourceComponent extends ScmElement if (isSingle) { this.open(); } - } + }; /** * Handle the double clicking of nodes present in the widget. @@ -516,7 +515,7 @@ export class ScmResourceComponent extends ScmElement if (isDouble) { this.open(); } - } + }; } export namespace ScmResourceComponent { export interface Props extends ScmElement.Props { @@ -542,7 +541,7 @@ export class ScmResourceGroupsContainer extends React.Component { const { commands, node, args } = this.props; commands.executeCommand(node.action.commandId, ...args); - } + }; } export namespace ScmInlineAction { export interface Props { diff --git a/packages/search-in-workspace/.eslintrc.js b/packages/search-in-workspace/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/search-in-workspace/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/search-in-workspace/compile.tsconfig.json b/packages/search-in-workspace/compile.tsconfig.json index b8b72b49c8822..ca6846e22c134 100644 --- a/packages/search-in-workspace/compile.tsconfig.json +++ b/packages/search-in-workspace/compile.tsconfig.json @@ -1,10 +1,31 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../navigator/compile.tsconfig.json" + }, + { + "path": "../process/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/search-in-workspace/package.json b/packages/search-in-workspace/package.json index 7f02b4b376f8b..979333e1f2d8b 100644 --- a/packages/search-in-workspace/package.json +++ b/packages/search-in-workspace/package.json @@ -37,10 +37,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-frontend-module.ts b/packages/search-in-workspace/src/browser/search-in-workspace-frontend-module.ts index fec6100d40470..5d6ea5bebc682 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-frontend-module.ts +++ b/packages/search-in-workspace/src/browser/search-in-workspace-frontend-module.ts @@ -19,7 +19,9 @@ import '../../src/browser/styles/index.css'; import { ContainerModule, interfaces } from 'inversify'; import { SearchInWorkspaceService, SearchInWorkspaceClientImpl } from './search-in-workspace-service'; import { SearchInWorkspaceServer, SIW_WS_PATH } from '../common/search-in-workspace-interface'; -import { WebSocketConnectionProvider, WidgetFactory, createTreeContainer, TreeWidget, bindViewContribution, FrontendApplicationContribution, LabelProviderContribution } from '@theia/core/lib/browser'; +import { + WebSocketConnectionProvider, WidgetFactory, createTreeContainer, TreeWidget, bindViewContribution, FrontendApplicationContribution, LabelProviderContribution +} from '@theia/core/lib/browser'; import { ResourceResolver } from '@theia/core'; import { SearchInWorkspaceWidget } from './search-in-workspace-widget'; import { SearchInWorkspaceResultTreeWidget } from './search-in-workspace-result-tree-widget'; diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx index 4f169e6ad7a48..289341692f171 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx +++ b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx @@ -49,7 +49,7 @@ export interface SearchInWorkspaceRoot extends CompositeTreeNode { children: SearchInWorkspaceRootFolderNode[]; } export namespace SearchInWorkspaceRoot { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(node: any): node is SearchInWorkspaceRoot { return CompositeTreeNode.is(node) && node.id === ROOT_ID; } @@ -63,7 +63,7 @@ export interface SearchInWorkspaceRootFolderNode extends ExpandableTreeNode, Sel folderUri: string; } export namespace SearchInWorkspaceRootFolderNode { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(node: any): node is SearchInWorkspaceRootFolderNode { return ExpandableTreeNode.is(node) && SelectableTreeNode.is(node) && 'path' in node && 'folderUri' in node && !('fileUri' in node); } @@ -78,7 +78,7 @@ export interface SearchInWorkspaceFileNode extends ExpandableTreeNode, Selectabl fileUri: string; } export namespace SearchInWorkspaceFileNode { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(node: any): node is SearchInWorkspaceFileNode { return ExpandableTreeNode.is(node) && SelectableTreeNode.is(node) && 'path' in node && 'fileUri' in node && !('folderUri' in node); } @@ -88,7 +88,7 @@ export interface SearchInWorkspaceResultLineNode extends SelectableTreeNode, Sea parent: SearchInWorkspaceFileNode } export namespace SearchInWorkspaceResultLineNode { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(node: any): node is SearchInWorkspaceResultLineNode { return SelectableTreeNode.is(node) && 'line' in node && 'character' in node && 'lineText' in node; } @@ -108,7 +108,7 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget { cancelIndicator?: CancellationTokenSource; protected changeEmitter = new Emitter>(); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected focusInputEmitter = new Emitter(); @inject(SearchInWorkspaceService) protected readonly searchService: SearchInWorkspaceService; @@ -216,7 +216,7 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget { this.changeEmitter.fire(this.resultTree); }); const progress = await this.progressService.showProgress({ text: `search: ${searchTerm}`, options: { location: 'search' } }); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let pendingRefreshTimeout: any; const searchId = await this.searchService.search(searchTerm, { onResult: (aSearchId: number, result: SearchInWorkspaceResult) => { @@ -259,7 +259,7 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget { }); this.refreshModelChildren(); } - }, searchOptions).catch(e => { return; }); + }, searchOptions).catch(() => undefined); token.onCancellationRequested(() => { progress.cancel(); if (searchId) { diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-widget.tsx b/packages/search-in-workspace/src/browser/search-in-workspace-widget.tsx index 4c3389ea1f3c6..705cd8f77fef5 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-widget.tsx +++ b/packages/search-in-workspace/src/browser/search-in-workspace-widget.tsx @@ -164,7 +164,7 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge }; } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any restoreState(oldState: any): void { this.matchCaseState = oldState.matchCaseState; this.wholeWordState = oldState.wholeWordState; diff --git a/packages/search-in-workspace/src/node/ripgrep-search-in-workspace-server.ts b/packages/search-in-workspace/src/node/ripgrep-search-in-workspace-server.ts index 45689b171e919..b02fc42c8dcf5 100644 --- a/packages/search-in-workspace/src/node/ripgrep-search-in-workspace-server.ts +++ b/packages/search-in-workspace/src/node/ripgrep-search-in-workspace-server.ts @@ -157,7 +157,7 @@ export class RipgrepSearchInWorkspaceServer implements SearchInWorkspaceServer { this.ongoingSearches.set(searchId, rgProcess); rgProcess.onError(error => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let errorCode = (error as any).code; // Try to provide somewhat clearer error messages, if possible. diff --git a/packages/task/.eslintrc.js b/packages/task/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/task/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/task/compile.tsconfig.json b/packages/task/compile.tsconfig.json index b8b72b49c8822..ce9deba4a1e7f 100644 --- a/packages/task/compile.tsconfig.json +++ b/packages/task/compile.tsconfig.json @@ -1,10 +1,43 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../markers/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + }, + { + "path": "../preferences/compile.tsconfig.json" + }, + { + "path": "../process/compile.tsconfig.json" + }, + { + "path": "../terminal/compile.tsconfig.json" + }, + { + "path": "../variable-resolver/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/task/package.json b/packages/task/package.json index 8fe5716979f9f..f483fccb85020 100644 --- a/packages/task/package.json +++ b/packages/task/package.json @@ -44,10 +44,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/task/src/browser/quick-open-task.ts b/packages/task/src/browser/quick-open-task.ts index 8fd334c4d4d64..2e472fb5899a1 100644 --- a/packages/task/src/browser/quick-open-task.ts +++ b/packages/task/src/browser/quick-open-task.ts @@ -23,7 +23,9 @@ import { QuickOpenHandler, QuickOpenService, QuickOpenOptions, QuickOpenBaseActi import { WorkspaceService } from '@theia/workspace/lib/browser'; import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service'; import { FileSystem } from '@theia/filesystem/lib/common'; -import { QuickOpenModel, QuickOpenItem, QuickOpenActionProvider, QuickOpenMode, QuickOpenGroupItem, QuickOpenGroupItemOptions, QuickOpenAction } from '@theia/core/lib/common/quick-open-model'; +import { + QuickOpenModel, QuickOpenItem, QuickOpenActionProvider, QuickOpenMode, QuickOpenGroupItem, QuickOpenGroupItemOptions, QuickOpenAction +} from '@theia/core/lib/common/quick-open-model'; import { PreferenceService } from '@theia/core/lib/browser'; import { TaskNameResolver } from './task-name-resolver'; import { TaskSourceResolver } from './task-source-resolver'; @@ -406,8 +408,9 @@ export class QuickOpenTask implements QuickOpenModel, QuickOpenHandler { return `Task id: ${task.taskId}, label: ${task.config.label}`; } - private getFilteredTasks(recentTasks: TaskConfiguration[], configuredTasks: TaskConfiguration[], providedTasks: TaskConfiguration[]) - : { filteredRecentTasks: TaskConfiguration[], filteredConfiguredTasks: TaskConfiguration[], filteredProvidedTasks: TaskConfiguration[] } { + private getFilteredTasks(recentTasks: TaskConfiguration[], configuredTasks: TaskConfiguration[], providedTasks: TaskConfiguration[]): { + filteredRecentTasks: TaskConfiguration[], filteredConfiguredTasks: TaskConfiguration[], filteredProvidedTasks: TaskConfiguration[] + } { const filteredRecentTasks: TaskConfiguration[] = []; recentTasks.forEach(recent => { diff --git a/packages/task/src/browser/task-configuration-manager.ts b/packages/task/src/browser/task-configuration-manager.ts index d188421617d12..b4fed15ea5a43 100644 --- a/packages/task/src/browser/task-configuration-manager.ts +++ b/packages/task/src/browser/task-configuration-manager.ts @@ -26,7 +26,7 @@ import { TaskConfigurationModel } from './task-configuration-model'; import { TaskTemplateSelector } from './task-templates'; import { TaskCustomization, TaskConfiguration } from '../common/task-protocol'; import { WorkspaceVariableContribution } from '@theia/workspace/lib/browser/workspace-variable-contribution'; -import { FileSystem, FileSystemError /*, FileStat */ } from '@theia/filesystem/lib/common'; +import { FileSystem, FileSystemError } from '@theia/filesystem/lib/common'; import { FileChange, FileChangeType } from '@theia/filesystem/lib/common/filesystem-watcher-protocol'; import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations'; diff --git a/packages/task/src/browser/task-configuration-model.ts b/packages/task/src/browser/task-configuration-model.ts index f54c995c4962a..57d8dad7e3905 100644 --- a/packages/task/src/browser/task-configuration-model.ts +++ b/packages/task/src/browser/task-configuration-model.ts @@ -69,7 +69,7 @@ export class TaskConfigurationModel implements Disposable { protected parseConfigurations(): TaskConfigurationModel.JsonContent { const configurations: (TaskCustomization | TaskConfiguration)[] = []; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { configUri, value } = this.preferences.resolve('tasks', undefined, this.workspaceFolderUri); if (value && typeof value === 'object' && 'tasks' in value) { if (Array.isArray(value.tasks)) { diff --git a/packages/task/src/browser/task-configurations.ts b/packages/task/src/browser/task-configurations.ts index c03b9e7050ac6..a063506c83a06 100644 --- a/packages/task/src/browser/task-configurations.ts +++ b/packages/task/src/browser/task-configurations.ts @@ -430,7 +430,7 @@ export class TaskConfigurations implements Disposable { * @param task task that the updates will be applied to * @param update the updates to be applied */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async updateTaskConfig(task: TaskConfiguration, update: { [name: string]: any }): Promise { const sourceFolderUri: string | undefined = this.taskSourceResolver.resolve(task); if (!sourceFolderUri) { diff --git a/packages/task/src/browser/task-definition-registry.spec.ts b/packages/task/src/browser/task-definition-registry.spec.ts index 32f8392a19116..27ab77fd96482 100644 --- a/packages/task/src/browser/task-definition-registry.spec.ts +++ b/packages/task/src/browser/task-definition-registry.spec.ts @@ -17,7 +17,7 @@ import { expect } from 'chai'; import { TaskDefinitionRegistry } from './task-definition-registry'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ describe('TaskDefinitionRegistry', () => { let registry: TaskDefinitionRegistry; const definitionContributionA = { diff --git a/packages/task/src/browser/task-folder-preference-provider.ts b/packages/task/src/browser/task-folder-preference-provider.ts index 5778a20d6c190..90f84d1c492bf 100644 --- a/packages/task/src/browser/task-folder-preference-provider.ts +++ b/packages/task/src/browser/task-folder-preference-provider.ts @@ -20,7 +20,7 @@ import { FolderPreferenceProvider } from '@theia/preferences/lib/browser/folder- @injectable() export class TaskFolderPreferenceProvider extends FolderPreferenceProvider { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected parse(content: string): any { const tasks = super.parse(content); if (tasks === undefined) { diff --git a/packages/task/src/browser/task-frontend-contribution.ts b/packages/task/src/browser/task-frontend-contribution.ts index acfd7e21ae957..a01e44d70db95 100644 --- a/packages/task/src/browser/task-frontend-contribution.ts +++ b/packages/task/src/browser/task-frontend-contribution.ts @@ -224,7 +224,7 @@ export class TaskFrontendContribution implements CommandContribution, MenuContri TaskCommands.TASK_RUN, { isEnabled: () => true, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute: (...args: any[]) => { const [source, label, scope] = args; if (source && label) { @@ -238,7 +238,7 @@ export class TaskFrontendContribution implements CommandContribution, MenuContri TaskCommands.TASK_RUN_BUILD, { isEnabled: () => this.workspaceService.opened, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute: (...args: any[]) => this.quickOpenTask.runBuildOrTestTask('build') } @@ -247,7 +247,7 @@ export class TaskFrontendContribution implements CommandContribution, MenuContri TaskCommands.TASK_RUN_TEST, { isEnabled: () => this.workspaceService.opened, - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any execute: (...args: any[]) => this.quickOpenTask.runBuildOrTestTask('test') } diff --git a/packages/task/src/browser/task-schema-updater.ts b/packages/task/src/browser/task-schema-updater.ts index f49946184cbf1..a7893438ba3d7 100644 --- a/packages/task/src/browser/task-schema-updater.ts +++ b/packages/task/src/browser/task-schema-updater.ts @@ -309,7 +309,7 @@ const group = { 'Marks the task as a test task accessible through the \'Run Test Task\' command.', 'Assigns the task to no group' ], - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len description: 'Defines to which execution group this task belongs to. It supports "build" to add it to the build group and "test" to add it to the test group.' }; @@ -336,6 +336,7 @@ const problemPattern: IJSONSchema = { }, location: { type: 'integer', + // eslint-disable-next-line max-len description: 'The match group index of the problem\'s location. Valid location patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn). If omitted (line,column) is assumed.' }, line: { @@ -368,6 +369,7 @@ const problemPattern: IJSONSchema = { }, loop: { type: 'boolean', + // eslint-disable-next-line max-len description: 'In a multi line matcher loop indicated whether this pattern is executed in a loop as long as it matches. Can only specified on a last pattern in a multi line pattern.' } } diff --git a/packages/task/src/browser/task-service.ts b/packages/task/src/browser/task-service.ts index ffd6ca9503e78..8b81387706505 100644 --- a/packages/task/src/browser/task-service.ts +++ b/packages/task/src/browser/task-service.ts @@ -791,7 +791,7 @@ export class TaskService implements TaskConfigurationClient { * @param task task that the updates will be applied to * @param update the updates to be applied */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any async updateTaskConfiguration(task: TaskConfiguration, update: { [name: string]: any }): Promise { if (update.problemMatcher) { if (Array.isArray(update.problemMatcher)) { diff --git a/packages/task/src/common/task-protocol.ts b/packages/task/src/common/task-protocol.ts index 892bc8d6a5e7c..73800727e2ad1 100644 --- a/packages/task/src/common/task-protocol.ts +++ b/packages/task/src/common/task-protocol.ts @@ -36,11 +36,11 @@ export enum RevealKind { export interface TaskOutputPresentation { focus?: boolean; reveal?: RevealKind; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any [name: string]: any; } export namespace TaskOutputPresentation { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function fromJson(task: any): TaskOutputPresentation { if (task && task.presentation) { let reveal = RevealKind.Always; @@ -76,7 +76,7 @@ export interface TaskCustomization { /** The order the dependsOn tasks should be executed in. */ dependsOrder?: DependsOrder; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any [name: string]: any; } export namespace TaskCustomization { @@ -134,7 +134,7 @@ export interface TaskInfo { /** task config used for launching a task */ readonly config: TaskConfiguration, /** Additional properties specific for a particular Task Runner. */ - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly [key: string]: any; } @@ -161,7 +161,7 @@ export interface TaskServer extends JsonRpcServer { export interface TaskCustomizationData { type: string; problemMatcher?: ProblemMatcher[]; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any [name: string]: any; } diff --git a/packages/task/src/node/task-abstract-line-matcher.ts b/packages/task/src/node/task-abstract-line-matcher.ts index 61757b44e33a7..e3376f1785f7c 100644 --- a/packages/task/src/node/task-abstract-line-matcher.ts +++ b/packages/task/src/node/task-abstract-line-matcher.ts @@ -82,7 +82,7 @@ export abstract class AbstractLineMatcher { } protected getEmptyProblemData(): ProblemData { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return Object.create(null) as ProblemData; } @@ -166,7 +166,7 @@ export abstract class AbstractLineMatcher { return this.parseLocationInfo(data.location); } if (!data.line) { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } const startLine = parseInt(data.line); @@ -178,7 +178,7 @@ export abstract class AbstractLineMatcher { private parseLocationInfo(value: string): Range | null { if (!value || !value.match(/(\d+|\d+,\d+|\d+,\d+,\d+,\d+)/)) { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null return null; } const parts = value.split(','); @@ -217,7 +217,7 @@ export abstract class AbstractLineMatcher { } private getSeverity(data: ProblemData): DiagnosticSeverity { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null let result: Severity | null = null; if (data.severity) { const value = data.severity; @@ -238,6 +238,7 @@ export abstract class AbstractLineMatcher { } } } + // eslint-disable-next-line no-null/no-null if (result === null || result === Severity.Ignore) { result = this.matcher.severity || Severity.Error; } diff --git a/packages/task/src/node/test/task-test-container.ts b/packages/task/src/node/test/task-test-container.ts index e3ef66ae013ea..be0900c3042f8 100644 --- a/packages/task/src/node/test/task-test-container.ts +++ b/packages/task/src/node/test/task-test-container.ts @@ -22,7 +22,6 @@ import taskBackendModule from '../task-backend-module'; import filesystemBackendModule from '@theia/filesystem/lib/node/filesystem-backend-module'; import workspaceServer from '@theia/workspace/lib/node/workspace-backend-module'; import { messagingBackendModule } from '@theia/core/lib/node/messaging/messaging-backend-module'; -// tslint:disable-next-line:no-implicit-dependencies import { ApplicationPackage } from '@theia/application-package/lib/application-package'; export function createTaskTestContainer(): Container { diff --git a/packages/terminal/.eslintrc.js b/packages/terminal/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/terminal/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/terminal/compile.tsconfig.json b/packages/terminal/compile.tsconfig.json index b8b72b49c8822..208e509b8dc1d 100644 --- a/packages/terminal/compile.tsconfig.json +++ b/packages/terminal/compile.tsconfig.json @@ -1,10 +1,28 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../process/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/terminal/package.json b/packages/terminal/package.json index bcff30400f5c4..aa332862bc75d 100644 --- a/packages/terminal/package.json +++ b/packages/terminal/package.json @@ -36,10 +36,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/terminal/src/browser/terminal-copy-on-selection-handler.ts b/packages/terminal/src/browser/terminal-copy-on-selection-handler.ts index d2ac51bc47ad4..23444f04fb6d9 100644 --- a/packages/terminal/src/browser/terminal-copy-on-selection-handler.ts +++ b/packages/terminal/src/browser/terminal-copy-on-selection-handler.ts @@ -28,7 +28,7 @@ export class TerminalCopyOnSelectionHandler { ev.clipboardData.setData('text/plain', this.textToCopy); ev.preventDefault(); } - } + }; @postConstruct() protected init(): void { @@ -41,7 +41,7 @@ export class TerminalCopyOnSelectionHandler { return true; } try { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const permissions = (navigator as any).permissions; const { state } = await permissions.query({ name: 'clipboard-write' }); if (state === 'granted') { @@ -63,7 +63,7 @@ export class TerminalCopyOnSelectionHandler { } private async writeToClipBoard(): Promise { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const clipboard = (navigator as any).clipboard; if (!clipboard) { @@ -81,7 +81,7 @@ export class TerminalCopyOnSelectionHandler { async copy(text: string): Promise { this.textToCopy = text; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const permissions = (navigator as any).permissions; if (permissions && permissions.query && await this.clipBoardCopyIsGranted()) { await this.writeToClipBoard(); diff --git a/packages/terminal/src/browser/terminal-frontend-contribution.ts b/packages/terminal/src/browser/terminal-frontend-contribution.ts index 7a9a37011158d..1866c59066486 100644 --- a/packages/terminal/src/browser/terminal-frontend-contribution.ts +++ b/packages/terminal/src/browser/terminal-frontend-contribution.ts @@ -445,7 +445,7 @@ export class TerminalFrontendContribution implements TerminalService, CommandCon }, description: 'The color of the border that separates split panes within the terminal. This defaults to panel.border.' }); - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const id in terminalAnsiColorMap) { const entry = terminalAnsiColorMap[id]; const colorName = id.substring(13); diff --git a/packages/terminal/src/browser/terminal-linkmatcher-files.ts b/packages/terminal/src/browser/terminal-linkmatcher-files.ts index 4383e6b36213a..090b45c5dd36d 100644 --- a/packages/terminal/src/browser/terminal-linkmatcher-files.ts +++ b/packages/terminal/src/browser/terminal-linkmatcher-files.ts @@ -52,6 +52,7 @@ export class TerminalLinkmatcherFiles extends AbstractCmdClickTerminalContributi if (toOpen) { // TODO: would be better to ask the opener service, but it returns positively even for unknown files. const f = await this.fileSystem.getFileStat(toOpen.toString()); + // eslint-disable-next-line no-null/no-null return f !== undefined && f !== null && !f.isDirectory; } } catch (err) { diff --git a/packages/terminal/src/browser/terminal-preferences.ts b/packages/terminal/src/browser/terminal-preferences.ts index feeec131ea029..e205dc2bcd9d3 100644 --- a/packages/terminal/src/browser/terminal-preferences.ts +++ b/packages/terminal/src/browser/terminal-preferences.ts @@ -102,7 +102,7 @@ type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '6 export type TerminalRendererType = 'canvas' | 'dom'; export const DEFAULT_TERMINAL_RENDERER_TYPE = 'canvas'; -// tslint:disable-next-line:no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function isTerminalRendererType(arg: any): arg is TerminalRendererType { return typeof arg === 'string' && (arg === 'canvas' || arg === 'dom'); } diff --git a/packages/terminal/src/browser/terminal-theme-service.ts b/packages/terminal/src/browser/terminal-theme-service.ts index d8a13264c2c66..e29babde72e0b 100644 --- a/packages/terminal/src/browser/terminal-theme-service.ts +++ b/packages/terminal/src/browser/terminal-theme-service.ts @@ -175,10 +175,10 @@ export class TerminalThemeService { cursorAccent: cursorAccentColor, selection: selectionColor }; - // tslint:disable-next-line:forin + // eslint-disable-next-line guard-for-in for (const id in terminalAnsiColorMap) { const colorName = id.substring(13); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (theme as any)[colorName] = this.colorRegistry.getCurrentColor(id); } return theme; diff --git a/packages/terminal/src/node/terminal-backend-module.ts b/packages/terminal/src/node/terminal-backend-module.ts index 1e3f36ca2a374..26d1535d61534 100644 --- a/packages/terminal/src/node/terminal-backend-module.ts +++ b/packages/terminal/src/node/terminal-backend-module.ts @@ -31,7 +31,7 @@ export function bindTerminalServer(bind: interfaces.Bind, { path, identifier, co path: string, identifier: interfaces.ServiceIdentifier, constructor: { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any new(...args: any[]): IBaseTerminalServer; } }): void { diff --git a/packages/terminal/src/node/test/terminal-test-container.ts b/packages/terminal/src/node/test/terminal-test-container.ts index 46228f8bf75a5..15ac597d63e75 100644 --- a/packages/terminal/src/node/test/terminal-test-container.ts +++ b/packages/terminal/src/node/test/terminal-test-container.ts @@ -19,7 +19,6 @@ import { backendApplicationModule } from '@theia/core/lib/node/backend-applicati import processBackendModule from '@theia/process/lib/node/process-backend-module'; import { messagingBackendModule } from '@theia/core/lib/node/messaging/messaging-backend-module'; import terminalBackendModule from '../terminal-backend-module'; -// tslint:disable-next-line:no-implicit-dependencies import { ApplicationPackage } from '@theia/application-package/lib/application-package'; export function createTerminalTestContainer(): Container { diff --git a/packages/textmate-grammars/.eslintrc.js b/packages/textmate-grammars/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/textmate-grammars/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/textmate-grammars/compile.tsconfig.json b/packages/textmate-grammars/compile.tsconfig.json index b8b72b49c8822..754ded382c695 100644 --- a/packages/textmate-grammars/compile.tsconfig.json +++ b/packages/textmate-grammars/compile.tsconfig.json @@ -1,10 +1,16 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../monaco/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/textmate-grammars/package.json b/packages/textmate-grammars/package.json index 3884a87a2834f..ca6308891885f 100644 --- a/packages/textmate-grammars/package.json +++ b/packages/textmate-grammars/package.json @@ -32,10 +32,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/textmate-grammars/src/browser/monaco.d.ts b/packages/textmate-grammars/src/browser/monaco.d.ts index c2e866c41c32e..0b9896563afaf 100644 --- a/packages/textmate-grammars/src/browser/monaco.d.ts +++ b/packages/textmate-grammars/src/browser/monaco.d.ts @@ -1 +1 @@ -/// \ No newline at end of file +/// diff --git a/packages/tslint/.eslintrc.js b/packages/tslint/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/tslint/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/tslint/compile.tsconfig.json b/packages/tslint/compile.tsconfig.json index a23513b5e6b13..b973ddbc673a2 100644 --- a/packages/tslint/compile.tsconfig.json +++ b/packages/tslint/compile.tsconfig.json @@ -1,10 +1,12 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" - ] + ], + "references": [] } diff --git a/packages/tslint/package.json b/packages/tslint/package.json index 4fc27e3560274..4f5c08ef45da6 100644 --- a/packages/tslint/package.json +++ b/packages/tslint/package.json @@ -26,10 +26,10 @@ "data" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/typehierarchy/.eslintrc.js b/packages/typehierarchy/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/typehierarchy/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/typehierarchy/compile.tsconfig.json b/packages/typehierarchy/compile.tsconfig.json index 18b90d15df3c5..8bf912df4dd5e 100644 --- a/packages/typehierarchy/compile.tsconfig.json +++ b/packages/typehierarchy/compile.tsconfig.json @@ -1,10 +1,22 @@ { - "extends": "../../configs/base.tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "lib" + "extends": "../../configs/base.tsconfig.json", + "compilerOptions": { + "composite": true, + "rootDir": "src", + "outDir": "lib" + }, + "include": [ + "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" }, - "include": [ - "src" - ] + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + } + ] } diff --git a/packages/typehierarchy/package.json b/packages/typehierarchy/package.json index c5bb4dbd51564..65343580514a6 100644 --- a/packages/typehierarchy/package.json +++ b/packages/typehierarchy/package.json @@ -34,10 +34,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/typehierarchy/src/browser/tree/typehierarchy-tree-widget.tsx b/packages/typehierarchy/src/browser/tree/typehierarchy-tree-widget.tsx index 3d23d4e6af758..2891b33bbbda1 100644 --- a/packages/typehierarchy/src/browser/tree/typehierarchy-tree-widget.tsx +++ b/packages/typehierarchy/src/browser/tree/typehierarchy-tree-widget.tsx @@ -29,7 +29,7 @@ import { TypeHierarchyTree } from './typehierarchy-tree'; @injectable() export class TypeHierarchyTreeWidget extends TreeWidget { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected readonly icons = new Map(Array.from(Object.keys(SymbolKind)).map(key => [(SymbolKind as any)[key], key.toLocaleLowerCase()] as [number, string])); constructor( diff --git a/packages/typehierarchy/src/browser/tree/typehierarchy-tree.ts b/packages/typehierarchy/src/browser/tree/typehierarchy-tree.ts index de08f2e5a42fb..eb96c1ae65d07 100644 --- a/packages/typehierarchy/src/browser/tree/typehierarchy-tree.ts +++ b/packages/typehierarchy/src/browser/tree/typehierarchy-tree.ts @@ -97,7 +97,7 @@ export namespace TypeHierarchyTree { export function is(node: TreeNode | undefined): node is RootNode { if (Node.is(node) && 'direction' in node) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { direction } = (node as any); return direction === TypeHierarchyDirection.Children || direction === TypeHierarchyDirection.Parents; } @@ -122,7 +122,7 @@ export namespace TypeHierarchyTree { export function is(node: TreeNode | undefined): node is Node { if (!!node && 'resolved' in node && 'item' in node) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const { resolved, item } = (node as any); return typeof resolved === 'boolean' && !!item; } diff --git a/packages/typescript/.eslintrc.js b/packages/typescript/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/typescript/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/typescript/compile.tsconfig.json b/packages/typescript/compile.tsconfig.json index b8b72b49c8822..aa8d587384b67 100644 --- a/packages/typescript/compile.tsconfig.json +++ b/packages/typescript/compile.tsconfig.json @@ -1,10 +1,37 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../../dev-packages/application-package/compile.tsconfig.json" + }, + { + "path": "../callhierarchy/compile.tsconfig.json" + }, + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../editor/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../languages/compile.tsconfig.json" + }, + { + "path": "../monaco/compile.tsconfig.json" + }, + { + "path": "../workspace/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/typescript/package.json b/packages/typescript/package.json index bc94a7bf706f1..7573bb417863e 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -41,10 +41,10 @@ "data" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/typescript/src/browser/monaco.d.ts b/packages/typescript/src/browser/monaco.d.ts index ad8ef7c744a72..c00ec81986742 100644 --- a/packages/typescript/src/browser/monaco.d.ts +++ b/packages/typescript/src/browser/monaco.d.ts @@ -1 +1 @@ -/// \ No newline at end of file +/// diff --git a/packages/typescript/src/browser/typescript-frontend-contribution.ts b/packages/typescript/src/browser/typescript-frontend-contribution.ts index 7d02b1fa7ce3a..d5471ea622223 100644 --- a/packages/typescript/src/browser/typescript-frontend-contribution.ts +++ b/packages/typescript/src/browser/typescript-frontend-contribution.ts @@ -140,7 +140,7 @@ export class TypeScriptFrontendContribution implements FrontendApplicationContri organizeImports(): void { const editor = MonacoEditor.get(this.currentEditor); if (editor) { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const action = editor.getControl().getAction('editor.action.organizeImports') as any; // workaround isSupported check action._run(); @@ -165,7 +165,7 @@ export class TypeScriptFrontendContribution implements FrontendApplicationContri )); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected async applyCodeAction(codeAction: tsp.CodeAction): Promise { const client = await this.clientContribution.languageClient; return client.sendRequest(ExecuteCommandRequest.type, { diff --git a/packages/typescript/src/browser/typescript-preferences.ts b/packages/typescript/src/browser/typescript-preferences.ts index 24b62f245f8c0..d2976e660197c 100644 --- a/packages/typescript/src/browser/typescript-preferences.ts +++ b/packages/typescript/src/browser/typescript-preferences.ts @@ -36,7 +36,7 @@ export const typescriptPreferenceSchema: PreferenceSchema = { 'verbose' ], 'default': 'off', - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len 'description': 'Enables logging of the TS server to a file. This log can be used to diagnose TS Server issues. The log may contain file paths, source code, and other potentially sensitive information from your project.' }, 'typescript.tsdk': { @@ -44,7 +44,7 @@ export const typescriptPreferenceSchema: PreferenceSchema = { 'string', 'null' ], - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null 'default': null, 'description': 'Specifies the folder path containing the tsserver and lib*.d.ts files to use.', 'scope': 'window' diff --git a/packages/typescript/src/node/typescript-version-service-impl.spec.ts b/packages/typescript/src/node/typescript-version-service-impl.spec.ts index c99f34d6897dc..2cf76a2f7d09d 100644 --- a/packages/typescript/src/node/typescript-version-service-impl.spec.ts +++ b/packages/typescript/src/node/typescript-version-service-impl.spec.ts @@ -29,7 +29,7 @@ describe('TypescriptVersionServiceImpl', function (): void { beforeEach(() => { impl = new TypescriptVersionServiceImpl(); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (impl as any).applicationPackage = { projectPath: FileUri.fsPath(projectUri) }; diff --git a/packages/typescript/src/node/typescript-version-service-impl.ts b/packages/typescript/src/node/typescript-version-service-impl.ts index 0039df5f70d81..438ef89bc7cea 100644 --- a/packages/typescript/src/node/typescript-version-service-impl.ts +++ b/packages/typescript/src/node/typescript-version-service-impl.ts @@ -14,7 +14,6 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable-next-line:no-implicit-dependencies import * as fs from 'fs-extra'; import * as cp from 'child_process'; import * as commandExists from 'command-exists'; @@ -23,7 +22,6 @@ import URI from '@theia/core/lib/common/uri'; import { isWindows, Path } from '@theia/core/lib/common'; import { FileUri } from '@theia/core/lib/node'; import { TypescriptVersion, TypescriptVersionService, TypescriptVersionOptions } from '../common/typescript-version-service'; -// tslint:disable-next-line:no-implicit-dependencies import { ApplicationPackage } from '@theia/application-package'; export namespace TypescriptVersionURI { @@ -146,7 +144,7 @@ export class TypescriptVersionServiceImpl implements TypescriptVersionService { try { const version = await this.readVersion(uri); versions.set(key, version); - } catch { /*no-op*/ } + } catch { /* no-op */ } } protected async readVersion(uri: URI): Promise { @@ -154,7 +152,7 @@ export class TypescriptVersionServiceImpl implements TypescriptVersionService { const packagePath = FileUri.fsPath(uri.parent.resolve('package.json')); const pck: { version?: string | Object } | undefined = await fs.readJSON(packagePath); return pck && pck.version && typeof pck.version === 'string' ? pck.version : undefined; - } catch { /*no-op*/ } + } catch { /* no-op */ } return undefined; } diff --git a/packages/userstorage/.eslintrc.js b/packages/userstorage/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/userstorage/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/userstorage/compile.tsconfig.json b/packages/userstorage/compile.tsconfig.json index b8b72b49c8822..d3e8f1dc24e40 100644 --- a/packages/userstorage/compile.tsconfig.json +++ b/packages/userstorage/compile.tsconfig.json @@ -1,10 +1,19 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/userstorage/package.json b/packages/userstorage/package.json index f5d037b12aa8b..b6cdace146ae8 100644 --- a/packages/userstorage/package.json +++ b/packages/userstorage/package.json @@ -31,10 +31,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/variable-resolver/.eslintrc.js b/packages/variable-resolver/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/variable-resolver/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/variable-resolver/compile.tsconfig.json b/packages/variable-resolver/compile.tsconfig.json index b8b72b49c8822..4f0b13d382c8f 100644 --- a/packages/variable-resolver/compile.tsconfig.json +++ b/packages/variable-resolver/compile.tsconfig.json @@ -1,10 +1,16 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/variable-resolver/package.json b/packages/variable-resolver/package.json index 4afc28270f82d..0167be76ff3aa 100644 --- a/packages/variable-resolver/package.json +++ b/packages/variable-resolver/package.json @@ -36,10 +36,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/variable-resolver/src/browser/common-variable-contribution.ts b/packages/variable-resolver/src/browser/common-variable-contribution.ts index 4d09b988d44f7..318f87d3c32a3 100644 --- a/packages/variable-resolver/src/browser/common-variable-contribution.ts +++ b/packages/variable-resolver/src/browser/common-variable-contribution.ts @@ -72,7 +72,7 @@ export class CommonVariableContribution implements VariableContribution { variables.registerVariable({ name: 'command', resolve: async (_, command) => - // tslint:disable-next-line:no-return-await + // eslint-disable-next-line no-return-await command && await this.commands.executeCommand(command) }); variables.registerVariable({ diff --git a/packages/variable-resolver/src/browser/variable-input.ts b/packages/variable-resolver/src/browser/variable-input.ts index 6951b8265a202..c456d4c063a36 100644 --- a/packages/variable-resolver/src/browser/variable-input.ts +++ b/packages/variable-resolver/src/browser/variable-input.ts @@ -40,7 +40,7 @@ export interface VariableCommandInput { id: string; type: 'command'; command: string; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any args?: any; } diff --git a/packages/variable-resolver/src/browser/variable-resolver-frontend-contribution.spec.ts b/packages/variable-resolver/src/browser/variable-resolver-frontend-contribution.spec.ts index 865a830878a2b..6693ebbb75dad 100644 --- a/packages/variable-resolver/src/browser/variable-resolver-frontend-contribution.spec.ts +++ b/packages/variable-resolver/src/browser/variable-resolver-frontend-contribution.spec.ts @@ -51,8 +51,8 @@ describe('variable-resolver-frontend-contribution', () => { bind(ILogger).to(MockLogger); bind(VariableRegistry).toSelf().inSingletonScope(); - // tslint:disable-next-line:no-any mocking VariableQuickOpenService - bind(VariableQuickOpenService).toConstantValue({} as any); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bind(VariableQuickOpenService).toConstantValue({} as any); // mock VariableQuickOpenService bind(VariableResolverFrontendContribution).toSelf(); }); diff --git a/packages/variable-resolver/src/browser/variable-resolver-service.ts b/packages/variable-resolver/src/browser/variable-resolver-service.ts index a88a05cd44956..d4dd6f7a3320c 100644 --- a/packages/variable-resolver/src/browser/variable-resolver-service.ts +++ b/packages/variable-resolver/src/browser/variable-resolver-service.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -// tslint:disable:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ import { injectable, inject } from 'inversify'; import { VariableRegistry } from './variable'; @@ -64,6 +64,7 @@ export class VariableResolverService { } protected async doResolve(value: Object | undefined, context: VariableResolverService.Context): Promise { + // eslint-disable-next-line no-null/no-null if (value === undefined || value === null) { return value; } @@ -111,6 +112,7 @@ export class VariableResolverService { protected async resolveVariables(value: string, context: VariableResolverService.Context): Promise { const variableRegExp = new RegExp(VariableResolverService.VAR_REGEXP); let match; + // eslint-disable-next-line no-null/no-null while ((match = variableRegExp.exec(value)) !== null) { const variableName = match[1]; await context.resolve(variableName); @@ -145,6 +147,7 @@ export namespace VariableResolverService { } const variable = this.variableRegistry.getVariable(variableName); const value = variable && await variable.resolve(this.options.context, argument, this.options.configurationSection); + // eslint-disable-next-line no-null/no-null const stringValue = value !== undefined && value !== null && JSONExt.isPrimitive(value as ReadonlyJSONValue) ? String(value) : undefined; this.resolved.set(name, stringValue); } catch (e) { diff --git a/packages/variable-resolver/src/browser/variable.spec.ts b/packages/variable-resolver/src/browser/variable.spec.ts index e4e3b3288d407..c4d33d5d19355 100644 --- a/packages/variable-resolver/src/browser/variable.spec.ts +++ b/packages/variable-resolver/src/browser/variable.spec.ts @@ -20,7 +20,7 @@ import { ILogger, Disposable } from '@theia/core/lib/common'; import { MockLogger } from '@theia/core/lib/common/test/mock-logger'; import { Variable, VariableRegistry } from './variable'; -// tslint:disable:no-unused-expression +/* eslint-disable no-unused-expressions */ const expect = chai.expect; let variableRegistry: VariableRegistry; diff --git a/packages/workspace/.eslintrc.js b/packages/workspace/.eslintrc.js new file mode 100644 index 0000000000000..f033eb1546d4b --- /dev/null +++ b/packages/workspace/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'compile.tsconfig.json' + } +}; diff --git a/packages/workspace/compile.tsconfig.json b/packages/workspace/compile.tsconfig.json index b8b72b49c8822..d9082d2855656 100644 --- a/packages/workspace/compile.tsconfig.json +++ b/packages/workspace/compile.tsconfig.json @@ -1,10 +1,22 @@ { "extends": "../../configs/base.tsconfig", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, "include": [ "src" + ], + "references": [ + { + "path": "../core/compile.tsconfig.json" + }, + { + "path": "../filesystem/compile.tsconfig.json" + }, + { + "path": "../variable-resolver/compile.tsconfig.json" + } ] -} \ No newline at end of file +} diff --git a/packages/workspace/package.json b/packages/workspace/package.json index 529ce83b61542..c0af917964543 100644 --- a/packages/workspace/package.json +++ b/packages/workspace/package.json @@ -37,10 +37,10 @@ "src" ], "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "theiaext clean", + "lint": "theiaext lint", "build": "theiaext build", "watch": "theiaext watch", + "clean": "theiaext clean", "test": "theiaext test" }, "devDependencies": { diff --git a/packages/workspace/src/browser/workspace-commands.ts b/packages/workspace/src/browser/workspace-commands.ts index 3c5afa3b9ddeb..a17f96aa3b281 100644 --- a/packages/workspace/src/browser/workspace-commands.ts +++ b/packages/workspace/src/browser/workspace-commands.ts @@ -451,17 +451,17 @@ export class WorkspaceRootUriAwareCommandHandler extends UriAwareCommandHandler< super(selectionService, handler); } - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any public isEnabled(...args: any[]): boolean { return super.isEnabled(...args) && !!this.workspaceService.tryGetRoots().length; } - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any public isVisible(...args: any[]): boolean { return super.isVisible(...args) && !!this.workspaceService.tryGetRoots().length; } - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected getUri(...args: any[]): URI | undefined { const uri = super.getUri(...args); // If the URI is available, return it immediately. diff --git a/packages/workspace/src/browser/workspace-frontend-contribution.spec.ts b/packages/workspace/src/browser/workspace-frontend-contribution.spec.ts index 116e37160cf7a..8a136a112211e 100644 --- a/packages/workspace/src/browser/workspace-frontend-contribution.spec.ts +++ b/packages/workspace/src/browser/workspace-frontend-contribution.spec.ts @@ -55,7 +55,7 @@ describe('workspace-frontend-contribution', () => { ] as [OS.Type, 'browser' | 'electron', boolean, OpenFileDialogProps][]).forEach(test => { const [type, environment, supportMultiRootWorkspace, expected] = test; const electron = environment === 'electron' ? true : false; - const os = (OS.Type as any)[type]; // tslint:disable-line:no-any + const os = (OS.Type as any)[type]; // eslint-disable-line @typescript-eslint/no-explicit-any const actual = WorkspaceFrontendContribution.createOpenWorkspaceOpenFileDialogProps({ type, electron, diff --git a/packages/workspace/src/browser/workspace-service.spec.ts b/packages/workspace/src/browser/workspace-service.spec.ts index 32b0441aa6f3b..5b27ce68eb6e5 100644 --- a/packages/workspace/src/browser/workspace-service.spec.ts +++ b/packages/workspace/src/browser/workspace-service.spec.ts @@ -55,8 +55,8 @@ const getFormattedJson = (data: string): string => { return jsoncparser.applyEdits(data, edits); }; -// tslint:disable:no-any -// tslint:disable:no-unused-expression +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable no-unused-expressions */ describe('WorkspaceService', () => { const toRestore: Array = []; const toDispose: Disposable[] = []; diff --git a/packages/workspace/src/browser/workspace-service.ts b/packages/workspace/src/browser/workspace-service.ts index 61f2a776b0206..eaf63830219f2 100644 --- a/packages/workspace/src/browser/workspace-service.ts +++ b/packages/workspace/src/browser/workspace-service.ts @@ -596,7 +596,7 @@ export interface WorkspaceInput { export interface WorkspaceData { folders: Array<{ path: string, name?: string }>; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any settings?: { [id: string]: any }; } @@ -625,12 +625,12 @@ export namespace WorkspaceData { required: ['folders'] }); - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function is(data: any): data is WorkspaceData { return !!validateSchema(data); } - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any export function buildWorkspaceData(folders: string[] | FileStat[], settings: { [id: string]: any } | undefined): WorkspaceData { let roots: string[] = []; if (folders.length > 0) { diff --git a/packages/workspace/src/browser/workspace-uri-contribution.spec.ts b/packages/workspace/src/browser/workspace-uri-contribution.spec.ts index 1cc81fd11c861..d3977bbd49feb 100644 --- a/packages/workspace/src/browser/workspace-uri-contribution.spec.ts +++ b/packages/workspace/src/browser/workspace-uri-contribution.spec.ts @@ -45,7 +45,7 @@ beforeEach(() => { container = new Container(); container.bind(ApplicationShell).toConstantValue({ currentChanged: new Signal({}) - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); const workspaceService = new WorkspaceService(); workspaceService.tryGetRoots = () => roots; @@ -96,7 +96,7 @@ describe('WorkspaceUriLabelProviderContribution class', () => { }); it('should return file icon from a non-folder FileStat', async () => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any stubs.push(sinon.stub(DefaultUriLabelProviderContribution.prototype, 'getFileIcon').returns(undefined)); expect(labelProvider.getIcon({ uri: 'file:///home/test', @@ -106,7 +106,7 @@ describe('WorkspaceUriLabelProviderContribution class', () => { }); it('should return folder icon from a folder URI', async () => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any stubs.push(sinon.stub(DefaultUriLabelProviderContribution.prototype, 'getFileIcon').returns(undefined)); expect(labelProvider.getIcon({ uri: 'file:///home/test', @@ -116,7 +116,7 @@ describe('WorkspaceUriLabelProviderContribution class', () => { }); it('should return file icon from a file URI', async () => { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any stubs.push(sinon.stub(DefaultUriLabelProviderContribution.prototype, 'getFileIcon').returns(undefined)); expect(labelProvider.getIcon({ uri: 'file:///home/test', @@ -127,7 +127,7 @@ describe('WorkspaceUriLabelProviderContribution class', () => { it('should return what getFileIcon() returns from a URI or non-folder FileStat, if getFileIcon() does not return null or undefined', async () => { const ret = 'TestString'; - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any stubs.push(sinon.stub(DefaultUriLabelProviderContribution.prototype, 'getFileIcon').returns(ret)); expect(labelProvider.getIcon(new URI('file:///home/test'))).eq(ret); expect(labelProvider.getIcon({ diff --git a/packages/workspace/src/node/default-workspace-server.ts b/packages/workspace/src/node/default-workspace-server.ts index 7d55ab0f4d616..f6e35ca98b350 100644 --- a/packages/workspace/src/node/default-workspace-server.ts +++ b/packages/workspace/src/node/default-workspace-server.ts @@ -173,7 +173,7 @@ interface RecentWorkspacePathsData { namespace RecentWorkspacePathsData { export function is(data: Object | undefined): data is RecentWorkspacePathsData { - // tslint:disable-next-line:no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return !!data && typeof data === 'object' && ('recentRoots' in data) && Array.isArray((data as any)['recentRoots']); } } diff --git a/scripts/compile-references.js b/scripts/compile-references.js new file mode 100644 index 0000000000000..0065df64f369f --- /dev/null +++ b/scripts/compile-references.js @@ -0,0 +1,201 @@ +/******************************************************************************** + * Copyright (C) 2020 Ericsson and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ + +/** + * This script generates tsconfig references between our workspaces, it also + * configures our .eslintrc file to use such references. + * + * `tsc` build mode relies on these references to build out of date dependencies + * only when required, but it cannot infer workspaces by itself, it has to be + * explicitly defined [1]. + * + * [1]: https://www.typescriptlang.org/docs/handbook/project-references.html + */ + +// @ts-check + +const cp = require('child_process') +const path = require('path').posix +const fs = require('fs') + +const CWD = path.join(__dirname, '..') + +const FORCE_REWRITE = Boolean(process.env['THEIA_REPO_FORCE_REWRITE']) + +/** @type {{ [packageName: string]: YarnWorkspace }} */ +const YARN_WORKSPACES = JSON.parse(cp.execSync('yarn --silent workspaces info').toString()) + +/** @type {YarnWorkspace} */ +const THEIA_MONOREPO = { + workspaceDependencies: Object.keys(YARN_WORKSPACES), + location: '.', +} + +{ + // Configure all `compile.tsconfig.json` files of this monorepo + for (const packageName of Object.keys(YARN_WORKSPACES)) { + const workspacePackage = YARN_WORKSPACES[packageName] + const tsconfigCompilePath = path.join(CWD, workspacePackage.location, 'compile.tsconfig.json') + const references = getTypescriptReferences(workspacePackage) + configureTypeScriptCompilation(tsconfigCompilePath, references) + } + const tsconfigCompilePath = path.join(CWD, 'compile.tsconfig.json') + const references = getTypescriptReferences(THEIA_MONOREPO) + configureTypeScriptCompilation(tsconfigCompilePath, references) + + // Configure the root `tsconfig.json` for code navigation using `tsserver`. + configureTypeScriptNavigation() +} + +/** + * @param {YarnWorkspace} requestedPackage + * @returns {string[]} project references for `requestedPackage`. + */ +function getTypescriptReferences(requestedPackage) { + const references = [] + for (const dependency of requestedPackage.workspaceDependencies || []) { + const depWorkspace = YARN_WORKSPACES[dependency] + const depConfig = path.join(depWorkspace.location, 'compile.tsconfig.json') + if (!fs.existsSync(depConfig)) { + continue + } + const relativePath = path.relative(requestedPackage.location, depWorkspace.location) + references.push(relativePath) + } + return references +} + +/** + * Wires a given compilation tsconfig file according to the provided references. + * This allows TypeScript to operate in build mode. + * + * @param {string} tsconfigPath path to the tsconfig file to edit. + * @param {string[]} references list of paths to the related project roots. + */ +function configureTypeScriptCompilation(tsconfigPath, references) { + if (!fs.existsSync(tsconfigPath)) { + return + } + let needRewrite = false + const tsconfigJson = readJsonFile(tsconfigPath) + if (!tsconfigJson.compilerOptions) { + // Somehow no `compilerOptions` literal is defined. + tsconfigJson.compilerOptions = { + composite: true, + rootDir: 'src', + outDir: 'lib', + } + } else if (!tsconfigJson.compilerOptions.composite) { + // `compilerOptions` is missing the `composite` literal. + tsconfigJson.compilerOptions = { + composite: true, + ...tsconfigJson.compilerOptions, + } + needRewrite = true + } + const currentReferences = new Set((tsconfigJson['references'] || []).map(reference => reference.path)) + for (const reference of references) { + const tsconfigReference = path.join(reference, 'compile.tsconfig.json') + if (!currentReferences.has(tsconfigReference)) { + currentReferences.add(tsconfigReference) + needRewrite = true + } + } + if (FORCE_REWRITE || needRewrite) { + tsconfigJson.references = [] + for (const reference of currentReferences) { + tsconfigJson.references.push({ + path: reference, + }) + } + const content = JSON.stringify(tsconfigJson, undefined, 2) + fs.writeFileSync(tsconfigPath, content + '\n') + } +} + +/** + * Wire the root `tsconfig.json` to map scoped import to real location in the monorepo. + * This setup is a shim for the TypeScript language server to provide cross-package navigation. + * Compilation is done via `compile.tsconfig.json` files. + */ +function configureTypeScriptNavigation() { + let needRewrite = false + const tsconfigPath = path.join(CWD, 'tsconfig.json') + const tsconfigJson = readJsonFile(tsconfigPath) + if (typeof tsconfigJson.compilerOptions === 'undefined') { + // Somehow no `compilerOptions` literal is defined. + tsconfigJson.compilerOptions = { + baseUrl: '.', + paths: {}, + } + needRewrite = true + } else if (typeof tsconfigJson.compilerOptions.paths === 'undefined') { + // `compilerOptions` is missing the `paths` literal. + tsconfigJson.compilerOptions = { + ...tsconfigJson.compilerOptions, + paths: {}, + } + needRewrite = true + } + /** @type {{ [prefix: string]: string[] }} */ + const currentPaths = tsconfigJson.compilerOptions.paths + for (const packageName of THEIA_MONOREPO.workspaceDependencies) { + const depWorkspace = YARN_WORKSPACES[packageName] + const depConfig = path.join(depWorkspace.location, 'compile.tsconfig.json') + + /** @type {string} */ + let originalPath + /** @type {string} */ + let mappedPath + + if (fs.existsSync(depConfig)) { + // If it is a TypeScript dependency, map `lib` imports to our local sources in `src`. + originalPath = `${packageName}/lib/*` + mappedPath = path.relative(THEIA_MONOREPO.location, path.join(depWorkspace.location, 'src', '*')) + } else { + // I don't really know what to do here, simply point to our local package root. + originalPath = `${packageName}/*` + mappedPath = path.relative(THEIA_MONOREPO.location, path.join(depWorkspace.location, '*')) + } + if (typeof currentPaths[originalPath] === 'undefined' || currentPaths[originalPath][0] !== mappedPath) { + currentPaths[originalPath] = [mappedPath] + needRewrite = true + } + } + if (FORCE_REWRITE || needRewrite) { + const content = JSON.stringify(tsconfigJson, undefined, 2) + fs.writeFileSync(tsconfigPath, content + '\n') + } +} + +/** + * @param {string} path + * @returns {any} + */ +function readJsonFile(path) { + try { + return JSON.parse(fs.readFileSync(path).toString()) + } catch (error) { + console.error('ParseError in file:', path); + throw error; + } +} + +/** + * @typedef YarnWorkspace + * @property {string} location + * @property {string[]} workspaceDependencies + */ diff --git a/scripts/run-reverse-topo.js b/scripts/run-reverse-topo.js new file mode 100644 index 0000000000000..0f62783ad73e9 --- /dev/null +++ b/scripts/run-reverse-topo.js @@ -0,0 +1,60 @@ +/******************************************************************************** + * Copyright (C) 2020 Ericsson and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ + +/** + * This script will run a subcommand for each package in reverse-topology order. + * + * The command will be ran once per package, you can use the __PACKAGE__ tag in + * your command and arguments and it will get replaced by the current package + * from the iteration. + */ + +// @ts-check + +const cp = require('child_process') + +const yarnWorkspaces = cp.execSync('yarn --silent workspaces info') +const lernaSort = cp.execSync('yarn --silent lerna ls --sort --json') + +/** @type {LernaPackage[]} */ +const packages = JSON.parse(lernaSort.toString()) + +/** @type {{ [key: string]: YarnWorkspace }} */ +const workspaces = JSON.parse(yarnWorkspaces.toString()) + +// reverse topology order +packages.reverse() + +for (const package of packages) { + const workspace = workspaces[package.name] + const command = process.argv[2] + const args = process.argv.slice(3).map(arg => arg.replace(/__PACKAGE__/g, package.name)) + console.log(`${package.name}: $ ${command} ${args.join(' ')}`) + cp.spawnSync(command, args, { + stdio: ['ignore', 'ignore', 'inherit'], + cwd: workspace.location, + }) +} + +/** + * @typedef LernaPackage + * @property {string} name + */ + +/** + * @typedef YarnWorkspace + * @property {string} location + */ diff --git a/scripts/skip-prepare.js b/scripts/skip-prepare.js deleted file mode 100644 index 3c9ce7481496b..0000000000000 --- a/scripts/skip-prepare.js +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env node -// @ts-check -/******************************************************************************** - * Copyright (C) 2019 Ericsson and others. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the Eclipse - * Public License v. 2.0 are satisfied: GNU General Public License, version 2 - * with the GNU Classpath Exception which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - ********************************************************************************/ - -/** - * Theia's `package.json` contains a `prepare` script which is triggered after each install. - * But we don't always want to build the whole project after installing dependencies. - * This script looks for an environment variable to skip the prepare step. - * - * Example (Unix): `THEIA_SKIP_NPM_PREPARE=1 yarn` - * - * Script returns successfully (code=0) when the variable is set, and fails (code>0) - * when variable is not set. This allows `script || a && b && ...` which will skip - * the following commands if `script` returns 0, but will keep going otherwise. - */ - -if (process.env.THEIA_SKIP_NPM_PREPARE) { - console.error('skipping `npm prepare`') - process.exit(0) // stop -} else { - process.exit(1) // ok -} diff --git a/tsconfig.json b/tsconfig.json index e10ed4853e031..45048363f0065 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,146 +1,186 @@ { - "extends": "./configs/base.tsconfig", + "// README": [ + "THIS FILE SHOULD NOT BE USED FOR COMPILATION.", + "THIS FILE IS WRITTEN FOR TSSERVER TO UNDERSTAND OUR MONOREPO.", + "SEE `compile.tsconfig.json` FOR COMPILATION CONFIGURATION." + ], + "extends": "./configs/base.tsconfig.json", + "include": [ + "dev-packages/*/src/**/*.ts", + "packages/*/src/**/*.ts", + "examples/*/src/**/*.ts" + ], "compilerOptions": { - "skipLibCheck": false, "baseUrl": ".", "paths": { - "@theia/application-package": [ - "dev-packages/application-package/src" - ], - "@theia/application-package/lib/*": [ - "dev-packages/application-package/src/*" - ], - "@theia/core": [ - "packages/core/src/common" - ], - "@theia/core/lib/*": [ - "packages/core/src/*" - ], - "@theia/filesystem/lib/*": [ - "packages/filesystem/src/*" - ], "mv": [ "packages/filesystem/src/typings/mv" ], "trash": [ "packages/filesystem/src/typings/trash" ], - "@theia/navigator/lib/*": [ - "packages/navigator/src/*" + "@theia/application-manager/lib/*": [ + "dev-packages/application-manager/src/*" ], - "@theia/preferences/lib/*": [ - "packages/preferences/src/*" + "@theia/application-package/lib/*": [ + "dev-packages/application-package/src/*" ], - "@theia/workspace/lib/*": [ - "packages/workspace/src/*" + "@theia/cli/lib/*": [ + "dev-packages/cli/src/*" ], - "@theia/terminal/lib/*": [ - "packages/terminal/src/*" + "@theia/callhierarchy/lib/*": [ + "packages/callhierarchy/src/*" ], - "@theia/languages/lib/*": [ - "packages/languages/src/*" + "@theia/console/lib/*": [ + "packages/console/src/*" + ], + "@theia/core/lib/*": [ + "packages/core/src/*" + ], + "@theia/debug-nodejs/lib/*": [ + "packages/debug-nodejs/src/*" + ], + "@theia/debug/lib/*": [ + "packages/debug/src/*" + ], + "@theia/editor-preview/lib/*": [ + "packages/editor-preview/src/*" ], "@theia/editor/lib/*": [ "packages/editor/src/*" ], - "@theia/mini-browser/lib/*": [ - "packages/mini-browser/src/*" + "@theia/editorconfig/lib/*": [ + "packages/editorconfig/src/*" ], - "@theia/monaco/lib/*": [ - "packages/monaco/src/*" + "@theia/file-search/lib/*": [ + "packages/file-search/src/*" ], - "@theia/java/lib/*": [ - "packages/java/src/*" + "@theia/filesystem/lib/*": [ + "packages/filesystem/src/*" + ], + "@theia/getting-started/lib/*": [ + "packages/getting-started/src/*" + ], + "@theia/git/lib/*": [ + "packages/git/src/*" ], "@theia/java-debug/lib/*": [ "packages/java-debug/src/*" ], - "@theia/debug/lib/*": [ - "packages/debug/src/*" - ], - "@theia/debug-nodejs/lib/*": [ - "packages/debug-nodejs/src/*" + "@theia/java/lib/*": [ + "packages/java/src/*" ], - "@theia/python/lib/*": [ - "packages/python/src/*" + "@theia/json/lib/*": [ + "packages/json/src/*" ], - "@theia/git/lib/*": [ - "packages/git/src/*" + "@theia/keymaps/lib/*": [ + "packages/keymaps/src/*" ], - "@theia/process/lib*": [ - "packages/process/src/*" + "@theia/languages/lib/*": [ + "packages/languages/src/*" ], "@theia/markers/lib/*": [ "packages/markers/src/*" ], - "@theia/outline-view/lib/*": [ - "packages/outline-view/src/*" + "@theia/merge-conflicts/lib/*": [ + "packages/merge-conflicts/src/*" ], "@theia/messages/lib/*": [ "packages/messages/src/*" ], - "@theia/merge-conflicts/lib/*": [ - "packages/merge-conflicts/src/*" + "@theia/metrics/lib/*": [ + "packages/metrics/src/*" + ], + "@theia/mini-browser/lib/*": [ + "packages/mini-browser/src/*" + ], + "@theia/monaco/lib/*": [ + "packages/monaco/src/*" + ], + "@theia/navigator/lib/*": [ + "packages/navigator/src/*" + ], + "@theia/outline-view/lib/*": [ + "packages/outline-view/src/*" ], "@theia/output/lib/*": [ "packages/output/src/*" ], - "@theia/callhierarchy/lib/*": [ - "packages/callhierarchy/src/*" + "@theia/plugin-dev/lib/*": [ + "packages/plugin-dev/src/*" ], - "@theia/typehierarchy/lib/*": [ - "packages/typehierarchy/src/*" + "@theia/plugin-ext-vscode/lib/*": [ + "packages/plugin-ext-vscode/src/*" ], - "@theia/variable-resolver/lib/*": [ - "packages/variable-resolver/src/*" + "@theia/plugin-ext/lib/*": [ + "packages/plugin-ext/src/*" ], - "@theia/editorconfig/lib/*": [ - "packages/editorconfig/src/*" + "@theia/plugin-metrics/lib/*": [ + "packages/plugin-metrics/src/*" ], - "@theia/console/lib/*": [ - "packages/console/src/*" + "@theia/plugin/lib/*": [ + "packages/plugin/src/*" + ], + "@theia/preferences/lib/*": [ + "packages/preferences/src/*" + ], + "@theia/preview/lib/*": [ + "packages/preview/src/*" + ], + "@theia/process/lib/*": [ + "packages/process/src/*" + ], + "@theia/python/lib/*": [ + "packages/python/src/*" ], "@theia/scm/lib/*": [ "packages/scm/src/*" ], - "@theia/getting-started/lib/*": [ - "packages/getting-started/src/*" + "@theia/search-in-workspace/lib/*": [ + "packages/search-in-workspace/src/*" ], - "@theia/file-search/lib/*": [ - "packages/file-search/src/*" + "@theia/task/lib/*": [ + "packages/task/src/*" ], - "@theia/plugin-dev/lib/*": [ - "packages/plugin-dev/src/*" + "@theia/terminal/lib/*": [ + "packages/terminal/src/*" ], - "@theia/plugin-ext/lib/*": [ - "packages/plugin-ext/src/*" + "@theia/textmate-grammars/lib/*": [ + "packages/textmate-grammars/src/*" ], - "@theia/plugin-ext-vscode/lib/*": [ - "packages/plugin-ext-vscode/src/*" + "@theia/tslint/lib/*": [ + "packages/tslint/src/*" ], - "@theia/plugin-metrics/lib/*": [ - "packages/plugin-metrics/src/*" + "@theia/typehierarchy/lib/*": [ + "packages/typehierarchy/src/*" + ], + "@theia/typescript/lib/*": [ + "packages/typescript/src/*" ], "@theia/userstorage/lib/*": [ "packages/userstorage/src/*" ], - "@theia/task/lib/*": [ - "packages/task/src/*" + "@theia/variable-resolver/lib/*": [ + "packages/variable-resolver/src/*" + ], + "@theia/workspace/lib/*": [ + "packages/workspace/src/*" ], "@theia/api-samples/lib/*": [ "examples/api-samples/src/*" + ], + "@theia/example-browser/lib/*": [ + "examples/browser/src/*" + ], + "@theia/example-electron/lib/*": [ + "examples/electron/src/*" + ], + "@theia/electron/*": [ + "dev-packages/electron/*" + ], + "@theia/ext-scripts/*": [ + "dev-packages/ext-scripts/*" ] - }, - "plugins": [ - { - "name": "tslint-language-service" - } - ] - }, - "include": [ - "dev-packages/*/src", - "packages/*/src", - "examples/*/src", - "examples/*/test" - ] + } + } } diff --git a/tslint.json b/tslint.json deleted file mode 100644 index e3a38cec479d5..0000000000000 --- a/tslint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "//": [ - "Lint rules expected to be used in interactive editors." - ], - "extends": [ - "./configs/errors.tslint.json", - "./configs/warnings.tslint.json" - ] -} diff --git a/yarn.lock b/yarn.lock index ad9fbd981dcf9..563b103c48517 100644 --- a/yarn.lock +++ b/yarn.lock @@ -973,6 +973,11 @@ resolved "https://registry.yarnpkg.com/@types/escape-html/-/escape-html-0.0.20.tgz#cae698714dd61ebee5ab3f2aeb9a34ba1011735a" integrity sha512-6dhZJLbA7aOwkYB2GDGdIqJ20wmHnkDzaxV9PJXe7O02I2dSFTERzRB6JrX6cWKaS+VqhhY7cQUMCbO5kloFUw== +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/events@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" @@ -1035,6 +1040,11 @@ "@types/tough-cookie" "*" parse5 "^4.0.0" +"@types/json-schema@^7.0.3": + version "7.0.4" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" + integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA== + "@types/linkify-it@*": version "2.1.0" resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-2.1.0.tgz#ea3dd64c4805597311790b61e872cbd1ed2cd806" @@ -1272,6 +1282,57 @@ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-11.1.3.tgz#33c8ebf05f78f1edeb249c1cde1a42ae57f5664e" integrity sha512-moBUF6X8JsK5MbLZGP3vCfG/TVHZHsaePj3EimlLKp8+ESUjGjpXalxyn90a2L9fTM2ZGtW4swb6Am1DvVRNGA== +"@typescript-eslint/eslint-plugin-tslint@^2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-2.16.0.tgz#8e8573cc2560ddae5a8a30fc2eb6af10f1ff9658" + integrity sha512-F+In2z6VCWiI0J4P4OzUQY9UzT5y/0Xg6bHM6twoK5XmPdbR7zT9JzIZKLcXyr80XT5LbgHjnW6oPGp1O3W36g== + dependencies: + "@typescript-eslint/experimental-utils" "2.16.0" + lodash "^4.17.15" + +"@typescript-eslint/eslint-plugin@^2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.16.0.tgz#bf339b7db824c7cc3fd1ebedbc88dd17016471af" + integrity sha512-TKWbeFAKRPrvKiR9GNxErQ8sELKqg1ZvXi6uho07mcKShBnCnqNpDQWP01FEvWKf0bxM2g7uQEI5MNjSNqvUpQ== + dependencies: + "@typescript-eslint/experimental-utils" "2.16.0" + eslint-utils "^1.4.3" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.16.0.tgz#bba65685728c532e0ddc811a0376e8d38e671f77" + integrity sha512-bXTmAztXpqxliDKZgvWkl+5dHeRN+jqXVZ16peKKFzSXVzT6mz8kgBpHiVzEKO2NZ8OCU7dG61K9sRS/SkUUFQ== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.16.0" + eslint-scope "^5.0.0" + +"@typescript-eslint/parser@^2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.16.0.tgz#d0c0135a8fdb915f670802ddd7c1ba457c1b4f9d" + integrity sha512-+w8dMaYETM9v6il1yYYkApMSiwgnqXWJbXrA94LAWN603vXHACsZTirJduyeBOJjA9wT6xuXe5zZ1iCUzoxCfw== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.16.0" + "@typescript-eslint/typescript-estree" "2.16.0" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/typescript-estree@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.16.0.tgz#b444943a76c716ed32abd08cbe96172d2ca0ab75" + integrity sha512-hyrCYjFHISos68Bk5KjUAXw0pP/455qq9nxqB1KkT67Pxjcfw+r6Yhcmqnp8etFL45UexCHUMrADHH7dI/m2WQ== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^6.3.0" + tsutils "^3.17.1" + "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" @@ -1467,6 +1528,11 @@ acorn-globals@^4.1.0: acorn "^6.0.1" acorn-walk "^6.0.1" +acorn-jsx@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" + integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== + acorn-walk@^6.0.1: version "6.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" @@ -1482,6 +1548,11 @@ acorn@^6.0.1, acorn@^6.2.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784" integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw== +acorn@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" + integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== + add-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" @@ -1514,7 +1585,7 @@ ajv@^5.0.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^6.1.0, ajv@^6.10.2, ajv@^6.5.3, ajv@^6.5.5: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.3, ajv@^6.5.5: version "6.10.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== @@ -1549,6 +1620,13 @@ ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== +ansi-escapes@^4.2.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.0.tgz#a4ce2b33d6b214b7950d8595c212f12ac9cc569d" + integrity sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg== + dependencies: + type-fest "^0.8.1" + ansi-gray@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" @@ -1571,6 +1649,11 @@ ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -1716,6 +1799,15 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= +array-includes@^3.0.3: + version "3.1.1" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.1.tgz#cdd67e6852bdf9c1215460786732255ed2459348" + integrity sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0" + is-string "^1.0.5" + array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -1738,6 +1830,14 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +array.prototype.flat@^1.2.1: + version "1.2.3" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz#0de82b426b0318dbfdb940089e38b043d37f6c7b" + integrity sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -1807,6 +1907,11 @@ ast-types@^0.9.2: resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.14.tgz#d34ba5dffb9d15a44351fd2a9d82e4ab2838b5ba" integrity sha512-Ebvx7/0lLboCdyEmAw/4GqwBeKIijPveXNiVGhCGCNxc7z26T5he7DC6ARxu8ByKuzUZZcLog+VP8GMyZrBzJw== +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + async-each@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" @@ -3035,6 +3140,11 @@ caller-id@^0.1.0: dependencies: stack-trace "~0.0.7" +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -3267,6 +3377,13 @@ cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + cli-spinners@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" @@ -3654,6 +3771,11 @@ constants-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + content-disposition@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" @@ -4266,7 +4388,7 @@ debug@^3.0.0, debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -4402,7 +4524,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -define-properties@^1.1.2: +define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -4534,6 +4656,21 @@ dir-glob@^2.0.0: dependencies: path-type "^3.0.0" +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + dom-helpers@^5.0.0: version "5.1.3" resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.1.3.tgz#7233248eb3a2d1f74aafca31e52c5299cc8ce821" @@ -4768,6 +4905,11 @@ emoji-regex@^7.0.1: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -4847,6 +4989,32 @@ error@^7.0.2: dependencies: string-template "~0.2.1" +es-abstract@^1.17.0, es-abstract@^1.17.0-next.1: + version "1.17.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.1.tgz#1331afa4cba2628b63e988104b9846c2d631b380" + integrity sha512-WmWNHWmm/LDwK8jaeZic/g6sU1ZckM+vvOyCV1qFRhJJ6hzve6DRgthNQB7Lra1ocrw68HexLKYgtdxIPcb3Fg== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.1.5" + is-regex "^1.0.5" + object-inspect "^1.7.0" + object-keys "^1.1.1" + object.assign "^4.1.0" + string.prototype.trimleft "^2.1.1" + string.prototype.trimright "^2.1.1" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + es6-promise@^4.0.3, es6-promise@^4.2.4: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" @@ -4898,6 +5066,45 @@ escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" +eslint-import-resolver-node@^0.3.2: + version "0.3.3" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz#dbaa52b6b2816b50bc6711af75422de808e98404" + integrity sha512-b8crLDo0M5RSe5YG8Pu2DYBj71tSB6OvXkfzwbJU2w7y8P4/yo0MyF8jU26IEuEuHF2K5/gcAJE3LhQGqBBbVg== + dependencies: + debug "^2.6.9" + resolve "^1.13.1" + +eslint-module-utils@^2.4.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.5.2.tgz#7878f7504824e1b857dd2505b59a8e5eda26a708" + integrity sha512-LGScZ/JSlqGKiT8OC+cYRxseMjyqt6QO54nl281CK93unD89ijSeRV6An8Ci/2nvWVKe8K/Tqdm75RQoIOCr+Q== + dependencies: + debug "^2.6.9" + pkg-dir "^2.0.0" + +eslint-plugin-import@^2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.0.tgz#d749a7263fb6c29980def8e960d380a6aa6aecaa" + integrity sha512-NK42oA0mUc8Ngn4kONOPsPB1XhbUvNHqF+g307dPV28aknPoiNnKLFd9em4nkswwepdF5ouieqv5Th/63U7YJQ== + dependencies: + array-includes "^3.0.3" + array.prototype.flat "^1.2.1" + contains-path "^0.1.0" + debug "^2.6.9" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.4.1" + has "^1.0.3" + minimatch "^3.0.4" + object.values "^1.1.0" + read-pkg-up "^2.0.0" + resolve "^1.12.0" + +eslint-plugin-no-null@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-null/-/eslint-plugin-no-null-1.0.2.tgz#1236a812391390a1877ad4007c26e745341c951f" + integrity sha1-EjaoEjkTkKGHetQAfCbnRTQclR8= + eslint-scope@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" @@ -4906,6 +5113,78 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" + integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-visitor-keys@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" + integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== + +eslint@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" + integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.10.0" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^5.0.0" + eslint-utils "^1.4.3" + eslint-visitor-keys "^1.1.0" + espree "^6.1.2" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.0.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^7.0.0" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.14" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.3" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" + table "^5.2.3" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.2.tgz#6c272650932b4f91c3714e5e7b5f5e2ecf47262d" + integrity sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA== + dependencies: + acorn "^7.1.0" + acorn-jsx "^5.1.0" + eslint-visitor-keys "^1.1.0" + esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -4921,6 +5200,13 @@ esprima@^4.0.0, esprima@~4.0.0: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" @@ -4933,7 +5219,7 @@ estraverse@^1.9.1: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= -estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -5312,6 +5598,20 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" +figures@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.1.0.tgz#4b198dd07d8d71530642864af2d45dd9e459c4ec" + integrity sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg== + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + file-icons-js@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/file-icons-js/-/file-icons-js-1.0.3.tgz#d0765dc1d86aba4b2d7664a39e4ef7af9f12c5af" @@ -5485,6 +5785,20 @@ fix-path@^2.1.0: dependencies: shell-path "^2.0.0" +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" + integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== + flatten@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" @@ -5694,6 +6008,11 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + fuzzy@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/fuzzy/-/fuzzy-0.1.3.tgz#4c76ec2ff0ac1a36a9dccf9a00df8623078d4ed8" @@ -5890,6 +6209,13 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" +glob-parent@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" + integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== + dependencies: + is-glob "^4.0.1" + glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" @@ -5941,7 +6267,7 @@ glob@^6.0.1: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@~7.1.1: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.1.1: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -5978,6 +6304,13 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +globals@^12.1.0: + version "12.3.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-12.3.0.tgz#1e564ee5c4dded2ab098b0f88f24702a3c56be13" + integrity sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw== + dependencies: + type-fest "^0.8.1" + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -6221,7 +6554,7 @@ has-symbol-support-x@^1.4.1: resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== -has-symbols@^1.0.0: +has-symbols@^1.0.0, has-symbols@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== @@ -6269,7 +6602,7 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -has@^1.0.1: +has@^1.0.1, has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== @@ -6473,11 +6806,24 @@ ignore@^3.3.5: resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + image-size@~0.5.0: version "0.5.5" resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" integrity sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w= +import-fresh@^3.0.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" + integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -6591,6 +6937,25 @@ inquirer@^6.0.0: strip-ansi "^5.1.0" through "^2.3.6" +inquirer@^7.0.0: + version "7.0.3" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.3.tgz#f9b4cd2dff58b9f73e8d43759436ace15bed4567" + integrity sha512-+OiOVeVydu4hnCGLCSX+wedovR/Yzskv9BFqUNNKq9uU2qg7LCcCo3R86S2E7WLo0y/x2pnEZfZe1CoYnORUAw== + dependencies: + ansi-escapes "^4.2.1" + chalk "^2.4.2" + cli-cursor "^3.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.15" + mute-stream "0.0.8" + run-async "^2.2.0" + rxjs "^6.5.3" + string-width "^4.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + interpret@^1.0.0, interpret@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" @@ -6679,6 +7044,11 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-callable@^1.1.4, is-callable@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" + integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== + is-ci@^1.0.10: version "1.2.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" @@ -6700,6 +7070,11 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-date-object@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" + integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -6781,6 +7156,11 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" @@ -6795,7 +7175,7 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0: +is-glob@^4.0.0, is-glob@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== @@ -6880,6 +7260,13 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= +is-regex@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" + integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== + dependencies: + has "^1.0.3" + is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" @@ -6897,6 +7284,11 @@ is-stream@^1.0.0, is-stream@^1.1.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + is-subset@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" @@ -6909,6 +7301,13 @@ is-svg@^2.0.0: dependencies: html-comment-regex "^1.1.0" +is-symbol@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== + dependencies: + has-symbols "^1.0.1" + is-text-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" @@ -7245,6 +7644,11 @@ json-schema@0.2.3: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -7488,7 +7892,7 @@ levenary@^1.1.0: dependencies: leven "^3.1.0" -levn@~0.3.0: +levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= @@ -8250,7 +8654,7 @@ mimic-fn@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== -mimic-fn@^2.0.0: +mimic-fn@^2.0.0, mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== @@ -8502,6 +8906,11 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= +mute-stream@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + mv@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/mv/-/mv-2.1.1.tgz#ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2" @@ -8548,6 +8957,11 @@ native-promise-only@^0.8.1: resolved "https://registry.yarnpkg.com/native-promise-only/-/native-promise-only-0.8.1.tgz#20a318c30cb45f71fe7adfbf7b21c99c1472ef11" integrity sha1-IKMYwwy0X3H+et+/eyHJnBRy7xE= +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + ncp@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" @@ -8886,7 +9300,12 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.11, object-keys@^1.0.12: +object-inspect@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" + integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== + +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -8928,6 +9347,16 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" +object.values@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.1.tgz#68a99ecde356b7e9295a3c5e0ce31dc8c953de5e" + integrity sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + octicons@^7.1.0: version "7.4.0" resolved "https://registry.yarnpkg.com/octicons/-/octicons-7.4.0.tgz#0be0082ed75b81e680800ef978bf47078b670091" @@ -8966,6 +9395,13 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +onetime@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" + integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + dependencies: + mimic-fn "^2.1.0" + onigasm@2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/onigasm/-/onigasm-2.2.1.tgz#d56da809d63d3bb25510e8b8e447ffe98e56bebb" @@ -8995,7 +9431,7 @@ optimist@~0.3.5: dependencies: wordwrap "~0.0.2" -optionator@^0.8.1: +optionator@^0.8.1, optionator@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== @@ -9220,6 +9656,13 @@ parallel-transform@^1.1.0: inherits "^2.0.3" readable-stream "^2.1.5" +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.5" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.5.tgz#003271343da58dc94cace494faef3d2147ecea0e" @@ -10402,6 +10845,16 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +regexpp@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.0.0.tgz#dd63982ee3300e67b41c1956f850aa680d9d330e" + integrity sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g== + regexpu-core@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b" @@ -10615,6 +11068,11 @@ resolve-from@^3.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" integrity sha1-six699nWiBvItuZTM17rywoYh0g= +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -10625,7 +11083,7 @@ resolve@1.1.x: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.3.2, resolve@^1.8.1: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.3.2, resolve@^1.8.1: version "1.14.2" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.14.2.tgz#dbf31d0fa98b1f29aa5169783b9c290cb865fea2" integrity sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ== @@ -10655,6 +11113,14 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -10672,6 +11138,13 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2. dependencies: glob "^7.1.3" +rimraf@2.6.3, rimraf@~2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + rimraf@~2.4.0: version "2.4.5" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.4.5.tgz#ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da" @@ -10679,13 +11152,6 @@ rimraf@~2.4.0: dependencies: glob "^6.0.1" -rimraf@~2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -10744,7 +11210,7 @@ rxjs@^5.4.2, rxjs@^5.5.2: dependencies: symbol-observable "1.0.1" -rxjs@^6.3.1, rxjs@^6.4.0: +rxjs@^6.3.1, rxjs@^6.4.0, rxjs@^6.5.3: version "6.5.4" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c" integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q== @@ -10861,7 +11327,7 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^6.0.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.2, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -11053,6 +11519,15 @@ slice-ansi@0.0.4: resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + slide@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" @@ -11402,6 +11877,31 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +string-width@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +string.prototype.trimleft@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz#9bdb8ac6abd6d602b17a4ed321870d2f8dcefc74" + integrity sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag== + dependencies: + define-properties "^1.1.3" + function-bind "^1.1.1" + +string.prototype.trimright@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz#440314b15996c866ce8a0341894d45186200c5d9" + integrity sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g== + dependencies: + define-properties "^1.1.3" + function-bind "^1.1.1" + string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -11442,6 +11942,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + strip-ansi@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" @@ -11491,6 +11998,11 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= +strip-json-comments@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" + integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -11597,6 +12109,16 @@ symbol-tree@^3.2.2: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== +table@^5.2.3: + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== + dependencies: + ajv "^6.10.2" + lodash "^4.17.14" + slice-ansi "^2.1.0" + string-width "^3.0.0" + tapable@^1.0.0, tapable@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" @@ -12015,6 +12537,13 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" +tsutils@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -12044,6 +12573,11 @@ type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -12381,6 +12915,11 @@ v8-compile-cache@^1.1.2: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-1.1.2.tgz#8d32e4f16974654657e676e0e467a348e89b0dc4" integrity sha512-ejdrifsIydN1XDH7EuR2hn8ZrkRKUYF7tUcBjBy/lhrCvs2K+zRlbW9UHc0IQ9RsYFZJFqJrieoIHfkCa0DBRA== +v8-compile-cache@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" + integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== + valid-filename@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/valid-filename/-/valid-filename-2.0.1.tgz#0768d6f364b1ed3bdf68f0d15abffb0d9d6cecaf" @@ -12958,6 +13497,13 @@ write-pkg@^3.1.0: sort-keys "^2.0.0" write-json-file "^2.2.0" +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + ws@^5.2.0: version "5.2.2" resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f"