Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lint-license): add lint checker #5657

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"format:e2e": "prettier ./e2e/**/*.js --write --ignore-unknown",
"generate": "lerna run generate --loglevel success --scope \"@carbon/ibm-products\" --",
"lint": "run-p -s 'lint:*'",
"lint:license": "scripts/check-license.cjs -a",
"lint:license:staged": "scripts/check-license.cjs -w",
"lint:js": "eslint packages --fix",
"lint:styles": "stylelint '**/*.scss'",
"prepare": "husky install",
Expand Down Expand Up @@ -83,6 +85,8 @@
"eslint": "^8.56.0",
"eslint-config-carbon": "^2.20.0",
"eslint-plugin-ssr-friendly": "^1.3.0",
"gitignore-to-glob": "^0.3.0",
"globby": "^14.0.0",
"husky": "^9.0.5",
"jest": "^29.7.0",
"jest-canvas-mock": "2.5.2",
Expand Down Expand Up @@ -207,15 +211,17 @@
"!(examples/**/*)**/*.{js,jsx,ts,tsx}": [
"npx prettier --cache --write",
"npx eslint --fix",
"npx cspell --no-must-find-files"
"npx cspell --no-must-find-files",
"yarn lint:license:staged"
],
"**/*.scss": [
"npx prettier --cache --write",
"npx stylelint --allow-empty-input"
],
"!(examples/**/*).md": [
"npx prettier --cache --write",
"npx cspell --no-must-find-files"
"npx cspell --no-must-find-files",
"yarn lint:license:staged"
]
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import ProductiveCard from './ProductiveCard';
export { ProductiveCard };
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import MultiStepTearsheetWide from './CreateTearsheetWide';
export { MultiStepTearsheetWide };
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import GlobalHeader from './GlobalHeader';
export { GlobalHeader };
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import PageHeader from './PageHeader';
export { PageHeader };
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import SidePanel from './SidePanel';
export { SidePanel };
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import TearsheetNarrow from './TearsheetNarrow';
import TearsheetWide from './TearsheetWide';
export { TearsheetNarrow, TearsheetWide };
7 changes: 7 additions & 0 deletions packages/core/src/component-playground/components/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

export { GlobalHeader } from './GlobalHeader';
export { PageHeader } from './PageHeader';
export { ProductiveCard } from './Card';
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/component-playground/data/CardData.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

const CardData = {
1: {
label: 'Label 1 encapsulated',
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/component-playground/data/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

export { CardData } from './CardData';
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import React from 'react';

const componentName = 'ExampleCommunityComponent';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import React from 'react';
import { render } from '@testing-library/react';
import { Example } from '.';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

.example {
font-size: inherit;
}
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use './example';
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

export { default as Example } from './Example';
7 changes: 7 additions & 0 deletions packages/ibm-products-community/src/components/_index.scss
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use './Example/';
7 changes: 7 additions & 0 deletions packages/ibm-products-community/src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

export { default as Example } from './components';
7 changes: 7 additions & 0 deletions packages/ibm-products-community/src/index.scss
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@forward './components/';
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/react/scss/theme' as *;
@use '@carbon/react/scss/spacing' as *;
@use '@carbon/react/scss/motion' as *;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use 'sass:list';
@use 'sass:string';
@use '@carbon/react/scss/theme' as *;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use './conditionBuilderItem';
@use './conditionBuilderCondition';
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
* Licensed Materials - Property of IBM
* 5724-Q36
* (c) Copyright IBM Corp. 2021
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/spacing' as *;
@use '@carbon/styles/scss/theme';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
* Licensed Materials - Property of IBM
* 5724-Q36
* (c) Copyright IBM Corp. 2020
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use './variables';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
* Licensed Materials - Property of IBM
* 5724-Q36
* (c) Copyright IBM Corp. 2022
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '../../../global/styles/project-settings' as c4p-settings;
@use '@carbon/styles/scss/theme' as *;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
* Licensed Materials - Property of IBM
* 5724-Q36
* (c) Copyright IBM Corp. 2021
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '../../../global/styles/project-settings' as c4p-settings;
@use '@carbon/styles/scss/spacing' as *;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
* Licensed Materials - Property of IBM
* 5724-Q36
* (c) Copyright IBM Corp. 2020 - 2022
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/spacing' as *;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
* Licensed Materials - Property of IBM
* 5724-Q36
* (c) Copyright IBM Corp. 2020
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/spacing' as *;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
* Licensed Materials - Property of IBM
* 5724-Q36
* (c) Copyright IBM Corp. 2021
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/spacing' as *;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
* Licensed Materials - Property of IBM
* 5724-Q36
* (c) Copyright IBM Corp. 2021
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/spacing' as *;
Expand Down
7 changes: 7 additions & 0 deletions packages/ibm-products-styles/src/config-dev.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@forward './global/styles/project-settings' with (
$pkg-prefix: 'dev-prefix--c4p'
);
7 changes: 7 additions & 0 deletions packages/ibm-products-styles/src/config.scss
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@forward './global/styles/project-settings';
Loading
Loading