Skip to content

Commit

Permalink
Update schema (#1582)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Nov 9, 2021
1 parent 31c83cd commit 5ee67a3
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 112 deletions.
92 changes: 48 additions & 44 deletions rules/import-style.js
Expand Up @@ -307,58 +307,62 @@ const create = context => {
return templates.visitor(visitor);
};

const schema = [
{
type: 'object',
properties: {
checkImport: {
type: 'boolean',
},
checkDynamicImport: {
type: 'boolean',
},
checkExportFrom: {
type: 'boolean',
},
checkRequire: {
type: 'boolean',
},
extendDefaultStyles: {
type: 'boolean',
const schema = {
type: 'array',
additionalItems: false,
items: [
{
type: 'object',
properties: {
checkImport: {
type: 'boolean',
},
checkDynamicImport: {
type: 'boolean',
},
checkExportFrom: {
type: 'boolean',
},
checkRequire: {
type: 'boolean',
},
extendDefaultStyles: {
type: 'boolean',
},
styles: {
$ref: '#/definitions/moduleStyles',
},
},
styles: {
$ref: '#/items/0/definitions/moduleStyles',
additionalProperties: false,
},
],
definitions: {
moduleStyles: {
type: 'object',
additionalProperties: {
$ref: '#/definitions/styles',
},
},
additionalProperties: false,
definitions: {
moduleStyles: {
type: 'object',
additionalProperties: {
$ref: '#/items/0/definitions/styles',
styles: {
anyOf: [
{
enum: [
false,
],
},
},
styles: {
anyOf: [
{
enum: [
false,
],
},
{
$ref: '#/items/0/definitions/booleanObject',
},
],
},
booleanObject: {
type: 'object',
additionalProperties: {
type: 'boolean',
{
$ref: '#/definitions/booleanObject',
},
],
},
booleanObject: {
type: 'object',
additionalProperties: {
type: 'boolean',
},
},
},
];
};

module.exports = {
create,
Expand Down
140 changes: 72 additions & 68 deletions rules/prevent-abbreviations.js
Expand Up @@ -528,82 +528,86 @@ const create = context => {
};
};

const schema = [
{
type: 'object',
properties: {
checkProperties: {
type: 'boolean',
},
checkVariables: {
type: 'boolean',
},
checkDefaultAndNamespaceImports: {
type: [
'boolean',
'string',
],
pattern: 'internal',
},
checkShorthandImports: {
type: [
'boolean',
'string',
],
pattern: 'internal',
},
checkShorthandProperties: {
type: 'boolean',
},
checkFilenames: {
type: 'boolean',
},
extendDefaultReplacements: {
type: 'boolean',
},
replacements: {
$ref: '#/items/0/definitions/abbreviations',
},
extendDefaultAllowList: {
type: 'boolean',
},
allowList: {
$ref: '#/items/0/definitions/booleanObject',
const schema = {
type: 'array',
additionalItems: false,
items: [
{
type: 'object',
properties: {
checkProperties: {
type: 'boolean',
},
checkVariables: {
type: 'boolean',
},
checkDefaultAndNamespaceImports: {
type: [
'boolean',
'string',
],
pattern: 'internal',
},
checkShorthandImports: {
type: [
'boolean',
'string',
],
pattern: 'internal',
},
checkShorthandProperties: {
type: 'boolean',
},
checkFilenames: {
type: 'boolean',
},
extendDefaultReplacements: {
type: 'boolean',
},
replacements: {
$ref: '#/definitions/abbreviations',
},
extendDefaultAllowList: {
type: 'boolean',
},
allowList: {
$ref: '#/definitions/booleanObject',
},
ignore: {
type: 'array',
uniqueItems: true,
},
},
ignore: {
type: 'array',
uniqueItems: true,
additionalProperties: false,
},
],
definitions: {
abbreviations: {
type: 'object',
additionalProperties: {
$ref: '#/definitions/replacements',
},
},
additionalProperties: false,
definitions: {
abbreviations: {
type: 'object',
additionalProperties: {
$ref: '#/items/0/definitions/replacements',
replacements: {
anyOf: [
{
enum: [
false,
],
},
},
replacements: {
anyOf: [
{
enum: [
false,
],
},
{
$ref: '#/items/0/definitions/booleanObject',
},
],
},
booleanObject: {
type: 'object',
additionalProperties: {
type: 'boolean',
{
$ref: '#/definitions/booleanObject',
},
],
},
booleanObject: {
type: 'object',
additionalProperties: {
type: 'boolean',
},
},
},
];
};

module.exports = {
create,
Expand Down

0 comments on commit 5ee67a3

Please sign in to comment.