From 42ddb3ecd764d6a64be9a925ee9ed41d24bab590 Mon Sep 17 00:00:00 2001 From: ssube Date: Mon, 11 Nov 2019 19:55:57 -0600 Subject: [PATCH] feat(rules): add npm package --- rules/gitlab-ci.yml | 2 +- rules/npm-package.yml | 55 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 rules/npm-package.yml diff --git a/rules/gitlab-ci.yml b/rules/gitlab-ci.yml index e7e1101..d8ff38d 100644 --- a/rules/gitlab-ci.yml +++ b/rules/gitlab-ci.yml @@ -79,7 +79,7 @@ rules: type: string - name: gitlab-top-level - desc: should only have includes and stages at the top level scope + desc: should only have includes and stages at the top level level: info tags: - gitlab diff --git a/rules/npm-package.yml b/rules/npm-package.yml new file mode 100644 index 0000000..c7977f7 --- /dev/null +++ b/rules/npm-package.yml @@ -0,0 +1,55 @@ +name: npm-package +rules: + - name: npm-package-license + desc: packages should have attribution information + level: info + tags: + - npm-package + - important + + check: + type: object + required: [author, license, main, version] + properties: + author: + type: string + license: + type: string + main: + type: string + version: + type: string + + - name: npm-package-publish + desc: packages should specify the registry to which they publish + level: info + tags: + - npm-package + - optional + + check: + type: object + required: [publishConfig] + properties: + publishConfig: + type: object + required: [registry] + properties: + registry: + type: string + + - name: npm-package-keywords + desc: packages should have normalized keywords + level: info + tags: + - npm-package + - optional + + check: + type: object + required: [keywords] + properties: + keywords: + type: array + items: + type: string \ No newline at end of file