Skip to content

Commit

Permalink
Actually fix array-type
Browse files Browse the repository at this point in the history
  • Loading branch information
domdomegg committed Apr 12, 2023
1 parent 68b193d commit d4ce93b
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions packages/eslint-plugin/src/rules/array-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,32 +105,31 @@ export default util.createRule<Options, MessageIds>({
errorStringGenericSimple:
"Array type using '{{readonlyPrefix}}{{type}}[]' is forbidden for non-simple types. Use '{{className}}<{{type}}>' instead.",
},
schema: [
{
$defs: {
arrayOption: {
enum: ['array', 'generic', 'array-simple'],
},
schema: {
$defs: {
arrayOption: {
enum: ['array', 'generic', 'array-simple'],
},
prefixItems: [
{
properties: {
default: {
$ref: '#/$defs/arrayOption',
description: 'The array type expected for mutable cases...',
},
readonly: {
$ref: '#/$defs/arrayOption',
description:
'The array type expected for readonly cases. If omitted, the value for `default` will be used.',
},
},
items: [
{
type: 'object',
additionalProperties: false,
properties: {
default: {
$ref: '#/$defs/arrayOption',
description: 'The array type expected for mutable cases...',
},
readonly: {
$ref: '#/$defs/arrayOption',
description:
'The array type expected for readonly cases. If omitted, the value for `default` will be used.',
},
type: 'object',
},
],
type: 'array',
},
],
},
],
type: 'array',
},
},
defaultOptions: [
{
Expand Down

0 comments on commit d4ce93b

Please sign in to comment.