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: add commitlint config #488

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
27 changes: 27 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Commitlint

on:
pull_request:
branches:
- main

jobs:
commitlint:
name: Check PR title conforms to @commitlint/config-conventional
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo $PR_TITLE | yarn commitlint
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{ts,tsx,js}": "prettier --write"
}
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
5 changes: 3 additions & 2 deletions cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
],
"words": [
"adamyeats",
"commitlint",
"curlimages",
"datasource",
"Datasource",
"errorsource",
"grafanalabs",
"healthcheck",
"instancemgmt",
Expand All @@ -34,7 +36,6 @@
"surql",
"surrealdb",
"typecheck",
"vals",
"errorsource"
"vals"
]
}
19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"e2e": "playwright test",
"lint:fix": "yarn run lint --fix",
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .",
"prepare": "husky",
"server": "docker compose up --build",
"sign": "npx --yes @grafana/sign-plugin@latest",
"test:ci": "jest --passWithNoTests --maxWorkers 4",
Expand All @@ -20,6 +21,8 @@
"license": "Apache-2.0",
"devDependencies": {
"@babel/core": "^7.26.0",
"@commitlint/cli": "^19.6.0",
"@commitlint/config-conventional": "^19.6.0",
"@grafana/eslint-config": "8.0.0",
"@grafana/plugin-e2e": "^1.12.3",
"@grafana/tsconfig": "^2.0.0",
Expand All @@ -39,35 +42,37 @@
"@typescript-eslint/parser": ">=6.18.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"eslint": "^8.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-jsdoc": "^46.8.0",
"eslint-plugin-react": "^7.33.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react": "^7.33.0",
"eslint-webpack-plugin": "^4.2.0",
"eslint": "^8.0.0",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"glob": "^11.0.0",
"husky": "^9.1.7",
"identity-obj-proxy": "3.0.0",
"imports-loader": "^5.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest": "^29.7.0",
"lint-staged": "^15.2.10",
"prettier": "^3.4.1",
"replace-in-file-webpack-plugin": "^1.0.6",
"sass": "1.81.0",
"sass-loader": "16.0.3",
"sass": "1.81.0",
"semver": "^7.6.3",
"style-loader": "4.0.0",
"swc-loader": "^0.2.6",
"terser-webpack-plugin": "^5.3.10",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.2.0",
"webpack": "^5.96.1",
"webpack-cli": "^5.1.4",
"webpack-livereload-plugin": "^3.0.2",
"webpack-subresource-integrity": "^5.1.0",
"webpack-virtual-modules": "^0.6.2"
"webpack-virtual-modules": "^0.6.2",
"webpack": "^5.96.1"
},
"engines": {
"node": ">=20"
Expand All @@ -88,7 +93,7 @@
},
"packageManager": "[email protected]",
"volta": {
"node": "20.18.0",
"node": "20.18.1",
"yarn": "1.22.22"
}
}
Loading