From 08726a9777f2fd29ef2c9943405962d399046643 Mon Sep 17 00:00:00 2001 From: Moritz Jacobs Date: Mon, 3 Feb 2020 11:53:20 +0100 Subject: [PATCH] fix(readme): Add missing parts of the README --- README.md | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fd7dda9..658cfa9 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ Enforceable standards for your package.json scripts – like eslint for `npm run ![dependency badge](https://img.shields.io/librariesio/release/npm/scriptlint) ![npm version badge](https://img.shields.io/npm/v/scriptlint) -**[tl;dr](#tldr)** - ## Intro There are quite a few pitfalls when it comes to using `package.json` scripts: @@ -66,9 +64,12 @@ uses-allowed-namespace script name should start with one of the allowed name Usage: scriptlint [options] Options: - -s, --strict strict mode - -f, --fix autofixing - -h, --help output usage information + -V, --version output the version number + -s, --strict strict mode + -j, --json JSON output + -c, --config inspect the config + -f, --fix autofixing + -h, --help output usage information ``` ### Project configuration @@ -81,6 +82,8 @@ This is the default: { "strict": false, "fix": false, + "config": false, + "json": false, "rules": {}, "ignoreScripts": [], "customRules": [] @@ -103,6 +106,32 @@ Turn a rule on/off like this: } ``` +#### `json` + +Output the issues in a json format + +```json +[ + … + { + "message": "Use of unix double ampersand (&&) in script 'test' is not allowed, consider using npm-run-all/run-s (no-unix-double-ampersand)", + "type": "warning", + "affected": "test" + } + … +] +``` + +#### `config` + +Print the config as json for debugging purposes. + +#### `fix` + +🚨 **This alters the contents of your `package.json`, only use it in a version controlled environment!** + +Attempt to fix all found issues. Not every rule has a autofix function ready, but some do. + #### ignore scripts ```json @@ -288,6 +317,3 @@ Since npm does it, we should do it: ``` Then run with `yarn test:lint:scripts` to see the problems in that project's package scripts. - - -## tdlr \ No newline at end of file