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: port load to typescript #786

Merged
merged 19 commits into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[{.*rc,*.yml,*.md,package.json,lerna.json,*.svg}]
[{.*rc,*.yml,*.md,package.json,lerna.json,tsconfig.json,tsconfig.*.json,*.svg}]
indent_style = space

[*.md]
Expand Down
4 changes: 2 additions & 2 deletions @commitlint/ensure/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ensureCase from './case';
import ensureCase, {TargetCaseType} from './case';
import ensureEnum from './enum';
import maxLength from './max-length';
import maxLineLength from './max-line-length';
Expand All @@ -7,5 +7,5 @@ import notEmpty from './not-empty';

export {ensureCase as case};
export {ensureEnum as enum};
export {TargetCaseType};
export {maxLength, maxLineLength, minLength, notEmpty};
export {TargetCaseType} from './case';
2 changes: 1 addition & 1 deletion @commitlint/execute-rule/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type ExecutedRule<T> = readonly [string, T];
export default execute;

export async function execute<T = unknown>(
rule: Rule<T>
rule?: Rule<T>
): Promise<ExecutedRule<T> | null> {
if (!Array.isArray(rule)) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/load/fixtures/basic/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
rules: {
basic: true
'body-case': [1, 'never', 'camel-case']
}
};
41 changes: 5 additions & 36 deletions @commitlint/load/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,14 @@
"name": "@commitlint/load",
"version": "8.3.5",
"description": "Load shared commitlint configuration",
"main": "lib/index.js",
"main": "lib/load.js",
"types": "lib/load.d.ts",
"files": [
"lib/"
],
"scripts": {
"build": "cross-env NODE_ENV=production babel src --out-dir lib --source-maps",
"deps": "dep-check",
"pkg": "pkg-check --skip-import",
"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
"test": "ava -c 4 --verbose && ava src/index.serial-test.js --verbose",
"watch": "babel src --out-dir lib --watch --source-maps"
},
"ava": {
"files": [
"src/**/*.test.js",
"!lib/**/*"
],
"source": [
"src/**/*.js",
"!lib/**/*"
],
"babel": {
"testOptions": {
"presets": [
"babel-preset-commitlint"
]
}
},
"require": [
"@babel/register"
]
},
"babel": {
"presets": [
"babel-preset-commitlint"
]
"pkg": "pkg-check --skip-import"
},
"engines": {
"node": ">=4"
Expand All @@ -62,13 +34,9 @@
},
"license": "MIT",
"devDependencies": {
"@babel/core": "7.7.7",
"@babel/cli": "7.7.7",
"@babel/register": "7.7.7",
"@commitlint/test": "8.2.0",
"@commitlint/utils": "^8.3.4",
"ava": "2.4.0",
"babel-preset-commitlint": "^8.2.0",
"@types/cosmiconfig": "^5.0.3",
"concurrently": "3.6.1",
"cross-env": "6.0.3",
"execa": "0.11.0",
Expand All @@ -77,6 +45,7 @@
"dependencies": {
"@commitlint/execute-rule": "^8.3.4",
"@commitlint/resolve-extends": "^8.3.5",
"@commitlint/rules": "^8.3.4",
"chalk": "2.4.2",
"cosmiconfig": "^5.2.0",
"lodash": "4.17.15",
Expand Down
164 changes: 0 additions & 164 deletions @commitlint/load/src/index.js

This file was deleted.

19 changes: 0 additions & 19 deletions @commitlint/load/src/index.serial-test.js

This file was deleted.

Loading