tests/lib/plugin.js
/**
 * Helper function which creates CLIEngine instance with enabled/disabled autofix feature.
 * @param {string} fixtureConfigName ESLint JSON config fixture filename.
 * @param {boolean} [isAutofixEnabled=false] Whether to enable autofix feature.
 * @returns {CLIEngine} CLIEngine instance to execute in tests.
 */
Helper function which creates CLIEngine instance with enabled/disabled autofix feature.
@param {string} fixtureConfigName ESLint JSON config fixture filename.
@param {boolean} [isAutofixEnabled=false] Whether to enable autofix feature.
@returns {CLIEngine} CLIEngine instance to execute in tests.
Helper function which creates CLIEngine instance with enabled / disabled autofix feature . @param { string } fixtureConfigName ESLint JSON config fixture filename . @param { boolean } [ isAutofixEnabled = false ] Whether to enable autofix feature . @returns { CLIEngine } CLIEngine instance to execute in tests .
function initCLI(fixtureConfigName, isAutofixEnabled) {
    const fix = isAutofixEnabled || false;
    const cli = new CLIEngine({
        fix,
        ignore: false,
        useEslintrc: false,
        configFile: path.resolve(__dirname, "../fixtures/", fixtureConfigName)
    });
    cli.addPlugin("markdown", plugin);
    return cli;
}
function initCLI ( fixtureConfigName , isAutofixEnabled ) { const fix = isAutofixEnabled || false ; const cli = new CLIEngine ( { fix , ignore : false , useEslintrc : false , configFile : path . resolve ( __dirname , "../fixtures/" , fixtureConfigName ) } ) ; cli . addPlugin ( "markdown" , plugin ) ; return cli ; }
Helper function which creates CLIEngine instance with enabled/disabled autofix feature.
Helper function which creates CLIEngine instance with enabled / disabled autofix feature .