Skip to content

Commit

Permalink
Reenable yarn eslint (#220037)
Browse files Browse the repository at this point in the history
* Reenable yarn eslint

* Fix eslint errors

* Fix compile error

* Fix another compile error

* Disable eslint errors
  • Loading branch information
dbaeumer authored Jul 5, 2024
1 parent f9af31c commit 20775fd
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ module.exports.eslintFilter = [
.toString().split(/\r\n|\n/)
.filter(line => !line.startsWith('#'))
.filter(line => !!line)
.map(line => `!${line}`)
.map(line => line.startsWith('!') ? line.slice(1) : `!${line}`)
];

module.exports.stylelintFilter = [
Expand Down
3 changes: 1 addition & 2 deletions src/vs/editor/common/languages/supports/richEditBrackets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as strings from 'vs/base/common/strings';
import * as stringBuilder from 'vs/editor/common/core/stringBuilder';
import { Range } from 'vs/editor/common/core/range';
import { CharacterPair } from 'vs/editor/common/languages/languageConfiguration';
import { RegExpOptions } from 'vs/base/common/strings';

interface InternalBracket {
open: string[];
Expand Down Expand Up @@ -409,7 +408,7 @@ function prepareBracketForRegExp(str: string): string {
return (insertWordBoundaries ? `\\b${str}\\b` : str);
}

export function createBracketOrRegExp(pieces: string[], options?: RegExpOptions): RegExp {
export function createBracketOrRegExp(pieces: string[], options?: strings.RegExpOptions): RegExp {
const regexStr = `(${pieces.map(prepareBracketForRegExp).join(')|(')})`;
return strings.createRegExp(regexStr, true, options);
}
Expand Down
11 changes: 5 additions & 6 deletions src/vs/editor/contrib/rename/browser/renameWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { IRange, Range } from 'vs/editor/common/core/range';
import { ScrollType } from 'vs/editor/common/editorCommon';
import { NewSymbolName, NewSymbolNameTag, NewSymbolNameTriggerKind, ProviderResult } from 'vs/editor/common/languages';
import * as nls from 'vs/nls';
import { localize } from 'vs/nls';
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { ILogService } from 'vs/platform/log/common/log';
Expand All @@ -55,8 +54,8 @@ const _sticky = false
;


export const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey<boolean>('renameInputVisible', false, localize('renameInputVisible', "Whether the rename input widget is visible"));
export const CONTEXT_RENAME_INPUT_FOCUSED = new RawContextKey<boolean>('renameInputFocused', false, localize('renameInputFocused', "Whether the rename input widget is focused"));
export const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey<boolean>('renameInputVisible', false, nls.localize('renameInputVisible', "Whether the rename input widget is visible"));
export const CONTEXT_RENAME_INPUT_FOCUSED = new RawContextKey<boolean>('renameInputFocused', false, nls.localize('renameInputFocused', "Whether the rename input widget is focused"));

/**
* "Source" of the new name:
Expand Down Expand Up @@ -311,7 +310,7 @@ export class RenameWidget implements IRenameWidget, IContentWidget, IDisposable

beforeRender(): IDimension | null {
const [accept, preview] = this._acceptKeybindings;
this._label!.innerText = localize({ key: 'label', comment: ['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"'] }, "{0} to Rename, {1} to Preview", this._keybindingService.lookupKeybinding(accept)?.getLabel(), this._keybindingService.lookupKeybinding(preview)?.getLabel());
this._label!.innerText = nls.localize({ key: 'label', comment: ['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"'] }, "{0} to Rename, {1} to Preview", this._keybindingService.lookupKeybinding(accept)?.getLabel(), this._keybindingService.lookupKeybinding(preview)?.getLabel());

this._domNode!.style.minWidth = `200px`; // to prevent from widening when candidates come in

Expand Down Expand Up @@ -750,7 +749,7 @@ class RenameCandidateListView {
this._listContainer.style.height = `${height}px`;
this._listContainer.style.width = `${width}px`;

aria.status(localize('renameSuggestionsReceivedAria', "Received {0} rename suggestions", candidates.length));
aria.status(nls.localize('renameSuggestionsReceivedAria', "Received {0} rename suggestions", candidates.length));
}

public clearCandidates(): void {
Expand Down Expand Up @@ -924,7 +923,7 @@ class InputWithButton implements IDisposable {
this._inputNode.className = 'rename-input';
this._inputNode.type = 'text';
this._inputNode.style.border = 'none';
this._inputNode.setAttribute('aria-label', localize('renameAriaLabel', "Rename input. Type new name and press Enter to commit."));
this._inputNode.setAttribute('aria-label', nls.localize('renameAriaLabel', "Rename input. Type new name and press Enter to commit."));

this._domNode.appendChild(this._inputNode);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/* eslint-disable local/code-import-patterns */

import type { Terminal } from '@xterm/xterm';
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';
Expand Down
3 changes: 1 addition & 2 deletions src/vs/workbench/api/browser/mainThreadComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { MarshalledCommentThread } from 'vs/workbench/common/comments';
import { revealCommentThread } from 'vs/workbench/contrib/comments/browser/commentsController';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
import { CommentThreadRevealOptions } from 'vs/editor/common/languages';

export class MainThreadCommentThread<T> implements languages.CommentThread<T> {
private _input?: languages.CommentInput;
Expand Down Expand Up @@ -643,7 +642,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
provider.updateCommentingRanges(resourceHints);
}

async $revealCommentThread(handle: number, commentThreadHandle: number, options: CommentThreadRevealOptions): Promise<void> {
async $revealCommentThread(handle: number, commentThreadHandle: number, options: languages.CommentThreadRevealOptions): Promise<void> {
const provider = this._commentControllers.get(handle);

if (!provider) {
Expand Down
23 changes: 11 additions & 12 deletions src/vs/workbench/contrib/chat/browser/chatAgentHover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/

import * as dom from 'vs/base/browser/dom';
import { h } from 'vs/base/browser/dom';
import { IManagedHoverOptions } from 'vs/base/browser/ui/hover/hover';
import { renderIcon } from 'vs/base/browser/ui/iconLabel/iconLabels';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
Expand Down Expand Up @@ -40,22 +39,22 @@ export class ChatAgentHover extends Disposable {
) {
super();

const hoverElement = h(
const hoverElement = dom.h(
'.chat-agent-hover@root',
[
h('.chat-agent-hover-header', [
h('.chat-agent-hover-icon@icon'),
h('.chat-agent-hover-details', [
h('.chat-agent-hover-name@name'),
h('.chat-agent-hover-extension', [
h('.chat-agent-hover-extension-name@extensionName'),
h('.chat-agent-hover-separator@separator'),
h('.chat-agent-hover-publisher@publisher'),
dom.h('.chat-agent-hover-header', [
dom.h('.chat-agent-hover-icon@icon'),
dom.h('.chat-agent-hover-details', [
dom.h('.chat-agent-hover-name@name'),
dom.h('.chat-agent-hover-extension', [
dom.h('.chat-agent-hover-extension-name@extensionName'),
dom.h('.chat-agent-hover-separator@separator'),
dom.h('.chat-agent-hover-publisher@publisher'),
]),
]),
]),
h('.chat-agent-hover-warning@warning'),
h('span.chat-agent-hover-description@description'),
dom.h('.chat-agent-hover-warning@warning'),
dom.h('span.chat-agent-hover-description@description'),
]);
this.domNode = hoverElement.root;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

// eslint-disable-next-line local/code-import-patterns
import assert from 'assert';
// eslint-disable-next-line local/code-import-patterns
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';
import { IssueReporterModel } from 'vs/workbench/contrib/issue/browser/issueReporterModel';
import { IssueType } from 'vs/platform/issue/common/issue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { IWorkingCopyIdentifier } from 'vs/workbench/services/workingCopy/common
import { IWorkingCopyEditorHandler, IWorkingCopyEditorService } from 'vs/workbench/services/workingCopy/common/workingCopyEditorService';
import { extname, isEqual } from 'vs/base/common/resources';
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
// eslint-disable-next-line local/code-translation-remind
import { localize2 } from 'vs/nls';
import { Action2, registerAction2 } from 'vs/platform/actions/common/actions';
import { IEditorResolverService, RegisteredEditorPriority } from 'vs/workbench/services/editor/common/editorResolverService';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import 'vs/css!./media/interactive';
// eslint-disable-next-line local/code-translation-remind
import * as nls from 'vs/nls';
import * as DOM from 'vs/base/browser/dom';
import { CancellationToken } from 'vs/base/common/cancellation';
Expand Down
3 changes: 1 addition & 2 deletions src/vs/workbench/contrib/testing/browser/testCoverageBars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { IHoverService } from 'vs/platform/hover/browser/hover';
import { Registry } from 'vs/platform/registry/common/platform';
import { ExplorerExtensions, IExplorerFileContribution, IExplorerFileContributionRegistry } from 'vs/workbench/contrib/files/browser/explorerFileContrib';
import * as coverUtils from 'vs/workbench/contrib/testing/browser/codeCoverageDisplayUtils';
import { calculateDisplayedStat } from 'vs/workbench/contrib/testing/browser/codeCoverageDisplayUtils';
import { ITestingCoverageBarThresholds, TestingConfigKeys, getTestingConfiguration, observeTestingConfiguration } from 'vs/workbench/contrib/testing/common/configuration';
import { AbstractFileCoverage } from 'vs/workbench/contrib/testing/common/testCoverage';
import { ITestCoverageService } from 'vs/workbench/contrib/testing/common/testCoverageService';
Expand Down Expand Up @@ -121,7 +120,7 @@ export class ManagedTestCoverageBars extends Disposable {

const precision = this.options.compact ? 0 : 2;
const thresholds = getTestingConfiguration(this.configurationService, TestingConfigKeys.CoverageBarThresholds);
const overallStat = calculateDisplayedStat(coverage, getTestingConfiguration(this.configurationService, TestingConfigKeys.CoveragePercent));
const overallStat = coverUtils.calculateDisplayedStat(coverage, getTestingConfiguration(this.configurationService, TestingConfigKeys.CoveragePercent));
if (this.options.overall !== false) {
el.overall.textContent = coverUtils.displayPercent(overallStat, precision);
} else {
Expand Down

0 comments on commit 20775fd

Please sign in to comment.