diff --git a/extensions/emmet/src/abbreviationActions.ts b/extensions/emmet/src/abbreviationActions.ts index f1128e200b6..dbde660d9e5 100644 --- a/extensions/emmet/src/abbreviationActions.ts +++ b/extensions/emmet/src/abbreviationActions.ts @@ -535,9 +535,7 @@ export function isValidLocationForEmmetAbbreviation(document: vscode.TextDocumen /** * Expands abbreviations as detailed in expandAbbrList in the editor - * @param editor - * @param expandAbbrList - * @param insertSameSnippet + * * @returns false if no snippet can be inserted. */ function expandAbbreviationInRange(editor: vscode.TextEditor, expandAbbrList: ExpandAbbreviationInput[], insertSameSnippet: boolean): Thenable { diff --git a/extensions/emmet/src/util.ts b/extensions/emmet/src/util.ts index 6e2531c001a..2b6ab87c98b 100644 --- a/extensions/emmet/src/util.ts +++ b/extensions/emmet/src/util.ts @@ -99,7 +99,6 @@ export function getMappingForIncludedLanguages(): any { * If the language is not supported by emmet or has been exlcuded via `exlcudeLanguages` setting, * then nothing is returned * -* @param language * @param exlcudedLanguages Array of language ids that user has chosen to exlcude for emmet */ export function getEmmetMode(language: string, excludedLanguages: string[]): string | undefined { @@ -353,7 +352,6 @@ export function getHtmlNode(document: vscode.TextDocument, root: Node | undefine /** * Returns inner range of an html node. - * @param currentNode */ export function getInnerRange(currentNode: HtmlNode): vscode.Range | undefined { if (!currentNode.close) { @@ -364,7 +362,6 @@ export function getInnerRange(currentNode: HtmlNode): vscode.Range | undefined { /** * Returns the deepest non comment node under given node - * @param node */ export function getDeepestNode(node: Node | undefined): Node | undefined { if (!node || !node.children || node.children.length === 0 || !node.children.find(x => x.type !== 'comment')) { diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts index d3c5c788d08..31d6d4ce312 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts @@ -17,11 +17,11 @@ suite('env-namespace', () => { }); test('env is readonly', function () { - assert.throws(() => env.language = '234'); - assert.throws(() => env.appRoot = '234'); - assert.throws(() => env.appName = '234'); - assert.throws(() => env.machineId = '234'); - assert.throws(() => env.sessionId = '234'); + assert.throws(() => (env as any).language = '234'); + assert.throws(() => (env as any).appRoot = '234'); + assert.throws(() => (env as any).appName = '234'); + assert.throws(() => (env as any).machineId = '234'); + assert.throws(() => (env as any).sessionId = '234'); }); }); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts index 8921b4aee46..e5cf2bd12a4 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts @@ -39,7 +39,7 @@ suite('workspace-namespace', () => { if (vscode.workspace.rootPath) { assert.ok(pathEquals(vscode.workspace.rootPath, join(__dirname, '../../testWorkspace'))); } - assert.throws(() => vscode.workspace.rootPath = 'farboo'); + assert.throws(() => (vscode.workspace as any).rootPath = 'farboo'); }); test('workspaceFolders', () => { diff --git a/src/vs/base/common/arrays.ts b/src/vs/base/common/arrays.ts index aac4ac597b4..07c888aa56d 100644 --- a/src/vs/base/common/arrays.ts +++ b/src/vs/base/common/arrays.ts @@ -211,9 +211,6 @@ export function sortedDiff(before: ReadonlyArray, after: ReadonlyArray, /** * Takes two *sorted* arrays and computes their delta (removed, added elements). * Finishes in `Math.min(before.length, after.length)` steps. - * @param before - * @param after - * @param compare */ export function delta(before: ReadonlyArray, after: ReadonlyArray, compare: (a: T, b: T) => number): { removed: T[], added: T[] } { const splices = sortedDiff(before, after, compare); @@ -330,15 +327,14 @@ export function move(array: any[], from: number, to: number): void { } /** - * @returns {{false}} if the provided object is an array - * and not empty. + * @returns false if the provided object is an array and not empty. */ export function isFalsyOrEmpty(obj: any): boolean { return !Array.isArray(obj) || obj.length === 0; } /** - * @returns {{true}} if the provided object is an array and has at least one element. + * @returns True if the provided object is an array and has at least one element. */ export function isNonEmptyArray(obj: ReadonlyArray | undefined | null): obj is Array { return Array.isArray(obj) && obj.length > 0; @@ -488,7 +484,6 @@ export function arrayInsert(target: T[], insertIndex: number, insertArr: T[]) /** * Uses Fisher-Yates shuffle to shuffle the given array - * @param array */ export function shuffle(array: T[], _seed?: number): void { let rand: () => number; diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 6cca3b8acb7..bd39facb709 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -546,7 +546,6 @@ function encodeURIComponentMinimal(path: string): string { /** * Compute `fsPath` for the given uri - * @param uri */ function _makeFsPath(uri: URI): string { diff --git a/src/vs/editor/contrib/folding/foldingModel.ts b/src/vs/editor/contrib/folding/foldingModel.ts index 56bc6c8c914..da25d5193dd 100644 --- a/src/vs/editor/contrib/folding/foldingModel.ts +++ b/src/vs/editor/contrib/folding/foldingModel.ts @@ -291,7 +291,6 @@ export function setCollapseStateLevelsUp(foldingModel: FoldingModel, doCollapse: * Folds or unfolds all regions that have a given level, except if they contain one of the blocked lines. * @param foldLevel level. Level == 1 is the top level * @param doCollapse Wheter to collase or expand -* @param blockedLineNumbers */ export function setCollapseStateAtLevel(foldingModel: FoldingModel, foldLevel: number, doCollapse: boolean, blockedLineNumbers: number[]): void { let filter = (region: FoldingRegion, level: number) => level === foldLevel && region.isCollapsed !== doCollapse && !blockedLineNumbers.some(line => region.containsLine(line)); diff --git a/src/vs/editor/standalone/browser/standaloneEditor.ts b/src/vs/editor/standalone/browser/standaloneEditor.ts index b84c6579e9d..638277b52d2 100644 --- a/src/vs/editor/standalone/browser/standaloneEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneEditor.ts @@ -178,8 +178,8 @@ export function setModelMarkers(model: ITextModel, owner: string, markers: IMark /** * Get markers for owner and/or resource - * @returns {IMarker[]} list of markers - * @param filter + * + * @returns list of markers */ export function getModelMarkers(filter: { owner?: string, resource?: URI, take?: number }): IMarker[] { return StaticServices.markerService.get().read(filter); diff --git a/src/vs/editor/standalone/browser/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts index 1fecf4a297c..e5ffa21d894 100644 --- a/src/vs/editor/standalone/browser/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -477,8 +477,6 @@ export interface CodeActionContext { /** * An array of diagnostics. - * - * @readonly */ readonly markers: IMarkerData[]; diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index c8d38d4bbd2..b3f84808cdd 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -846,8 +846,8 @@ declare namespace monaco.editor { /** * Get markers for owner and/or resource - * @returns {IMarker[]} list of markers - * @param filter + * + * @returns list of markers */ export function getModelMarkers(filter: { owner?: string; @@ -4374,8 +4374,6 @@ declare namespace monaco.languages { export interface CodeActionContext { /** * An array of diagnostics. - * - * @readonly */ readonly markers: editor.IMarkerData[]; /** diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index a36e27aa168..367335194a6 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2689,8 +2689,8 @@ declare module 'vscode' { * * @param document The document in which the command was invoked. * @param position The position at which the command was invoked. - * @param context * @param token A cancellation token. + * * @return An array of locations or a thenable that resolves to such. The lack of a result can be * signaled by returning `undefined`, `null`, or an empty array. */ @@ -5330,10 +5330,8 @@ declare module 'vscode' { /** * The currently active task executions or an empty array. - * - * @readonly */ - export let taskExecutions: ReadonlyArray; + export const taskExecutions: ReadonlyArray; /** * Fires when a task starts. @@ -5875,24 +5873,18 @@ declare module 'vscode' { /** * The application name of the editor, like 'VS Code'. - * - * @readonly */ - export let appName: string; + export const appName: string; /** * The application root folder from which the editor is running. - * - * @readonly */ - export let appRoot: string; + export const appRoot: string; /** * Represents the preferred user-language, like `de-CH`, `fr`, or `en-US`. - * - * @readonly */ - export let language: string; + export const language: string; /** * The system clipboard. @@ -5901,18 +5893,14 @@ declare module 'vscode' { /** * A unique identifier for the computer. - * - * @readonly */ - export let machineId: string; + export const machineId: string; /** * A unique identifier for the current session. * Changes each time the editor is started. - * - * @readonly */ - export let sessionId: string; + export const sessionId: string; } /** @@ -6118,10 +6106,8 @@ declare module 'vscode' { /** * Represents the current window's state. - * - * @readonly */ - export let state: WindowState; + export const state: WindowState; /** * An [event](#Event) which fires when the focus state of the current window @@ -7329,26 +7315,20 @@ declare module 'vscode' { * has been opened.~~ * * @deprecated Use [`workspaceFolders`](#workspace.workspaceFolders) instead. - * - * @readonly */ - export let rootPath: string | undefined; + export const rootPath: string | undefined; /** * List of workspace folders or `undefined` when no folder is open. * *Note* that the first entry corresponds to the value of `rootPath`. - * - * @readonly */ - export let workspaceFolders: WorkspaceFolder[] | undefined; + export const workspaceFolders: WorkspaceFolder[] | undefined; /** * The name of the workspace. `undefined` when no folder * has been opened. - * - * @readonly */ - export let name: string | undefined; + export const name: string | undefined; /** * An event that is emitted when a workspace folder is added or removed. @@ -7484,10 +7464,8 @@ declare module 'vscode' { /** * All text documents currently known to the system. - * - * @readonly */ - export let textDocuments: TextDocument[]; + export const textDocuments: TextDocument[]; /** * Opens a document. Will return early if this document is already open. Otherwise diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 647ca26252a..0968440c376 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -54,9 +54,6 @@ declare module 'vscode' { /** * Provide selection ranges starting at a given position. The first range must [contain](#Range.contains) * position and subsequent ranges must contain the previous range. - * @param document - * @param position - * @param token */ provideSelectionRanges(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; } diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 379098ff9f0..2e2ae5277fb 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -50,7 +50,6 @@ export interface IViewContainersRegistry { /** * Returns the view container with given id. * - * @param id * @returns the view container with given id. */ get(id: string): ViewContainer; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts index 12ad98c5f78..25a0dda9e30 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts @@ -318,7 +318,6 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe /** * Parse the extensions.json file for given workspace and return the recommendations - * @param workspace */ private resolveWorkspaceExtensionConfig(workspace: IWorkspace): Promise { if (!workspace.configuration) { @@ -331,7 +330,6 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe /** * Parse the extensions.json files for given workspace folder and return the recommendations - * @param workspaceFolder */ private resolveWorkspaceFolderExtensionConfig(workspaceFolder: IWorkspaceFolder): Promise { const extensionsJsonUri = workspaceFolder.toResource(paths.join('.vscode', 'extensions.json')); @@ -343,7 +341,6 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe /** * Validate the extensions.json file contents using regex and querying the gallery - * @param contents */ private async validateExtensions(contents: IExtensionsConfigContent[]): Promise<{ invalidExtensions: string[], message: string }> { const extensionsContent: IExtensionsConfigContent = { @@ -579,7 +576,6 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe /** * Prompt the user to either install the recommended extension for the file type in the current editor model * or prompt to search the marketplace if it has extensions that can support the file type - * @param model */ private promptFiletypeBasedRecommendations(model: ITextModel): void { let hasSuggestion = false; diff --git a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts index 0267c9b2035..c9372a0affd 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts @@ -518,7 +518,7 @@ class OpenEditorsDelegate implements IListVirtualDelegate command ids) is given, command variables are first mapped through it before being resolved. - * @param folder - * @param config + * * @param section For example, 'tasks' or 'debug'. Used for resolving inputs. * @param variables Aliases for commands. */ diff --git a/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts index 97655c13a1f..cdc76396f9d 100644 --- a/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts @@ -132,7 +132,7 @@ export class ConfigurationResolverService extends AbstractVariableResolverServic * Please note: this method does not substitute the input or command variables (so the configuration is not modified). * The returned dictionary can be passed to "resolvePlatform" for the actual substitution. * See #6569. - * @param configuration + * * @param variableToCommandMap Aliases for commands */ private async resolveWithInputAndCommands(folder: IWorkspaceFolder, configuration: any, variableToCommandMap: IStringDictionary, section: string): Promise> { diff --git a/tslint.json b/tslint.json index 0a86a3fea45..9191c9fc208 100644 --- a/tslint.json +++ b/tslint.json @@ -3,16 +3,19 @@ "build/lib/tslint" ], "rules": { + "no-arg": true, "no-construct": true, "no-duplicate-super": true, "no-duplicate-switch-case": true, "no-duplicate-variable": true, "no-eval": true, + "no-redundant-jsdoc": true, "no-sparse-arrays": true, "no-string-throw": true, "no-unsafe-finally": true, "no-unused-expression": true, "no-var-keyword": true, + "typeof-compare": true, "curly": true, "class-name": true, "label-position": true,