JSHint doesn't allow disabling a specific rule for a single line, but it is possible to disable all validations for a line:
var do_something; /* jshint ignore:line */
For JSCS, the syntax to enable/disable a single rule is like this:
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
...
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
Put together, to disable both JSHint and JSCS validation for a particular line, one would use a combination of the comments above:
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
var var_name_with_underscores; /* jshint ignore:line */
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
If the non-camelcase identifier is used in multiple lines inside a block (as is normally the rule), it may be necessary to enclose the whole function in comments.
// jscs: disable requireCamelCaseOrUpperCaseIdentifiers
/* jshint ignore:start */
function foo()
{
var var_name_with_underscores;
...
var_name_with_underscores = 123;
...
}
/* jshint ignore:end */
// jscs: enable requireCamelCaseOrUpperCaseIdentifiers