Socket
Socket
Sign inDemoInstall

@commitlint/types

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/types - npm Package Compare versions

Comparing version 9.1.1 to 9.1.2

lib/format.d.ts

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [9.1.2](https://github.com/conventional-changelog/commitlint/compare/v9.1.1...v9.1.2) (2020-07-13)
**Note:** Version bump only for package @commitlint/types
## [9.1.1](https://github.com/conventional-changelog/commitlint/compare/v9.1.0...v9.1.1) (2020-06-30)

@@ -8,0 +16,0 @@

1

lib/index.d.ts
export * from './ensure';
export * from './format';
export * from './is-ignored';

@@ -3,0 +4,0 @@ export * from './rules';

@@ -7,2 +7,3 @@ "use strict";

__export(require("./ensure"));
__export(require("./format"));
__export(require("./is-ignored"));

@@ -9,0 +10,0 @@ __export(require("./rules"));

7

lib/lint.d.ts
import { IsIgnoredOptions } from './is-ignored';
import { RuleConfigTuple, PluginRecords, RuleSeverity } from './load';
import { PluginRecords } from './load';
import { ParserOptions } from './parse';
export declare type LintRuleConfig = Record<string, Readonly<[RuleSeverity.Disabled]> | RuleConfigTuple<void> | RuleConfigTuple<unknown>>;
import { RuleConfigSeverity, RuleConfigTuple } from './rules';
export declare type LintRuleConfig = Record<string, Readonly<[RuleConfigSeverity.Disabled]> | RuleConfigTuple<void> | RuleConfigTuple<unknown>>;
export interface LintOptions {

@@ -28,3 +29,3 @@ /** If it should ignore the default commit messages (defaults to `true`) */

/** The "severity" of the rule (1 = warning, 2 = error) */
level: RuleSeverity;
level: RuleConfigSeverity;
/** The name of the rule */

@@ -31,0 +32,0 @@ name: string;

@@ -1,3 +0,2 @@

import { TargetCaseType } from './ensure';
import { Rule, RuleCondition } from './rules';
import { Rule, RulesConfig, RuleConfigQuality } from './rules';
export declare type PluginRecords = Record<string, Plugin>;

@@ -13,54 +12,5 @@ export interface Plugin {

}
export declare enum RuleSeverity {
Disabled = 0,
Warning = 1,
Error = 2
}
export declare type RuleConfigTuple<T> = T extends void ? Readonly<[RuleSeverity, RuleCondition]> : Readonly<[RuleSeverity, RuleCondition, T]>;
export declare enum RuleConfigQuality {
User = 0,
Qualified = 1
}
export declare type QualifiedRuleConfig<T> = (() => RuleConfigTuple<T>) | (() => RuleConfigTuple<Promise<T>>) | RuleConfigTuple<T>;
export declare type RuleConfig<V = RuleConfigQuality.Qualified, T = void> = V extends RuleConfigQuality.Qualified ? RuleConfigTuple<T> : QualifiedRuleConfig<T>;
export declare type CaseRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, TargetCaseType>;
export declare type LengthRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, number>;
export declare type EnumRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, string[]>;
export declare type RulesConfig<V = RuleConfigQuality.User> = {
'body-case': CaseRuleConfig<V>;
'body-empty': RuleConfig<V>;
'body-leading-blank': RuleConfig<V>;
'body-max-length': LengthRuleConfig<V>;
'body-max-line-length': LengthRuleConfig<V>;
'body-min-length': LengthRuleConfig<V>;
'footer-empty': RuleConfig<V>;
'footer-leading-blank': RuleConfig<V>;
'footer-max-length': LengthRuleConfig<V>;
'footer-max-line-length': LengthRuleConfig<V>;
'footer-min-length': LengthRuleConfig<V>;
'header-case': CaseRuleConfig<V>;
'header-full-stop': RuleConfig<V>;
'header-max-length': LengthRuleConfig<V>;
'header-min-length': LengthRuleConfig<V>;
'references-empty': RuleConfig<V>;
'scope-case': CaseRuleConfig<V>;
'scope-empty': RuleConfig<V>;
'scope-enum': EnumRuleConfig<V>;
'scope-max-length': LengthRuleConfig<V>;
'scope-min-length': LengthRuleConfig<V>;
'signed-off-by': RuleConfig<V>;
'subject-case': CaseRuleConfig<V>;
'subject-empty': RuleConfig<V>;
'subject-full-stop': RuleConfig<V>;
'subject-max-length': LengthRuleConfig<V>;
'subject-min-length': LengthRuleConfig<V>;
'type-case': CaseRuleConfig<V>;
'type-empty': RuleConfig<V>;
'type-enum': EnumRuleConfig<V>;
'type-max-length': LengthRuleConfig<V>;
'type-min-length': LengthRuleConfig<V>;
};
export interface UserConfig {
extends?: string[];
formatter?: unknown;
formatter?: string;
rules?: Partial<RulesConfig>;

@@ -74,3 +24,3 @@ parserPreset?: string | ParserPreset;

extends?: string[];
formatter?: unknown;
formatter?: string;
rules?: Partial<RulesConfig>;

@@ -85,4 +35,4 @@ parserPreset?: string | ParserPreset;

extends: string[];
formatter: unknown;
rules: Partial<QualifiedRules>;
formatter: string;
rules: QualifiedRules;
parserPreset: ParserPreset;

@@ -89,0 +39,0 @@ ignores: ((commit: string) => boolean)[];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var RuleSeverity;
(function (RuleSeverity) {
RuleSeverity[RuleSeverity["Disabled"] = 0] = "Disabled";
RuleSeverity[RuleSeverity["Warning"] = 1] = "Warning";
RuleSeverity[RuleSeverity["Error"] = 2] = "Error";
})(RuleSeverity = exports.RuleSeverity || (exports.RuleSeverity = {}));
var RuleConfigQuality;
(function (RuleConfigQuality) {
RuleConfigQuality[RuleConfigQuality["User"] = 0] = "User";
RuleConfigQuality[RuleConfigQuality["Qualified"] = 1] = "Qualified";
})(RuleConfigQuality = exports.RuleConfigQuality || (exports.RuleConfigQuality = {}));
//# sourceMappingURL=load.js.map

@@ -0,9 +1,4 @@

import { TargetCaseType } from './ensure';
import { Commit } from './parse';
/**
* Rules always have a condition.
* It can be either "always" (as tested), or "never" (as tested).
* For example, `header-full-stop` can be enforced as "always" or "never".
*/
export declare type RuleCondition = 'always' | 'never';
/**
* Rules match the input either as successful or failed.

@@ -19,6 +14,70 @@ * For example, when `header-full-stop` detects a full stop and is set as "always"; it's true.

export declare type RuleType = 'async' | 'sync' | 'either';
export declare type BaseRule<Value = never, Type extends RuleType = 'either'> = (parsed: Commit, when?: RuleCondition, value?: Value) => Type extends 'either' ? RuleOutcome | Promise<RuleOutcome> : Type extends 'async' ? Promise<RuleOutcome> : Type extends 'sync' ? RuleOutcome : never;
export declare type BaseRule<Value = never, Type extends RuleType = 'either'> = (parsed: Commit, when?: RuleConfigCondition, value?: Value) => Type extends 'either' ? RuleOutcome | Promise<RuleOutcome> : Type extends 'async' ? Promise<RuleOutcome> : Type extends 'sync' ? RuleOutcome : never;
export declare type Rule<Value = never> = BaseRule<Value, 'either'>;
export declare type AsyncRule<Value = never> = BaseRule<Value, 'async'>;
export declare type SyncRule<Value = never> = BaseRule<Value, 'sync'>;
/**
* Rules always have a severity.
* Severity indicates what to do if the rule is found to be broken
* 0 - Disable this rule
* 1 - Warn for violations
* 2 - Error for violations
*/
export declare enum RuleConfigSeverity {
Disabled = 0,
Warning = 1,
Error = 2
}
/**
* Rules always have a condition.
* It can be either "always" (as tested), or "never" (as tested).
* For example, `header-full-stop` can be enforced as "always" or "never".
*/
export declare type RuleConfigCondition = 'always' | 'never';
export declare type RuleConfigTuple<T> = T extends void ? Readonly<[RuleConfigSeverity.Disabled]> | Readonly<[RuleConfigSeverity, RuleConfigCondition]> : Readonly<[RuleConfigSeverity.Disabled]> | Readonly<[RuleConfigSeverity, RuleConfigCondition, T]>;
export declare enum RuleConfigQuality {
User = 0,
Qualified = 1
}
export declare type QualifiedRuleConfig<T> = (() => RuleConfigTuple<T>) | (() => RuleConfigTuple<Promise<T>>) | RuleConfigTuple<T>;
export declare type RuleConfig<V = RuleConfigQuality.Qualified, T = void> = V extends RuleConfigQuality.Qualified ? RuleConfigTuple<T> : QualifiedRuleConfig<T>;
export declare type CaseRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, TargetCaseType>;
export declare type LengthRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, number>;
export declare type EnumRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, string[]>;
export declare type RulesConfig<V = RuleConfigQuality.User> = {
'body-case': CaseRuleConfig<V>;
'body-empty': RuleConfig<V>;
'body-leading-blank': RuleConfig<V>;
'body-max-length': LengthRuleConfig<V>;
'body-max-line-length': LengthRuleConfig<V>;
'body-min-length': LengthRuleConfig<V>;
'footer-empty': RuleConfig<V>;
'footer-leading-blank': RuleConfig<V>;
'footer-max-length': LengthRuleConfig<V>;
'footer-max-line-length': LengthRuleConfig<V>;
'footer-min-length': LengthRuleConfig<V>;
'header-case': CaseRuleConfig<V>;
'header-full-stop': RuleConfig<V>;
'header-max-length': LengthRuleConfig<V>;
'header-min-length': LengthRuleConfig<V>;
'references-empty': RuleConfig<V>;
'scope-case': CaseRuleConfig<V>;
'scope-empty': RuleConfig<V>;
'scope-enum': EnumRuleConfig<V>;
'scope-max-length': LengthRuleConfig<V>;
'scope-min-length': LengthRuleConfig<V>;
'signed-off-by': RuleConfig<V>;
'subject-case': CaseRuleConfig<V>;
'subject-empty': RuleConfig<V>;
'subject-full-stop': RuleConfig<V>;
'subject-max-length': LengthRuleConfig<V>;
'subject-min-length': LengthRuleConfig<V>;
'type-case': CaseRuleConfig<V>;
'type-empty': RuleConfig<V>;
'type-enum': EnumRuleConfig<V>;
'type-max-length': LengthRuleConfig<V>;
'type-min-length': LengthRuleConfig<V>;
[key: string]: AnyRuleConfig<V>;
};
export declare type AnyRuleConfig<V> = RuleConfig<V, unknown> | RuleConfig<V, void>;
//# sourceMappingURL=rules.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Rules always have a severity.
* Severity indicates what to do if the rule is found to be broken
* 0 - Disable this rule
* 1 - Warn for violations
* 2 - Error for violations
*/
var RuleConfigSeverity;
(function (RuleConfigSeverity) {
RuleConfigSeverity[RuleConfigSeverity["Disabled"] = 0] = "Disabled";
RuleConfigSeverity[RuleConfigSeverity["Warning"] = 1] = "Warning";
RuleConfigSeverity[RuleConfigSeverity["Error"] = 2] = "Error";
})(RuleConfigSeverity = exports.RuleConfigSeverity || (exports.RuleConfigSeverity = {}));
var RuleConfigQuality;
(function (RuleConfigQuality) {
RuleConfigQuality[RuleConfigQuality["User"] = 0] = "User";
RuleConfigQuality[RuleConfigQuality["Qualified"] = 1] = "Qualified";
})(RuleConfigQuality = exports.RuleConfigQuality || (exports.RuleConfigQuality = {}));
//# sourceMappingURL=rules.js.map
{
"name": "@commitlint/types",
"version": "9.1.1",
"version": "9.1.2",
"description": "Shared types for commitlint packages",

@@ -14,3 +14,3 @@ "main": "lib/index.js",

"engines": {
"node": ">=8"
"node": ">=v8.17.0"
},

@@ -31,5 +31,5 @@ "repository": {

"devDependencies": {
"@commitlint/utils": "^9.1.1"
"@commitlint/utils": "^9.1.2"
},
"gitHead": "cb565dfcca3128380b9b3dc274aedbcae34ce5ca"
"gitHead": "41d4f5851508be1421bd23e0424cacf043bc6a88"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc