@commitlint/load
Advanced tools
Comparing version 15.0.0 to 16.0.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [16.0.0](https://github.com/conventional-changelog/commitlint/compare/v15.0.0...v16.0.0) (2021-12-26) | ||
### Features | ||
* config validation ([#2412](https://github.com/conventional-changelog/commitlint/issues/2412)) ([c717202](https://github.com/conventional-changelog/commitlint/commit/c7172022097b11f46b33617e4a94d751243c1049)), closes [#327](https://github.com/conventional-changelog/commitlint/issues/327) | ||
# [15.0.0](https://github.com/conventional-changelog/commitlint/compare/v14.2.0...v15.0.0) (2021-11-17) | ||
@@ -8,0 +19,0 @@ |
@@ -8,2 +8,3 @@ "use strict"; | ||
const resolve_extends_1 = __importDefault(require("@commitlint/resolve-extends")); | ||
const config_validator_1 = require("@commitlint/config-validator"); | ||
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject")); | ||
@@ -17,3 +18,2 @@ const merge_1 = __importDefault(require("lodash/merge")); | ||
const load_plugin_1 = __importDefault(require("./utils/load-plugin")); | ||
const pick_config_1 = require("./utils/pick-config"); | ||
async function load(seed = {}, options = {}) { | ||
@@ -23,10 +23,13 @@ const cwd = typeof options.cwd === 'undefined' ? process.cwd() : options.cwd; | ||
const base = loaded && loaded.filepath ? path_1.default.dirname(loaded.filepath) : cwd; | ||
// TODO: validate loaded.config against UserConfig type | ||
// Might amount to breaking changes, defer until 9.0.0 | ||
let config = {}; | ||
if (loaded) { | ||
(0, config_validator_1.validateConfig)(loaded.filepath || '', loaded.config); | ||
config = loaded.config; | ||
} | ||
// Merge passed config with file based options | ||
const config = (0, pick_config_1.pickConfig)((0, merge_1.default)({ | ||
config = (0, merge_1.default)({ | ||
extends: [], | ||
plugins: [], | ||
rules: {}, | ||
}, loaded ? loaded.config : null, seed)); | ||
}, config, seed); | ||
// Resolve parserPreset key | ||
@@ -33,0 +36,0 @@ if (typeof config.parserPreset === 'string') { |
@@ -7,5 +7,5 @@ "use strict"; | ||
exports.loadConfig = void 0; | ||
const cosmiconfig_1 = require("cosmiconfig"); | ||
const cosmiconfig_typescript_loader_1 = __importDefault(require("cosmiconfig-typescript-loader")); | ||
const path_1 = __importDefault(require("path")); | ||
const cosmiconfig_1 = require("cosmiconfig"); | ||
const cosmiconfig_typescript_loader_1 = __importDefault(require("@endemolshinegroup/cosmiconfig-typescript-loader")); | ||
async function loadConfig(cwd, configPath) { | ||
@@ -31,3 +31,3 @@ const moduleName = 'commitlint'; | ||
loaders: { | ||
'.ts': cosmiconfig_typescript_loader_1.default, | ||
'.ts': (0, cosmiconfig_typescript_loader_1.default)(), | ||
}, | ||
@@ -34,0 +34,0 @@ }); |
{ | ||
"name": "@commitlint/load", | ||
"version": "15.0.0", | ||
"version": "16.0.0", | ||
"description": "Load shared commitlint configuration", | ||
@@ -38,5 +38,5 @@ "main": "lib/load.js", | ||
"devDependencies": { | ||
"@commitlint/test": "^15.0.0", | ||
"@commitlint/utils": "^15.0.0", | ||
"@types/lodash": "4.14.177", | ||
"@commitlint/test": "^16.0.0", | ||
"@commitlint/utils": "^16.0.0", | ||
"@types/lodash": "4.14.178", | ||
"conventional-changelog-atom": "^2.0.8", | ||
@@ -46,8 +46,9 @@ "execa": "^5.0.0" | ||
"dependencies": { | ||
"@commitlint/execute-rule": "^15.0.0", | ||
"@commitlint/resolve-extends": "^15.0.0", | ||
"@commitlint/types": "^15.0.0", | ||
"@endemolshinegroup/cosmiconfig-typescript-loader": "^3.0.2", | ||
"@commitlint/config-validator": "^16.0.0", | ||
"@commitlint/execute-rule": "^16.0.0", | ||
"@commitlint/resolve-extends": "^16.0.0", | ||
"@commitlint/types": "^16.0.0", | ||
"chalk": "^4.0.0", | ||
"cosmiconfig": "^7.0.0", | ||
"cosmiconfig-typescript-loader": "^1.0.0", | ||
"lodash": "^4.17.19", | ||
@@ -57,3 +58,3 @@ "resolve-from": "^5.0.0", | ||
}, | ||
"gitHead": "399a0289356c670a87524387cc96d8fb0a33fdca" | ||
"gitHead": "70f7f4688b51774e7ac5e40e896cdaa3f132b2bc" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46349
10
28
398
+ Added@commitlint/config-validator@16.2.1(transitive)
+ Added@commitlint/execute-rule@16.2.1(transitive)
+ Added@commitlint/resolve-extends@16.2.1(transitive)
+ Added@commitlint/types@16.2.1(transitive)
+ Added@cspotcode/source-map-support@0.8.1(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.9(transitive)
+ Added@tsconfig/node10@1.0.11(transitive)
+ Added@tsconfig/node12@1.0.11(transitive)
+ Added@tsconfig/node14@1.0.3(transitive)
+ Added@tsconfig/node16@1.0.4(transitive)
+ Added@types/node@22.5.5(transitive)
+ Addedacorn@8.12.1(transitive)
+ Addedacorn-walk@8.3.4(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedcosmiconfig-typescript-loader@1.0.9(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedts-node@10.9.2(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedv8-compile-cache-lib@3.0.1(transitive)
- Removed@endemolshinegroup/cosmiconfig-typescript-loader@^3.0.2
- Removed@commitlint/execute-rule@15.0.0(transitive)
- Removed@commitlint/resolve-extends@15.0.0(transitive)
- Removed@commitlint/types@15.0.0(transitive)
- Removed@endemolshinegroup/cosmiconfig-typescript-loader@3.0.2(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedlodash.get@4.4.2(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsource-map-support@0.5.21(transitive)
- Removedts-node@9.1.1(transitive)
- Removedtslib@2.7.0(transitive)
Updated@commitlint/types@^16.0.0