Skip to content

Commit

Permalink
Run prettier (one-off) on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
davidje13 committed Dec 22, 2024
1 parent 869e06a commit 1da74d2
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 32 deletions.
File renamed without changes.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
language: node_js
node_js:
- '18'
- '20'
- '22'
- '23'
- '18'
- '20'
- '22'
- '23'
os: linux
addons:
chrome: stable
firefox: latest
env:
- PARALLEL_BUILD=false PARALLEL_E2E=false EXPLICIT_WAIT_TIMEOUT=20000 TEST_TIMEOUT=60000
- PARALLEL_BUILD=false PARALLEL_E2E=false EXPLICIT_WAIT_TIMEOUT=20000 TEST_TIMEOUT=60000
cache:
directories:
- backend/node_modules
- frontend/node_modules
- e2e/node_modules
- build/node_modules
- backend/node_modules
- frontend/node_modules
- e2e/node_modules
- build/node_modules
2 changes: 1 addition & 1 deletion docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ be sure to specify these as well:
node --disable-proto delete index.js
```

Note that these must be included *before* the `index.js` argument.
Note that these must be included _before_ the `index.js` argument.

If you do not need to specify custom flags, it is recommended to
stick with using `./index.js` to launch the application instead of
Expand Down
4 changes: 2 additions & 2 deletions docs/SERVICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ apt install mongodb
The configuration file will be created at `/usr/local/etc/mongod.conf`
on macOS and `/etc/mongod.conf` on Ubuntu.

*Note: MongoDB's default security model is enough for local
_Note: MongoDB's default security model is enough for local
development, but you should lock it down further in deployments. See
the [security documentation](./SECURITY.md) for details.*
the [security documentation](./SECURITY.md) for details._

### Redis

Expand Down
4 changes: 0 additions & 4 deletions e2e/.prettierrc.json

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/.prettierrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ if (preserveBuildModules) {
}

log('Compressing static resources...');
const staticFiles = await Promise.all((await findFiles(staticdir)).map(compressFile));
const staticFiles = await Promise.all(
(await findFiles(staticdir)).map(compressFile),
);

const isCode = hasExt('.js', '.css', '.html');

const codeTotals = staticFiles
.filter(isCode)
.reduce(sumSize, SIZE0);
const codeTotals = staticFiles.filter(isCode).reduce(sumSize, SIZE0);

const resourceTotals = staticFiles
.filter((v) => !isCode(v))
Expand Down
9 changes: 7 additions & 2 deletions scripts/helpers/io.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ export async function compressFile(file) {
return { file, size, brSize, gzSize };
}

export const hasExt = (...exts) => ({ file }) => exts.some((ext) => file.endsWith(ext));
export const hasExt =
(...exts) =>
({ file }) =>
exts.some((ext) => file.endsWith(ext));

export const SIZE0 = { size: 0, brSize: 0, gzSize: 0 };

Expand All @@ -114,7 +117,9 @@ export const sumSize = (a, b) => ({
});

export const printSize = ({ size, brSize, gzSize }) =>
`${prettyBytes(size)} / ${prettyBytes(gzSize)} gzip / ${prettyBytes(brSize)} brotli`;
`${prettyBytes(size)} / ${prettyBytes(gzSize)} gzip / ${prettyBytes(
brSize,
)} brotli`;

function prettyBytes(bytes) {
if (bytes < 2000) {
Expand Down
14 changes: 8 additions & 6 deletions scripts/helpers/proc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export async function exitWithCode(code, message) {
if (message) {
process.stderr.write(`\n${message}\n`);
}
// process.exit may lose stream data which has been buffered in NodeJS - wait for it all to be flushed before exiting
await Promise.all([
new Promise((resolve) => process.stdout.write('', resolve)),
new Promise((resolve) => process.stderr.write('', resolve)),
]);
// process.exit may lose stream data which has been buffered in NodeJS - wait for it all to be flushed before exiting
await Promise.all([
new Promise((resolve) => process.stdout.write('', resolve)),
new Promise((resolve) => process.stderr.write('', resolve)),
]);
process.exit(code);
}

Expand Down Expand Up @@ -239,7 +239,9 @@ export function runTask({
}
handled = true;
await streamsClosed;
output.write(`${failureMessage} - ${e instanceof Error ? e.message : e}\n`);
output.write(
`${failureMessage} - ${e instanceof Error ? e.message : e}\n`,
);
if (outputMode === 'atomic' || outputMode === 'fail_atomic') {
printInfo();
}
Expand Down

0 comments on commit 1da74d2

Please sign in to comment.