eslint-plugin-mdx
Version:
ESLint Plugin for MDX
17 lines • 857 B
JavaScript
import { cjsRequire } from '../helpers.js';
export const processorOptions = {};
const linterPath = Object.keys(cjsRequire.cache).find(path => /([/\\])eslint\1lib(?:\1linter){2}\.js$/.test(path));
if (!linterPath) {
throw new Error('Could not find ESLint Linter in require cache');
}
const ESLinter = cjsRequire(linterPath).Linter;
const { verify } = ESLinter.prototype;
ESLinter.prototype.verify = function (code, config, options) {
const settings = ((config.extractConfig?.(typeof options === 'undefined' || typeof options === 'string'
? options
: options.filename) ?? config).settings ?? {});
processorOptions.lintCodeBlocks = settings['mdx/code-blocks'] === true;
processorOptions.languageMapper = settings['mdx/language-mapper'];
return verify.call(this, code, config, options);
};
//# sourceMappingURL=options.js.map