What is jslint wanting me to do here?

  1. Expected one space between ‘,’ and ‘controls’.
    “controls”, “disablekb”, “end”, “fs”, “iv_load_policy”,

172: 102. Expected one space between ‘,’ and ‘list’.
“list”, “listType”, “loop”, “playlist”, “rel”, “start”];

What is wrong here?

    const settingsParams = ["width", "height", "videoid", "host"];
        const settings = settingsParams.reduce(paramInOpts, {});
        const playerVarsParams = ["autoplay", "cc_load_policy",
         "controls", "disablekb", "end", "fs", "iv_load_policy",
         "list", "listType", "loop", "playlist", "rel", "start"];
        settings.playerVars = playerVarsParams.reduce(paramInOpts, {});
        videoPlayer.addPlayer(video, settings);
    }

I think jslint is seeing a comma, then a newline, then a space, and then “controls”. It wants to see only a comma and a space. Perhaps your editor is adding a newline character, or the newline snuck in there when you copy/pasted, through some intermediary window, or perhaps you need to adjust the way your editor is handling line wrapping.
Also, consider switching from jslint to eslint, which is more modern, more gentle, and configurable.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.