Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumping eslint versions #141121

Merged
merged 3 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build/lib/eslint/code-no-unused-expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ module.exports = {
if (allowTaggedTemplates && node.type === 'TaggedTemplateExpression') {
return true;
}
return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await)Expression$/u.test(node.type) ||
if (node.type === 'ExpressionStatement') {
return isValidExpression(node.expression);
}
return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await|Chain)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: node, message: 'Expected an assignment or function call and instead saw an expression.' });
context.report({ node: node, message: `Expected an assignment or function call and instead saw an expression. ${node.expression}` });
}
}
};
Expand Down
8 changes: 6 additions & 2 deletions build/lib/eslint/code-no-unused-expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,18 @@ module.exports = {
return true;
}

return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await)Expression$/u.test(node.type) ||
if (node.type === 'ExpressionStatement') {
return isValidExpression(node.expression);
}

return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await|Chain)Expression$/u.test(node.type) ||
(node.type === 'UnaryExpression' && ['delete', 'void'].indexOf(node.operator) >= 0);
}

return {
ExpressionStatement(node: TSESTree.ExpressionStatement) {
if (!isValidExpression(node.expression) && !isDirective(node, <TSESTree.Node[]>context.getAncestors())) {
context.report({ node: <ESTree.Node>node, message: 'Expected an assignment or function call and instead saw an expression.' });
context.report({ node: <ESTree.Node>node, message: `Expected an assignment or function call and instead saw an expression. ${node.expression}` });
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@types/webpack": "^4.41.25",
"@types/xml2js": "0.0.33",
"@typescript-eslint/experimental-utils": "~2.13.0",
"@typescript-eslint/parser": "^3.3.0",
"@typescript-eslint/parser": "^5.10.0",
"@vscode/iconv-lite-umd": "0.7.0",
"applicationinsights": "1.4.2",
"byline": "^5.0.0",
Expand Down
262 changes: 209 additions & 53 deletions build/yarn.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
"@types/winreg": "^1.2.30",
"@types/yauzl": "^2.9.1",
"@types/yazl": "^2.4.2",
"@typescript-eslint/eslint-plugin": "3.2.0",
"@typescript-eslint/parser": "^3.3.0",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"@vscode/telemetry-extractor": "^1.9.5",
"@vscode/test-web": "^0.0.19",
"ansi-colors": "^3.2.3",
Expand All @@ -134,7 +134,7 @@
"debounce": "^1.0.0",
"deemon": "^1.4.0",
"electron": "13.5.1",
"eslint": "6.8.0",
"eslint": "8.7.0",
"eslint-plugin-header": "3.1.1",
"eslint-plugin-jsdoc": "^19.1.0",
"event-stream": "3.3.4",
Expand Down
4 changes: 2 additions & 2 deletions src/vs/base/browser/indexedDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export class IndexedDB {
this.database = null;
}

runInTransaction<T>(store: string, transactionMode: IDBTransactionMode, dbRequestFn: (store: IDBObjectStore) => IDBRequest<T>[]): Promise<T[]>
runInTransaction<T>(store: string, transactionMode: IDBTransactionMode, dbRequestFn: (store: IDBObjectStore) => IDBRequest<T>): Promise<T>
runInTransaction<T>(store: string, transactionMode: IDBTransactionMode, dbRequestFn: (store: IDBObjectStore) => IDBRequest<T>[]): Promise<T[]>;
runInTransaction<T>(store: string, transactionMode: IDBTransactionMode, dbRequestFn: (store: IDBObjectStore) => IDBRequest<T>): Promise<T>;
async runInTransaction<T>(store: string, transactionMode: IDBTransactionMode, dbRequestFn: (store: IDBObjectStore) => IDBRequest<T> | IDBRequest<T>[]): Promise<T | T[]> {
if (!this.database) {
throw new Error(`IndexedDB database '${this.name}' is not opened.`);
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/services/search/common/replace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class ReplacePattern {
private _regExp: RegExp;
private _caseOpsRegExp: RegExp;

constructor(replaceString: string, searchPatternInfo: IPatternInfo)
constructor(replaceString: string, parseParameters: boolean, regEx: RegExp)
constructor(replaceString: string, searchPatternInfo: IPatternInfo);
constructor(replaceString: string, parseParameters: boolean, regEx: RegExp);
constructor(replaceString: string, arg2: any, arg3?: any) {
this._replacePattern = replaceString;
let searchPatternInfo: IPatternInfo;
Expand Down
5 changes: 3 additions & 2 deletions src/vscode-dts/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,7 @@ declare module 'vscode' {
/**
* The event listeners can subscribe to.
*/
// eslint-disable-next-line vscode-dts-event-naming
event: Event<T>;

/**
Expand Down Expand Up @@ -1989,7 +1990,7 @@ declare module 'vscode' {
* Otherwise, a uri or string should only be used if the pattern is for a file path outside the workspace.
* @param pattern A file glob pattern like `*.{ts,js}` that will be matched on paths relative to the base.
*/
constructor(base: WorkspaceFolder | Uri | string, pattern: string)
constructor(base: WorkspaceFolder | Uri | string, pattern: string);
}

/**
Expand Down Expand Up @@ -10991,7 +10992,7 @@ declare module 'vscode' {
* excluded via `files.watcherExclude` setting
* * if the path is equal to any of the workspace folders, deletions are not tracked
* * if the path is outside of any of the workspace folders, deletions are not tracked
*
*
* If you are interested in being notified when the watched path itself is being deleted, you have
* to watch it's parent folder. Make sure to use a simple `pattern` (such as putting the name of the
* folder) to not accidentally watch all sibling folders recursively.
Expand Down
Loading