Skip to content

Commit 6ef0867

Browse files
committed
Update eslint to the latest version
Need to rename no-shadow to @typescript-eslint/no-shadow as specified there: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md Change-Id: Ib864501e48772b224b4999718f4f8dfbeb8964d6 Signed-off-by: Florent Benoit <[email protected]>
1 parent e209832 commit 6ef0867

File tree

12 files changed

+299
-116
lines changed

12 files changed

+299
-116
lines changed

configs/errors.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
],
5151
"no-new-wrappers": "error",
5252
"no-null/no-null": "error",
53-
"no-shadow": [
53+
"no-shadow": "off",
54+
"@typescript-eslint/no-shadow": [
5455
"error",
5556
{
5657
"hoist": "all"

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
"@types/sinon": "^2.3.5",
1818
"@types/temp": "^0.8.29",
1919
"@types/uuid": "^7.0.3",
20-
"@typescript-eslint/eslint-plugin": "^3.1.0",
21-
"@typescript-eslint/eslint-plugin-tslint": "^3.1.0",
22-
"@typescript-eslint/parser": "^3.1.0",
20+
"@typescript-eslint/eslint-plugin": "^4.8.1",
21+
"@typescript-eslint/eslint-plugin-tslint": "^4.8.1",
22+
"@typescript-eslint/parser": "^4.8.1",
2323
"chai-string": "^1.4.0",
2424
"colors": "^1.4.0",
2525
"concurrently": "^3.5.0",
2626
"electron-mocha": "^8.2.0",
27-
"eslint": "^6.8.0",
27+
"eslint": "^7.14.0",
2828
"eslint-plugin-deprecation": "^1.1.0",
29-
"eslint-plugin-import": "^2.20.0",
29+
"eslint-plugin-import": "^2.22.1",
3030
"eslint-plugin-no-null": "^1.0.2",
31-
"eslint-plugin-no-unsanitized": "^3.1.2",
32-
"eslint-plugin-react": "^7.20.6",
31+
"eslint-plugin-no-unsanitized": "^3.1.4",
32+
"eslint-plugin-react": "^7.21.5",
3333
"ignore-styles": "^5.0.1",
3434
"jsdom": "^11.5.1",
3535
"lerna": "^2.2.0",

packages/callhierarchy/src/common/glob.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import * as strings from '@theia/core/lib/common/strings';
2424
import * as paths from './paths';
2525
import { CharCode } from '@theia/core/lib/common/char-code';
2626

27-
/* eslint-disable no-shadow, no-null/no-null */
27+
/* eslint-disable @typescript-eslint/no-shadow, no-null/no-null */
2828
export interface IExpression {
2929
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3030
[pattern: string]: boolean | SiblingClause | any;
@@ -429,10 +429,10 @@ function trivia3(pattern: string, options: IGlobOptions): ParsedStringPattern {
429429
function trivia4and5(path: string, pattern: string, matchPathEnds: boolean): ParsedStringPattern {
430430
const nativePath = paths.nativeSep !== paths.sep ? path.replace(ALL_FORWARD_SLASHES, paths.nativeSep) : path;
431431
const nativePathEnd = paths.nativeSep + nativePath;
432-
// eslint-disable-next-line no-shadow
432+
// eslint-disable-next-line @typescript-eslint/no-shadow
433433
const parsedPattern: ParsedStringPattern = matchPathEnds ? function (path, basename): string {
434434
return path && (path === nativePath || strings.endsWith(path, nativePathEnd)) ? pattern : null!;
435-
// eslint-disable-next-line no-shadow
435+
// eslint-disable-next-line @typescript-eslint/no-shadow
436436
} : function (path, basename): string {
437437
return path && path === nativePath ? pattern : null!;
438438
};
@@ -560,7 +560,7 @@ export function isRelativePattern(obj: any): obj is IRelativePattern {
560560
* Same as `parse`, but the ParsedExpression is guaranteed to return a Promise
561561
*/
562562
export function parseToAsync(expression: IExpression, options?: IGlobOptions): ParsedExpression {
563-
// eslint-disable-next-line no-shadow
563+
// eslint-disable-next-line @typescript-eslint/no-shadow
564564
const parsedExpression = parse(expression, options);
565565
return (path: string, basename?: string, hasSibling?: (name: string) => boolean | Promise<boolean>): string | Promise<string> => {
566566
const result = parsedExpression(path, basename, hasSibling);
@@ -591,9 +591,9 @@ function parsedExpression(expression: IExpression, options: IGlobOptions): Parse
591591
return <ParsedStringPattern>parsedPatterns[0];
592592
}
593593

594-
// eslint-disable-next-line no-shadow
594+
// eslint-disable-next-line @typescript-eslint/no-shadow
595595
const resultExpression: ParsedStringPattern = function (path: string, basename: string): string | Promise<string> {
596-
// eslint-disable-next-line no-shadow
596+
// eslint-disable-next-line @typescript-eslint/no-shadow
597597
// tslint:disable-next-line:one-variable-per-declaration
598598
for (let i = 0, n = parsedPatterns.length; i < n; i++) {
599599
// Pattern matches path
@@ -606,13 +606,13 @@ function parsedExpression(expression: IExpression, options: IGlobOptions): Parse
606606
return null!;
607607
};
608608

609-
// eslint-disable-next-line no-shadow
609+
// eslint-disable-next-line @typescript-eslint/no-shadow
610610
const withBasenames = parsedPatterns.find(pattern => !!(<ParsedStringPattern>pattern).allBasenames);
611611
if (withBasenames) {
612612
resultExpression.allBasenames = (<ParsedStringPattern>withBasenames).allBasenames;
613613
}
614614

615-
// eslint-disable-next-line no-shadow
615+
// eslint-disable-next-line @typescript-eslint/no-shadow
616616
const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, <string[]>[]);
617617
if (allPaths.length) {
618618
resultExpression.allPaths = allPaths;
@@ -624,7 +624,7 @@ function parsedExpression(expression: IExpression, options: IGlobOptions): Parse
624624
const resultExpression: ParsedStringPattern = function (path: string, basename: string, hasSibling?: (name: string) => boolean | Promise<boolean>): string | Promise<string> {
625625
let name: string = null!;
626626

627-
// eslint-disable-next-line no-shadow
627+
// eslint-disable-next-line @typescript-eslint/no-shadow
628628
for (let i = 0, n = parsedPatterns.length; i < n; i++) {
629629
// Pattern matches path
630630
const parsedPattern = (<ParsedExpressionPattern>parsedPatterns[i]);

packages/callhierarchy/src/common/paths.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function normalize(path: string, toOSPath?: boolean): string {
8383
return path;
8484
}
8585

86-
// eslint-disable-next-line no-shadow
86+
// eslint-disable-next-line @typescript-eslint/no-shadow
8787
const sep = wantsBackslash ? '\\' : '/';
8888
const root = getRoot(path, sep);
8989

@@ -133,7 +133,7 @@ function streql(value: string, start: number, end: number, other: string): boole
133133
* `getRoot('files:///files/path') === files:///`,
134134
* or `getRoot('\\server\shares\path') === \\server\shares\`
135135
*/
136-
// eslint-disable-next-line no-shadow
136+
// eslint-disable-next-line @typescript-eslint/no-shadow
137137
export function getRoot(path: string, sep: string = '/'): string {
138138

139139
if (!path) {
@@ -150,7 +150,7 @@ export function getRoot(path: string, sep: string = '/'): string {
150150
// ^^^^^^^^^^^^^^^^^^^
151151
code = path.charCodeAt(2);
152152
if (code !== CharCode.Slash && code !== CharCode.Backslash) {
153-
// eslint-disable-next-line no-shadow
153+
// eslint-disable-next-line @typescript-eslint/no-shadow
154154
let pos = 3;
155155
const start = pos;
156156
for (; pos < len; pos++) {

packages/filesystem/src/browser/file-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// and https://github.com/microsoft/vscode/blob/04c36be045a94fee58e5f8992d3e3fd980294a84/src/vs/workbench/services/workingCopy/common/workingCopyFileOperationParticipant.ts
2525

2626
/* eslint-disable max-len */
27-
/* eslint-disable no-shadow */
27+
/* eslint-disable @typescript-eslint/no-shadow */
2828
/* eslint-disable no-null/no-null */
2929
/* eslint-disable @typescript-eslint/tslint/config */
3030
/* eslint-disable @typescript-eslint/no-explicit-any */

packages/filesystem/src/common/remote-file-system-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export class RemoteFileSystemProvider implements Required<FileSystemProvider>, D
229229

230230
readFileStream(resource: URI, opts: FileReadStreamOptions, token: CancellationToken): ReadableStreamEvents<Uint8Array> {
231231
const capturedError = new Error();
232-
// eslint-disable-next-line no-shadow
232+
// eslint-disable-next-line @typescript-eslint/no-shadow
233233
const stream = newWriteableStream<Uint8Array>(data => BinaryBuffer.concat(data.map(data => BinaryBuffer.wrap(data))).buffer);
234234
this.server.readFileStream(resource.toString(), opts, token).then(streamHandle => {
235235
if (token.isCancellationRequested) {

packages/filesystem/src/node/disk-file-system-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// based on https://github.com/microsoft/vscode/blob/04c36be045a94fee58e5f8992d3e3fd980294a84/src/vs/platform/files/node/diskFileSystemProvider.ts
2121

2222
/* eslint-disable no-null/no-null */
23-
/* eslint-disable no-shadow */
23+
/* eslint-disable @typescript-eslint/no-shadow */
2424

2525
import { injectable, inject, postConstruct } from 'inversify';
2626
import { basename, dirname, normalize, join } from 'path';

packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class HostedPluginProcess implements ServerPluginRunner {
9595
}
9696

9797
this.terminatingPluginServer = true;
98-
// eslint-disable-next-line no-shadow
98+
// eslint-disable-next-line @typescript-eslint/no-shadow
9999
const cp = this.childProcess;
100100
this.childProcess = undefined;
101101

packages/plugin-ext/src/plugin/file-system-event-service-ext-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525

2626
/* eslint-disable max-len */
27-
/* eslint-disable no-shadow */
27+
/* eslint-disable @typescript-eslint/no-shadow */
2828
/* eslint-disable @typescript-eslint/no-explicit-any */
2929
/* eslint-disable @typescript-eslint/tslint/config */
3030

packages/plugin-ext/src/plugin/node/debug/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class DebugExtImpl implements DebugExt {
189189
providers.add(provider);
190190

191191
return Disposable.create(() => {
192-
// eslint-disable-next-line no-shadow
192+
// eslint-disable-next-line @typescript-eslint/no-shadow
193193
const providers = this.configurationProviders.get(debugType);
194194
if (providers) {
195195
providers.delete(provider);

0 commit comments

Comments
 (0)