From a2b628ba7aa3e4f3ac826a835010c170699daa89 Mon Sep 17 00:00:00 2001 From: viqueen Date: Fri, 26 May 2023 17:51:07 +1000 Subject: [PATCH 1/5] LABSET-121: release under labset-eslint org --- README.md | 11 +++++++---- package.json | 8 ++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 888103c..61ac578 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,25 @@ -## eslint-plugin-license-notice +## eslint-plugin [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_eslint-plugin-license-notice&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=viqueen_eslint-plugin-license-notice) [![npm version](https://badge.fury.io/js/eslint-plugin-license-notice.svg)](https://badge.fury.io/js/eslint-plugin-license-notice) -Ensure all your source files include the relevant license header notice +A collection of eslint rules needed to ensure **labset** open-source packages are structured in a consistent way. + +It comes with: +- `license-notice` rule to enforce all source files include the relevant license header notice ### install it - with **npm** ```bash -npm install eslint-plugin-license-notice --save-dev +npm install @labset-eslint/eslint-plugin --save-dev ``` - with **yarn** ```bash -yarn add eslint-plugin-license-notice -D -W +yarn add @labset-eslint/eslint-plugin -D -W ``` ### use it diff --git a/package.json b/package.json index bafb3d5..0604ef8 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "@labset/eslint-plugin-license-notice", - "version": "1.1.0", - "description": "eslint plugin to ensure license notice/header is included across your files", - "repository": "git@github.com:viqueen/eslint-plugin-license-notice.git", + "name": "@labset-eslint/eslint-plugin", + "version": "1.2.0", + "description": "collection of eslint rules needed to ensure ts open-source packages structure is consistent", + "repository": "git@github.com:viqueen/eslint-plugin.git", "author": "Hasnae R. <>", "license": "Apache-2.0", "private": false, From 09769c161b1c5e60c69a7bc3e22b38be196b376e Mon Sep 17 00:00:00 2001 From: viqueen Date: Fri, 26 May 2023 17:55:41 +1000 Subject: [PATCH 2/5] LABSET-121: restructure for labset-eslint org and update doco --- CONTRIBUTING.md | 2 +- README.md | 7 ++++--- src/index.ts | 5 ++--- src/{ => license-notice-rule}/Apache-2.0-license.js.txt | 0 src/{include-rule.ts => license-notice-rule/index.ts} | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) rename src/{ => license-notice-rule}/Apache-2.0-license.js.txt (100%) rename src/{include-rule.ts => license-notice-rule/index.ts} (97%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c648f6c..dde834a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,7 @@ yarn build --watch ```bash cd my-other-package -yarn link eslint-plugin-license-notice +yarn link eslint-plugin-license-notice-rule ``` ### house-keeping diff --git a/README.md b/README.md index 61ac578..8ea6b6b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ A collection of eslint rules needed to ensure **labset** open-source packages are structured in a consistent way. It comes with: -- `license-notice` rule to enforce all source files include the relevant license header notice + +- `license-notice-rule` rule to enforce all source files include the relevant license header notice ### install it @@ -30,10 +31,10 @@ yarn add @labset-eslint/eslint-plugin -D -W module.exports = { ..., plugins: [ - 'license-notice', + '@labset-eslint/eslint-plugin', ], rules: { - 'license-notice/include': [ + '@labset-eslint/license-notice': [ 'error', { license: 'Apache-2.0', copyRightYear: '', diff --git a/src/index.ts b/src/index.ts index 8f5ef31..4f51aaa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,10 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { licenseNoticeRule } from './license-notice-rule'; -import { includeRule } from './include-rule'; - -const licenseNotice = includeRule(); +const licenseNotice = licenseNoticeRule(); const rules = { [licenseNotice.key]: licenseNotice.rule diff --git a/src/Apache-2.0-license.js.txt b/src/license-notice-rule/Apache-2.0-license.js.txt similarity index 100% rename from src/Apache-2.0-license.js.txt rename to src/license-notice-rule/Apache-2.0-license.js.txt diff --git a/src/include-rule.ts b/src/license-notice-rule/index.ts similarity index 97% rename from src/include-rule.ts rename to src/license-notice-rule/index.ts index 257987c..c8a08cf 100644 --- a/src/include-rule.ts +++ b/src/license-notice-rule/index.ts @@ -102,9 +102,9 @@ const handleProgram = (context: Rule.RuleContext) => (node: ESTree.Program) => { } }; -const includeRule = () => { +const licenseNoticeRule = () => { return { - key: 'include', + key: 'license-notice', rule: { meta: { docs: { @@ -135,4 +135,4 @@ const includeRule = () => { }; }; -export { includeRule }; +export { licenseNoticeRule }; From 593bed54b4c1eff16e8b1cda7ff98b79e59a450a Mon Sep 17 00:00:00 2001 From: viqueen Date: Fri, 26 May 2023 18:00:30 +1000 Subject: [PATCH 3/5] LABSET-121: fix up the doco --- CONTRIBUTING.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dde834a..fb74199 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,7 @@ yarn build --watch ```bash cd my-other-package -yarn link eslint-plugin-license-notice-rule +yarn link @labset-eslint/eslint-plugin ``` ### house-keeping diff --git a/README.md b/README.md index 8ea6b6b..2b46f4a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A collection of eslint rules needed to ensure **labset** open-source packages ar It comes with: -- `license-notice-rule` rule to enforce all source files include the relevant license header notice +- `license-notice` rule to enforce all source files include the relevant license header notice ### install it From bf638daf8f076157cc5cbd9b8bddca664fc05760 Mon Sep 17 00:00:00 2001 From: viqueen Date: Fri, 26 May 2023 18:04:17 +1000 Subject: [PATCH 4/5] LABSET-121: nit: use pacakge name in workflow --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/create-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9bedf92..bb7cb46 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,4 +1,4 @@ -name: eslint-plugin-license-notice Build and Test +name: @labset-eslint/eslint-plugin Build and Test on: push: branches: diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index f308ac1..44fa519 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -1,4 +1,4 @@ -name: eslint-plugin-license-notice Publish +name: @labset-eslint/eslint-plugin Publish on: release: From c7cb709d3e0de526fea5564cdbc51989c713bf47 Mon Sep 17 00:00:00 2001 From: viqueen Date: Fri, 26 May 2023 18:04:51 +1000 Subject: [PATCH 5/5] LABSET-121: nit: use pacakge name in workflow --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/create-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bb7cb46..da4ff36 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,4 +1,4 @@ -name: @labset-eslint/eslint-plugin Build and Test +name: "@labset-eslint/eslint-plugin Build and Test" on: push: branches: diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 44fa519..013eb1e 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -1,4 +1,4 @@ -name: @labset-eslint/eslint-plugin Publish +name: "@labset-eslint/eslint-plugin Publish" on: release: