Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
chore: clean up obsolete eslint disable comments (#1760)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb authored Sep 19, 2022
1 parent dd9de59 commit 56135b5
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 21 deletions.
3 changes: 0 additions & 3 deletions lib/detector.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import * as babelTypes from '@babel/types';
import * as babel from '@babel/parser';
import generate from '@babel/generator';
Expand Down Expand Up @@ -84,7 +83,6 @@ function reconstruct(node: babelTypes.Node) {
let v = generate(node, { comments: false }).code.replace(/\n/g, '');
let v2;

// eslint-disable-next-line no-constant-condition
while (true) {
v2 = v.replace(/\[ /g, '[').replace(/ \]/g, ']').replace(/ {2}/g, ' ');

Expand Down Expand Up @@ -436,7 +434,6 @@ export function visitorMalformed(n: babelTypes.Node) {
}

export function visitorUseSCWD(n: babelTypes.Node) {
// eslint-disable-line camelcase
if (!babelTypes.isCallExpression(n)) {
return null;
}
Expand Down
2 changes: 0 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ async function needViaCache(target: NodeTarget) {
}

export async function exec(argv2: string[]) {
// eslint-disable-line complexity
const argv = minimist(argv2, {
boolean: [
'b',
Expand Down Expand Up @@ -294,7 +293,6 @@ export async function exec(argv2: string[]) {
case 'none':
break;
default:
// eslint-disable-next-line no-console
throw wasReported(
`Invalid compression algorithm ${algo} ( should be None, Brotli or Gzip)`
);
Expand Down
1 change: 0 additions & 1 deletion lib/refiner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function hasParent(file: string, records: FileRecords) {
}

function purgeTopDirectories(records: FileRecords) {
// eslint-disable-next-line no-constant-condition
while (true) {
let found = false;

Expand Down
2 changes: 0 additions & 2 deletions lib/walker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,6 @@ class Walker {
marker: Marker,
derivative: Derivative
) {
// eslint-disable-line camelcase
const newPackages: { packageJson: string; marker?: Marker }[] = [];

const catchReadFile = (file: string) => {
Expand Down Expand Up @@ -871,7 +870,6 @@ class Walker {
}

async step_STORE_ANY(record: FileRecord, marker: Marker, store: number) {
// eslint-disable-line camelcase
if (strictVerify) {
assert(record.file === toNormalizedRealPath(record.file));
}
Expand Down
6 changes: 1 addition & 5 deletions prelude/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ function payloadFileSync(pointer) {
process.pkg.path.resolve = function resolve() {
const args = cloneArgs(arguments);
args.unshift(path.dirname(ENTRYPOINT));
return path.resolve.apply(path, args); // eslint-disable-line prefer-spread
return path.resolve.apply(path, args);
};
})();

Expand Down Expand Up @@ -722,7 +722,6 @@ function payloadFileSync(pointer) {
return fName;
}

// eslint-disable-next-line prefer-arrow-callback
const uncompressExternally = function uncompressExternally(dock) {
if (!dock.externalFilename) {
const snapshotFilename = dock.path;
Expand All @@ -737,7 +736,6 @@ function payloadFileSync(pointer) {
return dock.externalFilename;
};

// eslint-disable-next-line prefer-arrow-callback
function uncompressExternallyPath(path_) {
const entity = findVirtualFileSystemEntry(path_);
const dock = { path: path_, entity, position: 0 };
Expand All @@ -750,7 +748,6 @@ function payloadFileSync(pointer) {
return fd;
}

// eslint-disable-next-line prefer-arrow-callback
function openFromSnapshot(path_, uncompress, cb) {
const cb2 = cb || rethrow;
const entity = findVirtualFileSystemEntry(path_);
Expand Down Expand Up @@ -1752,7 +1749,6 @@ function payloadFileSync(pointer) {
return process.binding('fs').internalModuleStat(makeLong(fNative));
}

// eslint-disable-next-line prefer-arrow-callback
fs.internalModuleStat = function internalModuleStat(long) {
// from node comments:
// Used to speed up module loading. Returns 0 if the path refers to
Expand Down
2 changes: 1 addition & 1 deletion test/test-50-ast-parsing-2/test-x-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require(/**/ async + 75.25 /**/);
require(/**/ __dirname + '/' + async /**/); // eslint-disable-line no-path-concat
require(/**/ __dirname + '/' + async + 35.5 /**/); // eslint-disable-line no-path-concat

require(/**/ [async, 'js'].join('.') /**/); // eslint-disable-line array-bracket-spacing
require(/**/ [async, 'js'].join('.') /**/);
// TODO require({ async: "js" }.join("."));

require(/**/ async[0] /**/);
Expand Down
2 changes: 1 addition & 1 deletion test/test-50-global-object/test-y-resolve-A.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';

global.x = 42;
console.log(x); // eslint-disable-line no-undef
console.log(x);
2 changes: 1 addition & 1 deletion test/test-50-global-object/test-y-resolve-B.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';

global.y = 84;
console.log(y); // eslint-disable-line no-undef
console.log(y);
1 change: 0 additions & 1 deletion test/test-50-many-arrow-functions/test-z-creator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

// eslint-disable no-useless-concat
let s =
'function EventEmitter () {\n' +
' this.listeners = [];\n' +
Expand Down
2 changes: 0 additions & 2 deletions test/test-50-many-callbacks/test-z-creator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

// eslint-disable no-useless-concat

let s = "console.log('test');\n";

for (let i = 0; i < 100; i += 1) {
Expand Down
2 changes: 1 addition & 1 deletion test/test-79-npm/mongoose/mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ kitty.save(function (error1) {
if (error1) return;
Cat.find({})
.$where(function () {
return this.name.slice(0, 3) === 'Tuz'; // eslint-disable-line no-invalid-this
return this.name.slice(0, 3) === 'Tuz';
})
.exec(function (error2, cats) {
if (process.pkg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ async function withPromises() {
const buffer = Buffer.alloc(1000);

if (MAJOR_VERSION >= 14) {
// eslint-disable-line no-unused-vars
const { bytesRead } = await fd.read(buffer, 0, buffer.length, 10);
if (process.env.DEBUG) {
console.log('bytesRead = ', bytesRead);
Expand Down

0 comments on commit 56135b5

Please sign in to comment.