From 5f8330508cfc6b6b69d1d0529bad61d5e7192f87 Mon Sep 17 00:00:00 2001 From: Artem Manushenkov Date: Fri, 21 Feb 2025 08:40:25 -0300 Subject: [PATCH] add max len --- .eslintrc.cjs | 3 +- Extension/src/pages/.eslintrc.cjs | 1 - .../src/pages/common/components/ui/Icons.tsx | 2 +- .../src/pages/devtools-elements-sidebar.js | 10 ++++- .../RequestWizard/RequestInfo/RequestInfo.tsx | 15 ++++++-- .../components/Status/Status.jsx | 5 ++- .../filtering-log/components/ui/Icons.tsx | 2 +- .../pages/filtering-log/stores/LogStore.ts | 3 +- .../options/components/Filters/Filters.jsx | 4 +- .../Miscellaneous/Miscellaneous.jsx | 38 ++++++++++--------- .../components/Settings/SettingsSet.jsx | 6 ++- .../src/pages/options/components/ui/Icons.tsx | 1 + .../src/pages/popup/components/ui/Icons.tsx | 2 + Extension/src/pages/services/messenger.ts | 9 ++++- 14 files changed, 68 insertions(+), 33 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index f2fb4d9b0c..d848723110 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -153,11 +153,12 @@ module.exports = { 'strict': 'off', 'max-len': ['error', { 'code': 120, - 'comments': 120, + 'comments': 130, 'tabWidth': 4, 'ignoreUrls': true, 'ignoreTrailingComments': false, 'ignoreComments': false, + 'ignoreTemplateLiterals': true, }], 'indent': [ 'error', diff --git a/Extension/src/pages/.eslintrc.cjs b/Extension/src/pages/.eslintrc.cjs index 44d00bb87d..f1e39cfe72 100644 --- a/Extension/src/pages/.eslintrc.cjs +++ b/Extension/src/pages/.eslintrc.cjs @@ -26,7 +26,6 @@ module.exports = { ], 'import/prefer-default-export': 'off', - 'max-len': 'off', 'no-use-before-define': 'off', 'indent': 'off', 'arrow-body-style': 'off', diff --git a/Extension/src/pages/common/components/ui/Icons.tsx b/Extension/src/pages/common/components/ui/Icons.tsx index cb6343db32..bb99ec3242 100644 --- a/Extension/src/pages/common/components/ui/Icons.tsx +++ b/Extension/src/pages/common/components/ui/Icons.tsx @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with AdGuard Browser Extension. If not, see . */ - +/* eslint-disable max-len */ import React from 'react'; import '../../styles/icons.pcss'; diff --git a/Extension/src/pages/devtools-elements-sidebar.js b/Extension/src/pages/devtools-elements-sidebar.js index aa8ccaa448..f43b9db39e 100644 --- a/Extension/src/pages/devtools-elements-sidebar.js +++ b/Extension/src/pages/devtools-elements-sidebar.js @@ -149,7 +149,9 @@ export const devtoolsElementsSidebar = (() => { }; const updatePanelElements = function () { - const checkboxes = document.querySelectorAll('#one-domain-checkbox, #create-full-css-path, .attribute-check-box'); + const checkboxes = document.querySelectorAll( + '#one-domain-checkbox, #create-full-css-path, .attribute-check-box', + ); // All checkboxes should be disabled if block by url is checked if (document.querySelector('#block-by-url-checkbox').checked) { @@ -220,7 +222,11 @@ export const devtoolsElementsSidebar = (() => { } } } else { - placeholder.appendChild(createAttributeElement(attribute.name, attribute.value, attribute.name === 'id')); + placeholder.appendChild(createAttributeElement( + attribute.name, + attribute.value, + attribute.name === 'id', + )); } } diff --git a/Extension/src/pages/filtering-log/components/RequestWizard/RequestInfo/RequestInfo.tsx b/Extension/src/pages/filtering-log/components/RequestWizard/RequestInfo/RequestInfo.tsx index 6c093da5e9..e6193a6237 100644 --- a/Extension/src/pages/filtering-log/components/RequestWizard/RequestInfo/RequestInfo.tsx +++ b/Extension/src/pages/filtering-log/components/RequestWizard/RequestInfo/RequestInfo.tsx @@ -286,11 +286,17 @@ const RequestInfo = observer(() => { const appliedRulesData = __IS_MV3__ ? { - title: translator.getPlural('filtering_modal_applied_rules', selectedEvent.declarativeRuleInfo?.sourceRules.length || 0), + title: translator.getPlural( + 'filtering_modal_applied_rules', + selectedEvent.declarativeRuleInfo?.sourceRules.length || 0, + ), data: selectedEvent.declarativeRuleInfo?.sourceRules.map((r) => r.sourceRule), } : { - title: translator.getPlural('filtering_modal_applied_rules', Math.max(rulesData.appliedRuleTexts.length, 1)), + title: translator.getPlural( + 'filtering_modal_applied_rules', + Math.max(rulesData.appliedRuleTexts.length, 1), + ), data: rulesData.appliedRuleTexts.length > 0 ? rulesData.appliedRuleTexts.join('\n') : null, @@ -351,7 +357,10 @@ const RequestInfo = observer(() => { // Original rule texts contains elements only if the rule was converted if (rulesData.originalRuleTexts.length > 0) { eventPartsMap[PARTS.ORIGINAL_RULE] = { - title: translator.getPlural('filtering_modal_original_rules', Math.max(rulesData.originalRuleTexts.length, 1)), + title: translator.getPlural( + 'filtering_modal_original_rules', + Math.max(rulesData.originalRuleTexts.length, 1), + ), data: rulesData.originalRuleTexts.join('\n'), }; } diff --git a/Extension/src/pages/filtering-log/components/Status/Status.jsx b/Extension/src/pages/filtering-log/components/Status/Status.jsx index 79b5606534..00231bc8cf 100644 --- a/Extension/src/pages/filtering-log/components/Status/Status.jsx +++ b/Extension/src/pages/filtering-log/components/Status/Status.jsx @@ -68,7 +68,10 @@ export const Status = (props) => {
- +
diff --git a/Extension/src/pages/filtering-log/components/ui/Icons.tsx b/Extension/src/pages/filtering-log/components/ui/Icons.tsx index f686a54aac..c60ddc795f 100644 --- a/Extension/src/pages/filtering-log/components/ui/Icons.tsx +++ b/Extension/src/pages/filtering-log/components/ui/Icons.tsx @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with AdGuard Browser Extension. If not, see . */ - +/* eslint-disable max-len */ import React from 'react'; export const Icons = () => { diff --git a/Extension/src/pages/filtering-log/stores/LogStore.ts b/Extension/src/pages/filtering-log/stores/LogStore.ts index 12de7c1782..e5ede17703 100644 --- a/Extension/src/pages/filtering-log/stores/LogStore.ts +++ b/Extension/src/pages/filtering-log/stores/LogStore.ts @@ -533,7 +533,8 @@ class LogStore { // blocked CSP reports should be filtered as blocked requests in the filtering log. AG-24613 const filteringEventType = getStatusMode(filteringEvent); - const isAllowlisted = filteringEventType === StatusMode.ALLOWED || filteringEventType === StatusMode.ALLOWED_STEALTH; + const isAllowlisted = filteringEventType === StatusMode.ALLOWED + || filteringEventType === StatusMode.ALLOWED_STEALTH; const isBlocked = filteringEventType === StatusMode.BLOCKED; const isModified = filteringEventType === StatusMode.MODIFIED; const isRegular = !isAllowlisted && !isBlocked && !isModified; diff --git a/Extension/src/pages/options/components/Filters/Filters.jsx b/Extension/src/pages/options/components/Filters/Filters.jsx index 5afbdfc84d..4313af8102 100644 --- a/Extension/src/pages/options/components/Filters/Filters.jsx +++ b/Extension/src/pages/options/components/Filters/Filters.jsx @@ -68,7 +68,9 @@ const Filters = observer(() => { const query = useMemo(() => new URLSearchParams(location.search), [location.search]); const [modalIsOpen, setModalIsOpen] = useState(false); - const [urlToSubscribe, setUrlToSubscribe] = useState(decodeURIComponent(query.get(QUERY_PARAM_NAMES.SUBSCRIBE) || '')); + const [urlToSubscribe, setUrlToSubscribe] = useState(decodeURIComponent( + query.get(QUERY_PARAM_NAMES.SUBSCRIBE) || '', + )); const [customFilterTitle, setCustomFilterTitle] = useState(query.get(QUERY_PARAM_NAMES.TITLE)); // This state used to remove blinking while filters to render were not selected diff --git a/Extension/src/pages/options/components/Miscellaneous/Miscellaneous.jsx b/Extension/src/pages/options/components/Miscellaneous/Miscellaneous.jsx index eb92a909d4..6f899e4d64 100644 --- a/Extension/src/pages/options/components/Miscellaneous/Miscellaneous.jsx +++ b/Extension/src/pages/options/components/Miscellaneous/Miscellaneous.jsx @@ -223,15 +223,15 @@ export const Miscellaneous = observer(() => { { isOpenResetStatsModal - && ( - - ) + && ( + + ) }