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'
|
import syntax from 'micromark-extension-directive'
|
||||||
|
import fromMarkdown from 'mdast-util-directive/from-markdown.js'
|
||||||
var syntax = require('micromark-extension-directive')
|
import toMarkdown from 'mdast-util-directive/to-markdown.js'
|
||||||
var fromMarkdown = require('mdast-util-directive/from-markdown')
|
|
||||||
var toMarkdown = require('mdast-util-directive/to-markdown')
|
|
||||||
|
|
||||||
var warningIssued
|
var warningIssued
|
||||||
|
|
||||||
module.exports = directive
|
export default function remarkDirective() {
|
||||||
|
|
||||||
function directive() {
|
|
||||||
var data = this.data()
|
var data = this.data()
|
||||||
|
|
||||||
// Old remark.
|
// Old remark.
|
||||||
|
|
|
@ -24,9 +24,10 @@
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
||||||
],
|
],
|
||||||
"types": "types/index.d.ts",
|
"sideEffects": false,
|
||||||
|
"type": "module",
|
||||||
|
"main": "index.js",
|
||||||
"files": [
|
"files": [
|
||||||
"types/index.d.ts",
|
|
||||||
"index.js"
|
"index.js"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -66,6 +67,8 @@
|
||||||
"prettier": true,
|
"prettier": true,
|
||||||
"esnext": false,
|
"esnext": false,
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"no-var": "off",
|
||||||
|
"prefer-arrow-callback": "off",
|
||||||
"unicorn/no-array-callback-reference": "off",
|
"unicorn/no-array-callback-reference": "off",
|
||||||
"unicorn/prefer-optional-catch-binding": "off"
|
"unicorn/prefer-optional-catch-binding": "off"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
'use strict'
|
import fs from 'fs'
|
||||||
|
import path from 'path'
|
||||||
var fs = require('fs')
|
import test from 'tape'
|
||||||
var path = require('path')
|
import vfile from 'to-vfile'
|
||||||
var test = require('tape')
|
import unified from 'unified'
|
||||||
var vfile = require('to-vfile')
|
import remark from 'remark'
|
||||||
var unified = require('unified')
|
import not from 'not'
|
||||||
var remark = require('remark')
|
import hidden from 'is-hidden'
|
||||||
var not = require('not')
|
import directive from '../index.js'
|
||||||
var hidden = require('is-hidden')
|
|
||||||
var directive = require('..')
|
|
||||||
|
|
||||||
test('directive()', function (t) {
|
test('directive()', function (t) {
|
||||||
t.doesNotThrow(function () {
|
t.doesNotThrow(function () {
|
||||||
|
@ -23,7 +21,7 @@ test('directive()', function (t) {
|
||||||
})
|
})
|
||||||
|
|
||||||
test('fixtures', 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))
|
var entries = fs.readdirSync(base).filter(not(hidden))
|
||||||
|
|
||||||
t.plan(entries.length)
|
t.plan(entries.length)
|
||||||
|
|
Loading…
Add table
Reference in a new issue