diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9bedf92..da4ff36 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..013eb1e 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: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c648f6c..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 +yarn link @labset-eslint/eslint-plugin ``` ### house-keeping diff --git a/README.md b/README.md index 888103c..2b46f4a 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,26 @@ -## 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 @@ -27,10 +31,10 @@ yarn add eslint-plugin-license-notice -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/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, 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 };