Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Signed-off-by: UNIFINED <[email protected]>
  • Loading branch information
Wilsmac authored Oct 8, 2023
1 parent 7bcf2d8 commit 94d130b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import fs from 'fs';
import path, {dirname} from 'path';
import assert from 'assert';
import {spawn} from 'child_process';
import syntaxError from 'syntax-error';
import {fileURLToPath} from 'url';
import {createRequire} from 'module';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const require = createRequire(__dirname);
const folders = ['.', ...Object.keys(require(path.join(__dirname, './package.json')).directories)];
const files = [];
for (const folder of folders) {
for (const file of fs.readdirSync(folder).filter((v) => v.endsWith('.js'))) {
files.push(path.resolve(path.join(folder, file)));
}
}
for (const file of files) {
if (file == __filename) continue;
console.error('Checking', file);
const error = syntaxError(fs.readFileSync(file, 'utf8'), file, {
sourceType: 'module',
allowReturnOutsideFunction: true,
allowAwaitOutsideFunction: true,
});
if (error) assert.ok(error.length < 1, file + '\n\n' + error);
assert.ok(file);
console.log('Done', file);
}

0 comments on commit 94d130b

Please sign in to comment.