refactor: Fix eslint warnings (#3698)
* Update dependencies and remove typescript version pinning (fixed upstream) * Fix esling warnings (disabled any and script lang checks) Rewrote clipboard copy (Fixes #3407) Run prettier --------- Co-authored-by: Oleg Lobanov <oleg@lobanov.me>
This commit is contained in:
@@ -6,13 +6,16 @@ export default function getRule(rules: string[]) {
|
||||
let result = null;
|
||||
const find = Array.prototype.find;
|
||||
|
||||
find.call(document.styleSheets, (styleSheet) => {
|
||||
result = find.call(styleSheet.cssRules, (cssRule) => {
|
||||
find.call(document.styleSheets, (styleSheet: CSSStyleSheet) => {
|
||||
result = find.call(styleSheet.cssRules, (cssRule: CSSRule) => {
|
||||
let found = false;
|
||||
|
||||
if (cssRule instanceof window.CSSStyleRule) {
|
||||
// faster than checking instanceof for every element
|
||||
if (cssRule.constructor.name === "CSSStyleRule") {
|
||||
for (let i = 0; i < rules.length; i++) {
|
||||
if (cssRule.selectorText.toLowerCase() === rules[i]) {
|
||||
if (
|
||||
(cssRule as CSSStyleRule).selectorText.toLowerCase() === rules[i]
|
||||
) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
@@ -24,5 +27,5 @@ export default function getRule(rules: string[]) {
|
||||
return result != null;
|
||||
});
|
||||
|
||||
return result;
|
||||
return result as CSSStyleRule | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user