Skip to content

Commit ea1e0a6

Browse files
committed
refactor(conformance): fix lint errors in conformance update fixtures script (#13187)
Fix lint errors in script which updates transformer fixtures.
1 parent 72880a7 commit ea1e0a6

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

oxlintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"napi/**", // TODO
2727
"editors/vscode/tests/**", // TODO,
2828
"tasks/lint_rules/src/oxlint-rules.mjs", // TODO
29-
"tasks/transform_conformance/update_fixtures.mjs", // TODO
3029
"tasks/lint_rules/src/main.mjs" // TODO
3130
]
3231
}

tasks/transform_conformance/update_fixtures.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ const EXTERNAL_HELPERS_VERSION = '7.100.0';
4949

5050
for (const packageName of PACKAGES) {
5151
const dirPath = pathJoin(PACKAGES_PATH, packageName, 'test/fixtures');
52+
// oxlint-disable-next-line no-await-in-loop
5253
await updateDir(dirPath, {}, false);
5354
}
5455

5556
/**
5657
* Update fixtures in directory, and its sub-directories.
5758
* @param {string} dirPath - Path to directory containing fixtures
58-
* @param {Object} options - Transform options from parent directory
59+
* @param {object} options - Transform options from parent directory
5960
* @param {boolean} hasChangedOptions - `true` if transform options from parent directory have changed
60-
* @returns {undefined}
61+
* @returns {Promise<undefined>}
6162
*/
6263
async function updateDir(dirPath, options, hasChangedOptions) {
6364
if (IGNORED_FIXTURES.some(p => dirPath.endsWith(p))) {
@@ -110,6 +111,7 @@ async function updateDir(dirPath, options, hasChangedOptions) {
110111
// Process subfolders
111112
for (const filename of dirFiles) {
112113
const path = pathJoin(dirPath, filename);
114+
// oxlint-disable-next-line no-await-in-loop
113115
await updateDir(path, options, hasChangedOptions);
114116
}
115117
}
@@ -179,10 +181,10 @@ function ensureAllClassPluginsEnabled(options) {
179181
}
180182

181183
/**
182-
* Transform input with Babel and save to output file.
184+
* Transform input with Babel.
183185
* @param {string} inputPath - Path of input file
184-
* @param {Object} options - Transform options
185-
* @returns {undefined}
186+
* @param {object} options - Transform options
187+
* @returns {Promise<string>}
186188
*/
187189
async function transform(inputPath, options) {
188190
options = {
@@ -243,7 +245,7 @@ function getName(stringOrArray) {
243245
/**
244246
* Backup file.
245247
* @param {string} path - Original path
246-
* @returns {undefined}
248+
* @returns {Promise<undefined>}
247249
*/
248250
async function backupFile(path) {
249251
const ext = extname(path),

0 commit comments

Comments
 (0)