build: add import/order eslint rule (#44106)

build: add import/order eslint rule (#44085)

* build: add import/order eslint rule

* chore: run lint:js --fix
This commit is contained in:
Samuel Attard 2024-10-02 20:52:01 -07:00 committed by GitHub
parent 479caedc8a
commit e9cb85bea6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
209 changed files with 831 additions and 444 deletions

View file

@ -1,4 +1,5 @@
const { parseDocs } = require('@electron/docs-parser');
const fs = require('node:fs');
const path = require('node:path');

View file

@ -1,5 +1,8 @@
const args = require('minimist')(process.argv.slice(2));
const { Octokit } = require('@octokit/rest');
const minimist = require('minimist');
const args = minimist(process.argv.slice(2));
const octokit = new Octokit();
async function checkIfDocOnlyChange () {

View file

@ -1,6 +1,7 @@
const fs = require('node:fs');
const semver = require('semver');
const fs = require('node:fs');
const outputPath = process.argv[2];
const currentVersion = process.argv[3];

View file

@ -1,4 +1,5 @@
const asar = require('@electron/asar');
const crypto = require('node:crypto');
const fs = require('node:fs');

View file

@ -1,4 +1,5 @@
const asar = require('@electron/asar');
const assert = require('node:assert');
const fs = require('node:fs');
const os = require('node:os');

View file

@ -4,9 +4,12 @@ Usage:
$ node ./script/gn-check.js [--outDir=dirName]
*/
const minimist = require('minimist');
const cp = require('node:child_process');
const path = require('node:path');
const args = require('minimist')(process.argv.slice(2), { string: ['outDir'] });
const args = minimist(process.argv.slice(2), { string: ['outDir'] });
const { getOutDir } = require('./lib/utils');

View file

@ -1,5 +1,8 @@
/* eslint-disable camelcase */
const { BlobServiceClient } = require('@azure/storage-blob');
const minimist = require('minimist');
const path = require('node:path');
const { ELECTRON_ARTIFACTS_BLOB_STORAGE } = process.env;
@ -10,7 +13,7 @@ if (!ELECTRON_ARTIFACTS_BLOB_STORAGE) {
const blobServiceClient = BlobServiceClient.fromConnectionString(ELECTRON_ARTIFACTS_BLOB_STORAGE);
const args = require('minimist')(process.argv.slice(2));
const args = minimist(process.argv.slice(2));
let { prefix = '/', key_prefix = '', _: files } = args;
if (prefix && !prefix.endsWith(path.sep)) prefix = path.resolve(prefix) + path.sep;

View file

@ -1,5 +1,6 @@
const chalk = require('chalk');
const { GitProcess } = require('dugite');
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');

View file

@ -1,14 +1,16 @@
#!/usr/bin/env node
const crypto = require('node:crypto');
const { GitProcess } = require('dugite');
const childProcess = require('node:child_process');
const { ESLint } = require('eslint');
const fs = require('node:fs');
const minimist = require('minimist');
const path = require('node:path');
const { getCodeBlocks } = require('@electron/lint-roller/dist/lib/markdown');
const { GitProcess } = require('dugite');
const { ESLint } = require('eslint');
const minimist = require('minimist');
const childProcess = require('node:child_process');
const crypto = require('node:crypto');
const fs = require('node:fs');
const path = require('node:path');
const { chunkFilenames, findMatchingFiles } = require('./lib/utils');
const ELECTRON_ROOT = path.normalize(path.dirname(__dirname));

View file

@ -1,3 +1,5 @@
const minimist = require('minimist');
const cp = require('node:child_process');
const fs = require('node:fs');
const path = require('node:path');
@ -13,7 +15,7 @@ if (!require.main) {
throw new Error('Must call the nan spec runner directly');
}
const args = require('minimist')(process.argv.slice(2), {
const args = minimist(process.argv.slice(2), {
string: ['only']
});

View file

@ -1,20 +1,23 @@
const minimist = require('minimist');
const cp = require('node:child_process');
const fs = require('node:fs');
const path = require('node:path');
const args = require('minimist')(process.argv.slice(2), {
const utils = require('./lib/utils');
const DISABLED_TESTS = require('./node-disabled-tests.json');
const args = minimist(process.argv.slice(2), {
boolean: ['default', 'validateDisabled'],
string: ['jUnitDir']
});
const BASE = path.resolve(__dirname, '../..');
const DISABLED_TESTS = require('./node-disabled-tests.json');
const NODE_DIR = path.resolve(BASE, 'third_party', 'electron_node');
const JUNIT_DIR = args.jUnitDir ? path.resolve(args.jUnitDir) : null;
const TAP_FILE_NAME = 'test.tap';
const utils = require('./lib/utils');
if (!require.main) {
throw new Error('Must call the node spec runner directly');
}

View file

@ -1,9 +1,12 @@
const { Octokit } = require('@octokit/rest');
const got = require('got');
const assert = require('node:assert');
const fs = require('node:fs');
const got = require('got');
const path = require('node:path');
const { handleGitCall, ELECTRON_DIR } = require('./lib/utils.js');
const { Octokit } = require('@octokit/rest');
const octokit = new Octokit();
const APPVEYOR_IMAGES_URL = 'https://ci.appveyor.com/api/build-clouds';

View file

@ -1,4 +1,5 @@
const { appCredentialsFromString, getTokenForRepo } = require('@electron/github-app-auth');
const cp = require('node:child_process');
async function main () {

View file

@ -1,4 +1,5 @@
import { parseArgs } from 'node:util';
import { cleanReleaseArtifacts } from '../release-artifact-cleanup';
const { values: { tag: _tag, releaseID } } = parseArgs({

View file

@ -1,13 +1,13 @@
import { Octokit } from '@octokit/rest';
import * as childProcess from 'node:child_process';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as semver from 'semver';
import * as temp from 'temp';
import { getCurrentBranch, ELECTRON_DIR } from '../../lib/utils';
import { getElectronVersion } from '../../lib/get-version';
import * as childProcess from 'node:child_process';
import * as fs from 'node:fs';
import * as path from 'node:path';
import { getElectronVersion } from '../../lib/get-version';
import { getCurrentBranch, ELECTRON_DIR } from '../../lib/utils';
import { getAssetContents } from '../get-asset';
import { createGitHubTokenStrategy } from '../github-token';
import { ELECTRON_ORG, ELECTRON_REPO, ElectronReleaseRepo, NIGHTLY_REPO } from '../types';

View file

@ -1,4 +1,5 @@
import { Octokit } from '@octokit/rest';
import { createGitHubTokenStrategy } from './github-token';
import { ELECTRON_ORG, ELECTRON_REPO, ElectronReleaseRepo, NIGHTLY_REPO } from './types';

View file

@ -1,5 +1,6 @@
import { Octokit } from '@octokit/rest';
import got from 'got';
import { createGitHubTokenStrategy } from './github-token';
import { ELECTRON_ORG, ElectronReleaseRepo } from './types';

View file

@ -1,4 +1,5 @@
import got from 'got';
import * as url from 'node:url';
const HASHER_FUNCTION_HOST = 'electron-artifact-hasher.azurewebsites.net';

View file

@ -1,15 +1,15 @@
#!/usr/bin/env node
import { Octokit } from '@octokit/rest';
import { GitProcess } from 'dugite';
import { basename } from 'node:path';
import { valid, compare, gte, lte } from 'semver';
import { ELECTRON_DIR } from '../../lib/utils';
import { get, render } from './notes';
import { Octokit } from '@octokit/rest';
import { createGitHubTokenStrategy } from '../github-token';
import { basename } from 'node:path';
import { parseArgs } from 'node:util';
import { get, render } from './notes';
import { ELECTRON_DIR } from '../../lib/utils';
import { createGitHubTokenStrategy } from '../github-token';
import { ELECTRON_ORG, ELECTRON_REPO } from '../types';
const octokit = new Octokit({

View file

@ -1,11 +1,11 @@
#!/usr/bin/env node
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
import { resolve as _resolve } from 'node:path';
import { Octokit } from '@octokit/rest';
import { GitProcess } from 'dugite';
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
import { resolve as _resolve } from 'node:path';
import { ELECTRON_DIR } from '../../lib/utils';
import { createGitHubTokenStrategy } from '../github-token';
import { ELECTRON_ORG, ELECTRON_REPO } from '../types';

View file

@ -1,14 +1,15 @@
import { Octokit } from '@octokit/rest';
import * as chalk from 'chalk';
import { GitProcess } from 'dugite';
import { execSync } from 'node:child_process';
import { join } from 'node:path';
import { runReleaseCIJobs } from './run-release-ci-jobs';
import releaseNotesGenerator from './notes';
import { getCurrentBranch, ELECTRON_DIR } from '../lib/utils.js';
import { createGitHubTokenStrategy } from './github-token';
import releaseNotesGenerator from './notes';
import { runReleaseCIJobs } from './run-release-ci-jobs';
import { ELECTRON_ORG, ElectronReleaseRepo, VersionBumpType } from './types';
import { getCurrentBranch, ELECTRON_DIR } from '../lib/utils.js';
const pass = chalk.green('✓');
const fail = chalk.red('✗');

View file

@ -4,17 +4,18 @@ import { BlobServiceClient } from '@azure/storage-blob';
import { Octokit } from '@octokit/rest';
import * as chalk from 'chalk';
import got from 'got';
import { execSync, ExecSyncOptions } from 'node:child_process';
import { statSync, createReadStream, writeFileSync, close } from 'node:fs';
import { join } from 'node:path';
import { gte } from 'semver';
import { track as trackTemp } from 'temp';
import { ELECTRON_DIR } from '../lib/utils';
import { getElectronVersion } from '../lib/get-version';
import { execSync, ExecSyncOptions } from 'node:child_process';
import { statSync, createReadStream, writeFileSync, close } from 'node:fs';
import { join } from 'node:path';
import { getUrlHash } from './get-url-hash';
import { createGitHubTokenStrategy } from './github-token';
import { ELECTRON_ORG, ELECTRON_REPO, ElectronReleaseRepo, NIGHTLY_REPO } from './types';
import { getElectronVersion } from '../lib/get-version';
import { ELECTRON_DIR } from '../lib/utils';
const temp = trackTemp();

View file

@ -1,5 +1,6 @@
import { Octokit } from '@octokit/rest';
import got, { OptionsOfTextResponseBody } from 'got';
import * as assert from 'node:assert';
import { createGitHubTokenStrategy } from './github-token';

View file

@ -1,5 +1,7 @@
import { Octokit } from '@octokit/rest';
import * as fs from 'node:fs';
import { createGitHubTokenStrategy } from '../github-token';
import { ELECTRON_ORG, ELECTRON_REPO, ElectronReleaseRepo, NIGHTLY_REPO } from '../types';

View file

@ -2,7 +2,9 @@
import { valid, coerce, inc } from 'semver';
import { getElectronVersion } from '../lib/get-version';
import { parseArgs } from 'node:util';
import { VersionBumpType } from './types';
import {
isNightly,
isAlpha,
@ -12,8 +14,7 @@ import {
nextBeta,
isStable
} from './version-utils';
import { VersionBumpType } from './types';
import { parseArgs } from 'node:util';
import { getElectronVersion } from '../lib/get-version';
// run the script
async function main () {

View file

@ -1,5 +1,5 @@
import * as semver from 'semver';
import { GitProcess } from 'dugite';
import * as semver from 'semver';
import { ELECTRON_DIR } from '../lib/utils';

View file

@ -1,13 +1,14 @@
import * as childProcess from 'node:child_process';
import * as fs from 'node:fs';
import * as minimist from 'minimist';
import * as os from 'node:os';
import * as path from 'node:path';
import * as streamChain from 'stream-chain';
import * as streamJson from 'stream-json';
import { ignore as streamJsonIgnore } from 'stream-json/filters/Ignore';
import { streamArray as streamJsonStreamArray } from 'stream-json/streamers/StreamArray';
import * as childProcess from 'node:child_process';
import * as fs from 'node:fs';
import * as os from 'node:os';
import * as path from 'node:path';
import { chunkFilenames, findMatchingFiles } from './lib/utils';
const SOURCE_ROOT = path.normalize(path.dirname(__dirname));

View file

@ -1,19 +1,23 @@
#!/usr/bin/env node
const { ElectronVersions, Installer } = require('@electron/fiddle-core');
const chalk = require('chalk');
const { hashElement } = require('folder-hash');
const minimist = require('minimist');
const childProcess = require('node:child_process');
const crypto = require('node:crypto');
const fs = require('node:fs');
const { hashElement } = require('folder-hash');
const os = require('node:os');
const path = require('node:path');
const unknownFlags = [];
const pass = chalk.green('✓');
const fail = chalk.red('✗');
const args = require('minimist')(process.argv, {
const args = minimist(process.argv, {
string: ['runners', 'target', 'electronVersion'],
unknown: arg => unknownFlags.push(arg)
});

View file

@ -1,6 +1,7 @@
const fs = require('node:fs');
const glob = require('glob');
const fs = require('node:fs');
const currentShard = parseInt(process.argv[2], 10);
const shardCount = parseInt(process.argv[3], 10);

View file

@ -1,5 +1,7 @@
const cp = require('node:child_process');
const utils = require('./lib/utils');
const electronPath = utils.getAbsoluteElectronExec();
const child = cp.spawn(electronPath, process.argv.slice(2), { stdio: 'inherit' });