diff --git a/CHANGELOG.md b/CHANGELOG.md index 611c3023..d4d27283 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,13 @@ * update dependency markdownlint-cli to ^0.38.0 ([#410](https://github.com/eslint-community/eslint-plugin-eslint-plugin/issues/410)) ([6b53c5b](https://github.com/eslint-community/eslint-plugin-eslint-plugin/commit/6b53c5b7b8bc9e19dcb86796ab29019f89c449fc)) * update dependency markdownlint-cli to ^0.39.0 ([#431](https://github.com/eslint-community/eslint-plugin-eslint-plugin/issues/431)) ([f005a2c](https://github.com/eslint-community/eslint-plugin-eslint-plugin/commit/f005a2c0231b8b77f6862dca81b4a6e3099e0493)) +## [6.3.1](https://github.com/eslint-community/eslint-plugin-eslint-plugin/compare/v6.3.0...v6.3.1) (2024-10-25) + + +### Bug Fixes + +* **require-meta-schema-description:** handle non-iterable schema properties ([#493](https://github.com/eslint-community/eslint-plugin-eslint-plugin/issues/493)) ([7f99077](https://github.com/eslint-community/eslint-plugin-eslint-plugin/commit/7f99077233b1de04f67a7b6bc5a38ace90c629db)) + ## [6.3.0](https://github.com/eslint-community/eslint-plugin-eslint-plugin/compare/v6.2.0...v6.3.0) (2024-10-24) diff --git a/lib/rules/require-meta-schema-description.js b/lib/rules/require-meta-schema-description.js index 5705f8db..e267e487 100644 --- a/lib/rules/require-meta-schema-description.js +++ b/lib/rules/require-meta-schema-description.js @@ -87,9 +87,11 @@ module.exports = { case 'properties': { hadChildren = true; - for (const property of value.properties) { - if (property.value?.type === 'ObjectExpression') { - checkSchemaElement(property.value); + if (Array.isArray(value.properties)) { + for (const property of value.properties) { + if (property.value?.type === 'ObjectExpression') { + checkSchemaElement(property.value); + } } } diff --git a/package.json b/package.json index 573ef5d3..63274776 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-eslint-plugin", - "version": "6.3.0", + "version": "6.3.1", "description": "An ESLint plugin for linting ESLint plugins", "author": "Teddy Katz", "main": "./lib/index.js", diff --git a/tests/lib/rules/require-meta-schema-description.js b/tests/lib/rules/require-meta-schema-description.js index f6171c51..6af8dadb 100644 --- a/tests/lib/rules/require-meta-schema-description.js +++ b/tests/lib/rules/require-meta-schema-description.js @@ -145,6 +145,41 @@ module.exports = { create() {} }; `, + ` +module.exports = { + meta: { + schema: [ + { + type: 'object', + properties: null, + additionalProperties: false + } + ], + }, + create() {} +} + `, + ` +const DEFAULT_OPTIONS = Object.freeze({}); + +module.exports = { + meta: { + schema: [ + { + type: 'object', + properties: Object.fromEntries( + Object.keys(DEFAULT_OPTIONS).map((code) => [ + code, + { type: 'boolean' } + ]) + ), + additionalProperties: false + } + ], + }, + create() {} +} + `, ], invalid: [