Skip to content

Commit

Permalink
fix: Place schema property under meta (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall authored Dec 19, 2023
1 parent faedc01 commit 40d0f97
Show file tree
Hide file tree
Showing 44 changed files with 115 additions and 85 deletions.
2 changes: 1 addition & 1 deletion src/rules/arrayStyle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default (defaultConfig, simpleType) => {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
};
28 changes: 14 additions & 14 deletions src/rules/arrowParens.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,21 @@ export default {
},

type: 'layout',
},

schema: [
{
enum: ['always', 'as-needed'],
},
{
additionalProperties: false,
properties: {
requireForBlockBody: {
default: false,
type: 'boolean',
schema: [
{
enum: ['always', 'as-needed'],
},
{
additionalProperties: false,
properties: {
requireForBlockBody: {
default: false,
type: 'boolean',
},
},
type: 'object',
},
type: 'object',
},
],
],
},
};
2 changes: 1 addition & 1 deletion src/rules/booleanStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
4 changes: 3 additions & 1 deletion src/rules/defineFlowType.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
2 changes: 1 addition & 1 deletion src/rules/delimiterDangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
2 changes: 1 addition & 1 deletion src/rules/enforceLineBreak.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
4 changes: 3 additions & 1 deletion src/rules/enforceSuppressionCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
10 changes: 4 additions & 6 deletions src/rules/genericSpacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,10 @@ const create = (context) => {
};
};

const meta = {
fixable: 'whitespace',
};

export default {
create,
meta,
schema,
meta: {
fixable: 'whitespace',
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/interfaceIdMatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
2 changes: 1 addition & 1 deletion src/rules/newlineAfterFlowAnnotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
4 changes: 3 additions & 1 deletion src/rules/noDupeKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/noFlowFixMeComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/noFlowSuppressionsInStrictFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@ const create: Rule$Create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/noMixed.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ const create = (context) => ({

export default {
create,
schema,
meta: {
schema,
},
};
2 changes: 1 addition & 1 deletion src/rules/noMutableArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
4 changes: 3 additions & 1 deletion src/rules/noPrimitiveConstructorTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/noTypesMissingFileAnnotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/noWeakTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,7 @@ const create: Rule$Create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
10 changes: 4 additions & 6 deletions src/rules/objectTypeCurlySpacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ const schema = [
},
];

const meta = {
fixable: 'code',
};

const sameLine = (left, right) => left.loc.end.line === right.loc.start.line;

const create = (context) => {
Expand Down Expand Up @@ -86,6 +82,8 @@ const create = (context) => {

export default {
create,
meta,
schema,
meta: {
fixable: 'code',
schema,
},
};
2 changes: 1 addition & 1 deletion src/rules/objectTypeDelimiter.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
10 changes: 4 additions & 6 deletions src/rules/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ const schema = [
},
];

const meta = {
fixable: 'code',
};

const create = (context) => {
const double = (context.options[0] || 'double') === 'double';
const sourceCode = context.getSourceCode();
Expand Down Expand Up @@ -42,6 +38,8 @@ const create = (context) => {

export default {
create,
meta,
schema,
meta: {
fixable: 'code',
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/requireCompoundTypeAlias.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
10 changes: 4 additions & 6 deletions src/rules/requireExactType.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ const schema = [
},
];

const meta = {
fixable: 'code',
};

const create = (context) => {
const always = (context.options[0] || 'always') === 'always';
const sourceCode = context.getSourceCode();
Expand Down Expand Up @@ -48,6 +44,8 @@ const create = (context) => {

export default {
create,
meta,
schema,
meta: {
fixable: 'code',
schema,
},
};
2 changes: 1 addition & 1 deletion src/rules/requireIndexerName.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
4 changes: 3 additions & 1 deletion src/rules/requireInexactType.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/requireParameterType.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@ const create = iterateFunctionNodes((context) => {

export default {
create,
schema,
meta: {
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/requireReadonlyReactProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/requireReturnType.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
4 changes: 3 additions & 1 deletion src/rules/requireTypesAtTop.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
2 changes: 1 addition & 1 deletion src/rules/requireValidFileAnnotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
4 changes: 3 additions & 1 deletion src/rules/requireVariableType.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,7 @@ const create = (context) => {

export default {
create,
schema,
meta: {
schema,
},
};
2 changes: 1 addition & 1 deletion src/rules/semi.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
2 changes: 1 addition & 1 deletion src/rules/sortKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
2 changes: 1 addition & 1 deletion src/rules/spaceAfterTypeColon.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
2 changes: 1 addition & 1 deletion src/rules/spaceBeforeGenericBracket.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
2 changes: 1 addition & 1 deletion src/rules/spaceBeforeTypeColon.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export default {
create,
meta: {
fixable: 'code',
schema,
},
schema,
};
4 changes: 3 additions & 1 deletion src/rules/spreadExactType.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ const create = (context) => ({

export default {
create,
schema,
meta: {
schema,
},
};
Loading

0 comments on commit 40d0f97

Please sign in to comment.