diff --git a/.eslintrc.js b/.eslintrc.js index 0feb469..831aeb0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,7 +12,6 @@ module.exports = { "plugin:promise/recommended", "plugin:regexp/recommended", "plugin:security/recommended", - "plugin:security-node/recommended", "prettier", ], overrides: [ @@ -40,14 +39,7 @@ module.exports = { // Explicitly tell ESLint to parse JavaScript as CommonJS, as airbnb-base sets this to "modules" for ECMAScript sourceType: "script", }, - plugins: [ - "import", - "jsdoc", - "promise", - "regexp", - "security", - "security-node", - ], + plugins: ["import", "jsdoc", "promise", "regexp", "security"], root: true, rules: { "@eslint-community/eslint-comments/disable-enable-pair": "off", diff --git a/README.md b/README.md index da6890a..b6b22b4 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,10 @@ const { UnRTF } = require("node-unrtf"); ### Async Await -Example of an `async` `await` call to convert an RTF file to HTML, and then output the result to console: +Example of an `async` `await` call to convert an RTF file to HTML in an ESM environment: ```js -const { UnRTF } = require("node-unrtf"); +import { UnRTF } from "node-unrtf"; const file = "test_document.rtf"; const unRtf = new UnRTF(); @@ -74,7 +74,7 @@ console.log(res); ### Promise chaining -Example of calling unRTF.convert with a promise chain: +Example of calling unRTF.convert with a promise chain in a CJS environment: ```js const { UnRTF } = require("node-unrtf"); diff --git a/package.json b/package.json index 48f3c63..1db8271 100644 --- a/package.json +++ b/package.json @@ -70,28 +70,27 @@ "testTimeout": 10000 }, "devDependencies": { - "@commitlint/cli": "^18.2.0", - "@commitlint/config-conventional": "^18.1.0", + "@commitlint/cli": "^18.4.3", + "@commitlint/config-conventional": "^18.4.3", "@eslint-community/eslint-plugin-eslint-comments": "^4.1.0", - "@types/jest": "^29.5.5", - "eslint": "^8.50.0", + "@types/jest": "^29.5.10", + "eslint": "^8.54.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^9.0.0", - "eslint-plugin-import": "^2.28.1", - "eslint-plugin-jest": "^27.4.0", - "eslint-plugin-jsdoc": "^46.8.2", + "eslint-plugin-import": "^2.29.0", + "eslint-plugin-jest": "^27.6.0", + "eslint-plugin-jsdoc": "^46.9.0", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-regexp": "^2.1.1", "eslint-plugin-security": "^1.7.1", - "eslint-plugin-security-node": "^1.1.1", "husky": "^8.0.3", "is-html": "^2.0.0", "jest": "^29.7.0", "jsdoc-to-markdown": "^8.0.0", "license-checker": "^25.0.1", - "prettier": "^3.0.3", + "prettier": "^3.1.0", "spdx-copyleft": "^1.0.0", - "typescript": "^5.2.2" + "typescript": "^5.3.2" }, "dependencies": { "semver": "^7.5.4", diff --git a/src/index.test.js b/src/index.test.js index 3528643..4330872 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -115,11 +115,11 @@ describe("Convert function", () => { { outputVt: true }, ]); + const unRtf = new UnRTF(testBinaryPath); + expect.assertions(optionCombos.length); await Promise.all( optionCombos.map(async (options) => { - const unRtf = new UnRTF(testBinaryPath); - await expect( unRtf.convert(file, options) ).resolves.toStrictEqual(expect.any(String));