Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: correct handling of additionalProperties in object schemas#6939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bradzacher merged 1 commit intov6fromv6-fix-additional-properties
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionspackages/eslint-plugin/src/rules/array-type.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -112,6 +112,7 @@ export default util.createRule<Options, MessageIds>({
enum: ['array', 'generic', 'array-simple'],
},
},
additionalProperties: false,
properties: {
default: {
$ref: '#/items/0/$defs/arrayOption',
Expand Down
1 change: 1 addition & 0 deletionspackages/eslint-plugin/src/rules/ban-ts-comment.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,6 +53,7 @@ export default util.createRule<[Options], MessageIds>({
},
{
type: 'object',
additionalProperties: false,
properties: {
descriptionFormat: { type: 'string' },
},
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@ const $DEFS: Record<string, JSONSchema.JSONSchema4> = {
},
matchRegexConfig: {
type: 'object',
additionalProperties: false,
properties: {
match: { type: 'boolean' },
regex: { type: 'string' },
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,7 @@ export default util.createRule<Options, MessageId>({
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
checksConditionals: {
type: 'boolean',
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,6 +31,7 @@ export default util.createRule<Options, MessageIds>({
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
typesToIgnore: {
description: 'A list of type names to ignore.',
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ export default util.createRule<Options, MessageIds>({
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
ignoreStringArrays: {
description:
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,7 @@ export default util.createRule<Options, MessageId>({
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowNumber: {
description:
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,6 +124,7 @@ export default util.createRule<Options, MessageIds>({
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
checkIntersections: {
description: 'Whether to check intersection types.',
Expand Down
1 change: 1 addition & 0 deletionspackages/eslint-plugin/src/rules/typedef.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,6 +31,7 @@ export default util.createRule<[Options], MessageIds>({
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
[OptionKeys.ArrayDestructuring]: { type: 'boolean' },
[OptionKeys.ArrowParameter]: { type: 'boolean' },
Expand Down
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,13 +13,16 @@ export function generateObjectType(
const commentLines = getCommentLines(schema);

let indexSignature: AST | null = null;
if (schema.additionalProperties === true) {
if (
schema.additionalProperties === true ||
schema.additionalProperties === undefined
) {
indexSignature = {
type: 'type-reference',
typeName: 'unknown',
commentLines: [],
};
} else if (schema.additionalProperties) {
} else if (typeofschema.additionalProperties === 'object') {
const indexSigType = generateType(schema.additionalProperties, refMap);
indexSignature = indexSigType;
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp