diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000..dda0884b38115 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,16 @@ +**/vs/nls.build.js +**/vs/nls.js +**/vs/css.build.js +**/vs/css.js +**/vs/loader.js +**/promise-polyfill/** +**/insane/** +**/marked/** +**/test/**/*.js +**/node_modules/** +**/vscode-api-tests/testWorkspace/** +**/vscode-api-tests/testWorkspace2/** +**/extensions/**/out/** +**/extensions/**/build/** +**/extensions/markdown-language-features/media/** +**/extensions/typescript-basics/test/colorize-fixtures/** diff --git a/.eslintrc.json b/.eslintrc.json index 29efa7cbbc202..1a85f595bb2a8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,20 +1,626 @@ { - "root": true, - "env": { - "node": true, - "es6": true - }, - "rules": { - "no-console": 0, - "no-cond-assign": 0, - "no-unused-vars": 1, - "no-extra-semi": "warn", - "semi": "warn" - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaFeatures": { - "experimentalObjectRestSpread": true - } - } + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint", + "jsdoc" + ], + "rules": { + "constructor-super": "warn", + "curly": "warn", + "eqeqeq": "warn", + "no-buffer-constructor": "warn", + "no-caller": "warn", + "no-debugger": "warn", + "no-duplicate-case": "warn", + "no-duplicate-imports": "warn", + "no-eval": "warn", + "no-extra-semi": "warn", + "no-new-wrappers": "warn", + "no-redeclare": "off", + "no-sparse-arrays": "warn", + "no-throw-literal": "warn", + "no-unsafe-finally": "warn", + "no-unused-labels": "warn", + "no-var": "warn", + "jsdoc/no-types": "warn", + "semi": "off", + "@typescript-eslint/semi": "warn", + "@typescript-eslint/class-name-casing": "warn", + "code-no-unused-expressions": [ + "warn", + { + "allowTernary": true + } + ], + "code-translation-remind": "warn", + "code-no-nls-in-standalone-editor": "warn", + "code-no-standalone-editor": "warn", + "code-no-unexternalized-strings": "warn", + "code-layering": [ + "warn", + { + "common": [], + "node": [ + "common" + ], + "browser": [ + "common" + ], + "electron-main": [ + "common", + "node" + ], + "electron-browser": [ + "common", + "browser", + "node" + ] + } + ], + "code-import-patterns": [ + "warn", + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // !!! Do not relax these rules !!! + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + { + "target": "**/vs/base/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**" + ] + }, + { + "target": "**/vs/base/test/common/**", + "restrictions": [ + "assert", + "sinon", + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/test/common/**" + ] + }, + { + "target": "**/vs/base/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**" + ] + }, + { + "target": "**/vs/base/node/**", + "restrictions": [ + "vs/nls", + "**/vs/base/{common,node}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + // vs/base/test/browser contains tests for vs/base/browser + "target": "**/vs/base/test/browser/**", + "restrictions": [ + "assert", + "sinon", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/base/test/{common,browser}/**" + ] + }, + { + "target": "**/vs/base/parts/*/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/parts/*/common/**" + ] + }, + { + "target": "**/vs/base/parts/*/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**" + ] + }, + { + "target": "**/vs/base/parts/*/node/**", + "restrictions": [ + "vs/nls", + "**/vs/base/{common,node}/**", + "**/vs/base/parts/*/{common,node}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/base/parts/*/electron-browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser,node,electron-browser}/**", + "**/vs/base/parts/*/{common,browser,node,electron-browser}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/base/parts/*/electron-main/**", + "restrictions": [ + "vs/nls", + "**/vs/base/{common,node,electron-main}/**", + "**/vs/base/parts/*/{common,node,electron-main}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/platform/*/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/parts/*/common/**", + "**/vs/platform/*/common/**" + ] + }, + { + "target": "**/vs/platform/*/test/common/**", + "restrictions": [ + "assert", + "sinon", + "vs/nls", + "**/vs/base/common/**", + "**/vs/platform/*/common/**", + "**/vs/platform/*/test/common/**" + ] + }, + { + "target": "**/vs/platform/*/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**" + ] + }, + { + "target": "**/vs/platform/*/node/**", + "restrictions": [ + "vs/nls", + "**/vs/base/{common,node}/**", + "**/vs/base/parts/*/{common,node}/**", + "**/vs/platform/*/{common,node}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/platform/*/electron-browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser,node}/**", + "**/vs/base/parts/*/{common,browser,node,electron-browser}/**", + "**/vs/platform/*/{common,browser,node,electron-browser}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/platform/*/electron-main/**", + "restrictions": [ + "vs/nls", + "**/vs/base/{common,node,electron-main}/**", + "**/vs/base/parts/*/{common,node,electron-main}/**", + "**/vs/platform/*/{common,node,electron-main}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/platform/*/test/browser/**", + "restrictions": [ + "assert", + "sinon", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/platform/*/test/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/worker/**", + "**/vs/platform/*/common/**", + "**/vs/editor/common/**" + ] + }, + { + "target": "**/vs/editor/test/common/**", + "restrictions": [ + "assert", + "sinon", + "vs/nls", + "**/vs/base/common/**", + "**/vs/platform/*/common/**", + "**/vs/platform/*/test/common/**", + "**/vs/editor/common/**", + "**/vs/editor/test/common/**" + ] + }, + { + "target": "**/vs/editor/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/editor/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/test/browser/**", + "restrictions": [ + "assert", + "sinon", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/platform/*/test/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/test/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/standalone/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/platform/*/common/**", + "**/vs/editor/common/**", + "**/vs/editor/standalone/common/**" + ] + }, + { + "target": "**/vs/editor/standalone/test/common/**", + "restrictions": [ + "assert", + "sinon", + "vs/nls", + "**/vs/base/common/**", + "**/vs/platform/*/common/**", + "**/vs/platform/*/test/common/**", + "**/vs/editor/common/**", + "**/vs/editor/test/common/**" + ] + }, + { + "target": "**/vs/editor/standalone/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/contrib/**", + "**/vs/editor/standalone/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/standalone/test/browser/**", + "restrictions": [ + "assert", + "sinon", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/platform/*/test/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/standalone/{common,browser}/**", + "**/vs/editor/test/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/contrib/*/test/**", + "restrictions": [ + "assert", + "sinon", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/base/test/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/platform/*/test/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/test/{common,browser}/**", + "**/vs/editor/contrib/**" + ] + }, + { + "target": "**/vs/editor/contrib/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/contrib/**" + ] + }, + { + "target": "**/vs/workbench/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/parts/*/common/**", + "**/vs/platform/*/common/**", + "**/vs/editor/common/**", + "**/vs/editor/contrib/*/common/**", + "**/vs/workbench/common/**", + "**/vs/workbench/services/*/common/**", + "assert" + ] + }, + { + "target": "**/vs/workbench/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention + "**/vs/workbench/workbench.web.api", + "**/vs/workbench/{common,browser}/**", + "**/vs/workbench/services/*/{common,browser}/**", + "assert" + ] + }, + { + "target": "**/vs/workbench/workbench.desktop.main.ts", + "restrictions": [ + "**" + ] + }, + { + "target": "**/vs/workbench/api/common/**", + "restrictions": [ + "vscode", + "vs/nls", + "**/vs/base/common/**", + "**/vs/platform/*/common/**", + "**/vs/editor/common/**", + "**/vs/editor/contrib/*/common/**", + "**/vs/workbench/api/common/**", + "**/vs/workbench/common/**", + "**/vs/workbench/services/*/common/**", + "**/vs/workbench/contrib/*/common/**" + ] + }, + { + "target": "**/vs/workbench/api/worker/**", + "restrictions": [ + "vscode", + "vs/nls", + "**/vs/**/{common,worker}/**" + ] + }, + { + "target": "**/vs/workbench/electron-browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser,node,electron-browser}/**", + "**/vs/base/parts/*/{common,browser,node,electron-browser}/**", + "**/vs/platform/*/{common,browser,node,electron-browser}/**", + "**/vs/editor/{common,browser,node,electron-browser}/**", + "**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention + "**/vs/workbench/{common,browser,node,electron-browser,api}/**", + "**/vs/workbench/services/*/{common,browser,node,electron-browser}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/workbench/services/**/test/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/**", + "**/vs/platform/**", + "**/vs/editor/**", + "**/vs/workbench/{common,browser,node,electron-browser}/**", + "vs/workbench/contrib/files/common/editors/fileEditorInput", + "**/vs/workbench/services/**", + "**/vs/workbench/test/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/workbench/services/**/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/**/common/**", + "**/vs/platform/**/common/**", + "**/vs/editor/common/**", + "**/vs/workbench/workbench.web.api", + "**/vs/workbench/common/**", + "**/vs/workbench/services/**/common/**", + "**/vs/workbench/api/**/common/**", + "vscode-textmate" + ] + }, + { + "target": "**/vs/workbench/services/**/worker/**", + "restrictions": [ + "vs/nls", + "**/vs/base/**/common/**", + "**/vs/platform/**/common/**", + "**/vs/editor/common/**", + "**/vs/workbench/**/common/**", + "**/vs/workbench/**/worker/**", + "**/vs/workbench/services/**/common/**", + "vscode" + ] + }, + { + "target": "**/vs/workbench/services/**/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/**/{common,browser,worker}/**", + "**/vs/platform/**/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/workbench/workbench.web.api", + "**/vs/workbench/{common,browser}/**", + "**/vs/workbench/api/{common,browser}/**", + "**/vs/workbench/services/**/{common,browser}/**", + "vscode-textmate", + "onigasm-umd" + ] + }, + { + "target": "**/vs/workbench/services/**/node/**", + "restrictions": [ + "vs/nls", + "**/vs/base/**/{common,node}/**", + "**/vs/platform/**/{common,node}/**", + "**/vs/editor/{common,node}/**", + "**/vs/workbench/{common,node}/**", + "**/vs/workbench/api/{common,node}/**", + "**/vs/workbench/services/**/{common,node}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/workbench/services/**/electron-browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/**/{common,browser,worker,node,electron-browser}/**", + "**/vs/platform/**/{common,browser,node,electron-browser}/**", + "**/vs/editor/**", + "**/vs/workbench/{common,browser,node,electron-browser,api}/**", + "**/vs/workbench/services/**/{common,browser,node,electron-browser}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/workbench/contrib/terminal/browser/**", + "restrictions": [ + // xterm and its addons are strictly browser-only components + "xterm", + "xterm-addon-*", + "**/vs/**" + ] + }, + { + "target": "**/vs/workbench/contrib/extensions/browser/**", + "restrictions": [ + "semver-umd", + "**/vs/**" + ] + }, + { + "target": "**/vs/workbench/contrib/update/browser/update.ts", + "restrictions": [ + "semver-umd", + "**/vs/**" + ] + }, + { + "target": "**/vs/code/node/**", + "restrictions": [ + "vs/nls", + "**/vs/base/**/{common,node}/**", + "**/vs/base/parts/**/{common,node}/**", + "**/vs/platform/**/{common,node}/**", + "**/vs/code/**/{common,node}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/code/electron-browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/**/{common,browser,node,electron-browser}/**", + "**/vs/base/parts/**/{common,browser,node,electron-browser}/**", + "**/vs/platform/**/{common,browser,node,electron-browser}/**", + "**/vs/code/**/{common,browser,node,electron-browser}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/code/electron-main/**", + "restrictions": [ + "vs/nls", + "**/vs/base/**/{common,node,electron-main}/**", + "**/vs/base/parts/**/{common,node,electron-main}/**", + "**/vs/platform/**/{common,node,electron-main}/**", + "**/vs/code/**/{common,node,electron-main}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/vs/server/**", + "restrictions": [ + "vs/nls", + "**/vs/base/**/{common,node}/**", + "**/vs/base/parts/**/{common,node}/**", + "**/vs/platform/**/{common,node}/**", + "**/vs/workbench/**/{common,node}/**", + "**/vs/server/**", + "**/vs/code/**/{common,node}/**", + "!path" // node modules (except path where we have our own impl) + ] + }, + { + "target": "**/{node,electron-browser,electron-main}/**", + "restrictions": "**/*" + }, + { + "target": "**/extensions/**", + "restrictions": "**/*" + }, + { + "target": "**/test/smoke/**", + "restrictions": [ + "**/test/smoke/**", + "*" + ] + }, + { + "target": "**/test/automation/**", + "restrictions": [ + "**/test/automation/**", + "*" + ] + }, + { + "target": "{**/**.test.ts,**/test/**}", + "restrictions": "{**/vs/**,assert,sinon,crypto}" + }, + { + "target": "**/{common,browser,workbench}/**", + "restrictions": "**/vs/**" + } + ] + }, + "overrides": [ + { + "files": [ + "*.js" + ], + "rules": { + "jsdoc/no-types": "off" + } + } + ] } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9a2a3e71bddc..9fbfa2f16b4d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,10 +35,8 @@ jobs: name: Install Dependencies - run: yarn electron x64 name: Download Electron - - run: yarn gulp hygiene --skip-tslint + - run: yarn gulp hygiene name: Run Hygiene Checks - - run: yarn gulp tslint - name: Run TSLint Checks - run: yarn monaco-compile-check name: Run Monaco Editor Checks - run: yarn valid-globals-check @@ -69,10 +67,8 @@ jobs: name: Install Dependencies - run: yarn electron name: Download Electron - - run: yarn gulp hygiene --skip-tslint + - run: yarn gulp hygiene name: Run Hygiene Checks - - run: yarn gulp tslint - name: Run TSLint Checks - run: yarn monaco-compile-check name: Run Monaco Editor Checks - run: yarn valid-globals-check @@ -100,10 +96,8 @@ jobs: name: Install Dependencies - run: yarn electron x64 name: Download Electron - - run: yarn gulp hygiene --skip-tslint + - run: yarn gulp hygiene name: Run Hygiene Checks - - run: yarn gulp tslint - name: Run TSLint Checks - run: yarn monaco-compile-check name: Run Monaco Editor Checks - run: yarn valid-globals-check diff --git a/.vscode/extensions.json b/.vscode/extensions.json index b4336e7d127d5..2cd0a32b9ce77 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,7 +2,6 @@ // See https://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ - "ms-vscode.vscode-typescript-tslint-plugin", "dbaeumer.vscode-eslint", "EditorConfig.EditorConfig", "msjsdiag.debugger-for-chrome" diff --git a/.vscode/settings.json b/.vscode/settings.json index ef1f7370d26e3..e0fd4e2342841 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -37,6 +37,11 @@ } } ], + "eslint.options": { + "rulePaths": [ + "./build/lib/eslint" + ] + }, "typescript.tsdk": "node_modules/typescript/lib", "npm.exclude": "**/extensions/**", "npm.packageManager": "yarn", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 598d82214ce22..aa94be6112649 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -45,14 +45,6 @@ "applyTo": "allDocuments" } }, - { - "type": "gulp", - "task": "tslint", - "label": "Run tslint", - "problemMatcher": [ - "$tslint5" - ] - }, { "label": "Run tests", "type": "shell", @@ -90,7 +82,6 @@ "command": "yarn web -- --no-launch", "label": "Run web", "isBackground": true, - // This section to make error go away when launching the debug config "problemMatcher": { "pattern": { "regexp": "" @@ -104,5 +95,13 @@ "reveal": "never" } }, + { + "type": "npm", + "script": "eslint", + "problemMatcher": { + "source": "eslint", + "base": "$eslint-stylish" + } + } ] } diff --git a/build/azure-pipelines/darwin/continuous-build-darwin.yml b/build/azure-pipelines/darwin/continuous-build-darwin.yml index 1609e4a0027bb..72265e035e05f 100644 --- a/build/azure-pipelines/darwin/continuous-build-darwin.yml +++ b/build/azure-pipelines/darwin/continuous-build-darwin.yml @@ -24,11 +24,8 @@ steps: yarn electron x64 displayName: Download Electron - script: | - yarn gulp hygiene --skip-tslint + yarn gulp hygiene displayName: Run Hygiene Checks -- script: | - yarn gulp tslint - displayName: Run TSLint Checks - script: | yarn monaco-compile-check displayName: Run Monaco Editor Checks diff --git a/build/azure-pipelines/linux/continuous-build-linux.yml b/build/azure-pipelines/linux/continuous-build-linux.yml index 649c12593dac2..dac42d4ffaddc 100644 --- a/build/azure-pipelines/linux/continuous-build-linux.yml +++ b/build/azure-pipelines/linux/continuous-build-linux.yml @@ -32,11 +32,8 @@ steps: yarn electron x64 displayName: Download Electron - script: | - yarn gulp hygiene --skip-tslint + yarn gulp hygiene displayName: Run Hygiene Checks -- script: | - yarn gulp tslint - displayName: Run TSLint Checks - script: | yarn monaco-compile-check displayName: Run Monaco Editor Checks diff --git a/build/azure-pipelines/product-compile.yml b/build/azure-pipelines/product-compile.yml index 9ec01fd5db1d3..0055d48f0e450 100644 --- a/build/azure-pipelines/product-compile.yml +++ b/build/azure-pipelines/product-compile.yml @@ -88,11 +88,10 @@ steps: - script: | set -e - yarn gulp hygiene --skip-tslint - yarn gulp tslint + yarn gulp hygiene yarn monaco-compile-check yarn valid-globals-check - displayName: Run hygiene, tslint, monaco compile & valid globals checks + displayName: Run hygiene, monaco compile & valid globals checks condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | diff --git a/build/azure-pipelines/win32/continuous-build-win32.yml b/build/azure-pipelines/win32/continuous-build-win32.yml index 050a967629bda..17cb23d406faa 100644 --- a/build/azure-pipelines/win32/continuous-build-win32.yml +++ b/build/azure-pipelines/win32/continuous-build-win32.yml @@ -29,11 +29,8 @@ steps: - powershell: | yarn electron - script: | - yarn gulp hygiene --skip-tslint + yarn gulp hygiene displayName: Run Hygiene Checks -- script: | - yarn gulp tslint - displayName: Run TSLint Checks - powershell: | yarn monaco-compile-check displayName: Run Monaco Editor Checks diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index 938c82f57beab..7f52fbff35510 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -17,14 +17,14 @@ const compilation = require('./lib/compilation'); const monacoapi = require('./monaco/api'); const fs = require('fs'); -var root = path.dirname(__dirname); -var sha1 = util.getVersion(root); -var semver = require('./monaco/package.json').version; -var headerVersion = semver + '(' + sha1 + ')'; +let root = path.dirname(__dirname); +let sha1 = util.getVersion(root); +let semver = require('./monaco/package.json').version; +let headerVersion = semver + '(' + sha1 + ')'; // Build -var editorEntryPoints = [ +let editorEntryPoints = [ { name: 'vs/editor/editor.main', include: [], @@ -40,11 +40,11 @@ var editorEntryPoints = [ } ]; -var editorResources = [ +let editorResources = [ 'out-editor-build/vs/base/browser/ui/codiconLabel/**/*.ttf' ]; -var BUNDLED_FILE_HEADER = [ +let BUNDLED_FILE_HEADER = [ '/*!-----------------------------------------------------------', ' * Copyright (c) Microsoft Corporation. All rights reserved.', ' * Version: ' + headerVersion, @@ -263,7 +263,7 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => { // package.json gulp.src('build/monaco/package.json') .pipe(es.through(function (data) { - var json = JSON.parse(data.contents.toString()); + let json = JSON.parse(data.contents.toString()); json.private = false; data.contents = Buffer.from(JSON.stringify(json, null, ' ')); this.emit('data', data); @@ -307,10 +307,10 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => { return; } - var relativePathToMap = path.relative(path.join(data.relative), path.join('min-maps', data.relative + '.map')); + let relativePathToMap = path.relative(path.join(data.relative), path.join('min-maps', data.relative + '.map')); - var strContents = data.contents.toString(); - var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/'); + let strContents = data.contents.toString(); + let newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/'); strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr); data.contents = Buffer.from(strContents); diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index afde823d0b69d..9af81603c8ab7 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -8,10 +8,8 @@ const gulp = require('gulp'); const filter = require('gulp-filter'); const es = require('event-stream'); -const gulptslint = require('gulp-tslint'); const gulpeslint = require('gulp-eslint'); const tsfmt = require('typescript-formatter'); -const tslint = require('tslint'); const VinylFile = require('vinyl'); const vfs = require('vinyl-fs'); const path = require('path'); @@ -85,7 +83,7 @@ const indentationFilter = [ '!src/typings/**/*.d.ts', '!extensions/**/*.d.ts', '!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}', - '!build/{lib,tslintRules,download}/**/*.js', + '!build/{lib,download}/**/*.js', '!build/**/*.sh', '!build/azure-pipelines/**/*.js', '!build/azure-pipelines/**/*.config', @@ -128,7 +126,7 @@ const copyrightFilter = [ '!scripts/code-web.js' ]; -const eslintFilter = [ +const jsHygieneFilter = [ 'src/**/*.js', 'build/gulpfile.*.js', '!src/vs/loader.js', @@ -141,7 +139,10 @@ const eslintFilter = [ '!**/test/**' ]; -const tslintBaseFilter = [ +const tsHygieneFilter = [ + 'src/**/*.ts', + 'test/**/*.ts', + 'extensions/**/*.ts', '!**/fixtures/**', '!**/typings/**', '!**/node_modules/**', @@ -152,30 +153,6 @@ const tslintBaseFilter = [ '!extensions/html-language-features/server/lib/jquery.d.ts' ]; -const tslintCoreFilter = [ - 'src/**/*.ts', - 'test/**/*.ts', - '!extensions/**/*.ts', - '!test/automation/**', - '!test/smoke/**', - ...tslintBaseFilter -]; - -const tslintExtensionsFilter = [ - 'extensions/**/*.ts', - '!src/**/*.ts', - '!test/**/*.ts', - 'test/automation/**/*.ts', - ...tslintBaseFilter -]; - -const tslintHygieneFilter = [ - 'src/**/*.ts', - 'test/**/*.ts', - 'extensions/**/*.ts', - ...tslintBaseFilter -]; - const copyrightHeaderLines = [ '/*---------------------------------------------------------------------------------------------', ' * Copyright (c) Microsoft Corporation. All rights reserved.', @@ -185,27 +162,17 @@ const copyrightHeaderLines = [ gulp.task('eslint', () => { return vfs.src(all, { base: '.', follow: true, allowEmpty: true }) - .pipe(filter(eslintFilter)) - .pipe(gulpeslint('src/.eslintrc')) + .pipe(filter(jsHygieneFilter.concat(tsHygieneFilter))) + .pipe(gulpeslint({ + configFile: '.eslintrc.json', + rulePaths: ['./build/lib/eslint'] + })) .pipe(gulpeslint.formatEach('compact')) - .pipe(gulpeslint.failAfterError()); -}); - -gulp.task('tslint', () => { - return es.merge([ - - // Core: include type information (required by certain rules like no-nodejs-globals) - vfs.src(all, { base: '.', follow: true, allowEmpty: true }) - .pipe(filter(tslintCoreFilter)) - .pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint', program: tslint.Linter.createProgram('src/tsconfig.json') })) - .pipe(gulptslint.default.report({ emitError: true })), - - // Exenstions: do not include type information - vfs.src(all, { base: '.', follow: true, allowEmpty: true }) - .pipe(filter(tslintExtensionsFilter)) - .pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' })) - .pipe(gulptslint.default.report({ emitError: true })) - ]).pipe(es.through()); + .pipe(gulpeslint.results(results => { + if (results.warningCount > 0 || results.errorCount > 0) { + throw new Error('eslint failed with warnings and/or errors'); + } + })); }); function checkPackageJSON(actualPath) { @@ -227,7 +194,7 @@ function checkPackageJSON(actualPath) { const checkPackageJSONTask = task.define('check-package-json', () => { return gulp.src('package.json') - .pipe(es.through(function() { + .pipe(es.through(function () { checkPackageJSON.call(this, 'remote/package.json'); checkPackageJSON.call(this, 'remote/web/package.json'); })); @@ -294,8 +261,6 @@ function hygiene(some) { replace: undefined, tsconfig: undefined, tsconfigFile: undefined, - tslint: undefined, - tslintFile: undefined, tsfmtFile: undefined, vscode: undefined, vscodeFile: undefined @@ -304,7 +269,7 @@ function hygiene(some) { let formatted = result.dest.replace(/\r\n/gm, '\n'); if (original !== formatted) { - console.error("File not formatted. Run the 'Format Document' command to fix it:", file.relative); + console.error('File not formatted. Run the \'Format Document\' command to fix it:', file.relative); errorCount++; } cb(null, file); @@ -314,16 +279,6 @@ function hygiene(some) { }); }); - const tslintConfiguration = tslint.Configuration.findConfiguration('tslint.json', '.'); - const tslintOptions = { fix: false, formatter: 'json' }; - const tsLinter = new tslint.Linter(tslintOptions); - - const tsl = es.through(function (file) { - const contents = file.contents.toString('utf8'); - tsLinter.lint(file.relative, contents, tslintConfiguration.results); - this.emit('data', file); - }); - let input; if (Array.isArray(some) || typeof some === 'string' || !some) { @@ -349,19 +304,21 @@ function hygiene(some) { .pipe(filter(copyrightFilter)) .pipe(copyrights); - let typescript = result - .pipe(filter(tslintHygieneFilter)) + const typescript = result + .pipe(filter(tsHygieneFilter)) .pipe(formatting); - if (!process.argv.some(arg => arg === '--skip-tslint')) { - typescript = typescript.pipe(tsl); - } - const javascript = result - .pipe(filter(eslintFilter)) - .pipe(gulpeslint('src/.eslintrc')) + .pipe(filter(jsHygieneFilter.concat(tsHygieneFilter))) + .pipe(gulpeslint({ + configFile: '.eslintrc.json', + rulePaths: ['./build/lib/eslint'] + })) .pipe(gulpeslint.formatEach('compact')) - .pipe(gulpeslint.failAfterError()); + .pipe(gulpeslint.results(results => { + errorCount += results.warningCount; + errorCount += results.errorCount; + })); let count = 0; return es.merge(typescript, javascript) @@ -373,20 +330,6 @@ function hygiene(some) { this.emit('data', data); }, function () { process.stdout.write('\n'); - - const tslintResult = tsLinter.getResult(); - if (tslintResult.failures.length > 0) { - for (const failure of tslintResult.failures) { - const name = failure.getFileName(); - const position = failure.getStartPosition(); - const line = position.getLineAndCharacter().line; - const character = position.getLineAndCharacter().character; - - console.error(`${name}:${line + 1}:${character + 1}:${failure.getFailure()}`); - } - errorCount += tslintResult.failures.length; - } - if (errorCount > 0) { this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.'); } else { diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js index a956fba979ef6..f2ea1bd37010b 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -118,7 +118,7 @@ function mixinServer(watch) { const packageJSONPath = path.join(path.dirname(__dirname), 'package.json'); function exec(cmdLine) { console.log(cmdLine); - cp.execSync(cmdLine, { stdio: "inherit" }); + cp.execSync(cmdLine, { stdio: 'inherit' }); } function checkout() { const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath).toString()); diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index bb504fc09e970..4906bfdb1a24c 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -121,9 +121,9 @@ gulp.task(minifyVSCodeTask); * @return {Object} A map of paths to checksums. */ function computeChecksums(out, filenames) { - var result = {}; + let result = {}; filenames.forEach(function (filename) { - var fullPath = path.join(process.cwd(), out, filename); + let fullPath = path.join(process.cwd(), out, filename); result[filename] = computeChecksum(fullPath); }); return result; @@ -136,9 +136,9 @@ function computeChecksums(out, filenames) { * @return {string} The checksum for `filename`. */ function computeChecksum(filename) { - var contents = fs.readFileSync(filename); + let contents = fs.readFileSync(filename); - var hash = crypto + let hash = crypto .createHash('md5') .update(contents) .digest('base64') @@ -428,7 +428,7 @@ gulp.task('vscode-translations-pull', function () { }); gulp.task('vscode-translations-import', function () { - var options = minimist(process.argv.slice(2), { + let options = minimist(process.argv.slice(2), { string: 'location', default: { location: '../vscode-translations-import' diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index 9d3a7caa07e68..51c7002f5b12c 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -23,7 +23,7 @@ const commit = util.getVersion(root); const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); function getDebPackageArch(arch) { - return { x64: 'amd64', arm: 'armhf', arm64: "arm64" }[arch]; + return { x64: 'amd64', arm: 'armhf', arm64: 'arm64' }[arch]; } function prepareDebPackage(arch) { @@ -117,7 +117,7 @@ function getRpmBuildPath(rpmArch) { } function getRpmPackageArch(arch) { - return { x64: 'x86_64', arm: 'armhf', arm64: "arm64" }[arch]; + return { x64: 'x86_64', arm: 'armhf', arm64: 'arm64' }[arch]; } function prepareRpmPackage(arch) { diff --git a/build/lib/eslint/code-import-patterns.js b/build/lib/eslint/code-import-patterns.js new file mode 100644 index 0000000000000..0d508d1d00e37 --- /dev/null +++ b/build/lib/eslint/code-import-patterns.js @@ -0,0 +1,59 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +const path_1 = require("path"); +const minimatch = require("minimatch"); +const utils_1 = require("./utils"); +module.exports = new class { + constructor() { + this.meta = { + messages: { + badImport: 'Imports violates \'{{restrictions}}\' restrictions. See https://github.com/microsoft/vscode/wiki/Source-Code-Organization' + }, + docs: { + url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization' + } + }; + } + create(context) { + const configs = context.options; + for (const config of configs) { + if (minimatch(context.getFilename(), config.target)) { + return utils_1.createImportRuleListener((node, value) => this._checkImport(context, config, node, value)); + } + } + return {}; + } + _checkImport(context, config, node, path) { + // resolve relative paths + if (path[0] === '.') { + path = path_1.join(context.getFilename(), path); + } + let restrictions; + if (typeof config.restrictions === 'string') { + restrictions = [config.restrictions]; + } + else { + restrictions = config.restrictions; + } + let matched = false; + for (const pattern of restrictions) { + if (minimatch(path, pattern)) { + matched = true; + break; + } + } + if (!matched) { + // None of the restrictions matched + context.report({ + loc: node.loc, + messageId: 'badImport', + data: { + restrictions: restrictions.join(' or ') + } + }); + } + } +}; diff --git a/build/lib/eslint/code-import-patterns.ts b/build/lib/eslint/code-import-patterns.ts new file mode 100644 index 0000000000000..c3daadbf59a0d --- /dev/null +++ b/build/lib/eslint/code-import-patterns.ts @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { join } from 'path'; +import * as minimatch from 'minimatch'; +import { createImportRuleListener } from './utils'; + +interface ImportPatternsConfig { + target: string; + restrictions: string | string[]; +} + +export = new class implements eslint.Rule.RuleModule { + + readonly meta: eslint.Rule.RuleMetaData = { + messages: { + badImport: 'Imports violates \'{{restrictions}}\' restrictions. See https://github.com/microsoft/vscode/wiki/Source-Code-Organization' + }, + docs: { + url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization' + } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + + const configs = context.options; + + for (const config of configs) { + if (minimatch(context.getFilename(), config.target)) { + return createImportRuleListener((node, value) => this._checkImport(context, config, node, value)); + } + } + + return {}; + } + + private _checkImport(context: eslint.Rule.RuleContext, config: ImportPatternsConfig, node: TSESTree.Node, path: string) { + + // resolve relative paths + if (path[0] === '.') { + path = join(context.getFilename(), path); + } + + let restrictions: string[]; + if (typeof config.restrictions === 'string') { + restrictions = [config.restrictions]; + } else { + restrictions = config.restrictions; + } + + let matched = false; + for (const pattern of restrictions) { + if (minimatch(path, pattern)) { + matched = true; + break; + } + } + + if (!matched) { + // None of the restrictions matched + context.report({ + loc: node.loc, + messageId: 'badImport', + data: { + restrictions: restrictions.join(' or ') + } + }); + } + } +}; + diff --git a/build/lib/eslint/code-layering.js b/build/lib/eslint/code-layering.js new file mode 100644 index 0000000000000..db591f789c72c --- /dev/null +++ b/build/lib/eslint/code-layering.js @@ -0,0 +1,68 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +const path_1 = require("path"); +const utils_1 = require("./utils"); +module.exports = new class { + constructor() { + this.meta = { + messages: { + layerbreaker: 'Bad layering. You are not allowed to access {{from}} from here, allowed layers are: [{{allowed}}]' + }, + docs: { + url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization' + } + }; + } + create(context) { + const fileDirname = path_1.dirname(context.getFilename()); + const parts = fileDirname.split(/\\|\//); + const ruleArgs = context.options[0]; + let config; + for (let i = parts.length - 1; i >= 0; i--) { + if (ruleArgs[parts[i]]) { + config = { + allowed: new Set(ruleArgs[parts[i]]).add(parts[i]), + disallowed: new Set() + }; + Object.keys(ruleArgs).forEach(key => { + if (!config.allowed.has(key)) { + config.disallowed.add(key); + } + }); + break; + } + } + if (!config) { + // nothing + return {}; + } + return utils_1.createImportRuleListener((node, path) => { + if (path[0] === '.') { + path = path_1.join(path_1.dirname(context.getFilename()), path); + } + const parts = path_1.dirname(path).split(/\\|\//); + for (let i = parts.length - 1; i >= 0; i--) { + const part = parts[i]; + if (config.allowed.has(part)) { + // GOOD - same layer + break; + } + if (config.disallowed.has(part)) { + // BAD - wrong layer + context.report({ + loc: node.loc, + messageId: 'layerbreaker', + data: { + from: part, + allowed: [...config.allowed.keys()].join(', ') + } + }); + break; + } + } + }); + } +}; diff --git a/build/lib/eslint/code-layering.ts b/build/lib/eslint/code-layering.ts new file mode 100644 index 0000000000000..cca72eeec71e4 --- /dev/null +++ b/build/lib/eslint/code-layering.ts @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { join, dirname } from 'path'; +import { createImportRuleListener } from './utils'; + +type Config = { + allowed: Set; + disallowed: Set; +}; + +export = new class implements eslint.Rule.RuleModule { + + readonly meta: eslint.Rule.RuleMetaData = { + messages: { + layerbreaker: 'Bad layering. You are not allowed to access {{from}} from here, allowed layers are: [{{allowed}}]' + }, + docs: { + url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization' + } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + + const fileDirname = dirname(context.getFilename()); + const parts = fileDirname.split(/\\|\//); + const ruleArgs = >context.options[0]; + + let config: Config | undefined; + for (let i = parts.length - 1; i >= 0; i--) { + if (ruleArgs[parts[i]]) { + config = { + allowed: new Set(ruleArgs[parts[i]]).add(parts[i]), + disallowed: new Set() + }; + Object.keys(ruleArgs).forEach(key => { + if (!config!.allowed.has(key)) { + config!.disallowed.add(key); + } + }); + break; + } + } + + if (!config) { + // nothing + return {}; + } + + return createImportRuleListener((node, path) => { + if (path[0] === '.') { + path = join(dirname(context.getFilename()), path); + } + + const parts = dirname(path).split(/\\|\//); + for (let i = parts.length - 1; i >= 0; i--) { + const part = parts[i]; + + if (config!.allowed.has(part)) { + // GOOD - same layer + break; + } + + if (config!.disallowed.has(part)) { + // BAD - wrong layer + context.report({ + loc: node.loc, + messageId: 'layerbreaker', + data: { + from: part, + allowed: [...config!.allowed.keys()].join(', ') + } + }); + break; + } + } + }); + } +}; + diff --git a/build/lib/eslint/code-no-nls-in-standalone-editor.js b/build/lib/eslint/code-no-nls-in-standalone-editor.js new file mode 100644 index 0000000000000..d8955507bedc9 --- /dev/null +++ b/build/lib/eslint/code-no-nls-in-standalone-editor.js @@ -0,0 +1,38 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +const path_1 = require("path"); +const utils_1 = require("./utils"); +module.exports = new class NoNlsInStandaloneEditorRule { + constructor() { + this.meta = { + messages: { + noNls: 'Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts' + } + }; + } + create(context) { + const fileName = context.getFilename(); + if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(fileName) + || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(fileName) + || /vs(\/|\\)editor(\/|\\)editor.api/.test(fileName) + || /vs(\/|\\)editor(\/|\\)editor.main/.test(fileName) + || /vs(\/|\\)editor(\/|\\)editor.worker/.test(fileName)) { + return utils_1.createImportRuleListener((node, path) => { + // resolve relative paths + if (path[0] === '.') { + path = path_1.join(context.getFilename(), path); + } + if (/vs(\/|\\)nls/.test(path)) { + context.report({ + loc: node.loc, + messageId: 'noNls' + }); + } + }); + } + return {}; + } +}; diff --git a/build/lib/eslint/code-no-nls-in-standalone-editor.ts b/build/lib/eslint/code-no-nls-in-standalone-editor.ts new file mode 100644 index 0000000000000..90c80dee70c9d --- /dev/null +++ b/build/lib/eslint/code-no-nls-in-standalone-editor.ts @@ -0,0 +1,48 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { join } from 'path'; +import { createImportRuleListener } from './utils'; + +export = new class NoNlsInStandaloneEditorRule implements eslint.Rule.RuleModule { + + readonly meta: eslint.Rule.RuleMetaData = { + messages: { + noNls: 'Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts' + } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + + const fileName = context.getFilename(); + if ( + /vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(fileName) + || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(fileName) + || /vs(\/|\\)editor(\/|\\)editor.api/.test(fileName) + || /vs(\/|\\)editor(\/|\\)editor.main/.test(fileName) + || /vs(\/|\\)editor(\/|\\)editor.worker/.test(fileName) + ) { + return createImportRuleListener((node, path) => { + // resolve relative paths + if (path[0] === '.') { + path = join(context.getFilename(), path); + } + + if ( + /vs(\/|\\)nls/.test(path) + ) { + context.report({ + loc: node.loc, + messageId: 'noNls' + }); + } + }); + } + + return {}; + } +}; + diff --git a/build/lib/eslint/code-no-standalone-editor.js b/build/lib/eslint/code-no-standalone-editor.js new file mode 100644 index 0000000000000..d9d6bb55b872f --- /dev/null +++ b/build/lib/eslint/code-no-standalone-editor.js @@ -0,0 +1,41 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +const path_1 = require("path"); +const utils_1 = require("./utils"); +module.exports = new class NoNlsInStandaloneEditorRule { + constructor() { + this.meta = { + messages: { + badImport: 'Not allowed to import standalone editor modules.' + }, + docs: { + url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization' + } + }; + } + create(context) { + if (/vs(\/|\\)editor/.test(context.getFilename())) { + // the vs/editor folder is allowed to use the standalone editor + return {}; + } + return utils_1.createImportRuleListener((node, path) => { + // resolve relative paths + if (path[0] === '.') { + path = path_1.join(context.getFilename(), path); + } + if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path) + || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.api/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.main/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) { + context.report({ + loc: node.loc, + messageId: 'badImport' + }); + } + }); + } +}; diff --git a/build/lib/eslint/code-no-standalone-editor.ts b/build/lib/eslint/code-no-standalone-editor.ts new file mode 100644 index 0000000000000..898886d17d203 --- /dev/null +++ b/build/lib/eslint/code-no-standalone-editor.ts @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { join } from 'path'; +import { createImportRuleListener } from './utils'; + +export = new class NoNlsInStandaloneEditorRule implements eslint.Rule.RuleModule { + + readonly meta: eslint.Rule.RuleMetaData = { + messages: { + badImport: 'Not allowed to import standalone editor modules.' + }, + docs: { + url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization' + } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + + if (/vs(\/|\\)editor/.test(context.getFilename())) { + // the vs/editor folder is allowed to use the standalone editor + return {}; + } + + return createImportRuleListener((node, path) => { + + // resolve relative paths + if (path[0] === '.') { + path = join(context.getFilename(), path); + } + + if ( + /vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path) + || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.api/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.main/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.worker/.test(path) + ) { + context.report({ + loc: node.loc, + messageId: 'badImport' + }); + } + }); + } +}; + diff --git a/build/lib/eslint/code-no-unexternalized-strings.js b/build/lib/eslint/code-no-unexternalized-strings.js new file mode 100644 index 0000000000000..d1f2ffef6dc74 --- /dev/null +++ b/build/lib/eslint/code-no-unexternalized-strings.js @@ -0,0 +1,111 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var _a; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +function isStringLiteral(node) { + return !!node && node.type === experimental_utils_1.AST_NODE_TYPES.Literal && typeof node.value === 'string'; +} +function isDoubleQuoted(node) { + return node.raw[0] === '"' && node.raw[node.raw.length - 1] === '"'; +} +module.exports = new (_a = class NoUnexternalizedStrings { + constructor() { + this.meta = { + messages: { + doubleQuoted: 'Only use double-quoted strings for externalized strings.', + badKey: 'The key \'{{key}}\' doesn\'t conform to a valid localize identifier.', + duplicateKey: 'Duplicate key \'{{key}}\' with different message value.', + badMessage: 'Message argument to \'{{message}}\' must be a string literal.' + } + }; + } + create(context) { + const externalizedStringLiterals = new Map(); + const doubleQuotedStringLiterals = new Set(); + function collectDoubleQuotedStrings(node) { + if (isStringLiteral(node) && isDoubleQuoted(node)) { + doubleQuotedStringLiterals.add(node); + } + } + function visitLocalizeCall(node) { + // localize(key, message) + const [keyNode, messageNode] = node.arguments; + // (1) + // extract key so that it can be checked later + let key; + if (isStringLiteral(keyNode)) { + doubleQuotedStringLiterals.delete(keyNode); //todo@joh reconsider + key = keyNode.value; + } + else if (keyNode.type === experimental_utils_1.AST_NODE_TYPES.ObjectExpression) { + for (let property of keyNode.properties) { + if (property.type === experimental_utils_1.AST_NODE_TYPES.Property && !property.computed) { + if (property.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier && property.key.name === 'key') { + if (isStringLiteral(property.value)) { + doubleQuotedStringLiterals.delete(property.value); //todo@joh reconsider + key = property.value.value; + break; + } + } + } + } + } + if (typeof key === 'string') { + let array = externalizedStringLiterals.get(key); + if (!array) { + array = []; + externalizedStringLiterals.set(key, array); + } + array.push({ call: node, message: messageNode }); + } + // (2) + // remove message-argument from doubleQuoted list and make + // sure it is a string-literal + doubleQuotedStringLiterals.delete(messageNode); + if (!isStringLiteral(messageNode)) { + context.report({ + loc: messageNode.loc, + messageId: 'badMessage', + data: { message: context.getSourceCode().getText(node) } + }); + } + } + function reportBadStringsAndBadKeys() { + // (1) + // report all strings that are in double quotes + for (const node of doubleQuotedStringLiterals) { + context.report({ loc: node.loc, messageId: 'doubleQuoted' }); + } + for (const [key, values] of externalizedStringLiterals) { + // (2) + // report all invalid NLS keys + if (!key.match(NoUnexternalizedStrings._rNlsKeys)) { + for (let value of values) { + context.report({ loc: value.call.loc, messageId: 'badKey', data: { key } }); + } + } + // (2) + // report all invalid duplicates (same key, different message) + if (values.length > 1) { + for (let i = 1; i < values.length; i++) { + if (context.getSourceCode().getText(values[i - 1].message) !== context.getSourceCode().getText(values[i].message)) { + context.report({ loc: values[i].call.loc, messageId: 'duplicateKey', data: { key } }); + } + } + } + } + } + return { + ['Literal']: (node) => collectDoubleQuotedStrings(node), + ['ExpressionStatement[directive] Literal:exit']: (node) => doubleQuotedStringLiterals.delete(node), + ['CallExpression[callee.type="MemberExpression"][callee.property.name="localize"]:exit']: (node) => visitLocalizeCall(node), + ['CallExpression[callee.name="localize"][arguments.length>=2]:exit']: (node) => visitLocalizeCall(node), + ['Program:exit']: reportBadStringsAndBadKeys, + }; + } + }, + _a._rNlsKeys = /^[_a-zA-Z0-9][ .\-_a-zA-Z0-9]*$/, + _a); diff --git a/build/lib/eslint/code-no-unexternalized-strings.ts b/build/lib/eslint/code-no-unexternalized-strings.ts new file mode 100644 index 0000000000000..390500ed4ae02 --- /dev/null +++ b/build/lib/eslint/code-no-unexternalized-strings.ts @@ -0,0 +1,126 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; + +function isStringLiteral(node: TSESTree.Node | null | undefined): node is TSESTree.StringLiteral { + return !!node && node.type === AST_NODE_TYPES.Literal && typeof node.value === 'string'; +} + +function isDoubleQuoted(node: TSESTree.StringLiteral): boolean { + return node.raw[0] === '"' && node.raw[node.raw.length - 1] === '"'; +} + +export = new class NoUnexternalizedStrings implements eslint.Rule.RuleModule { + + private static _rNlsKeys = /^[_a-zA-Z0-9][ .\-_a-zA-Z0-9]*$/; + + readonly meta: eslint.Rule.RuleMetaData = { + messages: { + doubleQuoted: 'Only use double-quoted strings for externalized strings.', + badKey: 'The key \'{{key}}\' doesn\'t conform to a valid localize identifier.', + duplicateKey: 'Duplicate key \'{{key}}\' with different message value.', + badMessage: 'Message argument to \'{{message}}\' must be a string literal.' + } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + + const externalizedStringLiterals = new Map(); + const doubleQuotedStringLiterals = new Set(); + + function collectDoubleQuotedStrings(node: TSESTree.Literal) { + if (isStringLiteral(node) && isDoubleQuoted(node)) { + doubleQuotedStringLiterals.add(node); + } + } + + function visitLocalizeCall(node: TSESTree.CallExpression) { + + // localize(key, message) + const [keyNode, messageNode] = (node).arguments; + + // (1) + // extract key so that it can be checked later + let key: string | undefined; + if (isStringLiteral(keyNode)) { + doubleQuotedStringLiterals.delete(keyNode); //todo@joh reconsider + key = keyNode.value; + + } else if (keyNode.type === AST_NODE_TYPES.ObjectExpression) { + for (let property of keyNode.properties) { + if (property.type === AST_NODE_TYPES.Property && !property.computed) { + if (property.key.type === AST_NODE_TYPES.Identifier && property.key.name === 'key') { + if (isStringLiteral(property.value)) { + doubleQuotedStringLiterals.delete(property.value); //todo@joh reconsider + key = property.value.value; + break; + } + } + } + } + } + if (typeof key === 'string') { + let array = externalizedStringLiterals.get(key); + if (!array) { + array = []; + externalizedStringLiterals.set(key, array); + } + array.push({ call: node, message: messageNode }); + } + + // (2) + // remove message-argument from doubleQuoted list and make + // sure it is a string-literal + doubleQuotedStringLiterals.delete(messageNode); + if (!isStringLiteral(messageNode)) { + context.report({ + loc: messageNode.loc, + messageId: 'badMessage', + data: { message: context.getSourceCode().getText(node) } + }); + } + } + + function reportBadStringsAndBadKeys() { + // (1) + // report all strings that are in double quotes + for (const node of doubleQuotedStringLiterals) { + context.report({ loc: node.loc, messageId: 'doubleQuoted' }); + } + + for (const [key, values] of externalizedStringLiterals) { + + // (2) + // report all invalid NLS keys + if (!key.match(NoUnexternalizedStrings._rNlsKeys)) { + for (let value of values) { + context.report({ loc: value.call.loc, messageId: 'badKey', data: { key } }); + } + } + + // (2) + // report all invalid duplicates (same key, different message) + if (values.length > 1) { + for (let i = 1; i < values.length; i++) { + if (context.getSourceCode().getText(values[i - 1].message) !== context.getSourceCode().getText(values[i].message)) { + context.report({ loc: values[i].call.loc, messageId: 'duplicateKey', data: { key } }); + } + } + } + } + } + + return { + ['Literal']: (node: any) => collectDoubleQuotedStrings(node), + ['ExpressionStatement[directive] Literal:exit']: (node: any) => doubleQuotedStringLiterals.delete(node), + ['CallExpression[callee.type="MemberExpression"][callee.property.name="localize"]:exit']: (node: any) => visitLocalizeCall(node), + ['CallExpression[callee.name="localize"][arguments.length>=2]:exit']: (node: any) => visitLocalizeCall(node), + ['Program:exit']: reportBadStringsAndBadKeys, + }; + } +}; + diff --git a/build/lib/eslint/code-no-unused-expressions.js b/build/lib/eslint/code-no-unused-expressions.js new file mode 100644 index 0000000000000..c7b175513117c --- /dev/null +++ b/build/lib/eslint/code-no-unused-expressions.js @@ -0,0 +1,145 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +// FORKED FROM https://github.com/eslint/eslint/blob/b23ad0d789a909baf8d7c41a35bc53df932eaf30/lib/rules/no-unused-expressions.js +// and added support for `OptionalCallExpression`, see https://github.com/facebook/create-react-app/issues/8107 and https://github.com/eslint/eslint/issues/12642 + +/** + * @fileoverview Flag expressions in statement position that do not side effect + * @author Michael Ficarra + */ + +'use strict'; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: 'suggestion', + + docs: { + description: 'disallow unused expressions', + category: 'Best Practices', + recommended: false, + url: 'https://eslint.org/docs/rules/no-unused-expressions' + }, + + schema: [ + { + type: 'object', + properties: { + allowShortCircuit: { + type: 'boolean', + default: false + }, + allowTernary: { + type: 'boolean', + default: false + }, + allowTaggedTemplates: { + type: 'boolean', + default: false + } + }, + additionalProperties: false + } + ] + }, + + create(context) { + const config = context.options[0] || {}, + allowShortCircuit = config.allowShortCircuit || false, + allowTernary = config.allowTernary || false, + allowTaggedTemplates = config.allowTaggedTemplates || false; + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @returns {boolean} whether the given node structurally represents a directive + */ + function looksLikeDirective(node) { + return node.type === 'ExpressionStatement' && + node.expression.type === 'Literal' && typeof node.expression.value === 'string'; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {Function} predicate ([a] -> Boolean) the function used to make the determination + * @param {a[]} list the input list + * @returns {a[]} the leading sequence of members in the given list that pass the given predicate + */ + function takeWhile(predicate, list) { + for (let i = 0; i < list.length; ++i) { + if (!predicate(list[i])) { + return list.slice(0, i); + } + } + return list.slice(); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node a Program or BlockStatement node + * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body + */ + function directives(node) { + return takeWhile(looksLikeDirective, node.body); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @param {ASTNode[]} ancestors the given node's ancestors + * @returns {boolean} whether the given node is considered a directive in its current position + */ + function isDirective(node, ancestors) { + const parent = ancestors[ancestors.length - 1], + grandparent = ancestors[ancestors.length - 2]; + + return (parent.type === 'Program' || parent.type === 'BlockStatement' && + (/Function/u.test(grandparent.type))) && + directives(parent).indexOf(node) >= 0; + } + + /** + * Determines whether or not a given node is a valid expression. Recurses on short circuit eval and ternary nodes if enabled by flags. + * @param {ASTNode} node any node + * @returns {boolean} whether the given node is a valid expression + */ + function isValidExpression(node) { + if (allowTernary) { + + // Recursive check for ternary and logical expressions + if (node.type === 'ConditionalExpression') { + return isValidExpression(node.consequent) && isValidExpression(node.alternate); + } + } + + if (allowShortCircuit) { + if (node.type === 'LogicalExpression') { + return isValidExpression(node.right); + } + } + + if (allowTaggedTemplates && node.type === 'TaggedTemplateExpression') { + return true; + } + + return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await)Expression$/u.test(node.type) || + (node.type === 'UnaryExpression' && ['delete', 'void'].indexOf(node.operator) >= 0); + } + + return { + ExpressionStatement(node) { + if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) { + context.report({ node, message: 'Expected an assignment or function call and instead saw an expression.' }); + } + } + }; + + } +}; diff --git a/build/lib/eslint/code-translation-remind.js b/build/lib/eslint/code-translation-remind.js new file mode 100644 index 0000000000000..a276e7c0028aa --- /dev/null +++ b/build/lib/eslint/code-translation-remind.js @@ -0,0 +1,57 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var _a; +const fs_1 = require("fs"); +const utils_1 = require("./utils"); +module.exports = new (_a = class TranslationRemind { + constructor() { + this.meta = { + messages: { + missing: 'Please add \'{{resource}}\' to ./build/lib/i18n.resources.json file to use translations here.' + } + }; + } + create(context) { + return utils_1.createImportRuleListener((node, path) => this._checkImport(context, node, path)); + } + _checkImport(context, node, path) { + if (path !== TranslationRemind.NLS_MODULE) { + return; + } + const currentFile = context.getFilename(); + const matchService = currentFile.match(/vs\/workbench\/services\/\w+/); + const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/); + if (!matchService && !matchPart) { + return; + } + const resource = matchService ? matchService[0] : matchPart[0]; + let resourceDefined = false; + let json; + try { + json = fs_1.readFileSync('./build/lib/i18n.resources.json', 'utf8'); + } + catch (e) { + console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.'); + return; + } + const workbenchResources = JSON.parse(json).workbench; + workbenchResources.forEach((existingResource) => { + if (existingResource.name === resource) { + resourceDefined = true; + return; + } + }); + if (!resourceDefined) { + context.report({ + loc: node.loc, + messageId: 'missing', + data: { resource } + }); + } + } + }, + _a.NLS_MODULE = 'vs/nls', + _a); diff --git a/build/lib/eslint/code-translation-remind.ts b/build/lib/eslint/code-translation-remind.ts new file mode 100644 index 0000000000000..1ce01107a72a5 --- /dev/null +++ b/build/lib/eslint/code-translation-remind.ts @@ -0,0 +1,67 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { readFileSync } from 'fs'; +import { createImportRuleListener } from './utils'; + + +export = new class TranslationRemind implements eslint.Rule.RuleModule { + + private static NLS_MODULE = 'vs/nls'; + + readonly meta: eslint.Rule.RuleMetaData = { + messages: { + missing: 'Please add \'{{resource}}\' to ./build/lib/i18n.resources.json file to use translations here.' + } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + return createImportRuleListener((node, path) => this._checkImport(context, node, path)); + } + + private _checkImport(context: eslint.Rule.RuleContext, node: TSESTree.Node, path: string) { + + if (path !== TranslationRemind.NLS_MODULE) { + return; + } + + const currentFile = context.getFilename(); + const matchService = currentFile.match(/vs\/workbench\/services\/\w+/); + const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/); + if (!matchService && !matchPart) { + return; + } + + const resource = matchService ? matchService[0] : matchPart![0]; + let resourceDefined = false; + + let json; + try { + json = readFileSync('./build/lib/i18n.resources.json', 'utf8'); + } catch (e) { + console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.'); + return; + } + const workbenchResources = JSON.parse(json).workbench; + + workbenchResources.forEach((existingResource: any) => { + if (existingResource.name === resource) { + resourceDefined = true; + return; + } + }); + + if (!resourceDefined) { + context.report({ + loc: node.loc, + messageId: 'missing', + data: { resource } + }); + } + } +}; + diff --git a/build/lib/eslint/utils.js b/build/lib/eslint/utils.js new file mode 100644 index 0000000000000..ec59aef3b7d3c --- /dev/null +++ b/build/lib/eslint/utils.js @@ -0,0 +1,36 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +function createImportRuleListener(validateImport) { + function _checkImport(node) { + if (node && node.type === 'Literal' && typeof node.value === 'string') { + validateImport(node, node.value); + } + } + return { + // import ??? from 'module' + ImportDeclaration: (node) => { + _checkImport(node.source); + }, + // import('module').then(...) OR await import('module') + ['CallExpression[callee.type="Import"][arguments.length=1] > Literal']: (node) => { + _checkImport(node); + }, + // import foo = ... + ['TSImportEqualsDeclaration > TSExternalModuleReference > Literal']: (node) => { + _checkImport(node); + }, + // export ?? from 'module' + ExportAllDeclaration: (node) => { + _checkImport(node.source); + }, + // export {foo} from 'module' + ExportNamedDeclaration: (node) => { + _checkImport(node.source); + }, + }; +} +exports.createImportRuleListener = createImportRuleListener; diff --git a/build/lib/eslint/utils.ts b/build/lib/eslint/utils.ts new file mode 100644 index 0000000000000..428832e9cf97a --- /dev/null +++ b/build/lib/eslint/utils.ts @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { TSESTree } from '@typescript-eslint/experimental-utils'; + +export function createImportRuleListener(validateImport: (node: TSESTree.Literal, value: string) => any): eslint.Rule.RuleListener { + + function _checkImport(node: TSESTree.Node | null) { + if (node && node.type === 'Literal' && typeof node.value === 'string') { + validateImport(node, node.value); + } + } + + return { + // import ??? from 'module' + ImportDeclaration: (node: any) => { + _checkImport((node).source); + }, + // import('module').then(...) OR await import('module') + ['CallExpression[callee.type="Import"][arguments.length=1] > Literal']: (node: any) => { + _checkImport(node); + }, + // import foo = ... + ['TSImportEqualsDeclaration > TSExternalModuleReference > Literal']: (node: any) => { + _checkImport(node); + }, + // export ?? from 'module' + ExportAllDeclaration: (node: any) => { + _checkImport((node).source); + }, + // export {foo} from 'module' + ExportNamedDeclaration: (node: any) => { + _checkImport((node).source); + }, + + }; +} diff --git a/build/lib/tslint/duplicateImportsRule.js b/build/lib/tslint/duplicateImportsRule.js deleted file mode 100644 index f336095fc6a20..0000000000000 --- a/build/lib/tslint/duplicateImportsRule.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const path_1 = require("path"); -const Lint = require("tslint"); -class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile) { - return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions())); - } -} -exports.Rule = Rule; -class ImportPatterns extends Lint.RuleWalker { - constructor(file, opts) { - super(file, opts); - this.imports = Object.create(null); - } - visitImportDeclaration(node) { - let path = node.moduleSpecifier.getText(); - // remove quotes - path = path.slice(1, -1); - if (path[0] === '.') { - path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); - } - if (this.imports[path]) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Duplicate imports for '${path}'.`)); - } - this.imports[path] = true; - } -} diff --git a/build/lib/tslint/duplicateImportsRule.ts b/build/lib/tslint/duplicateImportsRule.ts deleted file mode 100644 index c648084be1db0..0000000000000 --- a/build/lib/tslint/duplicateImportsRule.ts +++ /dev/null @@ -1,40 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as ts from 'typescript'; -import { join, dirname } from 'path'; -import * as Lint from 'tslint'; - -export class Rule extends Lint.Rules.AbstractRule { - public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions())); - } -} - -class ImportPatterns extends Lint.RuleWalker { - - private imports: { [path: string]: boolean; } = Object.create(null); - - constructor(file: ts.SourceFile, opts: Lint.IOptions) { - super(file, opts); - } - - protected visitImportDeclaration(node: ts.ImportDeclaration): void { - let path = node.moduleSpecifier.getText(); - - // remove quotes - path = path.slice(1, -1); - - if (path[0] === '.') { - path = join(dirname(node.getSourceFile().fileName), path); - } - - if (this.imports[path]) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Duplicate imports for '${path}'.`)); - } - - this.imports[path] = true; - } -} diff --git a/build/lib/tslint/importPatternsRule.js b/build/lib/tslint/importPatternsRule.js deleted file mode 100644 index a64f5a6967877..0000000000000 --- a/build/lib/tslint/importPatternsRule.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const ts = require("typescript"); -const Lint = require("tslint"); -const minimatch = require("minimatch"); -const path_1 = require("path"); -class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile) { - const configs = this.getOptions().ruleArguments; - for (const config of configs) { - if (minimatch(sourceFile.fileName, config.target)) { - return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions(), config)); - } - } - return []; - } -} -exports.Rule = Rule; -class ImportPatterns extends Lint.RuleWalker { - constructor(file, opts, _config) { - super(file, opts); - this._config = _config; - } - visitImportEqualsDeclaration(node) { - if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { - this._validateImport(node.moduleReference.expression.getText(), node); - } - } - visitImportDeclaration(node) { - this._validateImport(node.moduleSpecifier.getText(), node); - } - visitCallExpression(node) { - super.visitCallExpression(node); - // import('foo') statements inside the code - if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { - const [path] = node.arguments; - this._validateImport(path.getText(), node); - } - } - _validateImport(path, node) { - // remove quotes - path = path.slice(1, -1); - // resolve relative paths - if (path[0] === '.') { - path = path_1.join(this.getSourceFile().fileName, path); - } - let restrictions; - if (typeof this._config.restrictions === 'string') { - restrictions = [this._config.restrictions]; - } - else { - restrictions = this._config.restrictions; - } - let matched = false; - for (const pattern of restrictions) { - if (minimatch(path, pattern)) { - matched = true; - break; - } - } - if (!matched) { - // None of the restrictions matched - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Imports violates '${restrictions.join(' or ')}' restrictions. See https://github.com/Microsoft/vscode/wiki/Code-Organization`)); - } - } -} diff --git a/build/lib/tslint/importPatternsRule.ts b/build/lib/tslint/importPatternsRule.ts deleted file mode 100644 index 6e545a6be1605..0000000000000 --- a/build/lib/tslint/importPatternsRule.ts +++ /dev/null @@ -1,87 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as ts from 'typescript'; -import * as Lint from 'tslint'; -import * as minimatch from 'minimatch'; -import { join } from 'path'; - -interface ImportPatternsConfig { - target: string; - restrictions: string | string[]; -} - -export class Rule extends Lint.Rules.AbstractRule { - public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - - const configs = this.getOptions().ruleArguments; - - - for (const config of configs) { - if (minimatch(sourceFile.fileName, config.target)) { - return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions(), config)); - } - } - - return []; - } -} - -class ImportPatterns extends Lint.RuleWalker { - - constructor(file: ts.SourceFile, opts: Lint.IOptions, private _config: ImportPatternsConfig) { - super(file, opts); - } - - protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void { - if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { - this._validateImport(node.moduleReference.expression.getText(), node); - } - } - - protected visitImportDeclaration(node: ts.ImportDeclaration): void { - this._validateImport(node.moduleSpecifier.getText(), node); - } - - protected visitCallExpression(node: ts.CallExpression): void { - super.visitCallExpression(node); - - // import('foo') statements inside the code - if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { - const [path] = node.arguments; - this._validateImport(path.getText(), node); - } - } - - private _validateImport(path: string, node: ts.Node): void { - // remove quotes - path = path.slice(1, -1); - - // resolve relative paths - if (path[0] === '.') { - path = join(this.getSourceFile().fileName, path); - } - - let restrictions: string[]; - if (typeof this._config.restrictions === 'string') { - restrictions = [this._config.restrictions]; - } else { - restrictions = this._config.restrictions; - } - - let matched = false; - for (const pattern of restrictions) { - if (minimatch(path, pattern)) { - matched = true; - break; - } - } - - if (!matched) { - // None of the restrictions matched - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Imports violates '${restrictions.join(' or ')}' restrictions. See https://github.com/Microsoft/vscode/wiki/Code-Organization`)); - } - } -} diff --git a/build/lib/tslint/layeringRule.js b/build/lib/tslint/layeringRule.js deleted file mode 100644 index 21a7c9a16d947..0000000000000 --- a/build/lib/tslint/layeringRule.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const ts = require("typescript"); -const Lint = require("tslint"); -const path_1 = require("path"); -class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile) { - const parts = path_1.dirname(sourceFile.fileName).split(/\\|\//); - const ruleArgs = this.getOptions().ruleArguments[0]; - let config; - for (let i = parts.length - 1; i >= 0; i--) { - if (ruleArgs[parts[i]]) { - config = { - allowed: new Set(ruleArgs[parts[i]]).add(parts[i]), - disallowed: new Set() - }; - Object.keys(ruleArgs).forEach(key => { - if (!config.allowed.has(key)) { - config.disallowed.add(key); - } - }); - break; - } - } - if (!config) { - return []; - } - return this.applyWithWalker(new LayeringRule(sourceFile, config, this.getOptions())); - } -} -exports.Rule = Rule; -class LayeringRule extends Lint.RuleWalker { - constructor(file, config, opts) { - super(file, opts); - this._config = config; - } - visitImportEqualsDeclaration(node) { - if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { - this._validateImport(node.moduleReference.expression.getText(), node); - } - } - visitImportDeclaration(node) { - this._validateImport(node.moduleSpecifier.getText(), node); - } - visitCallExpression(node) { - super.visitCallExpression(node); - // import('foo') statements inside the code - if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { - const [path] = node.arguments; - this._validateImport(path.getText(), node); - } - } - _validateImport(path, node) { - // remove quotes - path = path.slice(1, -1); - if (path[0] === '.') { - path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); - } - const parts = path_1.dirname(path).split(/\\|\//); - for (let i = parts.length - 1; i >= 0; i--) { - const part = parts[i]; - if (this._config.allowed.has(part)) { - // GOOD - same layer - return; - } - if (this._config.disallowed.has(part)) { - // BAD - wrong layer - const message = `Bad layering. You are not allowed to access '${part}' from here, allowed layers are: [${LayeringRule._print(this._config.allowed)}]`; - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), message)); - return; - } - } - } - static _print(set) { - const r = []; - set.forEach(e => r.push(e)); - return r.join(', '); - } -} diff --git a/build/lib/tslint/layeringRule.ts b/build/lib/tslint/layeringRule.ts deleted file mode 100644 index dc0053fe8de17..0000000000000 --- a/build/lib/tslint/layeringRule.ts +++ /dev/null @@ -1,105 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as ts from 'typescript'; -import * as Lint from 'tslint'; -import { join, dirname } from 'path'; - -interface Config { - allowed: Set; - disallowed: Set; -} - -export class Rule extends Lint.Rules.AbstractRule { - public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - - const parts = dirname(sourceFile.fileName).split(/\\|\//); - const ruleArgs = this.getOptions().ruleArguments[0]; - - let config: Config | undefined; - for (let i = parts.length - 1; i >= 0; i--) { - if (ruleArgs[parts[i]]) { - config = { - allowed: new Set(ruleArgs[parts[i]]).add(parts[i]), - disallowed: new Set() - }; - Object.keys(ruleArgs).forEach(key => { - if (!config!.allowed.has(key)) { - config!.disallowed.add(key); - } - }); - break; - } - } - - if (!config) { - return []; - } - - return this.applyWithWalker(new LayeringRule(sourceFile, config, this.getOptions())); - } -} - -class LayeringRule extends Lint.RuleWalker { - - private _config: Config; - - constructor(file: ts.SourceFile, config: Config, opts: Lint.IOptions) { - super(file, opts); - this._config = config; - } - - protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void { - if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { - this._validateImport(node.moduleReference.expression.getText(), node); - } - } - - protected visitImportDeclaration(node: ts.ImportDeclaration): void { - this._validateImport(node.moduleSpecifier.getText(), node); - } - - protected visitCallExpression(node: ts.CallExpression): void { - super.visitCallExpression(node); - - // import('foo') statements inside the code - if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { - const [path] = node.arguments; - this._validateImport(path.getText(), node); - } - } - - private _validateImport(path: string, node: ts.Node): void { - // remove quotes - path = path.slice(1, -1); - - if (path[0] === '.') { - path = join(dirname(node.getSourceFile().fileName), path); - } - - const parts = dirname(path).split(/\\|\//); - for (let i = parts.length - 1; i >= 0; i--) { - const part = parts[i]; - - if (this._config.allowed.has(part)) { - // GOOD - same layer - return; - } - - if (this._config.disallowed.has(part)) { - // BAD - wrong layer - const message = `Bad layering. You are not allowed to access '${part}' from here, allowed layers are: [${LayeringRule._print(this._config.allowed)}]`; - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), message)); - return; - } - } - } - - static _print(set: Set): string { - const r: string[] = []; - set.forEach(e => r.push(e)); - return r.join(', '); - } -} diff --git a/build/lib/tslint/noNewBufferRule.js b/build/lib/tslint/noNewBufferRule.js deleted file mode 100644 index ae9b02d457ec4..0000000000000 --- a/build/lib/tslint/noNewBufferRule.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const ts = require("typescript"); -const Lint = require("tslint"); -class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile) { - return this.applyWithWalker(new NewBufferRuleWalker(sourceFile, this.getOptions())); - } -} -exports.Rule = Rule; -class NewBufferRuleWalker extends Lint.RuleWalker { - visitNewExpression(node) { - if (node.expression.kind === ts.SyntaxKind.Identifier && node.expression && node.expression.text === 'Buffer') { - this.addFailureAtNode(node, '`new Buffer` is deprecated. Consider Buffer.From or Buffer.alloc instead.'); - } - super.visitNewExpression(node); - } -} diff --git a/build/lib/tslint/noNewBufferRule.ts b/build/lib/tslint/noNewBufferRule.ts deleted file mode 100644 index 7b0dd43e5383a..0000000000000 --- a/build/lib/tslint/noNewBufferRule.ts +++ /dev/null @@ -1,23 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as ts from 'typescript'; -import * as Lint from 'tslint'; - -export class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - return this.applyWithWalker(new NewBufferRuleWalker(sourceFile, this.getOptions())); - } -} - -class NewBufferRuleWalker extends Lint.RuleWalker { - visitNewExpression(node: ts.NewExpression) { - if (node.expression.kind === ts.SyntaxKind.Identifier && node.expression && (node.expression as ts.Identifier).text === 'Buffer') { - this.addFailureAtNode(node, '`new Buffer` is deprecated. Consider Buffer.From or Buffer.alloc instead.'); - } - - super.visitNewExpression(node); - } -} \ No newline at end of file diff --git a/build/lib/tslint/noNlsInStandaloneEditorRule.js b/build/lib/tslint/noNlsInStandaloneEditorRule.js deleted file mode 100644 index affd4cc837034..0000000000000 --- a/build/lib/tslint/noNlsInStandaloneEditorRule.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const ts = require("typescript"); -const Lint = require("tslint"); -const path_1 = require("path"); -class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile) { - if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName) - || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName) - || /vs(\/|\\)editor(\/|\\)editor.api/.test(sourceFile.fileName) - || /vs(\/|\\)editor(\/|\\)editor.main/.test(sourceFile.fileName) - || /vs(\/|\\)editor(\/|\\)editor.worker/.test(sourceFile.fileName)) { - return this.applyWithWalker(new NoNlsInStandaloneEditorRuleWalker(sourceFile, this.getOptions())); - } - return []; - } -} -exports.Rule = Rule; -class NoNlsInStandaloneEditorRuleWalker extends Lint.RuleWalker { - constructor(file, opts) { - super(file, opts); - } - visitImportEqualsDeclaration(node) { - if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { - this._validateImport(node.moduleReference.expression.getText(), node); - } - } - visitImportDeclaration(node) { - this._validateImport(node.moduleSpecifier.getText(), node); - } - visitCallExpression(node) { - super.visitCallExpression(node); - // import('foo') statements inside the code - if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { - const [path] = node.arguments; - this._validateImport(path.getText(), node); - } - } - _validateImport(path, node) { - // remove quotes - path = path.slice(1, -1); - // resolve relative paths - if (path[0] === '.') { - path = path_1.join(this.getSourceFile().fileName, path); - } - if (/vs(\/|\\)nls/.test(path)) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts`)); - } - } -} diff --git a/build/lib/tslint/noNlsInStandaloneEditorRule.ts b/build/lib/tslint/noNlsInStandaloneEditorRule.ts deleted file mode 100644 index ae23d74d784d5..0000000000000 --- a/build/lib/tslint/noNlsInStandaloneEditorRule.ts +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as ts from 'typescript'; -import * as Lint from 'tslint'; -import { join } from 'path'; - -export class Rule extends Lint.Rules.AbstractRule { - public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - if ( - /vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName) - || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName) - || /vs(\/|\\)editor(\/|\\)editor.api/.test(sourceFile.fileName) - || /vs(\/|\\)editor(\/|\\)editor.main/.test(sourceFile.fileName) - || /vs(\/|\\)editor(\/|\\)editor.worker/.test(sourceFile.fileName) - ) { - return this.applyWithWalker(new NoNlsInStandaloneEditorRuleWalker(sourceFile, this.getOptions())); - } - - return []; - } -} - -class NoNlsInStandaloneEditorRuleWalker extends Lint.RuleWalker { - - constructor(file: ts.SourceFile, opts: Lint.IOptions) { - super(file, opts); - } - - protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void { - if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { - this._validateImport(node.moduleReference.expression.getText(), node); - } - } - - protected visitImportDeclaration(node: ts.ImportDeclaration): void { - this._validateImport(node.moduleSpecifier.getText(), node); - } - - protected visitCallExpression(node: ts.CallExpression): void { - super.visitCallExpression(node); - - // import('foo') statements inside the code - if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { - const [path] = node.arguments; - this._validateImport(path.getText(), node); - } - } - - private _validateImport(path: string, node: ts.Node): void { - // remove quotes - path = path.slice(1, -1); - - // resolve relative paths - if (path[0] === '.') { - path = join(this.getSourceFile().fileName, path); - } - - if ( - /vs(\/|\\)nls/.test(path) - ) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts`)); - } - } -} diff --git a/build/lib/tslint/noStandaloneEditorRule.js b/build/lib/tslint/noStandaloneEditorRule.js deleted file mode 100644 index 44b70a6a8d7bb..0000000000000 --- a/build/lib/tslint/noStandaloneEditorRule.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const ts = require("typescript"); -const Lint = require("tslint"); -const path_1 = require("path"); -class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile) { - if (/vs(\/|\\)editor/.test(sourceFile.fileName)) { - // the vs/editor folder is allowed to use the standalone editor - return []; - } - return this.applyWithWalker(new NoStandaloneEditorRuleWalker(sourceFile, this.getOptions())); - } -} -exports.Rule = Rule; -class NoStandaloneEditorRuleWalker extends Lint.RuleWalker { - constructor(file, opts) { - super(file, opts); - } - visitImportEqualsDeclaration(node) { - if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { - this._validateImport(node.moduleReference.expression.getText(), node); - } - } - visitImportDeclaration(node) { - this._validateImport(node.moduleSpecifier.getText(), node); - } - visitCallExpression(node) { - super.visitCallExpression(node); - // import('foo') statements inside the code - if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { - const [path] = node.arguments; - this._validateImport(path.getText(), node); - } - } - _validateImport(path, node) { - // remove quotes - path = path.slice(1, -1); - // resolve relative paths - if (path[0] === '.') { - path = path_1.join(this.getSourceFile().fileName, path); - } - if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path) - || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path) - || /vs(\/|\\)editor(\/|\\)editor.api/.test(path) - || /vs(\/|\\)editor(\/|\\)editor.main/.test(path) - || /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import standalone editor modules. See https://github.com/Microsoft/vscode/wiki/Code-Organization`)); - } - } -} diff --git a/build/lib/tslint/noStandaloneEditorRule.ts b/build/lib/tslint/noStandaloneEditorRule.ts deleted file mode 100644 index 713b94097d4c0..0000000000000 --- a/build/lib/tslint/noStandaloneEditorRule.ts +++ /dev/null @@ -1,65 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as ts from 'typescript'; -import * as Lint from 'tslint'; -import { join } from 'path'; - -export class Rule extends Lint.Rules.AbstractRule { - public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - if (/vs(\/|\\)editor/.test(sourceFile.fileName)) { - // the vs/editor folder is allowed to use the standalone editor - return []; - } - return this.applyWithWalker(new NoStandaloneEditorRuleWalker(sourceFile, this.getOptions())); - } -} - -class NoStandaloneEditorRuleWalker extends Lint.RuleWalker { - - constructor(file: ts.SourceFile, opts: Lint.IOptions) { - super(file, opts); - } - - protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void { - if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { - this._validateImport(node.moduleReference.expression.getText(), node); - } - } - - protected visitImportDeclaration(node: ts.ImportDeclaration): void { - this._validateImport(node.moduleSpecifier.getText(), node); - } - - protected visitCallExpression(node: ts.CallExpression): void { - super.visitCallExpression(node); - - // import('foo') statements inside the code - if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { - const [path] = node.arguments; - this._validateImport(path.getText(), node); - } - } - - private _validateImport(path: string, node: ts.Node): void { - // remove quotes - path = path.slice(1, -1); - - // resolve relative paths - if (path[0] === '.') { - path = join(this.getSourceFile().fileName, path); - } - - if ( - /vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path) - || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path) - || /vs(\/|\\)editor(\/|\\)editor.api/.test(path) - || /vs(\/|\\)editor(\/|\\)editor.main/.test(path) - || /vs(\/|\\)editor(\/|\\)editor.worker/.test(path) - ) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import standalone editor modules. See https://github.com/Microsoft/vscode/wiki/Code-Organization`)); - } - } -} diff --git a/build/lib/tslint/noUnexternalizedStringsRule.js b/build/lib/tslint/noUnexternalizedStringsRule.js deleted file mode 100644 index a1183ce68e767..0000000000000 --- a/build/lib/tslint/noUnexternalizedStringsRule.js +++ /dev/null @@ -1,183 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const ts = require("typescript"); -const Lint = require("tslint"); -/** - * Implementation of the no-unexternalized-strings rule. - */ -class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile) { - if (/\.d.ts$/.test(sourceFile.fileName)) { - return []; - } - return this.applyWithWalker(new NoUnexternalizedStringsRuleWalker(sourceFile, this.getOptions())); - } -} -exports.Rule = Rule; -function isStringLiteral(node) { - return node && node.kind === ts.SyntaxKind.StringLiteral; -} -function isObjectLiteral(node) { - return node && node.kind === ts.SyntaxKind.ObjectLiteralExpression; -} -function isPropertyAssignment(node) { - return node && node.kind === ts.SyntaxKind.PropertyAssignment; -} -class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker { - constructor(file, opts) { - super(file, opts); - this.signatures = Object.create(null); - this.ignores = Object.create(null); - this.messageIndex = undefined; - this.keyIndex = undefined; - this.usedKeys = Object.create(null); - const options = this.getOptions(); - const first = options && options.length > 0 ? options[0] : null; - if (first) { - if (Array.isArray(first.signatures)) { - first.signatures.forEach((signature) => this.signatures[signature] = true); - } - if (Array.isArray(first.ignores)) { - first.ignores.forEach((ignore) => this.ignores[ignore] = true); - } - if (typeof first.messageIndex !== 'undefined') { - this.messageIndex = first.messageIndex; - } - if (typeof first.keyIndex !== 'undefined') { - this.keyIndex = first.keyIndex; - } - } - } - visitSourceFile(node) { - super.visitSourceFile(node); - Object.keys(this.usedKeys).forEach(key => { - // Keys are quoted. - let identifier = key.substr(1, key.length - 2); - if (!NoUnexternalizedStringsRuleWalker.IDENTIFIER.test(identifier)) { - let occurrence = this.usedKeys[key][0]; - this.addFailure(this.createFailure(occurrence.key.getStart(), occurrence.key.getWidth(), `The key ${occurrence.key.getText()} doesn't conform to a valid localize identifier`)); - } - const occurrences = this.usedKeys[key]; - if (occurrences.length > 1) { - occurrences.forEach(occurrence => { - this.addFailure((this.createFailure(occurrence.key.getStart(), occurrence.key.getWidth(), `Duplicate key ${occurrence.key.getText()} with different message value.`))); - }); - } - }); - } - visitStringLiteral(node) { - this.checkStringLiteral(node); - super.visitStringLiteral(node); - } - checkStringLiteral(node) { - const text = node.getText(); - const doubleQuoted = text.length >= 2 && text[0] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE && text[text.length - 1] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE; - const info = this.findDescribingParent(node); - // Ignore strings in import and export nodes. - if (info && info.isImport && doubleQuoted) { - const fix = [ - Lint.Replacement.replaceFromTo(node.getStart(), 1, '\''), - Lint.Replacement.replaceFromTo(node.getStart() + text.length - 1, 1, '\''), - ]; - this.addFailureAtNode(node, NoUnexternalizedStringsRuleWalker.ImportFailureMessage, fix); - return; - } - const callInfo = info ? info.callInfo : null; - const functionName = callInfo ? callInfo.callExpression.expression.getText() : null; - if (functionName && this.ignores[functionName]) { - return; - } - if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) { - const s = node.getText(); - const fix = [ - Lint.Replacement.replaceFromTo(node.getStart(), node.getWidth(), `nls.localize('KEY-${s.substring(1, s.length - 1)}', ${s})`), - ]; - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Unexternalized string found: ${node.getText()}`, fix)); - return; - } - // We have a single quoted string outside a localize function name. - if (!doubleQuoted && !this.signatures[functionName]) { - return; - } - // We have a string that is a direct argument into the localize call. - const keyArg = callInfo && callInfo.argIndex === this.keyIndex - ? callInfo.callExpression.arguments[this.keyIndex] - : null; - if (keyArg) { - if (isStringLiteral(keyArg)) { - this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined); - } - else if (isObjectLiteral(keyArg)) { - for (const property of keyArg.properties) { - if (isPropertyAssignment(property)) { - const name = property.name.getText(); - if (name === 'key') { - const initializer = property.initializer; - if (isStringLiteral(initializer)) { - this.recordKey(initializer, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined); - } - break; - } - } - } - } - } - const messageArg = callInfo.callExpression.arguments[this.messageIndex]; - if (messageArg && messageArg.kind !== ts.SyntaxKind.StringLiteral) { - this.addFailure(this.createFailure(messageArg.getStart(), messageArg.getWidth(), `Message argument to '${callInfo.callExpression.expression.getText()}' must be a string literal.`)); - return; - } - } - recordKey(keyNode, messageNode) { - const text = keyNode.getText(); - // We have an empty key - if (text.match(/(['"]) *\1/)) { - if (messageNode) { - this.addFailureAtNode(keyNode, `Key is empty for message: ${messageNode.getText()}`); - } - else { - this.addFailureAtNode(keyNode, `Key is empty.`); - } - return; - } - let occurrences = this.usedKeys[text]; - if (!occurrences) { - occurrences = []; - this.usedKeys[text] = occurrences; - } - if (messageNode) { - if (occurrences.some(pair => pair.message ? pair.message.getText() === messageNode.getText() : false)) { - return; - } - } - occurrences.push({ key: keyNode, message: messageNode }); - } - findDescribingParent(node) { - let parent; - while ((parent = node.parent)) { - const kind = parent.kind; - if (kind === ts.SyntaxKind.CallExpression) { - const callExpression = parent; - return { callInfo: { callExpression: callExpression, argIndex: callExpression.arguments.indexOf(node) } }; - } - else if (kind === ts.SyntaxKind.ImportEqualsDeclaration || kind === ts.SyntaxKind.ImportDeclaration || kind === ts.SyntaxKind.ExportDeclaration) { - return { isImport: true }; - } - else if (kind === ts.SyntaxKind.VariableDeclaration || kind === ts.SyntaxKind.FunctionDeclaration || kind === ts.SyntaxKind.PropertyDeclaration - || kind === ts.SyntaxKind.MethodDeclaration || kind === ts.SyntaxKind.VariableDeclarationList || kind === ts.SyntaxKind.InterfaceDeclaration - || kind === ts.SyntaxKind.ClassDeclaration || kind === ts.SyntaxKind.EnumDeclaration || kind === ts.SyntaxKind.ModuleDeclaration - || kind === ts.SyntaxKind.TypeAliasDeclaration || kind === ts.SyntaxKind.SourceFile) { - return null; - } - node = parent; - } - return null; - } -} -NoUnexternalizedStringsRuleWalker.ImportFailureMessage = 'Do not use double quotes for imports.'; -NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE = '"'; -NoUnexternalizedStringsRuleWalker.IDENTIFIER = /^[_a-zA-Z0-9][ .\-_a-zA-Z0-9]*$/; diff --git a/build/lib/tslint/noUnexternalizedStringsRule.ts b/build/lib/tslint/noUnexternalizedStringsRule.ts deleted file mode 100644 index d896e4fabe2ee..0000000000000 --- a/build/lib/tslint/noUnexternalizedStringsRule.ts +++ /dev/null @@ -1,222 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as ts from 'typescript'; -import * as Lint from 'tslint'; - -/** - * Implementation of the no-unexternalized-strings rule. - */ -export class Rule extends Lint.Rules.AbstractRule { - public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - if (/\.d.ts$/.test(sourceFile.fileName)) { - return []; - } - return this.applyWithWalker(new NoUnexternalizedStringsRuleWalker(sourceFile, this.getOptions())); - } -} - -interface Map { - [key: string]: V; -} - -interface UnexternalizedStringsOptions { - signatures?: string[]; - messageIndex?: number; - keyIndex?: number; - ignores?: string[]; -} - -function isStringLiteral(node: ts.Node): node is ts.StringLiteral { - return node && node.kind === ts.SyntaxKind.StringLiteral; -} - -function isObjectLiteral(node: ts.Node): node is ts.ObjectLiteralExpression { - return node && node.kind === ts.SyntaxKind.ObjectLiteralExpression; -} - -function isPropertyAssignment(node: ts.Node): node is ts.PropertyAssignment { - return node && node.kind === ts.SyntaxKind.PropertyAssignment; -} - -interface KeyMessagePair { - key: ts.StringLiteral; - message: ts.Node | undefined; -} - -class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker { - - private static ImportFailureMessage = 'Do not use double quotes for imports.'; - - private static DOUBLE_QUOTE: string = '"'; - - private signatures: Map; - private messageIndex: number | undefined; - private keyIndex: number | undefined; - private ignores: Map; - - private usedKeys: Map; - - constructor(file: ts.SourceFile, opts: Lint.IOptions) { - super(file, opts); - this.signatures = Object.create(null); - this.ignores = Object.create(null); - this.messageIndex = undefined; - this.keyIndex = undefined; - this.usedKeys = Object.create(null); - const options: any[] = this.getOptions(); - const first: UnexternalizedStringsOptions = options && options.length > 0 ? options[0] : null; - if (first) { - if (Array.isArray(first.signatures)) { - first.signatures.forEach((signature: string) => this.signatures[signature] = true); - } - if (Array.isArray(first.ignores)) { - first.ignores.forEach((ignore: string) => this.ignores[ignore] = true); - } - if (typeof first.messageIndex !== 'undefined') { - this.messageIndex = first.messageIndex; - } - if (typeof first.keyIndex !== 'undefined') { - this.keyIndex = first.keyIndex; - } - } - } - - private static IDENTIFIER = /^[_a-zA-Z0-9][ .\-_a-zA-Z0-9]*$/; - protected visitSourceFile(node: ts.SourceFile): void { - super.visitSourceFile(node); - Object.keys(this.usedKeys).forEach(key => { - // Keys are quoted. - let identifier = key.substr(1, key.length - 2); - if (!NoUnexternalizedStringsRuleWalker.IDENTIFIER.test(identifier)) { - let occurrence = this.usedKeys[key][0]; - this.addFailure(this.createFailure(occurrence.key.getStart(), occurrence.key.getWidth(), `The key ${occurrence.key.getText()} doesn't conform to a valid localize identifier`)); - } - const occurrences = this.usedKeys[key]; - if (occurrences.length > 1) { - occurrences.forEach(occurrence => { - this.addFailure((this.createFailure(occurrence.key.getStart(), occurrence.key.getWidth(), `Duplicate key ${occurrence.key.getText()} with different message value.`))); - }); - } - }); - } - - protected visitStringLiteral(node: ts.StringLiteral): void { - this.checkStringLiteral(node); - super.visitStringLiteral(node); - } - - private checkStringLiteral(node: ts.StringLiteral): void { - const text = node.getText(); - const doubleQuoted = text.length >= 2 && text[0] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE && text[text.length - 1] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE; - const info = this.findDescribingParent(node); - // Ignore strings in import and export nodes. - if (info && info.isImport && doubleQuoted) { - const fix = [ - Lint.Replacement.replaceFromTo(node.getStart(), 1, '\''), - Lint.Replacement.replaceFromTo(node.getStart() + text.length - 1, 1, '\''), - ]; - this.addFailureAtNode( - node, - NoUnexternalizedStringsRuleWalker.ImportFailureMessage, - fix - ); - return; - } - const callInfo = info ? info.callInfo : null; - const functionName = callInfo ? callInfo.callExpression.expression.getText() : null; - if (functionName && this.ignores[functionName]) { - return; - } - - if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName!])) { - const s = node.getText(); - const fix = [ - Lint.Replacement.replaceFromTo(node.getStart(), node.getWidth(), `nls.localize('KEY-${s.substring(1, s.length - 1)}', ${s})`), - ]; - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Unexternalized string found: ${node.getText()}`, fix)); - return; - } - // We have a single quoted string outside a localize function name. - if (!doubleQuoted && !this.signatures[functionName!]) { - return; - } - // We have a string that is a direct argument into the localize call. - const keyArg: ts.Expression | null = callInfo && callInfo.argIndex === this.keyIndex - ? callInfo.callExpression.arguments[this.keyIndex] - : null; - if (keyArg) { - if (isStringLiteral(keyArg)) { - this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined); - } else if (isObjectLiteral(keyArg)) { - for (const property of keyArg.properties) { - if (isPropertyAssignment(property)) { - const name = property.name.getText(); - if (name === 'key') { - const initializer = property.initializer; - if (isStringLiteral(initializer)) { - this.recordKey(initializer, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined); - } - break; - } - } - } - } - } - - const messageArg = callInfo!.callExpression.arguments[this.messageIndex!]; - - if (messageArg && messageArg.kind !== ts.SyntaxKind.StringLiteral) { - this.addFailure(this.createFailure( - messageArg.getStart(), messageArg.getWidth(), - `Message argument to '${callInfo!.callExpression.expression.getText()}' must be a string literal.`)); - return; - } - } - - private recordKey(keyNode: ts.StringLiteral, messageNode: ts.Node | undefined) { - const text = keyNode.getText(); - // We have an empty key - if (text.match(/(['"]) *\1/)) { - if (messageNode) { - this.addFailureAtNode(keyNode, `Key is empty for message: ${messageNode.getText()}`); - } else { - this.addFailureAtNode(keyNode, `Key is empty.`); - } - return; - } - let occurrences: KeyMessagePair[] = this.usedKeys[text]; - if (!occurrences) { - occurrences = []; - this.usedKeys[text] = occurrences; - } - if (messageNode) { - if (occurrences.some(pair => pair.message ? pair.message.getText() === messageNode.getText() : false)) { - return; - } - } - occurrences.push({ key: keyNode, message: messageNode }); - } - - private findDescribingParent(node: ts.Node): { callInfo?: { callExpression: ts.CallExpression, argIndex: number }, isImport?: boolean; } | null { - let parent: ts.Node; - while ((parent = node.parent)) { - const kind = parent.kind; - if (kind === ts.SyntaxKind.CallExpression) { - const callExpression = parent as ts.CallExpression; - return { callInfo: { callExpression: callExpression, argIndex: callExpression.arguments.indexOf(node) } }; - } else if (kind === ts.SyntaxKind.ImportEqualsDeclaration || kind === ts.SyntaxKind.ImportDeclaration || kind === ts.SyntaxKind.ExportDeclaration) { - return { isImport: true }; - } else if (kind === ts.SyntaxKind.VariableDeclaration || kind === ts.SyntaxKind.FunctionDeclaration || kind === ts.SyntaxKind.PropertyDeclaration - || kind === ts.SyntaxKind.MethodDeclaration || kind === ts.SyntaxKind.VariableDeclarationList || kind === ts.SyntaxKind.InterfaceDeclaration - || kind === ts.SyntaxKind.ClassDeclaration || kind === ts.SyntaxKind.EnumDeclaration || kind === ts.SyntaxKind.ModuleDeclaration - || kind === ts.SyntaxKind.TypeAliasDeclaration || kind === ts.SyntaxKind.SourceFile) { - return null; - } - node = parent; - } - return null; - } -} diff --git a/build/lib/tslint/translationRemindRule.js b/build/lib/tslint/translationRemindRule.js deleted file mode 100644 index 2234094421bb9..0000000000000 --- a/build/lib/tslint/translationRemindRule.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const Lint = require("tslint"); -const fs = require("fs"); -class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile) { - return this.applyWithWalker(new TranslationRemindRuleWalker(sourceFile, this.getOptions())); - } -} -exports.Rule = Rule; -class TranslationRemindRuleWalker extends Lint.RuleWalker { - constructor(file, opts) { - super(file, opts); - } - visitImportDeclaration(node) { - const declaration = node.moduleSpecifier.getText(); - if (declaration !== `'${TranslationRemindRuleWalker.NLS_MODULE}'`) { - return; - } - this.visitImportLikeDeclaration(node); - } - visitImportEqualsDeclaration(node) { - const reference = node.moduleReference.getText(); - if (reference !== `require('${TranslationRemindRuleWalker.NLS_MODULE}')`) { - return; - } - this.visitImportLikeDeclaration(node); - } - visitImportLikeDeclaration(node) { - const currentFile = node.getSourceFile().fileName; - const matchService = currentFile.match(/vs\/workbench\/services\/\w+/); - const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/); - if (!matchService && !matchPart) { - return; - } - const resource = matchService ? matchService[0] : matchPart[0]; - let resourceDefined = false; - let json; - try { - json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'); - } - catch (e) { - console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.'); - return; - } - const workbenchResources = JSON.parse(json).workbench; - workbenchResources.forEach((existingResource) => { - if (existingResource.name === resource) { - resourceDefined = true; - return; - } - }); - if (!resourceDefined) { - this.addFailureAtNode(node, `Please add '${resource}' to ./build/lib/i18n.resources.json file to use translations here.`); - } - } -} -TranslationRemindRuleWalker.NLS_MODULE = 'vs/nls'; diff --git a/build/lib/tslint/translationRemindRule.ts b/build/lib/tslint/translationRemindRule.ts deleted file mode 100644 index e2671599d3c0a..0000000000000 --- a/build/lib/tslint/translationRemindRule.ts +++ /dev/null @@ -1,73 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as ts from 'typescript'; -import * as Lint from 'tslint'; -import * as fs from 'fs'; - -export class Rule extends Lint.Rules.AbstractRule { - public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - return this.applyWithWalker(new TranslationRemindRuleWalker(sourceFile, this.getOptions())); - } -} - -class TranslationRemindRuleWalker extends Lint.RuleWalker { - - private static NLS_MODULE: string = 'vs/nls'; - - constructor(file: ts.SourceFile, opts: Lint.IOptions) { - super(file, opts); - } - - protected visitImportDeclaration(node: ts.ImportDeclaration): void { - const declaration = node.moduleSpecifier.getText(); - if (declaration !== `'${TranslationRemindRuleWalker.NLS_MODULE}'`) { - return; - } - - this.visitImportLikeDeclaration(node); - } - - protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void { - const reference = node.moduleReference.getText(); - if (reference !== `require('${TranslationRemindRuleWalker.NLS_MODULE}')`) { - return; - } - - this.visitImportLikeDeclaration(node); - } - - private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) { - const currentFile = node.getSourceFile().fileName; - const matchService = currentFile.match(/vs\/workbench\/services\/\w+/); - const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/); - if (!matchService && !matchPart) { - return; - } - - const resource = matchService ? matchService[0] : matchPart![0]; - let resourceDefined = false; - - let json; - try { - json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'); - } catch (e) { - console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.'); - return; - } - const workbenchResources = JSON.parse(json).workbench; - - workbenchResources.forEach((existingResource: any) => { - if (existingResource.name === resource) { - resourceDefined = true; - return; - } - }); - - if (!resourceDefined) { - this.addFailureAtNode(node, `Please add '${resource}' to ./build/lib/i18n.resources.json file to use translations here.`); - } - } -} diff --git a/build/package.json b/build/package.json index 7d72317ff5e0b..5cd8929a5e21f 100644 --- a/build/package.json +++ b/build/package.json @@ -6,6 +6,7 @@ "@types/ansi-colors": "^3.2.0", "@types/azure": "0.9.19", "@types/debounce": "^1.0.0", + "@types/eslint": "4.16.1", "@types/fancy-log": "^1.3.0", "@types/glob": "^7.1.1", "@types/gulp": "^4.0.5", @@ -28,6 +29,7 @@ "@types/through2": "^2.0.34", "@types/underscore": "^1.8.9", "@types/xml2js": "0.0.33", + "@typescript-eslint/experimental-utils": "~2.13.0", "applicationinsights": "1.0.8", "azure-storage": "^2.1.0", "github-releases": "^0.4.1", @@ -40,7 +42,6 @@ "minimist": "^1.2.0", "request": "^2.85.0", "terser": "4.3.8", - "tslint": "^5.9.1", "typescript": "3.7.3", "vsce": "1.48.0", "vscode-telemetry-extractor": "^1.5.4", diff --git a/build/tslint.json b/build/tslint.json deleted file mode 100644 index 15275279139de..0000000000000 --- a/build/tslint.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "rules": { - "no-unused-expression": true, - "no-duplicate-variable": true, - "curly": true, - "class-name": true, - "semicolon": [ - true, - "always" - ], - "triple-equals": true - }, - "defaultSeverity": "warning" -} \ No newline at end of file diff --git a/build/yarn.lock b/build/yarn.lock index 3f9e5f1cda793..b98261cbfc131 100644 --- a/build/yarn.lock +++ b/build/yarn.lock @@ -90,6 +90,19 @@ resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== +"@types/eslint@4.16.1": + version "4.16.1" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-4.16.1.tgz#19730c9fcb66b6e44742d12b27a603fabfeb2f49" + integrity sha512-lRUXQAULl5geixTiP2K0iYvMUbCkEnuOwvLGjwff12I4ECxoW5QaWML5UUOZ1CvpQLILkddBdMPMZz4ByQizsg== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*": + version "0.0.41" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.41.tgz#fd90754150b57432b72bf560530500597ff04421" + integrity sha512-rIAmXyJlqw4KEBO7+u9gxZZSQHaCNnIzYrnNmYVpgfJhxTqO0brCX0SYpqUTkVI5mwwUwzmtspLBGBKroMeynA== + "@types/events@*": version "1.2.0" resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86" @@ -184,6 +197,11 @@ resolved "https://registry.yarnpkg.com/@types/js-beautify/-/js-beautify-1.8.0.tgz#0369d3d0e1f35a6aec07cb4da2ee2bcda111367c" integrity sha512-/siF86XrwDKLuHe8l7h6NhrAWgLdgqbxmjZv9NvGWmgYRZoTipkjKiWb0SQHy/jcR+ee0GvbG6uGd+LEBMGNvA== +"@types/json-schema@*", "@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/mime@0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-0.0.29.tgz#fbcfd330573b912ef59eeee14602bface630754b" @@ -312,6 +330,28 @@ resolved "https://registry.yarnpkg.com/@types/xml2js/-/xml2js-0.0.33.tgz#20c5dd6460245284d64a55690015b95e409fb7de" integrity sha1-IMXdZGAkUoTWSlVpABW5XkCft94= +"@typescript-eslint/experimental-utils@~2.13.0": + version "2.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.13.0.tgz#958614faa6f77599ee2b241740e0ea402482533d" + integrity sha512-+Hss3clwa6aNiC8ZjA45wEm4FutDV5HsVXPl/rDug1THq6gEtOYRGLqS3JlTk7mSnL5TbJz0LpEbzbPnKvY6sw== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.13.0" + eslint-scope "^5.0.0" + +"@typescript-eslint/typescript-estree@2.13.0": + version "2.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.13.0.tgz#a2e746867da772c857c13853219fced10d2566bc" + integrity sha512-t21Mg5cc8T3ADEUGwDisHLIubgXKjuNRbkpzDMLb7/JMmgCe/gHM9FaaujokLey+gwTuLF5ndSQ7/EfQqrQx4g== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash.unescape "4.0.1" + semver "^6.3.0" + tsutils "^3.17.1" + acorn@4.X: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" @@ -905,11 +945,36 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +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-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== + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.1.0, estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1102,6 +1167,18 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + globby@^10.0.1: version "10.0.1" resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22" @@ -1641,6 +1718,11 @@ lodash.templatesettings@^3.0.0: lodash._reinterpolate "^3.0.0" lodash.escape "^3.0.0" +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + lodash@^4.15.0, lodash@^4.17.10: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" @@ -2165,6 +2247,11 @@ semver@^5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +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== + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -2416,6 +2503,13 @@ tsutils@^2.27.2: 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" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" diff --git a/extensions/emmet/src/test/abbreviationAction.test.ts b/extensions/emmet/src/test/abbreviationAction.test.ts index 31f46891965f8..cedf324490385 100644 --- a/extensions/emmet/src/test/abbreviationAction.test.ts +++ b/extensions/emmet/src/test/abbreviationAction.test.ts @@ -362,7 +362,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { }); test('Expand html when inside script tag with javascript type if js is mapped to html (HTML)', async () => { - await workspace.getConfiguration('emmet').update('includeLanguages', { "javascript": "html" }, ConfigurationTarget.Global); + await workspace.getConfiguration('emmet').update('includeLanguages', { 'javascript': 'html' }, ConfigurationTarget.Global); await withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => { editor.selection = new Selection(24, 10, 24, 10); let expandPromise = expandEmmetAbbreviation(null); @@ -378,7 +378,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { test('Expand html in completion list when inside script tag with javascript type if js is mapped to html (HTML)', async () => { const abbreviation = 'span.bye'; const expandedText = ''; - await workspace.getConfiguration('emmet').update('includeLanguages', { "javascript": "html" }, ConfigurationTarget.Global); + await workspace.getConfiguration('emmet').update('includeLanguages', { 'javascript': 'html' }, ConfigurationTarget.Global); await withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => { editor.selection = new Selection(24, 10, 24, 10); const cancelSrc = new CancellationTokenSource(); @@ -448,7 +448,7 @@ suite('Tests for jsx, xml and xsl', () => { }); test('Expand abbreviation with single quotes for jsx', async () => { - await workspace.getConfiguration('emmet').update('syntaxProfiles', { jsx: { "attr_quotes": "single" } }, ConfigurationTarget.Global); + await workspace.getConfiguration('emmet').update('syntaxProfiles', { jsx: { 'attr_quotes': 'single' } }, ConfigurationTarget.Global); return withRandomFileEditor('img', 'javascriptreact', async (editor, _doc) => { editor.selection = new Selection(0, 6, 0, 6); await expandEmmetAbbreviation({ language: 'javascriptreact' }); diff --git a/extensions/emmet/src/test/partialParsingStylesheet.test.ts b/extensions/emmet/src/test/partialParsingStylesheet.test.ts index 7a115bd47aad1..0c19d06b6453f 100644 --- a/extensions/emmet/src/test/partialParsingStylesheet.test.ts +++ b/extensions/emmet/src/test/partialParsingStylesheet.test.ts @@ -40,7 +40,7 @@ p { new vscode.Range(3, 13, 3, 14), // p just before ending of block comment new vscode.Range(6, 2, 6, 3) // p after ending of block - ] + ]; rangesForEmmet.forEach(range => { assert.equal(isValid(doc, range, 'css'), true); }); diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index 4edc79262d20c..47832f9e0f06e 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -1721,7 +1721,7 @@ export class Repository implements Disposable { if (branchName) { // '{0}' will be replaced by the corresponding key-command later in the process, which is why it needs to stay. - this._sourceControl.inputBox.placeholder = localize('commitMessageWithHeadLabel', "Message ({0} to commit on '{1}')", "{0}", branchName); + this._sourceControl.inputBox.placeholder = localize('commitMessageWithHeadLabel', "Message ({0} to commit on '{1}')", '{0}', branchName); } else { this._sourceControl.inputBox.placeholder = localize('commitMessage', "Message ({0} to commit)"); } diff --git a/extensions/html-language-features/server/lib/jquery.d.ts b/extensions/html-language-features/server/lib/jquery.d.ts index 3dc9f0e12610f..d31bfe6c1b546 100644 --- a/extensions/html-language-features/server/lib/jquery.d.ts +++ b/extensions/html-language-features/server/lib/jquery.d.ts @@ -34,7 +34,7 @@ interface JQueryAjaxSettings { /** * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. */ - beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; + beforeSend?(jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; /** * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. */ @@ -42,7 +42,7 @@ interface JQueryAjaxSettings { /** * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. */ - complete? (jqXHR: JQueryXHR, textStatus: string): any; + complete?(jqXHR: JQueryXHR, textStatus: string): any; /** * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) */ @@ -72,7 +72,7 @@ interface JQueryAjaxSettings { /** * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. */ - dataFilter? (data: any, ty: any): any; + dataFilter?(data: any, ty: any): any; /** * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). */ @@ -80,7 +80,7 @@ interface JQueryAjaxSettings { /** * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. */ - error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; + error?(jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; /** * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. */ @@ -132,7 +132,7 @@ interface JQueryAjaxSettings { /** * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. */ - success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; + success?(data: any, textStatus: string, jqXHR: JQueryXHR): any; /** * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. */ @@ -284,7 +284,7 @@ interface JQueryGenericPromise { * @param doneFilter A function that is called when the Deferred is resolved. * @param failFilter An optional function that is called when the Deferred is rejected. */ - then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; + then(doneFilter: (value?: T, ...values: any[]) => U | JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. @@ -303,7 +303,7 @@ interface JQueryPromiseCallback { } interface JQueryPromiseOperator { - (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + (callback1: JQueryPromiseCallback | JQueryPromiseCallback[], ...callbacksN: Array | JQueryPromiseCallback[]>): JQueryPromise; } /** @@ -320,27 +320,27 @@ interface JQueryPromise extends JQueryGenericPromise { * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ - always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + always(alwaysCallback1?: JQueryPromiseCallback | JQueryPromiseCallback[], ...alwaysCallbacksN: Array | JQueryPromiseCallback[]>): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved. * * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ - done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + done(doneCallback1?: JQueryPromiseCallback | JQueryPromiseCallback[], ...doneCallbackN: Array | JQueryPromiseCallback[]>): JQueryPromise; /** * Add handlers to be called when the Deferred object is rejected. * * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ - fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + fail(failCallback1?: JQueryPromiseCallback | JQueryPromiseCallback[], ...failCallbacksN: Array | JQueryPromiseCallback[]>): JQueryPromise; /** * Add handlers to be called when the Deferred object generates progress notifications. * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ - progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + progress(progressCallback1?: JQueryPromiseCallback | JQueryPromiseCallback[], ...progressCallbackN: Array | JQueryPromiseCallback[]>): JQueryPromise; // Deprecated - given no typings pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; @@ -367,27 +367,27 @@ interface JQueryDeferred extends JQueryGenericPromise { * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ - always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + always(alwaysCallback1?: JQueryPromiseCallback | JQueryPromiseCallback[], ...alwaysCallbacksN: Array | JQueryPromiseCallback[]>): JQueryDeferred; /** * Add handlers to be called when the Deferred object is resolved. * * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ - done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + done(doneCallback1?: JQueryPromiseCallback | JQueryPromiseCallback[], ...doneCallbackN: Array | JQueryPromiseCallback[]>): JQueryDeferred; /** * Add handlers to be called when the Deferred object is rejected. * * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ - fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + fail(failCallback1?: JQueryPromiseCallback | JQueryPromiseCallback[], ...failCallbacksN: Array | JQueryPromiseCallback[]>): JQueryDeferred; /** * Add handlers to be called when the Deferred object generates progress notifications. * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ - progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + progress(progressCallback1?: JQueryPromiseCallback | JQueryPromiseCallback[], ...progressCallbackN: Array | JQueryPromiseCallback[]>): JQueryDeferred; /** * Call the progressCallbacks on a Deferred object with the given args. @@ -495,7 +495,7 @@ interface JQueryKeyEventObject extends JQueryInputEventObject { keyCode: number; } -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } /* @@ -518,7 +518,7 @@ interface JQuerySupport { opacity?: boolean; optDisabled?: boolean; optSelected?: boolean; - scriptEval? (): boolean; + scriptEval?(): boolean; style?: boolean; submitBubbles?: boolean; tbody?: boolean; @@ -549,7 +549,7 @@ interface JQueryParam { */ interface JQueryEventConstructor { (name: string, eventProperties?: any): JQueryEventObject; - new (name: string, eventProperties?: any): JQueryEventObject; + new(name: string, eventProperties?: any): JQueryEventObject; } /** @@ -616,11 +616,11 @@ interface JQueryAnimationOptions { } interface JQueryEasingFunction { - ( percent: number ): number; + (percent: number): number; } interface JQueryEasingFunctions { - [ name: string ]: JQueryEasingFunction; + [name: string]: JQueryEasingFunction; linear: JQueryEasingFunction; swing: JQueryEasingFunction; } @@ -660,11 +660,11 @@ interface JQueryStatic { ajaxSettings: JQueryAjaxSettings; - /** - * Set default values for future Ajax requests. Its use is not recommended. - * - * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. - */ + /** + * Set default values for future Ajax requests. Its use is not recommended. + * + * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. + */ ajaxSetup(options: JQueryAjaxSettings): void; /** @@ -683,13 +683,13 @@ interface JQueryStatic { * @param success A callback function that is executed if the request succeeds. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ - get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + get(url: string, data?: Object | string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP GET request. * * @param settings The JQueryAjaxSettings to be used for the request */ - get(settings : JQueryAjaxSettings): JQueryXHR; + get(settings: JQueryAjaxSettings): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * @@ -704,7 +704,7 @@ interface JQueryStatic { * @param data A plain object or string that is sent to the server with the request. * @param success A callback function that is executed if the request succeeds. */ - getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + getJSON(url: string, data?: Object | string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; /** * Load a JavaScript file from the server using a GET HTTP request, then execute it. * @@ -734,13 +734,13 @@ interface JQueryStatic { * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ - post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + post(url: string, data?: Object | string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP POST request. * * @param settings The JQueryAjaxSettings to be used for the request */ - post(settings : JQueryAjaxSettings): JQueryXHR; + post(settings: JQueryAjaxSettings): JQueryXHR; /** * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. * @@ -761,7 +761,7 @@ interface JQueryStatic { * @param selector A string containing a selector expression * @param context A DOM Element, Document, or jQuery to use as context */ - (selector: string, context?: Element|JQuery): JQuery; + (selector: string, context?: Element | JQuery): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. @@ -831,7 +831,7 @@ interface JQueryStatic { * * @param deferreds One or more Deferred objects, or plain JavaScript objects. */ - when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; + when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; /** * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. @@ -987,7 +987,7 @@ interface JQueryStatic { each( collection: T[], callback: (indexInArray: number, valueOfElement: T) => any - ): any; + ): any; /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. @@ -998,7 +998,7 @@ interface JQueryStatic { each( collection: any, callback: (indexInArray: any, valueOfElement: any) => any - ): any; + ): any; /** * Merge the contents of two or more objects together into the first object. @@ -1228,7 +1228,7 @@ interface JQuery { * @param data A plain object or string that is sent to the server with the request. * @param complete A callback function that is executed when the request completes. */ - load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; + load(url: string, data?: string | Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; /** * Encode a set of form elements as a string for submission. @@ -1269,14 +1269,14 @@ interface JQuery { * @param attributeName The name of the attribute to set. * @param value A value to set for the attribute. */ - attr(attributeName: string, value: string|number): JQuery; + attr(attributeName: string, value: string | number): JQuery; /** * Set one or more attributes for the set of matched elements. * * @param attributeName The name of the attribute to set. * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. */ - attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; + attr(attributeName: string, func: (index: number, attr: string) => string | number): JQuery; /** * Set one or more attributes for the set of matched elements. * @@ -1325,7 +1325,7 @@ interface JQuery { * @param propertyName The name of the property to set. * @param value A value to set for the property. */ - prop(propertyName: string, value: string|number|boolean): JQuery; + prop(propertyName: string, value: string | number | boolean): JQuery; /** * Set one or more properties for the set of matched elements. * @@ -1397,7 +1397,7 @@ interface JQuery { * * @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked. */ - val(value: string|string[]|number): JQuery; + val(value: string | string[] | number): JQuery; /** * Set the value of each element in the set of matched elements. * @@ -1418,14 +1418,14 @@ interface JQuery { * @param propertyName A CSS property name. * @param value A value to set for the property. */ - css(propertyName: string, value: string|number): JQuery; + css(propertyName: string, value: string | number): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName A CSS property name. * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ - css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; + css(propertyName: string, value: (index: number, value: string) => string | number): JQuery; /** * Set one or more CSS properties for the set of matched elements. * @@ -1442,13 +1442,13 @@ interface JQuery { * * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). */ - height(value: number|string): JQuery; + height(value: number | string): JQuery; /** * Set the CSS height of every matched element. * * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. */ - height(func: (index: number, height: number) => number|string): JQuery; + height(func: (index: number, height: number) => number | string): JQuery; /** * Get the current computed height for the first element in the set of matched elements, including padding but not border. @@ -1460,7 +1460,7 @@ interface JQuery { * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ - innerHeight(height: number|string): JQuery; + innerHeight(height: number | string): JQuery; /** * Get the current computed width for the first element in the set of matched elements, including padding but not border. @@ -1472,7 +1472,7 @@ interface JQuery { * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ - innerWidth(width: number|string): JQuery; + innerWidth(width: number | string): JQuery; /** * Get the current coordinates of the first element in the set of matched elements, relative to the document. @@ -1503,7 +1503,7 @@ interface JQuery { * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ - outerHeight(height: number|string): JQuery; + outerHeight(height: number | string): JQuery; /** * Get the current computed width for the first element in the set of matched elements, including padding and border. @@ -1517,7 +1517,7 @@ interface JQuery { * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ - outerWidth(width: number|string): JQuery; + outerWidth(width: number | string): JQuery; /** * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. @@ -1555,13 +1555,13 @@ interface JQuery { * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ - width(value: number|string): JQuery; + width(value: number | string): JQuery; /** * Set the CSS width of each element in the set of matched elements. * * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. */ - width(func: (index: number, width: number) => number|string): JQuery; + width(func: (index: number, width: number) => number | string): JQuery; /** * Remove from the queue all items that have not yet been run. @@ -1633,7 +1633,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - animate(properties: Object, duration?: string|number, complete?: Function): JQuery; + animate(properties: Object, duration?: string | number, complete?: Function): JQuery; /** * Perform a custom animation of a set of CSS properties. * @@ -1642,7 +1642,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. (default: swing) * @param complete A function to call once the animation is complete. */ - animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; + animate(properties: Object, duration?: string | number, easing?: string, complete?: Function): JQuery; /** * Perform a custom animation of a set of CSS properties. * @@ -1665,7 +1665,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - fadeIn(duration?: number|string, complete?: Function): JQuery; + fadeIn(duration?: number | string, complete?: Function): JQuery; /** * Display the matched elements by fading them to opaque. * @@ -1673,7 +1673,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; + fadeIn(duration?: number | string, easing?: string, complete?: Function): JQuery; /** * Display the matched elements by fading them to opaque. * @@ -1687,7 +1687,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - fadeOut(duration?: number|string, complete?: Function): JQuery; + fadeOut(duration?: number | string, complete?: Function): JQuery; /** * Hide the matched elements by fading them to transparent. * @@ -1695,7 +1695,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; + fadeOut(duration?: number | string, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements by fading them to transparent. * @@ -1710,7 +1710,7 @@ interface JQuery { * @param opacity A number between 0 and 1 denoting the target opacity. * @param complete A function to call once the animation is complete. */ - fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; + fadeTo(duration: string | number, opacity: number, complete?: Function): JQuery; /** * Adjust the opacity of the matched elements. * @@ -1719,7 +1719,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; + fadeTo(duration: string | number, opacity: number, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. @@ -1727,7 +1727,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - fadeToggle(duration?: number|string, complete?: Function): JQuery; + fadeToggle(duration?: number | string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * @@ -1735,7 +1735,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + fadeToggle(duration?: number | string, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * @@ -1756,7 +1756,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - hide(duration?: number|string, complete?: Function): JQuery; + hide(duration?: number | string, complete?: Function): JQuery; /** * Hide the matched elements. * @@ -1764,7 +1764,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - hide(duration?: number|string, easing?: string, complete?: Function): JQuery; + hide(duration?: number | string, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements. * @@ -1778,7 +1778,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - show(duration?: number|string, complete?: Function): JQuery; + show(duration?: number | string, complete?: Function): JQuery; /** * Display the matched elements. * @@ -1786,7 +1786,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - show(duration?: number|string, easing?: string, complete?: Function): JQuery; + show(duration?: number | string, easing?: string, complete?: Function): JQuery; /** * Display the matched elements. * @@ -1800,7 +1800,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - slideDown(duration?: number|string, complete?: Function): JQuery; + slideDown(duration?: number | string, complete?: Function): JQuery; /** * Display the matched elements with a sliding motion. * @@ -1808,7 +1808,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; + slideDown(duration?: number | string, easing?: string, complete?: Function): JQuery; /** * Display the matched elements with a sliding motion. * @@ -1822,7 +1822,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - slideToggle(duration?: number|string, complete?: Function): JQuery; + slideToggle(duration?: number | string, complete?: Function): JQuery; /** * Display or hide the matched elements with a sliding motion. * @@ -1830,7 +1830,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + slideToggle(duration?: number | string, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements with a sliding motion. * @@ -1844,7 +1844,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - slideUp(duration?: number|string, complete?: Function): JQuery; + slideUp(duration?: number | string, complete?: Function): JQuery; /** * Hide the matched elements with a sliding motion. * @@ -1852,7 +1852,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; + slideUp(duration?: number | string, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements with a sliding motion. * @@ -1882,7 +1882,7 @@ interface JQuery { * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ - toggle(duration?: number|string, complete?: Function): JQuery; + toggle(duration?: number | string, complete?: Function): JQuery; /** * Display or hide the matched elements. * @@ -1890,7 +1890,7 @@ interface JQuery { * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ - toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + toggle(duration?: number | string, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements. * @@ -2344,7 +2344,7 @@ interface JQuery { * @param data Data to be passed to the handler in event.data when an event is triggered. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ - on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + on(events: string, data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * @@ -2515,14 +2515,14 @@ interface JQuery { * @param eventType A string containing a JavaScript event type, such as click or submit. * @param extraParameters Additional parameters to pass along to the event handler. */ - trigger(eventType: string, extraParameters?: any[]|Object): JQuery; + trigger(eventType: string, extraParameters?: any[] | Object): JQuery; /** * Execute all handlers and behaviors attached to the matched elements for the given event type. * * @param event A jQuery.Event object. * @param extraParameters Additional parameters to pass along to the event handler. */ - trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; + trigger(event: JQueryEventObject, extraParameters?: any[] | Object): JQuery; /** * Execute all handlers attached to an element for an event. @@ -2643,13 +2643,13 @@ interface JQuery { * param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert after each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. */ - after(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; + after(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ - after(func: (index: number, html: string) => string|Element|JQuery): JQuery; + after(func: (index: number, html: string) => string | Element | JQuery): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. @@ -2657,20 +2657,20 @@ interface JQuery { * param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. */ - append(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; + append(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ - append(func: (index: number, html: string) => string|Element|JQuery): JQuery; + append(func: (index: number, html: string) => string | Element | JQuery): JQuery; /** * Insert every element in the set of matched elements to the end of the target. * * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. */ - appendTo(target: JQuery|any[]|Element|string): JQuery; + appendTo(target: JQuery | any[] | Element | string): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. @@ -2678,13 +2678,13 @@ interface JQuery { * param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert before each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. */ - before(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; + before(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ - before(func: (index: number, html: string) => string|Element|JQuery): JQuery; + before(func: (index: number, html: string) => string | Element | JQuery): JQuery; /** * Create a deep copy of the set of matched elements. @@ -2711,14 +2711,14 @@ interface JQuery { * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. */ - insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; + insertAfter(target: JQuery | any[] | Element | Text | string): JQuery; /** * Insert every element in the set of matched elements before the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. */ - insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; + insertBefore(target: JQuery | any[] | Element | Text | string): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. @@ -2726,20 +2726,20 @@ interface JQuery { * param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. */ - prepend(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; + prepend(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ - prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; + prepend(func: (index: number, html: string) => string | Element | JQuery): JQuery; /** * Insert every element in the set of matched elements to the beginning of the target. * * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. */ - prependTo(target: JQuery|any[]|Element|string): JQuery; + prependTo(target: JQuery | any[] | Element | string): JQuery; /** * Remove the set of matched elements from the DOM. @@ -2753,20 +2753,20 @@ interface JQuery { * * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. */ - replaceAll(target: JQuery|any[]|Element|string): JQuery; + replaceAll(target: JQuery | any[] | Element | string): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. */ - replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; + replaceWith(newContent: JQuery | any[] | Element | Text | string): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param func A function that returns content with which to replace the set of matched elements. */ - replaceWith(func: () => Element|JQuery): JQuery; + replaceWith(func: () => Element | JQuery): JQuery; /** * Get the combined text contents of each element in the set of matched elements, including their descendants. @@ -2777,7 +2777,7 @@ interface JQuery { * * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. */ - text(text: string|number|boolean): JQuery; + text(text: string | number | boolean): JQuery; /** * Set the content of each element in the set of matched elements to the specified text. * @@ -2801,20 +2801,20 @@ interface JQuery { * * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ - wrap(wrappingElement: JQuery|Element|string): JQuery; + wrap(wrappingElement: JQuery | Element | string): JQuery; /** * Wrap an HTML structure around each element in the set of matched elements. * * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ - wrap(func: (index: number) => string|JQuery): JQuery; + wrap(func: (index: number) => string | JQuery): JQuery; /** * Wrap an HTML structure around all elements in the set of matched elements. * * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ - wrapAll(wrappingElement: JQuery|Element|string): JQuery; + wrapAll(wrappingElement: JQuery | Element | string): JQuery; wrapAll(func: (index: number) => string): JQuery; /** @@ -2822,7 +2822,7 @@ interface JQuery { * * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. */ - wrapInner(wrappingElement: JQuery|Element|string): JQuery; + wrapInner(wrappingElement: JQuery | Element | string): JQuery; /** * Wrap an HTML structure around the content of each element in the set of matched elements. * @@ -2858,7 +2858,7 @@ interface JQuery { * * @param selector A selector representing a jQuery collection in which to look for an element. */ - index(selector: string|JQuery|Element): number; + index(selector: string | JQuery | Element): number; /** * The number of elements in the jQuery object. @@ -3109,7 +3109,7 @@ interface JQuery { * * @param elements One or more DOM elements to remove from the matched set. */ - not(elements: Element|Element[]): JQuery; + not(elements: Element | Element[]): JQuery; /** * Remove elements from the set of matched elements. * @@ -3242,7 +3242,7 @@ interface JQuery { */ queue(queueName: string, callback: Function): JQuery; } -declare module "jquery" { +declare module 'jquery' { export = $; } declare const jQuery: JQueryStatic; diff --git a/extensions/markdown-language-features/preview-src/index.ts b/extensions/markdown-language-features/preview-src/index.ts index 311c40b62d672..092148e19a4cd 100644 --- a/extensions/markdown-language-features/preview-src/index.ts +++ b/extensions/markdown-language-features/preview-src/index.ts @@ -10,7 +10,7 @@ import { getEditorLineNumberForPageOffset, scrollToRevealSourceLine, getLineElem import { getSettings, getData } from './settings'; import throttle = require('lodash.throttle'); -declare var acquireVsCodeApi: any; +declare let acquireVsCodeApi: any; let scrollDisabled = true; const marker = new ActiveLineMarker(); diff --git a/extensions/typescript-language-features/src/extension.ts b/extensions/typescript-language-features/src/extension.ts index ffa61f231f1be..a7493570f1bce 100644 --- a/extensions/typescript-language-features/src/extension.ts +++ b/extensions/typescript-language-features/src/extension.ts @@ -99,7 +99,6 @@ function lazilyActivateClient( if (!hasActivated && isSupportedDocument(supportedLanguage, textDocument)) { hasActivated = true; // Force activation - // tslint:disable-next-line:no-unused-expression void lazyClientHost.value; disposables.push(new ManagedFileContextManager(resource => { diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index ce01e4468e553..4433f18e97da3 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -118,7 +118,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType this.pathSeparator = path.sep; this.lastStart = Date.now(); - // tslint:disable-next-line: no-var-keyword + // eslint-disable-next-line no-var var p = new Promise((resolve, reject) => { this._onReady = { promise: p, resolve, reject }; }); diff --git a/extensions/vscode-colorize-tests/src/colorizer.test.ts b/extensions/vscode-colorize-tests/src/colorizer.test.ts index 82892577bdfa2..28a992573b9cd 100644 --- a/extensions/vscode-colorize-tests/src/colorizer.test.ts +++ b/extensions/vscode-colorize-tests/src/colorizer.test.ts @@ -56,7 +56,7 @@ function hasThemeChange(d: any, p: any) : boolean { } } return false; -}; +} suite('colorization', () => { let extensionsFolder = normalize(join(__dirname, '../../')); diff --git a/package.json b/package.json index df3f7c85ff457..d29bdbe18b7ea 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "valid-globals-check": "node build/lib/globalsLinter.js", "strict-function-types-watch": "tsc --watch -p src/tsconfig.json --noEmit --strictFunctionTypes", "update-distro": "node build/npm/update-distro.js", - "web": "node scripts/code-web.js" + "web": "node scripts/code-web.js", + "eslint": "eslint -c .eslintrc.json --rulesdir ./build/lib/eslint --ext .ts --ext .js ./src/vs ./extensions" }, "dependencies": { "applicationinsights": "1.0.8", @@ -81,6 +82,8 @@ "@types/winreg": "^1.2.30", "@types/yauzl": "^2.9.1", "@types/yazl": "^2.4.2", + "@typescript-eslint/eslint-plugin": "2.3.2", + "@typescript-eslint/parser": "^2.12.0", "ansi-colors": "^3.2.3", "asar": "^0.14.0", "chromium-pickle-js": "^0.2.0", @@ -89,6 +92,8 @@ "cson-parser": "^1.3.3", "debounce": "^1.0.0", "electron": "6.1.6", + "eslint": "6.8.0", + "eslint-plugin-jsdoc": "^19.1.0", "event-stream": "3.3.4", "express": "^4.13.1", "fancy-log": "^1.3.3", @@ -111,7 +116,6 @@ "gulp-replace": "^0.5.4", "gulp-shell": "^0.6.5", "gulp-tsb": "4.0.5", - "gulp-tslint": "^8.1.3", "gulp-untar": "^0.0.7", "gulp-vinyl-zip": "^2.1.2", "husky": "^0.13.1", @@ -140,7 +144,6 @@ "sinon": "^1.17.2", "source-map": "^0.4.4", "ts-loader": "^4.4.2", - "tslint": "^5.16.0", "typescript": "3.7.3", "typescript-formatter": "7.1.0", "underscore": "^1.8.2", diff --git a/src/.eslintrc b/src/.eslintrc deleted file mode 100644 index c25b0d558c2c3..0000000000000 --- a/src/.eslintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parserOptions": { - "ecmaVersion": 6 - }, - "env": { - "node": true, - "es6": true, - "browser": true, - "amd": true - }, - "rules": { - "no-console": 0, - "no-cond-assign": 0, - "no-unused-vars": "error", - "no-extra-semi": "error", - "semi": "error", - "no-inner-declarations": 0 - } -} \ No newline at end of file diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 19f89eec62678..78c9fda1d71ba 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -389,7 +389,7 @@ interface UriState extends UriComponents { const _pathSepMarker = isWindows ? 1 : undefined; -// tslint:disable-next-line:class-name +// eslint-disable-next-line @typescript-eslint/class-name-casing class _URI extends URI { _formatted: string | null = null; diff --git a/src/vs/base/test/common/event.test.ts b/src/vs/base/test/common/event.test.ts index a0e8ca9fcfa40..8c9d65ba20bb2 100644 --- a/src/vs/base/test/common/event.test.ts +++ b/src/vs/base/test/common/event.test.ts @@ -136,6 +136,7 @@ suite('Event', function () { let a = new Emitter(); let hit = false; a.event(function () { + // eslint-disable-next-line no-throw-literal throw 9; }); a.event(function () { diff --git a/src/vs/base/test/node/keytar.test.ts b/src/vs/base/test/node/keytar.test.ts index 53f1c31a1a64d..b2f7bab5042f4 100644 --- a/src/vs/base/test/node/keytar.test.ts +++ b/src/vs/base/test/node/keytar.test.ts @@ -28,7 +28,7 @@ suite('Keytar', () => { try { await keytar.deletePassword(name, 'foo'); } finally { - // tslint:disable-next-line: no-unsafe-finally + // eslint-disable-next-line no-unsafe-finally throw err; } } diff --git a/src/vs/editor/contrib/find/findWidget.ts b/src/vs/editor/contrib/find/findWidget.ts index d2f904129a9b5..8cf2da8896c2e 100644 --- a/src/vs/editor/contrib/find/findWidget.ts +++ b/src/vs/editor/contrib/find/findWidget.ts @@ -908,7 +908,6 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas return null; } try { - /* tslint:disable-next-line:no-unused-expression */ new RegExp(value); return null; } catch (e) { diff --git a/src/vs/editor/test/node/classification/typescript-test.ts b/src/vs/editor/test/node/classification/typescript-test.ts index bf8856d2f767d..f1a8a21c22d80 100644 --- a/src/vs/editor/test/node/classification/typescript-test.ts +++ b/src/vs/editor/test/node/classification/typescript-test.ts @@ -1,5 +1,5 @@ /// -/* tslint:disable */ +/* eslint-disable */ const x01 = "string"; /// ^^^^^^^^ string diff --git a/src/vs/platform/contextkey/common/contextkey.ts b/src/vs/platform/contextkey/common/contextkey.ts index d0654bc1caf81..a91b5ed598704 100644 --- a/src/vs/platform/contextkey/common/contextkey.ts +++ b/src/vs/platform/contextkey/common/contextkey.ts @@ -282,10 +282,9 @@ export class ContextKeyEqualsExpr implements ContextKeyExpr { } public evaluate(context: IContext): boolean { - /* tslint:disable:triple-equals */ // Intentional == + // eslint-disable-next-line eqeqeq return (context.getValue(this.key) == this.value); - /* tslint:enable:triple-equals */ } public serialize(): string { @@ -348,10 +347,9 @@ export class ContextKeyNotEqualsExpr implements ContextKeyExpr { } public evaluate(context: IContext): boolean { - /* tslint:disable:triple-equals */ // Intentional != + // eslint-disable-next-line eqeqeq return (context.getValue(this.key) != this.value); - /* tslint:enable:triple-equals */ } public serialize(): string { diff --git a/src/vs/platform/contextkey/test/common/contextkey.test.ts b/src/vs/platform/contextkey/test/common/contextkey.test.ts index 9db3782da3177..72929eff4289b 100644 --- a/src/vs/platform/contextkey/test/common/contextkey.test.ts +++ b/src/vs/platform/contextkey/test/common/contextkey.test.ts @@ -57,7 +57,6 @@ suite('ContextKeyExpr', () => { }); test('evaluate', () => { - /* tslint:disable:triple-equals */ let context = createContext({ 'a': true, 'b': false, @@ -70,6 +69,7 @@ suite('ContextKeyExpr', () => { assert.equal(rules!.evaluate(context), expected, expr); } function testBatch(expr: string, value: any): void { + /* eslint-disable eqeqeq */ testExpression(expr, !!value); testExpression(expr + ' == true', !!value); testExpression(expr + ' != true', !value); @@ -80,6 +80,7 @@ suite('ContextKeyExpr', () => { testExpression('!' + expr, !value); testExpression(expr + ' =~ /d.*/', /d.*/.test(value)); testExpression(expr + ' =~ /D/i', /D/i.test(value)); + /* eslint-enable eqeqeq */ } testBatch('a', true); @@ -90,9 +91,8 @@ suite('ContextKeyExpr', () => { testExpression('a && !b', true && !false); testExpression('a && b', true && false); - testExpression('a && !b && c == 5', true && !false && '5' == '5'); + testExpression('a && !b && c == 5', true && !false && '5' === '5'); testExpression('d =~ /e.*/', false); - /* tslint:enable:triple-equals */ // precedence test: false && true || true === true because && is evaluated first testExpression('b && a || a', true); diff --git a/src/vs/platform/log/common/fileLogService.ts b/src/vs/platform/log/common/fileLogService.ts index 32493332bc1a7..20716554d0477 100644 --- a/src/vs/platform/log/common/fileLogService.ts +++ b/src/vs/platform/log/common/fileLogService.ts @@ -173,7 +173,7 @@ export class FileLoggerService extends Disposable implements ILoggerService { getLogger(resource: URI): ILogger { let logger = this.loggers.get(resource.toString()); if (!logger) { - logger = new BufferLogService, this.logService.getLevel(); + logger = new BufferLogService(this.logService.getLevel()); this.loggers.set(resource.toString(), logger); whenProviderRegistered(resource, this.fileService).then(() => (logger).logger = this.instantiationService.createInstance(FileLogService, basename(resource), resource, this.logService.getLevel())); } diff --git a/src/vs/platform/sign/node/signService.ts b/src/vs/platform/sign/node/signService.ts index dac29b90c0cdd..b6d0afd467cbf 100644 --- a/src/vs/platform/sign/node/signService.ts +++ b/src/vs/platform/sign/node/signService.ts @@ -5,9 +5,8 @@ import { ISignService } from 'vs/platform/sign/common/sign'; -/* tslint:disable */ - declare module vsda { + // eslint-disable-next-line @typescript-eslint/class-name-casing export class signer { sign(arg: any): any; } diff --git a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts index f78fc4363b7b4..ea21d8ff5f4c1 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts @@ -32,17 +32,17 @@ export class QuickInputBox extends Disposable { return dom.addDisposableListener(this.inputBox.inputElement, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => { handler(new StandardKeyboardEvent(e)); }); - } + }; onMouseDown = (handler: (event: StandardMouseEvent) => void): IDisposable => { return dom.addDisposableListener(this.inputBox.inputElement, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => { handler(new StandardMouseEvent(e)); }); - } + }; onDidChange = (handler: (event: string) => void): IDisposable => { return this.inputBox.onDidChange(handler); - } + }; get value() { return this.inputBox.value; diff --git a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts index 50063ae1e88a5..93958775e4f9c 100644 --- a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts +++ b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts @@ -37,10 +37,11 @@ import { isFullscreen } from 'vs/base/browser/browser'; import { IHostService } from 'vs/workbench/services/host/browser/host'; // TODO@sbatten https://github.com/microsoft/vscode/issues/81360 -// tslint:disable-next-line: import-patterns layering TODO@sbatten +// eslint-disable-next-line code-layering, code-import-patterns import { IElectronService } from 'vs/platform/electron/node/electron'; import { optional } from 'vs/platform/instantiation/common/instantiation'; -// tslint:disable-next-line: import-patterns layering TODO@sbatten +// TODO@sbatten +// eslint-disable-next-line code-layering, code-import-patterns import { IElectronEnvironmentService } from 'vs/workbench/services/electron/electron-browser/electronEnvironmentService'; import { BrowserFeatures } from 'vs/base/browser/canIUse'; diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index 2af28e59378bc..09a3338ddcc9b 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -43,7 +43,7 @@ import { IProductService } from 'vs/platform/product/common/productService'; import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; // TODO@sbatten https://github.com/microsoft/vscode/issues/81360 -// tslint:disable-next-line: import-patterns layering +// eslint-disable-next-line code-layering, code-import-patterns import { IElectronService } from 'vs/platform/electron/node/electron'; export class TitlebarPart extends Part implements ITitleService { diff --git a/src/vs/workbench/contrib/codeActions/common/codeActions.contribution.ts b/src/vs/workbench/contrib/codeActions/common/codeActions.contribution.ts index 94cab6e33d557..ddf83c61dc77c 100644 --- a/src/vs/workbench/contrib/codeActions/common/codeActions.contribution.ts +++ b/src/vs/workbench/contrib/codeActions/common/codeActions.contribution.ts @@ -21,7 +21,6 @@ class WorkbenchContribution { constructor( @IKeybindingService keybindingsService: IKeybindingService, ) { - // tslint:disable-next-line: no-unused-expression new CodeActionWorkbenchContribution(codeActionsExtensionPoint, keybindingsService); } } diff --git a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts index fbbf29cc24e71..5e58e2ef15563 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts @@ -54,7 +54,6 @@ export abstract class SimpleFindWidget extends Widget { return null; } try { - /* tslint:disable-next-line:no-unused-expression */ new RegExp(value); return null; } catch (e) { diff --git a/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts b/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts index 7de229cf5837f..cebc296f37790 100644 --- a/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts +++ b/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts @@ -180,7 +180,7 @@ export class TextFileSaveErrorHandler extends Disposable implements ISaveErrorHa // Show message and keep function to hide in case the file gets saved/reverted const actions: INotificationActions = { primary: primaryActions, secondary: secondaryActions }; const handle = this.notificationService.notify({ severity: Severity.Error, message, actions }); - Event.once(handle.onDidClose)(() => { dispose(primaryActions), dispose(secondaryActions); }); + Event.once(handle.onDidClose)(() => { dispose(primaryActions); dispose(secondaryActions); }); this.messages.set(model.resource, handle); } diff --git a/src/vs/workbench/contrib/markers/browser/messages.ts b/src/vs/workbench/contrib/markers/browser/messages.ts index 7275dc27c439c..4fbffb9d7d434 100644 --- a/src/vs/workbench/contrib/markers/browser/messages.ts +++ b/src/vs/workbench/contrib/markers/browser/messages.ts @@ -67,7 +67,7 @@ export default class Messages { return marker.marker.source ? nls.localize('problems.tree.aria.label.marker', "Problem generated by {0}: {1} at line {2} and character {3}.{4}", marker.marker.source, marker.marker.message, marker.marker.startLineNumber, marker.marker.startColumn, relatedInformationMessage) : nls.localize('problems.tree.aria.label.marker.nosource', "Problem: {0} at line {1} and character {2}.{3}", marker.marker.message, marker.marker.startLineNumber, marker.marker.startColumn, relatedInformationMessage); } - } + }; public static readonly MARKERS_TREE_ARIA_LABEL_RELATED_INFORMATION = (relatedInformation: IRelatedInformation): string => nls.localize('problems.tree.aria.label.relatedinfo.message', "{0} at line {1} and character {2} in {3}", relatedInformation.message, relatedInformation.startLineNumber, relatedInformation.startColumn, basename(relatedInformation.resource)); public static SHOW_ERRORS_WARNINGS_ACTION_LABEL: string = nls.localize('errors.warnings.show.label', "Show Errors and Warnings"); } diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index 5a7ece35793cd..2a834ed343eec 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -1515,13 +1515,13 @@ export class SearchView extends ViewPane { event.stopPropagation(); } })); - } + }; private onOpenSettings = (e: dom.EventLike): void => { dom.EventHelper.stop(e, false); this.openSettings('.exclude'); - } + }; private openSettings(query: string): Promise { const options: ISettingsEditorOptions = { query }; @@ -1534,7 +1534,7 @@ export class SearchView extends ViewPane { dom.EventHelper.stop(e, false); this.openerService.open(URI.parse('https://go.microsoft.com/fwlink/?linkid=853977')); - } + }; private updateSearchResultCount(disregardExcludesAndIgnores?: boolean): void { const fileCount = this.viewModel.searchResult.fileCount(); diff --git a/src/vs/workbench/contrib/search/browser/searchWidget.ts b/src/vs/workbench/contrib/search/browser/searchWidget.ts index b339428b977b7..77defd9110c5c 100644 --- a/src/vs/workbench/contrib/search/browser/searchWidget.ts +++ b/src/vs/workbench/contrib/search/browser/searchWidget.ts @@ -103,7 +103,7 @@ export class SearchWidget extends Widget { private static readonly REPLACE_ALL_ENABLED_LABEL = (keyBindingService2: IKeybindingService): string => { const kb = keyBindingService2.lookupKeybinding(ReplaceAllAction.ID); return appendKeyBindingLabel(nls.localize('search.action.replaceAll.enabled.label', "Replace All"), kb, keyBindingService2); - } + }; domNode!: HTMLElement; @@ -439,7 +439,6 @@ export class SearchWidget extends Widget { return null; } try { - // tslint:disable-next-line: no-unused-expression new RegExp(value, 'u'); } catch (e) { return { content: e.message }; diff --git a/src/vs/workbench/services/extensions/test/node/rpcProtocol.test.ts b/src/vs/workbench/services/extensions/test/node/rpcProtocol.test.ts index 404e8b259f6ec..51951f79e20cb 100644 --- a/src/vs/workbench/services/extensions/test/node/rpcProtocol.test.ts +++ b/src/vs/workbench/services/extensions/test/node/rpcProtocol.test.ts @@ -190,6 +190,7 @@ suite('RPCProtocol', () => { test('issue #72798: null errors are hard to digest', function (done) { delegate = (a1: number, a2: number) => { + // eslint-disable-next-line no-throw-literal throw { 'what': 'what' }; }; bProxy.$m(4, 1).then((res) => { diff --git a/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts b/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts index 374f21e78d00f..1a3f95ea4c3da 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts @@ -33,8 +33,7 @@ suite('ExtHostDiagnostics', () => { assert.throws(() => collection.name); assert.throws(() => collection.clear()); assert.throws(() => collection.delete(URI.parse('aa:bb'))); - // tslint:disable-next-line:semicolon - assert.throws(() => collection.forEach(() => { ; })); + assert.throws(() => collection.forEach(() => { })); assert.throws(() => collection.get(URI.parse('aa:bb'))); assert.throws(() => collection.has(URI.parse('aa:bb'))); assert.throws(() => collection.set(URI.parse('aa:bb'), [])); diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts index 0703fb2ac5933..78c73141ae01f 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts @@ -61,7 +61,6 @@ suite('MainThreadDocumentsAndEditors', () => { onAfterOperation = Event.None; }; - /* tslint:disable */ new MainThreadDocumentsAndEditors( SingleProxyRPCProtocol(new class extends mock() { $acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta) { deltas.push(delta); } @@ -86,7 +85,6 @@ suite('MainThreadDocumentsAndEditors', () => { }, TestEnvironmentService ); - /* tslint:enable */ }); diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 9b5b07a5dd7a6..0000000000000 --- a/tslint.json +++ /dev/null @@ -1,619 +0,0 @@ -{ - "rulesDirectory": [ - "build/lib/tslint" - ], - "rules": { - "no-arg": true, - "no-construct": true, - "no-debugger": true, - "no-duplicate-super": true, - "no-duplicate-switch-case": true, - "no-duplicate-variable": true, - "no-for-in-array": true, - "no-eval": true, - "no-redundant-jsdoc": true, - "no-restricted-globals": true, - "no-sparse-arrays": true, - "no-string-throw": true, - "no-unsafe-finally": true, - "no-unused-expression": true, - "no-var-keyword": true, - "number-literal-format": true, - "curly": true, - "class-name": true, - "label-position": true, - "semicolon": [ - true, - "always" - ], - "triple-equals": true, - "no-unexternalized-strings": [ - true, - { - "signatures": [ - "localize", - "nls.localize" - ], - "keyIndex": 0, - "messageIndex": 1 - } - ], - "layering": [ - true, - { - "common": [], - "node": [ - "common" - ], - "browser": [ - "common" - ], - "electron-main": [ - "common", - "node" - ], - "electron-browser": [ - "common", - "browser", - "node" - ] - } - ], - "import-patterns": [ - true, - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // !!! Do not relax these rules !!! - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - { - "target": "**/vs/base/common/**", - "restrictions": [ - "vs/nls", - "**/vs/base/common/**" - ] - }, - { - "target": "**/vs/base/test/common/**", - "restrictions": [ - "assert", - "sinon", - "vs/nls", - "**/vs/base/common/**", - "**/vs/base/test/common/**" - ] - }, - { - "target": "**/vs/base/browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser}/**" - ] - }, - { - "target": "**/vs/base/node/**", - "restrictions": [ - "vs/nls", - "**/vs/base/{common,node}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - // vs/base/test/browser contains tests for vs/base/browser - "target": "**/vs/base/test/browser/**", - "restrictions": [ - "assert", - "sinon", - "vs/nls", - "**/vs/base/{common,browser}/**", - "**/vs/base/test/{common,browser}/**" - ] - }, - { - "target": "**/vs/base/parts/*/common/**", - "restrictions": [ - "vs/nls", - "**/vs/base/common/**", - "**/vs/base/parts/*/common/**" - ] - }, - { - "target": "**/vs/base/parts/*/browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser}/**", - "**/vs/base/parts/*/{common,browser}/**" - ] - }, - { - "target": "**/vs/base/parts/*/node/**", - "restrictions": [ - "vs/nls", - "**/vs/base/{common,node}/**", - "**/vs/base/parts/*/{common,node}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/base/parts/*/electron-browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser,node,electron-browser}/**", - "**/vs/base/parts/*/{common,browser,node,electron-browser}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/base/parts/*/electron-main/**", - "restrictions": [ - "vs/nls", - "**/vs/base/{common,node,electron-main}/**", - "**/vs/base/parts/*/{common,node,electron-main}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/platform/*/common/**", - "restrictions": [ - "vs/nls", - "**/vs/base/common/**", - "**/vs/base/parts/*/common/**", - "**/vs/platform/*/common/**" - ] - }, - { - "target": "**/vs/platform/*/test/common/**", - "restrictions": [ - "assert", - "sinon", - "vs/nls", - "**/vs/base/common/**", - "**/vs/platform/*/common/**", - "**/vs/platform/*/test/common/**" - ] - }, - { - "target": "**/vs/platform/*/browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser}/**", - "**/vs/base/parts/*/{common,browser}/**", - "**/vs/platform/*/{common,browser}/**" - ] - }, - { - "target": "**/vs/platform/*/node/**", - "restrictions": [ - "vs/nls", - "**/vs/base/{common,node}/**", - "**/vs/base/parts/*/{common,node}/**", - "**/vs/platform/*/{common,node}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/platform/*/electron-browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser,node}/**", - "**/vs/base/parts/*/{common,browser,node,electron-browser}/**", - "**/vs/platform/*/{common,browser,node,electron-browser}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/platform/*/electron-main/**", - "restrictions": [ - "vs/nls", - "**/vs/base/{common,node,electron-main}/**", - "**/vs/base/parts/*/{common,node,electron-main}/**", - "**/vs/platform/*/{common,node,electron-main}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/platform/*/test/browser/**", - "restrictions": [ - "assert", - "sinon", - "vs/nls", - "**/vs/base/{common,browser}/**", - "**/vs/platform/*/{common,browser}/**", - "**/vs/platform/*/test/{common,browser}/**" - ] - }, - { - "target": "**/vs/editor/common/**", - "restrictions": [ - "vs/nls", - "**/vs/base/common/**", - "**/vs/base/worker/**", - "**/vs/platform/*/common/**", - "**/vs/editor/common/**" - ] - }, - { - "target": "**/vs/editor/test/common/**", - "restrictions": [ - "assert", - "sinon", - "vs/nls", - "**/vs/base/common/**", - "**/vs/platform/*/common/**", - "**/vs/platform/*/test/common/**", - "**/vs/editor/common/**", - "**/vs/editor/test/common/**" - ] - }, - { - "target": "**/vs/editor/browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser}/**", - "**/vs/platform/*/{common,browser}/**", - "**/vs/editor/{common,browser}/**" - ] - }, - { - "target": "**/vs/editor/test/browser/**", - "restrictions": [ - "assert", - "sinon", - "vs/nls", - "**/vs/base/{common,browser}/**", - "**/vs/platform/*/{common,browser}/**", - "**/vs/platform/*/test/{common,browser}/**", - "**/vs/editor/{common,browser}/**", - "**/vs/editor/test/{common,browser}/**" - ] - }, - { - "target": "**/vs/editor/standalone/common/**", - "restrictions": [ - "vs/nls", - "**/vs/base/common/**", - "**/vs/platform/*/common/**", - "**/vs/editor/common/**", - "**/vs/editor/standalone/common/**" - ] - }, - { - "target": "**/vs/editor/standalone/test/common/**", - "restrictions": [ - "assert", - "sinon", - "vs/nls", - "**/vs/base/common/**", - "**/vs/platform/*/common/**", - "**/vs/platform/*/test/common/**", - "**/vs/editor/common/**", - "**/vs/editor/test/common/**" - ] - }, - { - "target": "**/vs/editor/standalone/browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser}/**", - "**/vs/base/parts/*/{common,browser}/**", - "**/vs/platform/*/{common,browser}/**", - "**/vs/editor/{common,browser}/**", - "**/vs/editor/contrib/**", - "**/vs/editor/standalone/{common,browser}/**" - ] - }, - { - "target": "**/vs/editor/standalone/test/browser/**", - "restrictions": [ - "assert", - "sinon", - "vs/nls", - "**/vs/base/{common,browser}/**", - "**/vs/platform/*/{common,browser}/**", - "**/vs/platform/*/test/{common,browser}/**", - "**/vs/editor/{common,browser}/**", - "**/vs/editor/standalone/{common,browser}/**", - "**/vs/editor/test/{common,browser}/**" - ] - }, - { - "target": "**/vs/editor/contrib/*/test/**", - "restrictions": [ - "assert", - "sinon", - "vs/nls", - "**/vs/base/{common,browser}/**", - "**/vs/base/test/{common,browser}/**", - "**/vs/base/parts/*/{common,browser}/**", - "**/vs/platform/*/{common,browser}/**", - "**/vs/platform/*/test/{common,browser}/**", - "**/vs/editor/{common,browser}/**", - "**/vs/editor/test/{common,browser}/**", - "**/vs/editor/contrib/**" - ] - }, - { - "target": "**/vs/editor/contrib/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser}/**", - "**/vs/base/parts/*/{common,browser}/**", - "**/vs/platform/{common,browser}/**", - "**/vs/platform/*/{common,browser}/**", - "**/vs/editor/{common,browser}/**", - "**/vs/editor/contrib/**" - ] - }, - { - "target": "**/vs/workbench/common/**", - "restrictions": [ - "vs/nls", - "**/vs/base/common/**", - "**/vs/base/parts/*/common/**", - "**/vs/platform/*/common/**", - "**/vs/editor/common/**", - "**/vs/editor/contrib/*/common/**", - "**/vs/workbench/common/**", - "**/vs/workbench/services/*/common/**", - "assert" - ] - }, - { - "target": "**/vs/workbench/browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser}/**", - "**/vs/base/parts/*/{common,browser}/**", - "**/vs/platform/*/{common,browser}/**", - "**/vs/editor/{common,browser}/**", - "**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention - "**/vs/workbench/workbench.web.api", - "**/vs/workbench/{common,browser}/**", - "**/vs/workbench/services/*/{common,browser}/**", - "assert" - ] - }, - { - "target": "**/vs/workbench/workbench.desktop.main.ts", - "restrictions": [ - "**" - ] - }, - { - "target": "**/vs/workbench/api/common/**", - "restrictions": [ - "vscode", - "vs/nls", - "**/vs/base/common/**", - "**/vs/platform/*/common/**", - "**/vs/editor/common/**", - "**/vs/editor/contrib/*/common/**", - "**/vs/workbench/api/common/**", - "**/vs/workbench/common/**", - "**/vs/workbench/services/*/common/**", - "**/vs/workbench/contrib/*/common/**" - ] - }, - { - "target": "**/vs/workbench/api/worker/**", - "restrictions": [ - "vscode", - "vs/nls", - "**/vs/**/{common,worker}/**" - ] - }, - { - "target": "**/vs/workbench/electron-browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/{common,browser,node,electron-browser}/**", - "**/vs/base/parts/*/{common,browser,node,electron-browser}/**", - "**/vs/platform/*/{common,browser,node,electron-browser}/**", - "**/vs/editor/{common,browser,node,electron-browser}/**", - "**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention - "**/vs/workbench/{common,browser,node,electron-browser,api}/**", - "**/vs/workbench/services/*/{common,browser,node,electron-browser}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/workbench/services/**/test/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/**", - "**/vs/platform/**", - "**/vs/editor/**", - "**/vs/workbench/{common,browser,node,electron-browser}/**", - "vs/workbench/contrib/files/common/editors/fileEditorInput", - "**/vs/workbench/services/**", - "**/vs/workbench/test/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/workbench/services/**/common/**", - "restrictions": [ - "vs/nls", - "**/vs/base/**/common/**", - "**/vs/platform/**/common/**", - "**/vs/editor/common/**", - "**/vs/workbench/workbench.web.api", - "**/vs/workbench/common/**", - "**/vs/workbench/services/**/common/**", - "**/vs/workbench/api/**/common/**", - "vscode-textmate" - ] - }, - { - "target": "**/vs/workbench/services/**/worker/**", - "restrictions": [ - "vs/nls", - "**/vs/base/**/common/**", - "**/vs/platform/**/common/**", - "**/vs/editor/common/**", - "**/vs/workbench/**/common/**", - "**/vs/workbench/**/worker/**", - "**/vs/workbench/services/**/common/**", - "vscode" - ] - }, - { - "target": "**/vs/workbench/services/**/browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/**/{common,browser,worker}/**", - "**/vs/platform/**/{common,browser}/**", - "**/vs/editor/{common,browser}/**", - "**/vs/workbench/workbench.web.api", - "**/vs/workbench/{common,browser}/**", - "**/vs/workbench/api/{common,browser}/**", - "**/vs/workbench/services/**/{common,browser}/**", - "vscode-textmate", - "onigasm-umd" - ] - }, - { - "target": "**/vs/workbench/services/**/node/**", - "restrictions": [ - "vs/nls", - "**/vs/base/**/{common,node}/**", - "**/vs/platform/**/{common,node}/**", - "**/vs/editor/{common,node}/**", - "**/vs/workbench/{common,node}/**", - "**/vs/workbench/api/{common,node}/**", - "**/vs/workbench/services/**/{common,node}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/workbench/services/**/electron-browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/**/{common,browser,worker,node,electron-browser}/**", - "**/vs/platform/**/{common,browser,node,electron-browser}/**", - "**/vs/editor/**", - "**/vs/workbench/{common,browser,node,electron-browser,api}/**", - "**/vs/workbench/services/**/{common,browser,node,electron-browser}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/workbench/contrib/terminal/browser/**", - "restrictions": [ - // xterm and its addons are strictly browser-only components - "xterm", - "xterm-addon-*", - "**/vs/**" - ] - }, - { - "target": "**/vs/workbench/contrib/extensions/browser/**", - "restrictions": [ - "semver-umd", - "**/vs/**" - ] - }, - { - "target": "**/vs/workbench/contrib/update/browser/update.ts", - "restrictions": [ - "semver-umd", - "**/vs/**" - ] - }, - { - "target": "**/vs/code/node/**", - "restrictions": [ - "vs/nls", - "**/vs/base/**/{common,node}/**", - "**/vs/base/parts/**/{common,node}/**", - "**/vs/platform/**/{common,node}/**", - "**/vs/code/**/{common,node}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/code/electron-browser/**", - "restrictions": [ - "vs/nls", - "vs/css!./**/*", - "**/vs/base/**/{common,browser,node,electron-browser}/**", - "**/vs/base/parts/**/{common,browser,node,electron-browser}/**", - "**/vs/platform/**/{common,browser,node,electron-browser}/**", - "**/vs/code/**/{common,browser,node,electron-browser}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/code/electron-main/**", - "restrictions": [ - "vs/nls", - "**/vs/base/**/{common,node,electron-main}/**", - "**/vs/base/parts/**/{common,node,electron-main}/**", - "**/vs/platform/**/{common,node,electron-main}/**", - "**/vs/code/**/{common,node,electron-main}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/vs/server/**", - "restrictions": [ - "vs/nls", - "**/vs/base/**/{common,node}/**", - "**/vs/base/parts/**/{common,node}/**", - "**/vs/platform/**/{common,node}/**", - "**/vs/workbench/**/{common,node}/**", - "**/vs/server/**", - "**/vs/code/**/{common,node}/**", - "!path" // node modules (except path where we have our own impl) - ] - }, - { - "target": "**/{node,electron-browser,electron-main}/**", - "restrictions": "**/*" - }, - { - "target": "**/extensions/**", - "restrictions": "**/*" - }, - { - "target": "**/test/smoke/**", - "restrictions": [ - "**/test/smoke/**", - "*" - ] - }, - { - "target": "**/test/automation/**", - "restrictions": [ - "**/test/automation/**", - "*" - ] - }, - { - "target": "{**/**.test.ts,**/test/**}", - "restrictions": "{**/vs/**,assert,sinon,crypto}" - }, - { - "target": "**/{common,browser,workbench}/**", - "restrictions": "**/vs/**" - } - ], - "duplicate-imports": true, - "no-new-buffer": true, - "translation-remind": true, - "no-standalone-editor": true, - "no-nls-in-standalone-editor": true - }, - "defaultSeverity": "warning" -} diff --git a/yarn.lock b/yarn.lock index fec3ecf526b01..464ac72bb3d32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -121,6 +121,11 @@ resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.3.3.tgz#85bc74ba782fb7aa3a514d11767832b0e3bc6803" integrity sha512-LKVP3cgXBT9RYj+t+9FDKwS5tdI+rPBXaNSkma7hvqy35lc7mAokC2zsqWJH0LaqIt3B962nuYI77hsJoT1gow== +"@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/fancy-log@1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@types/fancy-log/-/fancy-log-1.3.0.tgz#a61ab476e5e628cd07a846330df53b85e05c8ce0" @@ -147,6 +152,11 @@ dependencies: "@types/node" "*" +"@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/keytar@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@types/keytar/-/keytar-4.4.0.tgz#ca24e6ee6d0df10c003aafe26e93113b8faf0d8e" @@ -248,6 +258,68 @@ dependencies: "@types/node" "*" +"@typescript-eslint/eslint-plugin@2.3.2": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.3.2.tgz#7e112ca0bb29044d915baf10163a8199a20f7c69" + integrity sha512-tcnpksq1bXzcIRbYLeXkgp6l+ggEMXXUcl1wsSvL807fRtmvVQKygElwEUf4hBA76dNag3VAK1q2m3vd7qJaZA== + dependencies: + "@typescript-eslint/experimental-utils" "2.3.2" + eslint-utils "^1.4.2" + functional-red-black-tree "^1.0.1" + regexpp "^2.0.1" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@2.13.0": + version "2.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.13.0.tgz#958614faa6f77599ee2b241740e0ea402482533d" + integrity sha512-+Hss3clwa6aNiC8ZjA45wEm4FutDV5HsVXPl/rDug1THq6gEtOYRGLqS3JlTk7mSnL5TbJz0LpEbzbPnKvY6sw== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.13.0" + eslint-scope "^5.0.0" + +"@typescript-eslint/experimental-utils@2.3.2": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.3.2.tgz#e50f31264507e6fec7b33840bb6af260c24f4ea8" + integrity sha512-t+JGdTT6dRbmvKDlhlVkEueoZa0fhJNfG6z2cpnRPLwm3VwYr2BjR//acJGC1Yza0I9ZNcDfRY7ubQEvvfG6Jg== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.3.2" + eslint-scope "^5.0.0" + +"@typescript-eslint/parser@^2.12.0": + version "2.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.13.0.tgz#ea1ab394cf9ca17467e3da7f96eca9309f57c326" + integrity sha512-vbDeLr5QRJ1K7x5iRK8J9wuGwR9OVyd1zDAY9XFAQvAosHVjSVbDgkm328ayE6hx2QWVGhwvGaEhedcqAbfQcA== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.13.0" + "@typescript-eslint/typescript-estree" "2.13.0" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/typescript-estree@2.13.0": + version "2.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.13.0.tgz#a2e746867da772c857c13853219fced10d2566bc" + integrity sha512-t21Mg5cc8T3ADEUGwDisHLIubgXKjuNRbkpzDMLb7/JMmgCe/gHM9FaaujokLey+gwTuLF5ndSQ7/EfQqrQx4g== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash.unescape "4.0.1" + semver "^6.3.0" + tsutils "^3.17.1" + +"@typescript-eslint/typescript-estree@2.3.2": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.3.2.tgz#107414aa04e689fe6f7251eb63fb500217f2b7f4" + integrity sha512-eZNEAai16nwyhIVIEaWQlaUgAU3S9CkQ58qvK0+3IuSdLJD3W1PNuehQFMIhW/mTP1oFR9GNoTcLg7gtXz6lzA== + dependencies: + glob "^7.1.4" + is-glob "^4.0.1" + lodash.unescape "4.0.1" + semver "^6.3.0" + "@webassemblyjs/ast@1.5.13": version "1.5.13" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.5.13.tgz#81155a570bd5803a30ec31436bc2c9c0ede38f25" @@ -427,6 +499,11 @@ acorn-jsx@^5.0.0: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== +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@^5.0.0, acorn@^5.6.2: version "5.7.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" @@ -437,6 +514,11 @@ acorn@^6.0.2: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.7.tgz#490180ce18337270232d9488a44be83d9afb7fd3" integrity sha512-HNJNgE60C9eOTgn974Tlp3dpLZdUr+SoxxDwPaY9J/kDNOLQTkaDgwBUXAF4SSsrAwD9RpdxuHK/EbuF+W9Ahw== +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== + agent-base@4: version "4.2.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce" @@ -493,6 +575,16 @@ ajv@^6.1.0: json-schema-traverse "^0.4.1" uri-js "^4.2.1" +ajv@^6.10.0, ajv@^6.10.2: + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + ajv@^6.5.3, ajv@^6.6.1: version "6.8.1" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.8.1.tgz#0890b93742985ebf8973cd365c5b23920ce3cb20" @@ -537,6 +629,13 @@ 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" @@ -571,6 +670,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" @@ -1595,6 +1699,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-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" @@ -1813,6 +1924,11 @@ commandpost@^1.0.0: resolved "https://registry.yarnpkg.com/commandpost/-/commandpost-1.2.1.tgz#2e9c4c7508b9dc704afefaa91cab92ee6054cc68" integrity sha512-V1wzc+DTFsO96te2W/U+fKNRSOWtOwXhkkZH2WRLLbucrY+YrDNsRr4vtfSf83MUZVF3E6B4nwT30fqaTpzipQ== +comment-parser@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-0.7.2.tgz#baf6d99b42038678b81096f15b630d18142f4b8a" + integrity sha512-4Rjb1FnxtOcv9qsfuaNuVsmmVn4ooVoBHzYfyKteiXwIU84PClyGA5jASoFMwPV93+FPh9spwueXauxFJZkGAg== + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -2412,6 +2528,13 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" +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-serializer@0, dom-serializer@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" @@ -2581,6 +2704,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" @@ -2693,6 +2821,20 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +eslint-plugin-jsdoc@^19.1.0: + version "19.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-19.1.0.tgz#fcc17f0378fdd6ee1c847a79b7211745cb05d014" + integrity sha512-rw8ouveUzz41dgSCyjlZgh5cKuQIyBzsrJnKeGYoY74+9AXuOygAQMwvyN4bMRp0hJu0DYQptKyQiSBqOnXmTg== + dependencies: + comment-parser "^0.7.2" + debug "^4.1.1" + jsdoctypeparser "^6.1.0" + lodash "^4.17.15" + object.entries-ponyfill "^1.0.1" + regextras "^0.7.0" + semver "^6.3.0" + spdx-expression-parse "^3.0.0" + eslint-scope@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" @@ -2701,16 +2843,79 @@ eslint-scope@^4.0.0: 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.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== +eslint-utils@^1.4.2, 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.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== +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" + eslint@^5.0.1: version "5.13.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.13.0.tgz#ce71cc529c450eed9504530939aa97527861ede9" @@ -2762,6 +2967,15 @@ espree@^5.0.0: acorn-jsx "^5.0.0" eslint-visitor-keys "^1.0.0" +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.6.0: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -3040,7 +3254,7 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= -fast-levenshtein@~2.0.4: +fast-levenshtein@~2.0.4, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= @@ -3071,6 +3285,13 @@ 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@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" @@ -3079,6 +3300,13 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" +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-uri-to-path@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" @@ -3217,6 +3445,20 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" +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.2" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" @@ -3526,7 +3768,7 @@ glob-parent@^3.0.0, glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@~5.1.0: +glob-parent@^5.0.0, glob-parent@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== @@ -3629,6 +3871,18 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.4, glob@^7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + global-modules@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" @@ -3675,6 +3929,13 @@ globals@^11.7.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.10.0.tgz#1e09776dffda5e01816b3bb4077c8b59c24eaa50" integrity sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ== +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" + globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" @@ -4388,6 +4649,25 @@ inquirer@^6.1.0: strip-ansi "^5.0.0" through "^2.3.6" +inquirer@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.1.tgz#13f7980eedc73c689feff3994b109c4e799c6ebb" + integrity sha512-V1FFQ3TIO15det8PijPLFR9M9baSlnRs9nL7zWu1MNVA2T9YVl9ZbrHJhYs7e9X8jeMZ3lr2JH/rdHFgNCBdYw== + 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.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" @@ -4581,6 +4861,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" @@ -4909,7 +5194,7 @@ js-yaml@^3.12.0: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.13.0: +js-yaml@^3.13.0, js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -4935,6 +5220,11 @@ jschardet@2.1.1: resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-2.1.1.tgz#af6f8fd0b3b0f5d46a8fd9614a4fce490575c184" integrity sha512-pA5qG9Zwm8CBpGlK/lo2GE9jPxwqRgMV7Lzc/1iaPccw6v4Rhj8Zg2BTyrdmHmxlJojnbLupLeRnaPLsq03x6Q== +jsdoctypeparser@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsdoctypeparser/-/jsdoctypeparser-6.1.0.tgz#acfb936c26300d98f1405cb03e20b06748e512a8" + integrity sha512-UCQBZ3xCUBv/PLfwKAJhp6jmGOSLFNKzrotXGNgbKhWvz27wPsCsVeP7gIcHPElQw2agBmynAitXqhxR58XAmA== + jsdom-no-contextify@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/jsdom-no-contextify/-/jsdom-no-contextify-3.1.0.tgz#0d8beaf610c2ff23894f54dfa7f89dd22fd0f7ab" @@ -5286,6 +5576,11 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -5306,6 +5601,11 @@ lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== +lodash@^4.17.14, lodash@^4.17.15: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + log-driver@1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056" @@ -5616,7 +5916,7 @@ mimic-fn@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" integrity sha1-5md4PZLonb00KBi1IwudYqZyrRg= -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== @@ -5805,6 +6105,11 @@ mute-stream@0.0.7, mute-stream@~0.0.4: 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== + nan@2.14.0, nan@^2.10.0, nan@^2.13.2, nan@^2.14.0: version "2.14.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" @@ -6175,6 +6480,11 @@ object.defaults@^1.0.0, object.defaults@^1.1.0: for-own "^1.0.0" isobject "^3.0.0" +object.entries-ponyfill@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.entries-ponyfill/-/object.entries-ponyfill-1.0.1.tgz#29abdf77cbfbd26566dd1aa24e9d88f65433d256" + integrity sha1-Kavfd8v70mVm3RqiTp2I9lQz0lY= + object.map@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" @@ -6227,6 +6537,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-umd@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/onigasm-umd/-/onigasm-umd-2.2.5.tgz#f104247334a543accd3f8d641a4d99b3d908d6a1" @@ -6273,6 +6590,18 @@ optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" +optionator@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + ordered-read-streams@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b" @@ -7410,6 +7739,11 @@ regexpp@^2.0.1: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== +regextras@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/regextras/-/regextras-0.7.0.tgz#2298bef8cfb92b1b7e3b9b12aa8f69547b7d71e4" + integrity sha512-ds+fL+Vhl918gbAUb0k2gVKbTZLsg84Re3DI6p85Et0U0tYME3hyW4nMK8Px4dtDaBA2qNjvG5uWyW7eK5gfmw== + remove-bom-buffer@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" @@ -7652,12 +7986,20 @@ 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" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -rimraf@2, rimraf@^2.6.3: +rimraf@2, rimraf@2.6.3, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -7712,6 +8054,13 @@ rxjs@^6.4.0: dependencies: tslib "^1.9.0" +rxjs@^6.5.3: + version "6.5.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" + integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -7799,6 +8148,11 @@ semver@^6.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== +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== + send@0.16.1: version "0.16.1" resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3" @@ -7949,7 +8303,7 @@ slash@^1.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= -slice-ansi@^2.0.0: +slice-ansi@^2.0.0, 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== @@ -8089,6 +8443,19 @@ spdx-correct@~1.0.0: dependencies: spdx-license-ids "^1.0.2" +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + spdx-expression-parse@~1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" @@ -8099,6 +8466,11 @@ spdx-license-ids@^1.0.2: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" integrity sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc= +spdx-license-ids@^3.0.0: + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== + speedometer@~0.1.2: version "0.1.4" resolved "https://registry.yarnpkg.com/speedometer/-/speedometer-0.1.4.tgz#9876dbd2a169d3115402d48e6ea6329c8816a50d" @@ -8275,6 +8647,15 @@ 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_decoder@^1.0.0, string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -8334,6 +8715,13 @@ 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-bom-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz#e7144398577d51a6bed0fa1994fa05f43fd988ee" @@ -8366,6 +8754,11 @@ strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +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== + sudo-prompt@9.1.1: version "9.1.1" resolved "https://registry.yarnpkg.com/sudo-prompt/-/sudo-prompt-9.1.1.tgz#73853d729770392caec029e2470db9c221754db0" @@ -8454,6 +8847,16 @@ table@^5.0.2: slice-ansi "^2.0.0" string-width "^2.1.1" +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: version "1.0.0" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2" @@ -8771,6 +9174,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" @@ -8805,6 +9215,11 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +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.15: version "1.6.15" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410" @@ -9055,6 +9470,11 @@ v8-compile-cache@2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe" integrity sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w== +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== + v8-inspect-profiler@^0.0.20: version "0.0.20" resolved "https://registry.yarnpkg.com/v8-inspect-profiler/-/v8-inspect-profiler-0.0.20.tgz#f7ad0f8178dcea2f1504334e8844ef38181792ab" @@ -9488,6 +9908,11 @@ windows-process-tree@0.2.4: dependencies: nan "^2.13.2" +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" @@ -9527,6 +9952,13 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +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" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"