From 37612646c91e564d0d05de6fbcc5eede0563b7eb Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 29 Nov 2021 18:42:40 +0000 Subject: [PATCH] chore(package/scripts): add `lint:licenses` (#155) --- .github/workflows/ci.yml | 2 + .husky/pre-commit | 2 +- package.json | 166 ++++++++++++++++++++------------------- 3 files changed, 87 insertions(+), 83 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2bf3231..1d3c7af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,8 @@ jobs: run: npm run lint - name: Run Prettier run: npm run lint:prettier:ci + - name: Run License Checker + run: npm run lint:licenses - name: Compile TypeScript Definition File run: npm run build diff --git a/.husky/pre-commit b/.husky/pre-commit index 44b7388..64380ef 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npm run lint:prettier:ci && npm test +npm run lint:prettier:ci && npm run lint:licenses && npm test diff --git a/package.json b/package.json index 988e390..0f7e2ea 100644 --- a/package.json +++ b/package.json @@ -1,84 +1,86 @@ { - "name": "node-unrtf", - "version": "2.0.5", - "description": "Asynchronous node.js wrapper for the UnRTF RTF conversion program", - "keywords": [ - "async", - "converter", - "html", - "latex", - "ps", - "rtf", - "rtf-converter", - "rtf-to-html", - "rtf-to-latex", - "rtf-to-ps", - "rtf-to-text", - "rtf-to-wpml", - "text", - "txt", - "unrtf", - "wpml" - ], - "main": "src/index.js", - "repository": "git+https://github.com/Fdawgs/node-unrtf.git", - "homepage": "https://github.com/Fdawgs/node-unrtf", - "bugs": { - "url": "https://github.com/Fdawgs/node-unrtf/issues" - }, - "license": "MIT", - "author": "Frazer Smith ", - "engines": { - "node": ">=12.0.0" - }, - "scripts": { - "build": "tsc", - "doc": "tsc && jsdoc2md src/index.js > API.md && npm run lint:prettier", - "jest": "jest --detectOpenHandles --runInBand", - "jest:coverage": "jest --coverage --runInBand", - "lint": "eslint . --cache --ext js,jsx --ignore-path .gitignore", - "lint:prettier": "prettier . --write --ignore-unknown", - "lint:prettier:ci": "prettier . --check --ignore-unknown", - "prepare": "husky install && rm -rf .git/hooks && ln -s ../.husky .git/hooks", - "test": "npm run lint && npm run jest" - }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, - "jest": { - "clearMocks": true, - "coverageReporters": [ - "text", - "lcovonly" - ], - "resetMocks": true, - "testEnvironment": "node", - "testTimeout": 10000 - }, - "devDependencies": { - "@commitlint/cli": "^15.0.0", - "@commitlint/config-conventional": "^15.0.0", - "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-prettier": "^8.1.0", - "eslint-plugin-import": "^2.25.2", - "eslint-plugin-jest": "^25.2.2", - "eslint-plugin-jsdoc": "^37.0.3", - "eslint-plugin-promise": "^5.1.1", - "eslint-plugin-security": "^1.4.0", - "eslint-plugin-security-node": "^1.0.14", - "husky": "^7.0.4", - "is-html": "^2.0.0", - "jest": "^27.3.1", - "jsdoc-to-markdown": "^7.1.0", - "prettier": "2.4.1", - "typescript": "^4.4.4" - }, - "dependencies": { - "file-type": "^16.5.3", - "semver": "^7.3.5", - "upath": "^2.0.1" - } + "name": "node-unrtf", + "version": "2.0.5", + "description": "Asynchronous node.js wrapper for the UnRTF RTF conversion program", + "keywords": [ + "async", + "converter", + "html", + "latex", + "ps", + "rtf", + "rtf-converter", + "rtf-to-html", + "rtf-to-latex", + "rtf-to-ps", + "rtf-to-text", + "rtf-to-wpml", + "text", + "txt", + "unrtf", + "wpml" + ], + "main": "src/index.js", + "repository": "git+https://github.com/Fdawgs/node-unrtf.git", + "homepage": "https://github.com/Fdawgs/node-unrtf", + "bugs": { + "url": "https://github.com/Fdawgs/node-unrtf/issues" + }, + "license": "MIT", + "author": "Frazer Smith ", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "doc": "tsc && jsdoc2md src/index.js > API.md && npm run lint:prettier", + "jest": "jest --detectOpenHandles --runInBand", + "jest:coverage": "jest --coverage --runInBand", + "lint": "eslint . --cache --ext js,jsx --ignore-path .gitignore", + "lint:licenses": "license-checker --direct --onlyAllow=\"0BSD;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT;Unlicense\" --production --summary", + "lint:prettier": "prettier . --write --ignore-unknown", + "lint:prettier:ci": "prettier . --check --ignore-unknown", + "prepare": "husky install && rm -rf .git/hooks && ln -s ../.husky .git/hooks", + "test": "npm run lint && npm run jest" + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "jest": { + "clearMocks": true, + "coverageReporters": [ + "text", + "lcovonly" + ], + "resetMocks": true, + "testEnvironment": "node", + "testTimeout": 10000 + }, + "devDependencies": { + "@commitlint/cli": "^15.0.0", + "@commitlint/config-conventional": "^15.0.0", + "eslint": "^7.32.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^8.1.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-jest": "^25.2.2", + "eslint-plugin-jsdoc": "^37.0.3", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-security-node": "^1.0.14", + "husky": "^7.0.4", + "is-html": "^2.0.0", + "jest": "^27.3.1", + "jsdoc-to-markdown": "^7.1.0", + "license-checker": "^25.0.1", + "prettier": "2.4.1", + "typescript": "^4.4.4" + }, + "dependencies": { + "file-type": "^16.5.3", + "semver": "^7.3.5", + "upath": "^2.0.1" + } }