Skip to content

Commit

Permalink
Add *.js suffix in relative require statements, remove unnecessary es…
Browse files Browse the repository at this point in the history
…lint-disable directives, rename require variables, see phetsims/chipper#1498
  • Loading branch information
samreid committed Oct 28, 2024
1 parent da0fa8a commit a84e83c
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 38 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// AQUA wants to opt out of global SIGINT handling so that it can handle it itself.
global.processEventOptOut = true;

const Gruntfile = require( '../chipper/Gruntfile' );
const registerTasks = require( '../perennial-alias/js/grunt/util/registerTasks' );
const Gruntfile = require( '../chipper/Gruntfile.js' );
const registerTasks = require( '../perennial-alias/js/grunt/util/registerTasks.js' );

// Stream winston logging to the console
module.exports = grunt => {
Expand Down
2 changes: 1 addition & 1 deletion js/local/fuzzOneSim.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


const puppeteer = require( 'puppeteer' );
const puppeteerPage = require( './puppeteerPage' );
const puppeteerPage = require( './puppeteerPage.js' );
const _ = require( '../../../sherpa/lib/lodash-4.17.4' );
const child_process = require( 'child_process' );

Expand Down
3 changes: 1 addition & 2 deletions js/local/puppeteerHelpCT.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
* @author Michael Kauzmann (PhET Interactive Simulations)
*/


const puppeteerLoad = require( '../../../perennial/js/common/puppeteerLoad' );
const puppeteerLoad = require( '../../../perennial/js/common/puppeteerLoad.js' );
const assert = require( 'assert' );

process.on( 'SIGINT', () => process.exit() );
Expand Down
2 changes: 1 addition & 1 deletion js/local/puppeteerPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2018-2024, University of Colorado Boulder
// @author Michael Kauzmann (PhET Interactive Simulations)

const puppeteerLoad = require( '../../../perennial-alias/js/common/puppeteerLoad' );
const puppeteerLoad = require( '../../../perennial-alias/js/common/puppeteerLoad.js' );

module.exports = async function puppeteerPage( browser, targetURL, timeout ) {

Expand Down
6 changes: 3 additions & 3 deletions js/node-client/runNextTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* @author Jonathan Olson <[email protected]>
*/

const getNextTestInfo = require( './getNextTestInfo' );
const runTest = require( './runTest' );
const sendTestResult = require( './sendTestResult' );
const getNextTestInfo = require( './getNextTestInfo.js' );
const runTest = require( './runTest.js' );
const sendTestResult = require( './sendTestResult.js' );
const winston = require( 'winston' );

/**
Expand Down
6 changes: 3 additions & 3 deletions js/node-client/runTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/

const _ = require( 'lodash' );
const sendTestResult = require( './sendTestResult' );
const puppeteer = require( '../../../perennial/node_modules/puppeteer' );
const browserPageLoad = require( '../../../perennial/js/common/browserPageLoad' );
const sendTestResult = require( './sendTestResult.js' );
const puppeteer = require( '../../../perennial/node_modules/puppeteer.js' );
const browserPageLoad = require( '../../../perennial/js/common/browserPageLoad.js' );
const winston = require( 'winston' );
const path = require( 'path' );
require( 'dotenv' ).config();
Expand Down
24 changes: 12 additions & 12 deletions js/server/ContinuousServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
* @author Jonathan Olson <[email protected]>
*/

const asyncFilter = require( '../../../perennial/js/common/asyncFilter' );
const cloneMissingRepos = require( '../../../perennial/js/common/cloneMissingRepos' );
const execute = require( '../../../perennial/js/common/execute' );
const getRepoList = require( '../../../perennial/js/common/getRepoList' );
const gitPull = require( '../../../perennial/js/common/gitPull' );
const gitRevParse = require( '../../../perennial/js/common/gitRevParse' );
const gruntCommand = require( '../../../perennial/js/common/gruntCommand' );
const isStale = require( '../../../perennial/js/common/isStale' );
const npmUpdate = require( '../../../perennial/js/common/npmUpdate' );
const transpileAll = require( '../../../perennial/js/common/transpileAll' );
const sleep = require( '../../../perennial/js/common/sleep' );
const Snapshot = require( './Snapshot' );
const asyncFilter = require( '../../../perennial/js/common/asyncFilter.js' );
const cloneMissingRepos = require( '../../../perennial/js/common/cloneMissingRepos.js' );
const execute = require( '../../../perennial/js/common/execute.js' );
const getRepoList = require( '../../../perennial/js/common/getRepoList.js' );
const gitPull = require( '../../../perennial/js/common/gitPull.js' );
const gitRevParse = require( '../../../perennial/js/common/gitRevParse.js' );
const gruntCommand = require( '../../../perennial/js/common/gruntCommand.js' );
const isStale = require( '../../../perennial/js/common/isStale.js' );
const npmUpdate = require( '../../../perennial/js/common/npmUpdate.js' );
const transpileAll = require( '../../../perennial/js/common/transpileAll.js' );
const sleep = require( '../../../perennial/js/common/sleep.js' );
const Snapshot = require( './Snapshot.js' );
const assert = require( 'assert' );
const fs = require( 'fs' );
const http = require( 'http' );
Expand Down
2 changes: 1 addition & 1 deletion js/server/ContinuousServerClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const _ = require( 'lodash' );
const path = require( 'path' );
const assert = require( 'assert' );
const { Worker } = require( 'worker_threads' );
const sleep = require( '../../../perennial/js/common/sleep' );
const sleep = require( '../../../perennial/js/common/sleep.js' );

process.on( 'SIGINT', () => process.exit( 0 ) );

Expand Down
16 changes: 8 additions & 8 deletions js/server/Snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
*/


const copyDirectory = require( '../../../perennial/js/common/copyDirectory' );
const createDirectory = require( '../../../perennial/js/common/createDirectory' );
const deleteDirectory = require( '../../../perennial/js/common/deleteDirectory' );
const execute = require( '../../../perennial/js/common/execute' );
const getRepoList = require( '../../../perennial/js/common/getRepoList' );
const gitLastCommitTimestamp = require( '../../../perennial/js/common/gitLastCommitTimestamp' );
const gitRevParse = require( '../../../perennial/js/common/gitRevParse' );
const Test = require( './Test' );
const copyDirectory = require( '../../../perennial/js/common/copyDirectory.js' );
const createDirectory = require( '../../../perennial/js/common/createDirectory.js' );
const deleteDirectory = require( '../../../perennial/js/common/deleteDirectory.js' );
const execute = require( '../../../perennial/js/common/execute.js' );
const getRepoList = require( '../../../perennial/js/common/getRepoList.js' );
const gitLastCommitTimestamp = require( '../../../perennial/js/common/gitLastCommitTimestamp.js' );
const gitRevParse = require( '../../../perennial/js/common/gitRevParse.js' );
const Test = require( './Test.js' );
const fs = require( 'fs' );
const winston = require( 'winston' );
const tsxCommand = require( '../../../perennial/js/common/tsxCommand.js' );
Expand Down
2 changes: 1 addition & 1 deletion js/server/Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/


const TestResult = require( './TestResult' );
const TestResult = require( './TestResult.js' );
const assert = require( 'assert' );
const _ = require( 'lodash' );

Expand Down
4 changes: 2 additions & 2 deletions js/server/playwrightCTClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/

const assert = require( 'assert' );
const playwrightLoad = require( '../../../perennial/js/common/playwrightLoad' );
const playwrightLoad = require( '../../../perennial/js/common/playwrightLoad.js' );
const { parentPort } = require( 'worker_threads' );
const playwright = require( '../../../perennial/node_modules/playwright' );
const playwright = require( '../../../perennial/node_modules/playwright.js' );

process.on( 'SIGINT', () => process.exit() );

Expand Down
2 changes: 1 addition & 1 deletion js/server/puppeteerCTClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

const assert = require( 'assert' );
const path = require( 'path' );
const puppeteerLoad = require( '../../../perennial/js/common/puppeteerLoad' );
const puppeteerLoad = require( '../../../perennial/js/common/puppeteerLoad.js' );
const { parentPort } = require( 'worker_threads' );

process.on( 'SIGINT', () => process.exit() );
Expand Down
2 changes: 1 addition & 1 deletion js/server/sendSlackMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Jonathan Olson <[email protected]>
*/

const buildLocal = require( '../../../perennial/js/common/buildLocal' );
const buildLocal = require( '../../../perennial/js/common/buildLocal.js' );

const { App } = require( '@slack/bolt' );

Expand Down

0 comments on commit a84e83c

Please sign in to comment.