Skip to content

Commit 288aff8

Browse files
fix(eslint): update for new eslint version
1 parent 4795ec0 commit 288aff8

5 files changed

Lines changed: 225 additions & 198 deletions

File tree

src/cli.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-console */
2-
31
import { readdir, readFile, stat, writeFile } from 'mz/fs';
42
import { basename, dirname, extname, join } from 'path';
53
import { convert, modernizeJS } from './index';

src/utils/Scope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default class Scope {
6565
}
6666

6767
hasOwnBinding(name: string): boolean {
68-
return this.bindings.hasOwnProperty(this.key(name));
68+
return Object.prototype.hasOwnProperty.call(this.bindings, this.key(name));
6969
}
7070

7171
/**

src/utils/debug.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2-
export function logger(name: string): (...args: Array<any>) => void {
1+
export function logger<A extends Array<unknown>>(name: string): (...args: A) => void {
32
if (isLoggingEnabled(name)) {
4-
// eslint-disable-next-line no-console
53
return (...args) => console.log(name, ...args);
64
} else {
75
return () => {};

test/support/validate.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ export default function validate(
3737
expectedOutput?: any | { cs1: any; cs2: any },
3838
{ options = {}, skipNodeCheck = false }: ValidateOptions = {}
3939
): void {
40-
const expectedCS1 = expectedOutput && expectedOutput.hasOwnProperty('cs1') ? expectedOutput.cs1 : expectedOutput;
41-
const expectedCS2 = expectedOutput && expectedOutput.hasOwnProperty('cs2') ? expectedOutput.cs2 : expectedOutput;
40+
const expectedCS1 =
41+
expectedOutput && Object.prototype.hasOwnProperty.call(expectedOutput, 'cs1') ? expectedOutput.cs1 : expectedOutput;
42+
const expectedCS2 =
43+
expectedOutput && Object.prototype.hasOwnProperty.call(expectedOutput, 'cs2') ? expectedOutput.cs2 : expectedOutput;
4244
runValidateCase(source, expectedCS1, { options: { ...options, useCS2: false }, skipNodeCheck });
4345
runValidateCase(source, expectedCS2, { options: { ...options, useCS2: true }, skipNodeCheck });
4446
}

0 commit comments

Comments
 (0)