diff --git a/lib/rules/forbid-component-props.js b/lib/rules/forbid-component-props.js index 2dd4412b87..468365885e 100644 --- a/lib/rules/forbid-component-props.js +++ b/lib/rules/forbid-component-props.js @@ -131,6 +131,7 @@ module.exports = { }, }, }, + additionalProperties: false, }], }, diff --git a/lib/rules/forbid-dom-props.js b/lib/rules/forbid-dom-props.js index 4638a8700d..e2f8b217c2 100644 --- a/lib/rules/forbid-dom-props.js +++ b/lib/rules/forbid-dom-props.js @@ -74,6 +74,7 @@ module.exports = { type: 'string', }, }, + additionalProperties: false, }], minLength: 1, }, diff --git a/lib/rules/forbid-prop-types.js b/lib/rules/forbid-prop-types.js index 44de1fa023..5dfa48a220 100644 --- a/lib/rules/forbid-prop-types.js +++ b/lib/rules/forbid-prop-types.js @@ -54,7 +54,7 @@ module.exports = { type: 'boolean', }, }, - additionalProperties: true, + additionalProperties: false, }], }, diff --git a/lib/rules/function-component-definition.js b/lib/rules/function-component-definition.js index cca665abe2..3f11c5d81f 100644 --- a/lib/rules/function-component-definition.js +++ b/lib/rules/function-component-definition.js @@ -167,6 +167,7 @@ module.exports = { ], }, }, + additionalProperties: false, }, ], }, diff --git a/lib/rules/jsx-curly-spacing.js b/lib/rules/jsx-curly-spacing.js index fda49381ce..d39b202e6d 100644 --- a/lib/rules/jsx-curly-spacing.js +++ b/lib/rules/jsx-curly-spacing.js @@ -35,6 +35,28 @@ const messages = { spaceNeededBefore: 'A space is required before \'{{token}}\'', }; +const BASIC_CONFIG_SCHEMA = { + type: 'object', + properties: { + when: { + enum: SPACING_VALUES, + }, + allowMultiline: { + type: 'boolean', + }, + spacing: { + type: 'object', + properties: { + objectLiterals: { + enum: SPACING_VALUES, + }, + }, + additionalProperties: false, + }, + }, + additionalProperties: false, +}; + /** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { @@ -50,29 +72,8 @@ module.exports = { schema: { definitions: { - basicConfig: { - type: 'object', - properties: { - when: { - enum: SPACING_VALUES, - }, - allowMultiline: { - type: 'boolean', - }, - spacing: { - type: 'object', - properties: { - objectLiterals: { - enum: SPACING_VALUES, - }, - }, - }, - }, - }, basicConfigOrBoolean: { - anyOf: [{ - $ref: '#/definitions/basicConfig', - }, { + anyOf: [BASIC_CONFIG_SCHEMA, { type: 'boolean', }], }, @@ -80,19 +81,16 @@ module.exports = { type: 'array', items: [{ anyOf: [{ - allOf: [{ - $ref: '#/definitions/basicConfig', - }, { - type: 'object', - properties: { - attributes: { - $ref: '#/definitions/basicConfigOrBoolean', - }, - children: { - $ref: '#/definitions/basicConfigOrBoolean', - }, + type: 'object', + properties: Object.assign(BASIC_CONFIG_SCHEMA.properties, { + attributes: { + $ref: '#/definitions/basicConfigOrBoolean', }, - }], + children: { + $ref: '#/definitions/basicConfigOrBoolean', + }, + }), + additionalProperties: false, }, { enum: SPACING_VALUES, }], @@ -109,6 +107,7 @@ module.exports = { enum: SPACING_VALUES, }, }, + additionalProperties: false, }, }, additionalProperties: false, diff --git a/lib/rules/jsx-handler-names.js b/lib/rules/jsx-handler-names.js index f89f24413e..070019dcfe 100644 --- a/lib/rules/jsx-handler-names.js +++ b/lib/rules/jsx-handler-names.js @@ -111,6 +111,7 @@ module.exports = { items: { type: 'string' }, }, }, + additionalProperties: false, }, ], }], diff --git a/lib/rules/jsx-indent-props.js b/lib/rules/jsx-indent-props.js index 8504878731..4fe40fac84 100644 --- a/lib/rules/jsx-indent-props.js +++ b/lib/rules/jsx-indent-props.js @@ -77,6 +77,7 @@ module.exports = { type: 'boolean', }, }, + additionalProperties: false, }], }], }, diff --git a/lib/rules/jsx-max-props-per-line.js b/lib/rules/jsx-max-props-per-line.js index eebf7f0f33..81d515b58d 100644 --- a/lib/rules/jsx-max-props-per-line.js +++ b/lib/rules/jsx-max-props-per-line.js @@ -53,6 +53,7 @@ module.exports = { minimum: 1, }, }, + additionalProperties: false, }, }, additionalProperties: false, diff --git a/lib/rules/jsx-no-literals.js b/lib/rules/jsx-no-literals.js index 45c9a54c48..81780d5ca5 100644 --- a/lib/rules/jsx-no-literals.js +++ b/lib/rules/jsx-no-literals.js @@ -138,10 +138,11 @@ const elementOverrides = { [reOverridableElement.source]: { type: 'object', properties: Object.assign( + { allowElement: { type: 'boolean' } }, { applyToNestedElements: { type: 'boolean' } }, commonPropertiesSchema ), - + additionalProperties: false, }, }, }; diff --git a/lib/rules/jsx-no-script-url.js b/lib/rules/jsx-no-script-url.js index b18ce2ccb3..8dd4b8d9ea 100644 --- a/lib/rules/jsx-no-script-url.js +++ b/lib/rules/jsx-no-script-url.js @@ -88,7 +88,7 @@ module.exports = { type: 'boolean', }, }, - additionalItems: false, + additionalProperties: false, }, ], additionalItems: false, @@ -103,7 +103,7 @@ module.exports = { type: 'boolean', }, }, - additionalItems: false, + additionalProperties: false, }, ], additionalItems: false, diff --git a/lib/rules/jsx-no-useless-fragment.js b/lib/rules/jsx-no-useless-fragment.js index 9827560f0e..7562682669 100644 --- a/lib/rules/jsx-no-useless-fragment.js +++ b/lib/rules/jsx-no-useless-fragment.js @@ -103,6 +103,7 @@ module.exports = { type: 'boolean', }, }, + additionalProperties: false, }], }, diff --git a/lib/rules/jsx-props-no-spreading.js b/lib/rules/jsx-props-no-spreading.js index 1aa8ab4ace..1657dd4c2d 100644 --- a/lib/rules/jsx-props-no-spreading.js +++ b/lib/rules/jsx-props-no-spreading.js @@ -71,6 +71,7 @@ module.exports = { }, }, }, + additionalProperties: false, }, { not: { type: 'object', diff --git a/lib/rules/no-danger.js b/lib/rules/no-danger.js index 54dbed49cf..647311d745 100644 --- a/lib/rules/no-danger.js +++ b/lib/rules/no-danger.js @@ -68,6 +68,7 @@ module.exports = { uniqueItems: true, }, }, + additionalProperties: false, }], }, diff --git a/lib/rules/no-unescaped-entities.js b/lib/rules/no-unescaped-entities.js index 3ec2cb23b6..9f42cee3c4 100644 --- a/lib/rules/no-unescaped-entities.js +++ b/lib/rules/no-unescaped-entities.js @@ -73,6 +73,7 @@ module.exports = { }, }, }, + additionalProperties: false, }], }, }, diff --git a/lib/rules/style-prop-object.js b/lib/rules/style-prop-object.js index f2c63e525f..6da08240ab 100644 --- a/lib/rules/style-prop-object.js +++ b/lib/rules/style-prop-object.js @@ -43,6 +43,7 @@ module.exports = { uniqueItems: true, }, }, + additionalProperties: false, }, ], },