diff --git a/build.js b/build.js index a99258a..63f38b3 100644 --- a/build.js +++ b/build.js @@ -7,7 +7,7 @@ import rehypeParse from 'rehype-parse' import {selectAll} from 'hast-util-select' import {toString} from 'hast-util-to-string' -var endpoint = +const endpoint = 'https://www.readabilityformulas.com/articles/spache-formula-word-list.php' https.get(endpoint, onresponse) @@ -23,9 +23,9 @@ function onresponse(response) { * @param {Buffer} buf */ function onconcat(buf) { - var tree = unified().use(rehypeParse).parse(buf) + const tree = unified().use(rehypeParse).parse(buf) - var values = selectAll('td p', tree) + const values = selectAll('td p', tree) .map((/** @type {import('hast').Element} */ d) => toString(d)) .join('|') .replace(/\\/g, "'") @@ -44,7 +44,7 @@ function onconcat(buf) { fs.writeFile( 'index.js', - 'export var spache = ' + JSON.stringify(values, null, 2) + '\n', + 'export const spache = ' + JSON.stringify(values, null, 2) + '\n', bail ) } diff --git a/index.js b/index.js index 2e34567..178151e 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -export var spache = [ +export const spache = [ 'a', 'able', 'about', diff --git a/package.json b/package.json index c72dbff..5715b78 100644 --- a/package.json +++ b/package.json @@ -65,12 +65,7 @@ "trailingComma": "none" }, "xo": { - "prettier": true, - "rules": { - "import/no-mutable-exports": "off", - "no-var": "off", - "prefer-arrow-callback": "off" - } + "prettier": true }, "remarkConfig": { "plugins": [