Skip to content

Commit

Permalink
refactor: update commitlint and remove unnecessary changelog angular …
Browse files Browse the repository at this point in the history
…dependency

closes #776

Signed-off-by: Vojtech Masek <[email protected]>
  • Loading branch information
vmasek committed Oct 18, 2024
1 parent f01bcc4 commit 0de1cd5
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 837 deletions.
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@
- 'esbuild.config.js'
- '.github/ISSUE_TEMPLATE/**'
- '.husky/**'
- 'commitlint.config.js'
- 'commitlint.config.mjs'
- '.verdaccio/config.yml'
18 changes: 7 additions & 11 deletions commitlint.config.js → commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
const { RuleConfigSeverity } = require('@commitlint/types');
const { rules } = require('@commitlint/config-conventional');
const {
utils: { getProjects },
} = require('@commitlint/config-nx-scopes');
import config from '@commitlint/config-conventional';
import nxScopes from '@commitlint/config-nx-scopes';
import { RuleConfigSeverity } from '@commitlint/types';

/** @type {import('@commitlint/types').UserConfig} */
const configuration = {
export default {
extends: ['@commitlint/config-conventional'],
plugins: ['commitlint-plugin-tense'],
rules: {
'scope-enum': async ctx => {
const projects = await getProjects(
const projects = nxScopes.utils.getProjects(
ctx,
({ name, projectType, tags }) =>
({ projectType }) =>
projectType === 'library' || projectType === 'application',
);
const scopes = [...projects, 'tools', 'workflows', 'testing'].sort();
return [RuleConfigSeverity.Error, 'always', scopes];
},
'type-enum': () => {
const defaultTypes = rules['type-enum'][2];
const defaultTypes = config.rules['type-enum'][2];
const types = [
...defaultTypes,
'release', // custom type for release commits
Expand All @@ -33,5 +31,3 @@ const configuration = {
],
},
};

module.exports = configuration;
4 changes: 2 additions & 2 deletions knip.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
KnipConfigPlugin,
type KnipConfigPlugin,
combineNxKnipPlugins,
withEsbuildApps,
withEsbuildPublishableLibs,
Expand Down Expand Up @@ -48,7 +48,7 @@ const withNxStandards = (): KnipConfigPlugin => () => {
project: ['**/*.{ts,js,tsx,jsx}'],
ignore: ['tmp/**', 'node_modules/**'],
commitlint: {
config: ['commitlint.config.js'],
config: ['commitlint.config.mjs'],
},
exclude: ['duplicates'],
entry: [
Expand Down
Loading

0 comments on commit 0de1cd5

Please sign in to comment.