Skip to content

Commit 9d1965f

Browse files
committed
Add rule prohibiting spaces between a template tag and its literal
1 parent 3899710 commit 9d1965f

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

etc/eslint/rules/style.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,6 +1810,25 @@ rules[ 'switch-colon-spacing' ] = [ 'error', {
18101810
'after': true
18111811
}];
18121812

1813+
/**
1814+
* Do not allow one or more spaces between template tags and their literals.
1815+
*
1816+
* @name template-tag-spacing
1817+
* @memberof rules
1818+
* @type {Array}
1819+
* @default [ 'error', 'never' ]
1820+
* @see [template-tag-spacing]{@link http://eslint.org/docs/rules/template-tag-spacing}
1821+
*
1822+
* @example
1823+
* // Bad...
1824+
* var foo = bar `beep boop`;
1825+
*
1826+
* @example
1827+
* // Good...
1828+
* var foo = bar`beep boop`;
1829+
*/
1830+
rules[ 'template-tag-spacing' ] = [ 'error', 'never' ];
1831+
18131832
/**
18141833
* Do not require a Unicode byte order mark (BOM), as we assume UTF-8.
18151834
*

0 commit comments

Comments
 (0)