1
0
Fork 0
firefox/dom/webgpu/tests/cts/checkout/.eslint-resolver.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

24 lines
678 B
JavaScript

const path = require('path');
const resolve = require('resolve'); // eslint-disable-line node/no-extraneous-require
// Implements the following resolver spec:
// https://github.com/benmosher/eslint-plugin-import/blob/master/resolvers/README.md
exports.interfaceVersion = 2;
exports.resolve = function (source, file, config) {
if (resolve.isCore(source)) return { found: true, path: null };
source = source.replace(/\.js$/, '.ts');
try {
return {
found: true,
path: resolve.sync(source, {
extensions: [],
basedir: path.dirname(path.resolve(file)),
...config,
}),
};
} catch (err) {
return { found: false };
}
};