-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add commitlint, lint-staged and husky
- Loading branch information
1 parent
ccc5172
commit 33ccbcc
Showing
13 changed files
with
958 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"path": "node_modules/cz-git", | ||
"useEmoji": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx lint-staged --relative --concurrent false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx nx affected -t test && npx nx affected -t component-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"*.ts": ["nx affected:lint --fix --files"], | ||
"*": ["npx nx format:write --files"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,39 @@ | ||
{ | ||
"singleQuote": true | ||
"tabWidth": 2, | ||
"endOfLine": "lf", | ||
"useTabs": false, | ||
"printWidth": 120, | ||
"semi": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": true, | ||
"proseWrap": "always", | ||
"bracketSameLine": true, | ||
"singleQuote": true, | ||
"arrowParens": "avoid", | ||
"singleAttributePerLine": true, | ||
"htmlWhitespaceSensitivity": "strict", | ||
"plugins": ["@trivago/prettier-plugin-sort-imports"], | ||
"importOrder": [ | ||
"^@angular/(.*)$", | ||
"^rxjs|rxjs/(.*)$", | ||
"<THIRD_PARTY_MODULES>", | ||
"^[./]" | ||
], | ||
"importOrderSeparation": true, | ||
"importOrderSortSpecifiers": true, | ||
"importOrderParserPlugins": ["typescript", "decorators-legacy"], | ||
"overrides": [ | ||
{ | ||
"files": ["**/*.html"], | ||
"options": { | ||
"printWidth": 120 | ||
} | ||
}, | ||
{ | ||
"files": "*.{yaml,yml}", | ||
"options": { | ||
"singleQuote": false | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
const fs = require('node:fs'); | ||
const path = require('node:path'); | ||
const apps = fs.readdirSync(path.resolve(__dirname, 'apps')); | ||
/** @type {import('cz-git').UserConfig} */ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional', '@commitlint/config-nx-scopes'], | ||
prompt: { | ||
messages: { | ||
type: "Select the type of change that you're committing:", | ||
scope: 'Denote the SCOPE of this change (optional):', | ||
customScope: 'Denote the SCOPE of this change:', | ||
subject: 'Write a SHORT, IMPERATIVE tense description of the change:\n', | ||
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n', | ||
breaking: 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n', | ||
footerPrefixesSelect: 'Select the ISSUES type of changeList by this change (optional):', | ||
customFooterPrefix: 'Input ISSUES prefix:', | ||
footer: 'List any ISSUES by this change. E.g.: #31, #34:\n', | ||
generatingByAI: 'Generating your AI commit subject...', | ||
generatedSelectByAI: 'Select suitable subject by AI generated:', | ||
confirmCommit: 'Are you sure you want to proceed with the commit above?' | ||
}, | ||
types: [ | ||
{ | ||
value: 'feat', | ||
name: 'feat: ✨ A new feature', | ||
emoji: '✨' | ||
}, | ||
{ | ||
value: 'fix', | ||
name: 'fix: 🐛 A bug fix', | ||
emoji: '🐛' | ||
}, | ||
{ | ||
value: 'docs', | ||
name: 'docs: 📝 Documentation only changes', | ||
emoji: '📝' | ||
}, | ||
{ | ||
value: 'style', | ||
name: 'style: 💄 Changes that do not affect the meaning of the code', | ||
emoji: '💄' | ||
}, | ||
{ | ||
value: 'refactor', | ||
name: 'refactor: ♻️ A code change that neither fixes a bug nor adds a feature', | ||
emoji: '♻️' | ||
}, | ||
{ | ||
value: 'perf', | ||
name: 'perf: ⚡️ A code change that improves performance', | ||
emoji: '⚡️' | ||
}, | ||
{ | ||
value: 'test', | ||
name: 'test: 🧪 Adding missing tests or correcting existing tests', | ||
emoji: '🧪' | ||
}, | ||
{ | ||
value: 'build', | ||
name: 'build: 📦️ Changes that affect the build system or external dependencies', | ||
emoji: '📦️' | ||
}, | ||
{ | ||
value: 'ci', | ||
name: 'ci: 👷 Changes to our CI configuration files and scripts', | ||
emoji: '👷' | ||
}, | ||
{ | ||
value: 'chore', | ||
name: "chore: 🔨 Other changes that don't modify src or test files", | ||
emoji: '🔨' | ||
}, | ||
{ | ||
value: 'revert', | ||
name: 'revert: ⏪️ Reverts a previous commit', | ||
emoji: '⏪️' | ||
} | ||
], | ||
useEmoji: true, | ||
emojiAlign: 'center', | ||
useAI: false, | ||
aiNumber: 1, | ||
themeColorCode: '', | ||
scopes: [...apps], | ||
allowCustomScopes: true, | ||
allowEmptyScopes: true, | ||
customScopesAlign: 'bottom', | ||
customScopesAlias: 'custom', | ||
emptyScopesAlias: 'empty', | ||
upperCaseSubject: false, | ||
markBreakingChangeMode: true, | ||
allowBreakingChanges: ['feat', 'fix'], | ||
breaklineNumber: 100, | ||
breaklineChar: '|', | ||
skipQuestions: [], | ||
issuePrefixes: [{ value: 'closed', name: 'closed: ISSUES has been processed' }], | ||
customIssuePrefixAlign: 'top', | ||
emptyIssuePrefixAlias: 'skip', | ||
customIssuePrefixAlias: 'custom', | ||
allowCustomIssuePrefix: true, | ||
allowEmptyIssuePrefix: true, | ||
confirmColorize: true, | ||
scopeOverrides: undefined, | ||
defaultBody: '', | ||
defaultIssues: '', | ||
defaultScope: '', | ||
defaultSubject: '' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.