diff --git a/lib/validateConfig.js b/lib/validateConfig.js index bcc79091c..6e5011ff4 100644 --- a/lib/validateConfig.js +++ b/lib/validateConfig.js @@ -23,13 +23,14 @@ const TEST_DEPRECATED_KEYS = new Map([ * two curly braces without a `,` or `..` between them, to make sure * users can still accidentally use them without * some linters never matching anything. It will further not match - * escaped braces `\{` `\}`, or if braces contain an escaped comma `\,` + * escaped braces `\{` `\}`, or if braces contain an escaped comma `\,`. + * Finally, a dollar sign `${` inhibits brace expansion. * * For example `.{js,ts}` or `file_{1..10}` are valid but `*.{js}` is not. * * @see https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html */ -const BRACES_REGEXP = new RegExp(/(? { expect('*.{js\\,ts}'.match(BRACES_REGEXP)).toBeTruthy() }) + it("should not match '*.${js}'", () => { + expect('*.${js}'.match(BRACES_REGEXP)).not.toBeTruthy() + }) + it(`should not match '.{js,ts}'`, () => { expect('.{js,ts}'.match(BRACES_REGEXP)).not.toBeTruthy() })