Skip to content

Commit

Permalink
Merge pull request #3 from viqueen/issue/LABSET-121-rename-and-releas…
Browse files Browse the repository at this point in the history
…e-for-labset

LABSET-121 rename and release for labset
  • Loading branch information
viqueen authored May 26, 2023
2 parents ffa2a5e + c7cb709 commit b349726
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: eslint-plugin-license-notice Build and Test
name: "@labset-eslint/eslint-plugin Build and Test"
on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: eslint-plugin-license-notice Publish
name: "@labset-eslint/eslint-plugin Publish"

on:
release:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: '<year>',
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]: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": "[email protected]:viqueen/eslint-plugin.git",
"author": "Hasnae R. <>",
"license": "Apache-2.0",
"private": false,
Expand Down
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/include-rule.ts → src/license-notice-rule/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -135,4 +135,4 @@ const includeRule = () => {
};
};

export { includeRule };
export { licenseNoticeRule };

0 comments on commit b349726

Please sign in to comment.