Skip to content

Commit 3465e16

Browse files
committed
refactor: update commitlint and remove unnecessary changelog angular dependency
closes #776 Signed-off-by: Vojtech Masek <[email protected]>
1 parent b472450 commit 3465e16

File tree

5 files changed

+473
-829
lines changed

5 files changed

+473
-829
lines changed

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@
7676
- 'esbuild.config.js'
7777
- '.github/ISSUE_TEMPLATE/**'
7878
- '.husky/**'
79-
- 'commitlint.config.js'
79+
- 'commitlint.config.mjs'
8080
- '.verdaccio/config.yml'
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
const { RuleConfigSeverity } = require('@commitlint/types');
2-
const { rules } = require('@commitlint/config-conventional');
3-
const {
4-
utils: { getProjects },
5-
} = require('@commitlint/config-nx-scopes');
1+
import config from '@commitlint/config-conventional';
2+
import nxScopes from '@commitlint/config-nx-scopes';
3+
import { RuleConfigSeverity } from '@commitlint/types';
64

75
/** @type {import('@commitlint/types').UserConfig} */
8-
const configuration = {
6+
export default {
97
extends: ['@commitlint/config-conventional'],
108
plugins: ['commitlint-plugin-tense'],
119
rules: {
1210
'scope-enum': async ctx => {
13-
const projects = await getProjects(
11+
const projects = nxScopes.utils.getProjects(
1412
ctx,
15-
({ name, projectType, tags }) =>
13+
({ projectType }) =>
1614
projectType === 'library' || projectType === 'application',
1715
);
1816
const scopes = [...projects, 'tools', 'workflows', 'testing'].sort();
1917
return [RuleConfigSeverity.Error, 'always', scopes];
2018
},
2119
'type-enum': () => {
22-
const defaultTypes = rules['type-enum'][2];
20+
const defaultTypes = config.rules['type-enum'][2];
2321
const types = [
2422
...defaultTypes,
2523
'release', // custom type for release commits
@@ -33,5 +31,3 @@ const configuration = {
3331
],
3432
},
3533
};
36-
37-
module.exports = configuration;

knip.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
KnipConfigPlugin,
2+
type KnipConfigPlugin,
33
combineNxKnipPlugins,
44
withEsbuildApps,
55
withEsbuildPublishableLibs,
@@ -48,7 +48,7 @@ const withNxStandards = (): KnipConfigPlugin => () => {
4848
project: ['**/*.{ts,js,tsx,jsx}'],
4949
ignore: ['tmp/**', 'node_modules/**'],
5050
commitlint: {
51-
config: ['commitlint.config.js'],
51+
config: ['commitlint.config.mjs'],
5252
},
5353
exclude: ['duplicates'],
5454
entry: [

0 commit comments

Comments
 (0)