Skip to content

Commit e1e5da7

Browse files
authored
handle undefined context.options[0] (#1915)
1 parent 26b81ab commit e1e5da7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eslint-rules/lib/rules/no-hard-coded-color.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ module.exports = {
3232
message: `Found '${colorString}'. Use UILib colors instead of hardcoded colors.${dueDateNotice}`,
3333
fix(fixer) {
3434
if (node) {
35-
const {validColors} = context.options[0];
36-
const {customColors: extraColors} = context.options[0];
35+
const validColors = context.options[0] && context.options[0].validColors;
36+
const extraColors = context.options[0] && context.options[0].customColors;
3737
if (validColors) {
3838
const validColorsDic = _.chain(validColors)
3939
.mapValues(value => value.toLowerCase())

0 commit comments

Comments
 (0)