Skip to content

Commit

Permalink
chore: add commitlint, prettier, stylelint
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Sep 25, 2024
1 parent b5253c7 commit c05b789
Show file tree
Hide file tree
Showing 13 changed files with 1,716 additions and 37 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Cache node_modules
- uses: actions/setup-node@v4
with:
Expand All @@ -27,4 +27,6 @@ jobs:
run: yarn

# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
- run: npx nx affected -t lint test build --base=origin/main --head=origin/${{ github.head_ref || github.ref_name }}
- run:
npx nx affected -t build --base=origin/main --head=origin/${{
github.head_ref || github.ref_name }}
82 changes: 79 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,93 @@
"license": "MIT",
"scripts": {
"build": "nx run-many -t build",
"format": "prettier --cache --write '**/*.{js,md,scss,ts,tsx}' '!**/{build,es,lib,storybook,ts,umd,dist}/**'"
"clean": "nx reset && rimraf node_modules",
"format": "prettier --cache --write '**/*.{js,md,scss,ts,tsx}' '!**/{build,es,lib,storybook,ts,umd,dist}/**'",
"lint": "nx run-many -t lint --flag unstable_ts_config",
"lint:styles": "stylelint '**/*.scss' --report-needless-disables --report-invalid-scope-disables"
},
"private": true,
"dependencies": {},
"devDependencies": {
"@nx/js": "^19.6.4",
"eslint": "^9.0.0",
"jiti": "^2.0.0",
"lint-staged": "^15.0.0",
"nx": "^19.6.4",
"prettier": "^2.8.8",
"prettier-config-carbon": "^0.11.0"
"prettier-config-carbon": "^0.11.0",
"rimraf": "^5.0.0",
"stylelint": "^15.0.0",
"stylelint-config-carbon": "^1.18.0"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"header-max-length": [
2,
"always",
72
],
"body-max-line-length": [
2,
"always",
80
],
"scope-case": [
0,
"always",
"lower-case"
],
"type-enum": [
2,
"always",
[
"build",
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"test",
"style"
]
]
}
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": [
"prettier --cache --write"
],
"**/*.scss": [
"prettier --cache --write",
"stylelint --report-needless-disables --report-invalid-scope-disables --allow-empty-input"
],
"!(*sass).md": [
"prettier --cache --write"
]
},
"stylelint": {
"extends": [
"stylelint-config-carbon"
],
"overrides": [
{
"files": [
"src/components/**/*.scss"
],
"rules": {
"max-nesting-depth": null
}
}
]
},
"workspaces": [
"react/*"
"react/*",
"web-components/*"
]
}
3 changes: 2 additions & 1 deletion react/editableCells/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"lint": "eslint . --flag unstable_ts_config",
"preview": "vite preview"
},
"dependencies": {
Expand All @@ -30,6 +30,7 @@
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0",
"jiti": "^2.0.0",
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.1"
Expand Down
4 changes: 1 addition & 3 deletions react/editableCells/src/EditableCells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,11 @@ export const EditableCells = () => {
return Array.prototype.indexOf.call(node.parentNode.children, node);
};

console.log(commandLeft, captureCommandLeft.current);
const handleKeyDownActiveCell = (event: KeyboardEvent) => {
event.preventDefault();
const key = event.code;
const activeCellElement = getActiveCell();
// console.log(commandLeft);
if (!!commandLeft) {
if (commandLeft) {
return;
}
// Don't enter switch if there is no active cell
Expand Down
2 changes: 1 addition & 1 deletion web-components/basic/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "basic",
"name": "basic-table-web-component",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion web-components/batch-actions/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "batch-actions",
"name": "batch-actions-table-web-component",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion web-components/customize-columns/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "customize-columns",
"name": "customize-columns-table-web-component",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion web-components/nested-rows/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nested-rows",
"name": "nested-rows-table-web-component",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion web-components/resizing/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "resizing",
"name": "resizing-table-web-component",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion web-components/row-click/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "basic",
"name": "row-click-table-web-component",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion web-components/sticky-columns/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "sticky-columns",
"name": "sticky-columns-table-web-component",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion web-components/virtual/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "virtual",
"name": "virtual-table-web-component",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
Loading

0 comments on commit c05b789

Please sign in to comment.