<commit_before>const {getOptions} = require('loader-utils')
const mdx = require('@mdx-js/mdx')
const octicons = require('@primer/octicons')

const emoji = require('remark-emoji')
const images = require('remark-images')
const rehypePrism = require('./rehype-prism')
const textr = require('remark-textr')
const toc = require('remark-toc')
const erbToHTML = require('./erb-to-html')

const mdxExportJSONByDefault = require('mdx-constant')
const grayMatter = require('gray-matter')
const typographicBase = require('typographic-base')

module.exports = async function(source) {
  let result
  const {data, content: mdxContent} = grayMatter(source)
  const callback = this.async()

  const options = Object.assign(
    {
      mdPlugins: [
        [toc, {heading: '(table of|section)? contents'}],
        images,
        emoji,
        [textr, {plugins: [typographicBase]}],
        [
          erbToHTML,
          {
            converters: {
              /* eslint-disable camelcase, no-unused-vars */
              octicon: ([icon], attrs) => {
                if (octicons[icon]) {
                  return octicons[icon].toSVG(attrs)
                } else {
                  throw new Error(`No such octicon: "${icon}"`)
                }
              },
              avatar_for: ([username, size], kwargs) => {
                const name = username === 'current_user' ? 'github' : username
                const attrs = Object.entries(kwargs)
                  .map(([key, value]) => ` ${key}="${value}"`)
                  .join(' ')
                const s = size * 2
                return `<img src="https://github.com/${name}.png?s=${s}" width="${size}" height="${size}"${attrs}>`
              }
              /* eslint-enable */
            }
          }<commit_msg>tweak eslint disables<commit_after>const {getOptions} = require('loader-utils')
const mdx = require('@mdx-js/mdx')
const octicons = require('@primer/octicons')

const emoji = require('remark-emoji')
const images = require('remark-images')
const rehypePrism = require('./rehype-prism')
const textr = require('remark-textr')
const toc = require('remark-toc')
const erbToHTML = require('./erb-to-html')

const mdxExportJSONByDefault = require('mdx-constant')
const grayMatter = require('gray-matter')
const typographicBase = require('typographic-base')

module.exports = async function(source) {
  let result
  const {data, content: mdxContent} = grayMatter(source)
  const callback = this.async()

  const options = Object.assign(
    {
      mdPlugins: [
        [toc, {heading: '(table of|section)? contents'}],
        images,
        emoji,
        [textr, {plugins: [typographicBase]}],
        [
          erbToHTML,
          {
            converters: {
              octicon: ([icon], attrs) => {
                if (octicons[icon]) {
                  return octicons[icon].toSVG(attrs)
                } else {
                  throw new Error(`No such octicon: "${icon}"`)
                }
              },
              // eslint-disable-next-line camelcase
              avatar_for: ([username, size], kwargs) => {
                const name = username === 'current_user' ? 'github' : username
                const attrs = Object.entries(kwargs)
                  .map(([key, value]) => ` ${key}="${value}"`)
                  .join(' ')
                const s = size * 2
                return `<img src="https://github.com/${name}.png?s=${s}" width="${size}" height="${size}"${attrs}>`
              }
            }
          }
{'fraction_non_alphanumeric': 0.1532784558614817, 'fraction_numerical': 0.0005676979846721544, 'mean_word_length': 2.0993843447669307, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7011991', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1018, 'n_words': 218}