diff --git a/.gitignore b/.gitignore index 67c47b9..33d4929 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ -.DS_Store -*.log coverage/ -dist/ node_modules/ +.DS_Store +*.log yarn.lock diff --git a/.prettierignore b/.prettierignore index 3d25895..cebe81f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,2 @@ coverage/ -dist/ *.md diff --git a/src/index.js b/index.js similarity index 87% rename from src/index.js rename to index.js index c80fb37..4e40f85 100644 --- a/src/index.js +++ b/index.js @@ -2,12 +2,13 @@ let warningIssued const defaults = {2: {before: 2}} -export default function (options) { +export default function remarkHeadingGap(options) { const data = this.data() const gaps = {...defaults, ...options} const headingGap = {join: [betweenHeading]} - /* istanbul ignore next - old remark. */ + // Old remark. + /* c8 ignore next 11 */ if ( !warningIssued && this.Compiler && @@ -20,7 +21,8 @@ export default function (options) { ) } - /* istanbul ignore next - other extensions */ + // Other extensions + /* c8 ignore next */ if (!data.toMarkdownExtensions) data.toMarkdownExtensions = [] data.toMarkdownExtensions.push(headingGap) diff --git a/package.json b/package.json index 15eddd0..3919156 100644 --- a/package.json +++ b/package.json @@ -27,18 +27,13 @@ "Ben Briggs (http://beneb.info)", "Titus Wormer (https://wooorm.com)" ], - "main": "dist/index.js", - "module": "src/index.js", + "sideEffects": false, + "type": "module", + "main": "index.js", "files": [ - "dist", - "src/index.js" + "index.js" ], "devDependencies": { - "@babel/cli": "^7.0.0", - "@babel/core": "^7.0.0", - "@babel/preset-env": "^7.0.0", - "@babel/register": "^7.0.0", - "babel-plugin-add-module-exports": "^1.0.0", "c8": "^7.0.0", "prettier": "^2.0.0", "remark": "^13.0.0", @@ -48,21 +43,10 @@ "xo": "^0.37.0" }, "scripts": { - "prepublishOnly": "npm run compile", "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", - "compile": "babel src --out-dir dist --ignore src/**/__tests__", "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": "npm run compile && npm run format && npm run test-coverage" - }, - "browserslist": "> 2.5%, node 6", - "babel": { - "presets": [ - "@babel/preset-env" - ], - "plugins": [ - "add-module-exports" - ] + "test": "npm run format && npm run test-coverage" }, "prettier": { "tabWidth": 2, @@ -73,10 +57,7 @@ "trailingComma": "none" }, "xo": { - "prettier": true, - "rules": { - "import/no-anonymous-default-export": "off" - } + "prettier": true }, "#": "this plugin is currently not turned on while remark is updating", "remarkConfig": { diff --git a/test/index.js b/test/index.js index c35315c..3717c81 100644 --- a/test/index.js +++ b/test/index.js @@ -1,10 +1,10 @@ -const fs = require('fs') -const path = require('path') -const test = require('tape') -const remark = require('remark') -const plugin = require('../dist/index.js') +import fs from 'fs' +import path from 'path' +import test from 'tape' +import remark from 'remark' +import plugin from '../index.js' -const base = path.join(__dirname, 'fixtures') +const base = path.join('test', 'fixtures') const specs = {}