Skip to content

Commit

Permalink
feat(dep): upgrade unist-util-visit to latest & update to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahacad committed Jul 7, 2021
1 parent 711312c commit 5239cf0
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 38 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const visit = require('unist-util-visit');
const spawnSync = require('child_process').spawnSync;
import { visit } from 'unist-util-visit';
import { spawnSync as spawnSync } from 'child_process';

function visitor(node) {
if (node.type == 'code' || node.type == 'inlineCode') {
Expand All @@ -15,8 +15,8 @@ function visitor(node) {
}
}

module.exports = function attacher() {
export default function attacher() {
return function transformer(tree) {
visit(tree, visitor);
};
};
}
70 changes: 43 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"homepage": "https://github.com/Ir1d/remark-clang-format#readme",
"dependencies": {
"clang-format": "^1.2.4",
"unist-util-visit": "^1.4.0"
"unist-util-visit": "^3.1.0"
},
"devDependencies": {
"ava": "^3.15.0",
Expand All @@ -32,5 +32,6 @@
"prettier": "^2.3.2",
"remark": "^13.0.0",
"remark-parse": "^9.0.0"
}
},
"type": "module"
}
9 changes: 4 additions & 5 deletions tests/tests.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const test = require('ava');
import test from 'ava';
import fs from 'fs';
import remark from 'remark';

const remark = require('remark');

const fs = require('fs');
const de = require('../index');
import de from '../index.js';

const in_1 = fs.readFileSync('tests/1.in.md');
const out_1 = fs.readFileSync('tests/1.out.md');
Expand Down

0 comments on commit 5239cf0

Please sign in to comment.