Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Use ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 5, 2021
1 parent 7f3bdf6 commit 6ec8372
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
11 changes: 4 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
'use strict'
import syntax from 'micromark-extension-footnote'
import fromMarkdown from 'mdast-util-footnote/from-markdown.js'
import toMarkdown from 'mdast-util-footnote/to-markdown.js'

var syntax = require('micromark-extension-footnote')
var fromMarkdown = require('mdast-util-footnote/from-markdown')
var toMarkdown = require('mdast-util-footnote/to-markdown')
var warningIssued

module.exports = footnotes

function footnotes(options) {
export default function remarkFootnotes(options) {
var data = this.data()

// Old remark.
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,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 @@ -56,8 +57,7 @@
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node --conditions development test/index.js",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api",
"test-types": "dtslint types",
"test": "npm run format && npm run test-coverage && npm run test-types"
"test": "npm run format && npm run test-coverage"
},
"prettier": {
"tabWidth": 2,
Expand All @@ -71,6 +71,8 @@
"prettier": true,
"esnext": false,
"rules": {
"no-var": "off",
"prefer-arrow-callback": "off",
"unicorn/prefer-optional-catch-binding": "off",
"complexity": "off",
"no-self-compare": "off",
Expand Down
26 changes: 12 additions & 14 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
'use strict'

var fs = require('fs')
var path = require('path')
var test = require('tape')
var u = require('unist-builder')
var clean = require('unist-util-remove-position')
var vfile = require('to-vfile')
var unified = require('unified')
var parse = require('remark-parse')
var stringify = require('remark-stringify')
var remark2rehype = require('remark-rehype')
var html = require('rehype-stringify')
var footnotes = require('..')
import fs from 'fs'
import path from 'path'
import test from 'tape'
import u from 'unist-builder'
import clean from 'unist-util-remove-position'
import vfile from 'to-vfile'
import unified from 'unified'
import parse from 'remark-parse'
import stringify from 'remark-stringify'
import remark2rehype from 'remark-rehype'
import html from 'rehype-stringify'
import footnotes from '../index.js'

var base = path.join('test', 'fixtures')

Expand Down

0 comments on commit 6ec8372

Please sign in to comment.