Skip to content

Commit

Permalink
chore(eslint-plugin): use defs, not definitions, in rule schemas (#5534)
Browse files Browse the repository at this point in the history
chore(eslint-plugin): use defs, not definitions, in rule schemas
  • Loading branch information
JoshuaKGoldberg committed Aug 24, 2022
1 parent 6ab767b commit 4a805d5
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions packages/eslint-plugin/src/rules/array-type.ts
Expand Up @@ -104,18 +104,18 @@ export default util.createRule<Options, MessageIds>({
},
schema: [
{
definitions: {
$defs: {
arrayOption: {
enum: ['array', 'generic', 'array-simple'],
},
},
properties: {
default: {
$ref: '#/definitions/arrayOption',
$ref: '#/$defs/arrayOption',
description: 'The array type expected for mutable cases...',
},
readonly: {
$ref: '#/definitions/arrayOption',
$ref: '#/$defs/arrayOption',
description:
'The array type expected for readonly cases. If omitted, the value for `default` will be used.',
},
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-plugin/src/rules/ban-ts-comment.ts
Expand Up @@ -40,7 +40,7 @@ export default util.createRule<[Options], MessageIds>({
},
schema: [
{
definitions: {
$defs: {
directiveConfigSchema: {
oneOf: [
{
Expand All @@ -62,11 +62,11 @@ export default util.createRule<[Options], MessageIds>({
type: 'object',
properties: {
'ts-expect-error': {
$ref: '#/definitions/directiveConfigSchema',
$ref: '#/$defs/directiveConfigSchema',
},
'ts-ignore': { $ref: '#/definitions/directiveConfigSchema' },
'ts-nocheck': { $ref: '#/definitions/directiveConfigSchema' },
'ts-check': { $ref: '#/definitions/directiveConfigSchema' },
'ts-ignore': { $ref: '#/$defs/directiveConfigSchema' },
'ts-nocheck': { $ref: '#/$defs/directiveConfigSchema' },
'ts-check': { $ref: '#/$defs/directiveConfigSchema' },
minimumDescriptionLength: {
type: 'number',
default: defaultMinimumDescriptionLength,
Expand Down
20 changes: 10 additions & 10 deletions packages/eslint-plugin/src/rules/comma-dangle.ts
Expand Up @@ -46,7 +46,7 @@ export default util.createRule<Options, MessageIds>({
extendsBaseRule: true,
},
schema: {
definitions: {
$defs: {
value: {
enum: OPTION_VALUE_SCHEME,
},
Expand All @@ -59,19 +59,19 @@ export default util.createRule<Options, MessageIds>({
{
oneOf: [
{
$ref: '#/definitions/value',
$ref: '#/$defs/value',
},
{
type: 'object',
properties: {
arrays: { $ref: '#/definitions/valueWithIgnore' },
objects: { $ref: '#/definitions/valueWithIgnore' },
imports: { $ref: '#/definitions/valueWithIgnore' },
exports: { $ref: '#/definitions/valueWithIgnore' },
functions: { $ref: '#/definitions/valueWithIgnore' },
enums: { $ref: '#/definitions/valueWithIgnore' },
generics: { $ref: '#/definitions/valueWithIgnore' },
tuples: { $ref: '#/definitions/valueWithIgnore' },
arrays: { $ref: '#/$defs/valueWithIgnore' },
objects: { $ref: '#/$defs/valueWithIgnore' },
imports: { $ref: '#/$defs/valueWithIgnore' },
exports: { $ref: '#/$defs/valueWithIgnore' },
functions: { $ref: '#/$defs/valueWithIgnore' },
enums: { $ref: '#/$defs/valueWithIgnore' },
generics: { $ref: '#/$defs/valueWithIgnore' },
tuples: { $ref: '#/$defs/valueWithIgnore' },
},
additionalProperties: false,
},
Expand Down
Expand Up @@ -63,20 +63,20 @@ export default util.createRule<Options, MessageIds>({
},
schema: [
{
definitions: {
$defs: {
accessibilityLevel,
},
type: 'object',
properties: {
accessibility: { $ref: '#/definitions/accessibilityLevel' },
accessibility: { $ref: '#/$defs/accessibilityLevel' },
overrides: {
type: 'object',
properties: {
accessors: { $ref: '#/definitions/accessibilityLevel' },
constructors: { $ref: '#/definitions/accessibilityLevel' },
methods: { $ref: '#/definitions/accessibilityLevel' },
properties: { $ref: '#/definitions/accessibilityLevel' },
parameterProperties: { $ref: '#/definitions/accessibilityLevel' },
accessors: { $ref: '#/$defs/accessibilityLevel' },
constructors: { $ref: '#/$defs/accessibilityLevel' },
methods: { $ref: '#/$defs/accessibilityLevel' },
properties: { $ref: '#/$defs/accessibilityLevel' },
parameterProperties: { $ref: '#/$defs/accessibilityLevel' },
},

additionalProperties: false,
Expand Down
Expand Up @@ -594,7 +594,7 @@ export default util.createRule<Options, MessageIds>({
fixable: 'whitespace',
hasSuggestions: false,
schema: {
definitions: {
$defs: {
paddingType: {
enum: Object.keys(PaddingTypes),
},
Expand All @@ -615,9 +615,9 @@ export default util.createRule<Options, MessageIds>({
items: {
type: 'object',
properties: {
blankLine: { $ref: '#/definitions/paddingType' },
prev: { $ref: '#/definitions/statementType' },
next: { $ref: '#/definitions/statementType' },
blankLine: { $ref: '#/$defs/paddingType' },
prev: { $ref: '#/$defs/statementType' },
next: { $ref: '#/$defs/statementType' },
},
additionalProperties: false,
required: ['blankLine', 'prev', 'next'],
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/parameter-properties.ts
Expand Up @@ -38,7 +38,7 @@ export default util.createRule<Options, MessageIds>({
},
schema: [
{
definitions: {
$defs: {
modifier: {
enum: [
'readonly',
Expand All @@ -56,7 +56,7 @@ export default util.createRule<Options, MessageIds>({
allow: {
type: 'array',
items: {
$ref: '#/definitions/modifier',
$ref: '#/$defs/modifier',
},
minItems: 1,
},
Expand Down

0 comments on commit 4a805d5

Please sign in to comment.