forked from mirrors/gecko-dev
After implementing vendoring in part 1, it's time to run it! This patch was broken out from part 1 to isolate very tedious portion of the review. Most of this patch is composed of: 1. Generated CTS test files from part 1. 2. A massive wall of test expectation management acknowledging current passes and failures. Currently, Linux and Windows are expected to pass with these noted failures. Many, but not all, current failures on MacOS are recorded. Differential Revision: https://phabricator.services.mozilla.com/D169953
23 lines
615 B
JavaScript
23 lines
615 B
JavaScript
const path = require('path');
|
|
const resolve = require('resolve')
|
|
|
|
// 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 }
|
|
}
|
|
}
|