Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/rules/forbid-component-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ module.exports = {
},
},
},
additionalProperties: false,
}],
},

Expand Down
1 change: 1 addition & 0 deletions lib/rules/forbid-dom-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module.exports = {
type: 'string',
},
},
additionalProperties: false,
}],
minLength: 1,
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/forbid-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
type: 'boolean',
},
},
additionalProperties: true,
additionalProperties: false,
}],
},

Expand Down
1 change: 1 addition & 0 deletions lib/rules/function-component-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ module.exports = {
],
},
},
additionalProperties: false,
},
],
},
Expand Down
67 changes: 33 additions & 34 deletions lib/rules/jsx-curly-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -50,49 +72,25 @@ 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',
}],
},
},
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,
}],
Expand All @@ -109,6 +107,7 @@ module.exports = {
enum: SPACING_VALUES,
},
},
additionalProperties: false,
},
},
additionalProperties: false,
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-handler-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ module.exports = {
items: { type: 'string' },
},
},
additionalProperties: false,
},
],
}],
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-indent-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module.exports = {
type: 'boolean',
},
},
additionalProperties: false,
}],
}],
},
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-max-props-per-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = {
minimum: 1,
},
},
additionalProperties: false,
},
},
additionalProperties: false,
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-no-literals.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ const elementOverrides = {
[reOverridableElement.source]: {
type: 'object',
properties: Object.assign(
{ allowElement: { type: 'boolean' } },
{ applyToNestedElements: { type: 'boolean' } },
commonPropertiesSchema
),

additionalProperties: false,
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/jsx-no-script-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module.exports = {
type: 'boolean',
},
},
additionalItems: false,
additionalProperties: false,
},
],
additionalItems: false,
Expand All @@ -103,7 +103,7 @@ module.exports = {
type: 'boolean',
},
},
additionalItems: false,
additionalProperties: false,
},
],
additionalItems: false,
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-no-useless-fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ module.exports = {
type: 'boolean',
},
},
additionalProperties: false,
}],
},

Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-props-no-spreading.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ module.exports = {
},
},
},
additionalProperties: false,
}, {
not: {
type: 'object',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-danger.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module.exports = {
uniqueItems: true,
},
},
additionalProperties: false,
}],
},

Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-unescaped-entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ module.exports = {
},
},
},
additionalProperties: false,
}],
},
},
Expand Down
1 change: 1 addition & 0 deletions lib/rules/style-prop-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = {
uniqueItems: true,
},
},
additionalProperties: false,
},
],
},
Expand Down