diff --git a/__tests__/filters-downloader.test.js b/__tests__/filters-downloader.test.js index 53f9feb..4bb2a03 100644 --- a/__tests__/filters-downloader.test.js +++ b/__tests__/filters-downloader.test.js @@ -1,4 +1,4 @@ -/* global QUnit */ +/* global QUnit, assert */ /* eslint-disable global-require */ const FilterCompilerConditionsConstants = { @@ -590,7 +590,7 @@ QUnit.test('Test filter downloader - invalid "if" conditions', async (assert) => 'if_chromium_rule', '!#elseif adguard_ext_firefox', 'invalid_else', - '!#endif' + '!#endif', ]; assert.throws(() => { FilterDownloader.resolveConditions(rules, FilterCompilerConditionsConstants); @@ -795,7 +795,7 @@ QUnit.test('Test filter downloader - simple "if" conditions with "else" branch', 'adguard_included_rule', '!#else', 'non_adguard_included_rule', - '!#endif' + '!#endif', ]; expected = [ 'always_included_rule', @@ -811,7 +811,7 @@ QUnit.test('Test filter downloader - simple "if" conditions with "else" branch', '!#else', 'adguard_included_rule_1', 'adguard_included_rule_2', - '!#endif' + '!#endif', ]; expected = [ 'always_included_rule', @@ -827,7 +827,7 @@ QUnit.test('Test filter downloader - simple "if" conditions with "else" branch', 'adguard_included_rule', '!#else', 'non_adguard_included_rule', - '!#endif' + '!#endif', ]; expected = [ 'always_included_rule', @@ -847,7 +847,7 @@ QUnit.test('Test filter downloader - simple "if" conditions with "else" branch', 'adguard_ext_chromium_included_rule', '!#else', 'non_adguard_included_rule_2', - '!#endif' + '!#endif', ]; expected = [ 'always_included_rule', @@ -868,7 +868,7 @@ QUnit.test('Test filter downloader - simple "if" conditions with "else" branch', 'non_adguard_included_rule_2', '!#else', 'adguard_ext_chromium_included_rule', - '!#endif' + '!#endif', ]; expected = [ 'always_included_rule', @@ -892,7 +892,7 @@ QUnit.test('Test filter downloader - logical "if" conditions with "else" branch' 'adguard_included_rule', '!#else', 'non_adguard_included_rule', - '!#endif' + '!#endif', ]; expected = [ 'always_included_rule', @@ -997,7 +997,7 @@ QUnit.test('Test filter downloader - logical "if" conditions with "else" branch' 'if_included_rule', '!#else', 'else_included_rule', - '!#endif' + '!#endif', ]; expected = [ 'always_included_rule', @@ -1012,7 +1012,7 @@ QUnit.test('Test filter downloader - logical "if" conditions with "else" branch' 'if_included_rule', '!#else', 'else_included_rule', - '!#endif' + '!#endif', ]; expected = [ 'always_included_rule', @@ -1040,7 +1040,7 @@ QUnit.test('Test filter downloader - nested if conditions with else branch', asy '!#endif', '!#else', 'else_first_level_rule', - '!#endif' + '!#endif', ]; expected = [ 'zero_level_rule', @@ -1066,7 +1066,7 @@ QUnit.test('Test filter downloader - nested if conditions with else branch', asy '!#endif', '!#else', 'else_first_level_rule', - '!#endif' + '!#endif', ]; expected = [ 'zero_level_rule', @@ -1093,7 +1093,7 @@ QUnit.test('Test filter downloader - nested if conditions with else branch', asy '!#endif', '!#else', 'else_first_level_rule', - '!#endif' + '!#endif', ]; expected = [ 'zero_level_rule', @@ -1115,7 +1115,7 @@ QUnit.test('Test filter downloader - nested if conditions with else branch', asy '!#endif', '!#else', 'else_first_level_rule', - '!#endif' + '!#endif', ]; expected = [ 'zero_level_rule', @@ -1136,7 +1136,7 @@ QUnit.test('Test filter downloader - nested if conditions with else branch', asy '!#endif', '!#else', 'else_first_level_rule', - '!#endif' + '!#endif', ]; expected = [ 'zero_level_rule', diff --git a/src/filters-downloader-creator.js b/src/filters-downloader-creator.js index 0294ea9..42af924 100644 --- a/src/filters-downloader-creator.js +++ b/src/filters-downloader-creator.js @@ -31,9 +31,9 @@ * https://github.com/AdguardTeam/AdguardBrowserExtension/issues/917 */ const FiltersDownloaderCreator = (FileDownloadWrapper) => { - const CONDITION_IF_DIRECTIVE_START = "!#if"; - const CONDITION_ELSE_DIRECTIVE_START = "!#else"; - const CONDITION_DIRECTIVE_END = "!#endif"; + const CONDITION_IF_DIRECTIVE_START = '!#if'; + const CONDITION_ELSE_DIRECTIVE_START = '!#else'; + const CONDITION_DIRECTIVE_END = '!#endif'; const CONDITION_OPERATOR_NOT = '!'; const CONDITION_OPERATOR_AND = '&&'; @@ -248,7 +248,7 @@ const FiltersDownloaderCreator = (FileDownloadWrapper) => { let result = []; - for (let i = 0; i < rules.length; i++) { + for (let i = 0; i < rules.length; i += 1) { const rule = rules[i]; if (rule.indexOf(CONDITION_IF_DIRECTIVE_START) === 0) {