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

refactor(core): port core to typescript #961

Merged
merged 2 commits into from Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions @commitlint/core/index.js

This file was deleted.

4 changes: 3 additions & 1 deletion @commitlint/core/package.json
Expand Up @@ -2,8 +2,10 @@
"name": "@commitlint/core",
"version": "8.3.5",
"description": "Lint your commit messages",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
"index.js"
"lib/"
],
"scripts": {
"deps": "dep-check",
Expand Down
11 changes: 11 additions & 0 deletions @commitlint/core/src/index.ts
@@ -0,0 +1,11 @@
import format from '@commitlint/format';
armano2 marked this conversation as resolved.
Show resolved Hide resolved
import load from '@commitlint/load';
import lint from '@commitlint/lint';
import read from '@commitlint/read';

export = {
format,
load,
lint,
read
};
Copy link
Contributor Author

@armano2 armano2 Feb 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export equal is going to generate

module.exports = {
    format: format_1.default,
    load: load_1.default,
    lint: lint_1.default,
    read: read_1.default
};

export = {
format,
load,
lint,
read
};

10 changes: 10 additions & 0 deletions @commitlint/core/tsconfig.json
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.shared.json",
"compilerOptions": {
"composite": true,
"rootDir": "./src",
"outDir": "./lib"
},
"include": ["./src/**/*.ts"],
"exclude": ["./src/**/*.test.ts", "./lib/**/*"]
armano2 marked this conversation as resolved.
Show resolved Hide resolved
}
1 change: 1 addition & 0 deletions tsconfig.json
Expand Up @@ -17,5 +17,6 @@
{ "path": "@commitlint/read" },
{ "path": "@commitlint/rules" },
{ "path": "@commitlint/lint" },
{ "path": "@commitlint/core" },
]
}