@shopify/theme-check-node
Advanced tools
Comparing version
@@ -9,7 +9,7 @@ "use strict"; | ||
(0, node_assert_1.strict)(settings, `Unexpected missing settings for ${check.meta.code} in validateConfig call`); | ||
validateSettings(check.meta.schema, settings, true); | ||
validateSettings(check.meta.code, check.meta.schema, settings, true); | ||
} | ||
} | ||
exports.validateConfig = validateConfig; | ||
function validateSettings(schema, settings, isTopLevel) { | ||
function validateSettings(checkCode, schema, settings, isTopLevel) { | ||
for (const key in schema) { | ||
@@ -23,3 +23,3 @@ const schemaProp = schema[key]; | ||
} | ||
validateSuperfluousSettings(schema, settings); | ||
validateSuperfluousSettings(checkCode, schema, settings); | ||
} | ||
@@ -32,7 +32,7 @@ function validateCommonCheckSettings(settings) { | ||
} | ||
function validateSuperfluousSettings(schema, settings) { | ||
function validateSuperfluousSettings(checkCode, schema, settings) { | ||
const commonCheckSettingsKeys = ['enabled', 'severity', 'ignore']; | ||
for (const key in settings) { | ||
if (!(key in schema) && !commonCheckSettingsKeys.includes(key)) { | ||
node_assert_1.strict.fail(`Unexpected setting: ${key}`); | ||
console.error(`Unexpected setting: ${key} for check ${checkCode} found in configuration`); | ||
} | ||
@@ -39,0 +39,0 @@ } |
{ | ||
"name": "@shopify/theme-check-node", | ||
"version": "1.17.0", | ||
"version": "1.18.0", | ||
"main": "dist/index.js", | ||
@@ -28,4 +28,4 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@shopify/theme-check-common": "1.17.0", | ||
"@shopify/theme-check-docs-updater": "1.17.0", | ||
"@shopify/theme-check-common": "1.18.0", | ||
"@shopify/theme-check-docs-updater": "1.18.0", | ||
"glob": "^8.0.3", | ||
@@ -32,0 +32,0 @@ "yaml": "^2.3.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
46164
0.27%+ Added
+ Added
- Removed
- Removed