How to use the module-alias.reset function in module-alias

To help you get started, we’ve selected a few module-alias examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github humanmade / linter-bot / src / linters / eslint / index.js View on Github external
try {
			output = run( engine, codepath );
		} catch ( err ) {
			if ( err.messageTemplate === 'no-config-found' ) {
				// Try with default configuration.
				const engine = new CLIEngine( { ...options, configFile: `${ standardPath }/index.js` } );
				console.log( 'Running eslint with default config on path', codepath );
				output = run( engine, codepath );
			} else {
				console.log( err );
				throw err;
			}
		}

		// Reset path loader.
		moduleAlias.reset();
		Module._findPath = origFindPath;

		resolve( formatOutput( output, codepath ) );
	} );
};

module-alias

Create aliases of directories and register custom module paths

MIT
Latest version published 11 months ago

Package Health Score

77 / 100
Full package analysis