eslint-plugin-nowrap-in-template-string
Version:
No wrap in template string rule for Eslint
34 lines (30 loc) • 766 B
JavaScript
/**
* @fileoverview Rule to disallow wrap in template string
* @author Zhang Visper
*/
;
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
meta: {
docs: {
description: 'disallow wrap in template string',
category: 'ECMAScript 6',
recommended: false
},
schema: [] // no options
},
create: function(context) {
return {
TemplateLiteral(node) {
if (node.loc.start.line !== node.loc.end.line) {
context.report({
node: node,
message: 'Unexpected wrap in template string'
})
}
}
};
}
};