Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
slavaleleka committed Oct 2, 2023
1 parent 4ea3cb5 commit a568d65
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
30 changes: 15 additions & 15 deletions __tests__/filters-downloader.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global QUnit */
/* global QUnit, assert */
/* eslint-disable global-require */

const FilterCompilerConditionsConstants = {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
8 changes: 4 additions & 4 deletions src/filters-downloader-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '&&';
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a568d65

Please sign in to comment.