Skip to content

Commit e901d03

Browse files
bradzacherSimenB
authored andcommitted
fix: add missing schemas so rule config is properly validated (#291)
1 parent 9cba626 commit e901d03

29 files changed

+53
-0
lines changed

src/rules/lowercase-name.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ module.exports = {
5555
messages: {
5656
unexpectedLowercase: '`{{ method }}`s should begin with lowercase',
5757
},
58+
schema: [
59+
{
60+
type: 'object',
61+
properties: {
62+
ignore: {
63+
type: 'array',
64+
items: {
65+
enum: ['describe', 'test', 'it'],
66+
},
67+
additionalItems: false,
68+
},
69+
},
70+
additionalProperties: false,
71+
},
72+
],
5873
fixable: 'code',
5974
},
6075
create(context) {

src/rules/no-alias-methods.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111
replaceAlias: `Replace {{ replace }}() with its canonical name of {{ canonical }}()`,
1212
},
1313
fixable: 'code',
14+
schema: [],
1415
},
1516
create(context) {
1617
// The Jest methods which have aliases. The canonical name is the first

src/rules/no-commented-out-tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = {
1616
messages: {
1717
commentedTests: 'Some tests seem to be commented',
1818
},
19+
schema: [],
1920
},
2021
create(context) {
2122
const sourceCode = context.getSourceCode();

src/rules/no-disabled-tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = {
1717
disabledSuite: 'Disabled test suite',
1818
disabledTest: 'Disabled test',
1919
},
20+
schema: [],
2021
},
2122
create(context) {
2223
let suiteDepth = 0;

src/rules/no-empty-title.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
describe: 'describe should not have an empty title',
2020
test: 'test should not have an empty title',
2121
},
22+
schema: [],
2223
},
2324
create(context) {
2425
return {

src/rules/no-focused-tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = {
2727
messages: {
2828
focusedTest: 'Unexpected focused test.',
2929
},
30+
schema: [],
3031
},
3132
create: context => ({
3233
CallExpression(node) {

src/rules/no-identical-title.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ module.exports = {
5454
multipleDescribeTitle:
5555
'Describe block title is used multiple times in the same describe block.',
5656
},
57+
schema: [],
5758
},
5859
create(context) {
5960
const contexts = [newDescribeContext()];

src/rules/no-jasmine-globals.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
'Illegal usage of `pending`, prefer explicitly skipping a test using `test.skip`',
2020
illegalJasmine: 'Illegal usage of jasmine global',
2121
},
22+
schema: [],
2223
},
2324
create(context) {
2425
return {

src/rules/no-jest-import.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
messages: {
1111
unexpectedImport: `Jest is automatically in scope. Do not import "jest", as Jest doesn't export anything.`,
1212
},
13+
schema: [],
1314
},
1415
create(context) {
1516
return {

src/rules/no-large-snapshots.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ module.exports = {
3030
tooLongSnapshots:
3131
'Expected Jest snapshot to be smaller than {{ lineLimit }} lines but was {{ lineCount }} lines long',
3232
},
33+
schema: [
34+
{
35+
type: 'object',
36+
properties: {
37+
maxSize: {
38+
type: 'number',
39+
},
40+
},
41+
additionalProperties: false,
42+
},
43+
],
3344
},
3445
create(context) {
3546
if (context.getFilename().endsWith('.snap')) {

0 commit comments

Comments
 (0)