Skip to content

Commit 338e530

Browse files
committed
Add schema to validate rules options
1 parent d657ea5 commit 338e530

18 files changed

+124
-6
lines changed

lib/rules/display-name.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,13 @@ module.exports = function(context) {
197197
};
198198

199199
};
200+
201+
module.exports.schema = [{
202+
type: 'object',
203+
properties: {
204+
acceptTranspilerName: {
205+
type: 'boolean'
206+
}
207+
},
208+
additionalProperties: false
209+
}];

lib/rules/jsx-boolean-value.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ module.exports = function(context) {
3434
}
3535
};
3636
};
37+
38+
module.exports.schema = [{
39+
enum: ['always', 'never']
40+
}];

lib/rules/jsx-no-undef.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ module.exports = function(context) {
6363
};
6464

6565
};
66+
67+
module.exports.schema = [];

lib/rules/jsx-quotes.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,9 @@ module.exports = function(context) {
6868
};
6969

7070
};
71+
72+
module.exports.schema = [{
73+
enum: ['single', 'double']
74+
}, {
75+
enum: ['avoid-escape']
76+
}];

lib/rules/jsx-sort-prop-types.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,13 @@ module.exports = function(context) {
9292

9393
};
9494
};
95+
96+
module.exports.schema = [{
97+
type: 'object',
98+
properties: {
99+
ignoreCase: {
100+
type: 'boolean'
101+
}
102+
},
103+
additionalProperties: false
104+
}];

lib/rules/jsx-sort-props.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,13 @@ module.exports = function(context) {
3838
}
3939
};
4040
};
41+
42+
module.exports.schema = [{
43+
type: 'object',
44+
properties: {
45+
ignoreCase: {
46+
type: 'boolean'
47+
}
48+
},
49+
additionalProperties: false
50+
}];

lib/rules/jsx-uses-react.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,13 @@ module.exports = function(context) {
3838
};
3939

4040
};
41+
42+
module.exports.schema = [{
43+
type: 'object',
44+
properties: {
45+
pragma: {
46+
type: 'string'
47+
}
48+
},
49+
additionalProperties: false
50+
}];

lib/rules/jsx-uses-vars.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ module.exports = function(context) {
3030
};
3131

3232
};
33+
34+
module.exports.schema = [];

lib/rules/no-did-mount-set-state.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ module.exports = function(context) {
4747
};
4848

4949
};
50+
51+
module.exports.schema = [{
52+
enum: ['allow-in-func']
53+
}];

lib/rules/no-did-update-set-state.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ module.exports = function(context) {
3535
};
3636

3737
};
38+
39+
module.exports.schema = [];

0 commit comments

Comments
 (0)