Skip to content

Commit 3423735

Browse files
JounQinmarcalexiei
authored andcommitted
feat!: migrate to pure ESM (#3850)
BREAKING CHANGE: migrate to pure ESM * feat: migrate to pure ESM * chore: update snapshot * fix: load `parserPreset` with another `await` * test: migrate to vitest * test: remove no replacement `--runInBand` test-ci script * chore: fix code reviews * refactor(load): rewrite resolve logic * fix(config-nx-scopes): fix syntax error * feat(resolve-extends): add resolveFrom and loadParserPreset * feat(load): use resolveFrom and loadParserPreset from resolve-extends * test: include only @commitlint/* packages src in coverage * test: explicit import vitest utilities * test: remove @jest/globals from dependencies * fix(resolve-extends): `resolveFrom` output should be platform aware * test: restore NO_COLOR to test script * chore: fix linting issues * fix: should use fileURLToPath instead of pathname for Windows compatibility * Apply suggestions from code review * fix: should reuse `cli` instead call `yargs()` * feat(cli): set terminalWidth as wrap to avoid work break on help * Update .eslintrc.cjs * feat: migrate @commitlint/config-conventional to pure ESM --------- Co-authored-by: Marco Pasqualetti <marco.pasqualetti@live.com>
1 parent 93fa15e commit 3423735

225 files changed

Lines changed: 3258 additions & 3352 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = {
3131
'import/no-extraneous-dependencies': [
3232
'error',
3333
{
34-
devDependencies: ['**/*.test.js', '**/*.test.ts'],
34+
devDependencies: ['**/*.test.js', '**/*.test.ts', 'vitest'],
3535
},
3636
],
3737
},
@@ -61,15 +61,14 @@ module.exports = {
6161
},
6262
{
6363
files: ['*.test.ts', '*.test.js'],
64-
env: {
65-
jest: true,
66-
},
6764
extends: ['plugin:jest/recommended'],
6865
rules: {
6966
'@typescript-eslint/no-explicit-any': 'off',
7067
'@typescript-eslint/no-var-requires': 'off',
7168
// disallow non-import statements appearing before import statements
7269
'import/first': 'off',
70+
'import/no-extraneous-dependencies': 'off',
71+
'jest/no-deprecated-functions': 'off'
7372
},
7473
},
7574
],

.github/workflows/CI.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
run: yarn build
3030

3131
- name: Test
32-
run: yarn test-ci
32+
run: yarn test
3333

3434
nodeJsBaselineAptCompatibility:
3535
name: NodeJS installed from stock Ubuntu-LTS packages (not external sources)
3636
runs-on: ubuntu-22.04
3737
container:
38-
image: "ubuntu:24.04"
38+
image: 'ubuntu:24.04'
3939
steps:
4040
- uses: actions/checkout@v4
4141

@@ -55,5 +55,4 @@ jobs:
5555
run: yarn build
5656

5757
- name: Run Tests
58-
run: yarn test-ci
59-
58+
run: yarn test
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('@commitlint/config-angular');
1+
export {default} from '@commitlint/config-angular';

@alias/commitlint-config-angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "commitlint-config-angular",
3+
"type": "module",
34
"version": "18.6.1",
45
"description": "Shareable commitlint config enforcing the angular commit convention",
56
"files": [
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('@commitlint/config-lerna-scopes');
1+
export {default} from '@commitlint/config-lerna-scopes';

@alias/commitlint-config-lerna-scopes/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "commitlint-config-lerna-scopes",
3+
"type": "module",
34
"version": "18.6.1",
45
"description": "Shareable commitlint config enforcing lerna package names as scopes",
56
"files": [
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('@commitlint/config-nx-scopes');
1+
export {default} from '@commitlint/config-nx-scopes';

@alias/commitlint-config-nx-scopes/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "commitlint-config-nx-scopes",
3+
"type": "module",
34
"version": "18.6.1",
45
"description": "Shareable commitlint config enforcing nx project names as scopes",
56
"files": [
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('@commitlint/config-patternplate');
1+
export {default} from '@commitlint/config-patternplate';

@alias/commitlint-config-patternplate/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "commitlint-config-patternplate",
3+
"type": "module",
34
"version": "18.6.1",
45
"description": "Lint your commits, patternplate-style",
56
"files": [

0 commit comments

Comments
 (0)