Skip to content

Commit

Permalink
Use ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 6, 2021
1 parent 93b0afb commit 6c518d8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
12 changes: 4 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
'use strict'

var syntax = require('micromark-extension-gfm')
var fromMarkdown = require('mdast-util-gfm/from-markdown')
var toMarkdown = require('mdast-util-gfm/to-markdown')
import syntax from 'micromark-extension-gfm'
import fromMarkdown from 'mdast-util-gfm/from-markdown.js'
import toMarkdown from 'mdast-util-gfm/to-markdown.js'

var warningIssued

module.exports = gfm

function gfm(options) {
export default function remarkGfm(options) {
var data = this.data()

// Old remark.
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"types": "types/index.d.ts",
"sideEffects": false,
"type": "module",
"main": "index.js",
"files": [
"types/index.d.ts",
"index.js"
],
"dependencies": {
Expand Down Expand Up @@ -69,6 +70,8 @@
"prettier": true,
"esnext": false,
"rules": {
"no-var": "off",
"prefer-arrow-callback": "off",
"unicorn/no-fn-reference-in-iterator": "off",
"unicorn/prefer-optional-catch-binding": "off"
}
Expand Down
22 changes: 10 additions & 12 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
'use strict'

var fs = require('fs')
var path = require('path')
var test = require('tape')
var vfile = require('to-vfile')
var unified = require('unified')
var remark = require('remark')
var hidden = require('is-hidden')
var stringWidth = require('string-width')
var gfm = require('..')
import fs from 'fs'
import path from 'path'
import test from 'tape'
import vfile from 'to-vfile'
import unified from 'unified'
import remark from 'remark'
import hidden from 'is-hidden'
import stringWidth from 'string-width'
import gfm from '../index.js'

test('gfm()', function (t) {
t.doesNotThrow(function () {
Expand All @@ -23,7 +21,7 @@ test('gfm()', function (t) {
})

test('fixtures', function (t) {
var base = path.join(__dirname, 'fixtures')
var base = path.join('test', 'fixtures')
var entries = fs.readdirSync(base)
var index = -1
var file
Expand Down

0 comments on commit 6c518d8

Please sign in to comment.