Use ESM
This commit is contained in:
parent
1d5afb9f28
commit
0b9dc4284e
3 changed files with 19 additions and 22 deletions
12
index.js
12
index.js
|
@ -1,14 +1,10 @@
|
|||
'use strict'
|
||||
|
||||
var syntax = require('micromark-extension-directive')
|
||||
var fromMarkdown = require('mdast-util-directive/from-markdown')
|
||||
var toMarkdown = require('mdast-util-directive/to-markdown')
|
||||
import syntax from 'micromark-extension-directive'
|
||||
import fromMarkdown from 'mdast-util-directive/from-markdown.js'
|
||||
import toMarkdown from 'mdast-util-directive/to-markdown.js'
|
||||
|
||||
var warningIssued
|
||||
|
||||
module.exports = directive
|
||||
|
||||
function directive() {
|
||||
export default function remarkDirective() {
|
||||
var data = this.data()
|
||||
|
||||
// Old remark.
|
||||
|
|
|
@ -24,9 +24,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": {
|
||||
|
@ -66,6 +67,8 @@
|
|||
"prettier": true,
|
||||
"esnext": false,
|
||||
"rules": {
|
||||
"no-var": "off",
|
||||
"prefer-arrow-callback": "off",
|
||||
"unicorn/no-array-callback-reference": "off",
|
||||
"unicorn/prefer-optional-catch-binding": "off"
|
||||
},
|
||||
|
|
|
@ -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 not = require('not')
|
||||
var hidden = require('is-hidden')
|
||||
var directive = 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 not from 'not'
|
||||
import hidden from 'is-hidden'
|
||||
import directive from '../index.js'
|
||||
|
||||
test('directive()', function (t) {
|
||||
t.doesNotThrow(function () {
|
||||
|
@ -23,7 +21,7 @@ test('directive()', function (t) {
|
|||
})
|
||||
|
||||
test('fixtures', function (t) {
|
||||
var base = path.join(__dirname, 'fixtures')
|
||||
var base = path.join('test', 'fixtures')
|
||||
var entries = fs.readdirSync(base).filter(not(hidden))
|
||||
|
||||
t.plan(entries.length)
|
||||
|
|
Loading…
Add table
Reference in a new issue