improve eslint config

This commit is contained in:
Vendicated
2025-11-23 23:55:37 +01:00
parent 34c92cfb59
commit 0483a1abdc
14 changed files with 254 additions and 52 deletions
+11 -3
View File
@@ -580,11 +580,15 @@ function AudioSourcePickerLinux({
return (
<Forms.FormText>
Failed to retrieve Audio Sources because your C++ library is too old to run
<a href="https://github.com/Vencord/venmic" target="_blank">
<a href="https://github.com/Vencord/venmic" target="_blank" rel="noreferrer">
venmic
</a>
. See{" "}
<a href="https://gist.github.com/Vendicated/b655044ffbb16b2716095a448c6d827a" target="_blank">
<a
href="https://gist.github.com/Vendicated/b655044ffbb16b2716095a448c6d827a"
target="_blank"
rel="noreferrer"
>
this guide
</a>{" "}
for possible solutions.
@@ -596,7 +600,11 @@ function AudioSourcePickerLinux({
return (
<Text variant="text-sm/normal">
Could not find pipewire-pulse. See{" "}
<a href="https://gist.github.com/the-spyke/2de98b22ff4f978ebf0650c90e82027e#install" target="_blank">
<a
href="https://gist.github.com/the-spyke/2de98b22ff4f978ebf0650c90e82027e#install"
target="_blank"
rel="noreferrer"
>
this guide
</a>{" "}
on how to switch to pipewire. <br />
@@ -154,8 +154,8 @@ function SettingsSections() {
</Text>
<div className={cl("category-content")}>
{settings.map(Setting => {
if (typeof Setting === "function") return <Setting settings={Settings} />;
{settings.map((Setting, i) => {
if (typeof Setting === "function") return <Setting key={`Custom-${i}`} settings={Settings} />;
const { defaultValue, title, description, key, disabled, invisible } = Setting;
if (invisible?.()) return null;
-2
View File
@@ -26,12 +26,10 @@ addPatch({
group: true,
replacement: [
{
// eslint-disable-next-line no-useless-escape
match: /if\(null!=(\i)\)(?=.{0,50}\1\.window\.setDevtoolsCallbacks)/,
replace: "if(true)"
},
{
// eslint-disable-next-line no-useless-escape
match: /\b\i\.window\.setDevtoolsCallbacks/g,
replace: "VesktopNative.win.setDevtoolsCallbacks"
}
@@ -11,8 +11,6 @@ addPatch({
{
find: '"NotificationSettingsStore',
replacement: {
// FIXME: fix eslint rule
// eslint-disable-next-line no-useless-escape
match: /\.isPlatformEmbedded(?=\?\i\.\i\.ALL)/g,
replace: "$&||true"
}
@@ -11,7 +11,6 @@ addPatch({
{
find: "lastOutputSystemDevice.justChanged",
replacement: {
// eslint-disable-next-line no-useless-escape
match: /(\i)\.\i\.getState\(\).neverShowModal/,
replace: "$& || $self.shouldIgnoreDevice($1)"
}
-1
View File
@@ -11,7 +11,6 @@ addPatch({
{
find: 'setSinkId"in',
replacement: {
// eslint-disable-next-line no-useless-escape
match: /return (\i)\?navigator\.mediaDevices\.enumerateDevices/,
replace: "return $1 ? $self.filteredDevices"
}
-1
View File
@@ -14,7 +14,6 @@ addPatch({
{
find: "platform-web",
replacement: {
// eslint-disable-next-line no-useless-escape
match: /(?<=" platform-overlay"\):)\i/,
replace: "$self.getPlatformClass()"
}
+2
View File
@@ -66,6 +66,7 @@ addContextMenuPatch("textarea-context", children => {
<>
{corrections.map(c => (
<Menu.MenuItem
key={c}
id={"vcd-spellcheck-suggestion-" + c}
label={c}
action={() => VesktopNative.spellcheck.replaceMisspelling(c)}
@@ -95,6 +96,7 @@ addContextMenuPatch("textarea-context", children => {
const isEnabled = spellCheckLanguages.includes(lang);
return (
<Menu.MenuCheckboxItem
key={lang}
id={"vcd-spellcheck-lang-" + lang}
label={lang}
checked={isEnabled}
-1
View File
@@ -12,7 +12,6 @@ addPatch({
find: ".STREAMER_MODE_ENABLE,",
replacement: {
// remove if (platformEmbedded) check from streamer mode toggle
// eslint-disable-next-line no-useless-escape
match: /if\(\i\.\i\)(?=return.{0,200}?"autoToggle")/g,
replace: ""
}
-3
View File
@@ -12,13 +12,10 @@ addPatch({
find: ",setSystemTrayApplications",
replacement: [
{
// eslint-disable-next-line no-useless-escape
match: /\i\.window\.(close|minimize|maximize)/g,
replace: `VesktopNative.win.$1`
},
{
// TODO: Fix eslint rule
// eslint-disable-next-line no-useless-escape
match: /(focus(\(\i\)){).{0,150}?\.focus\(\i,\i\)/,
replace: "$1VesktopNative.win.focus$2"
},
-6
View File
@@ -15,8 +15,6 @@ if (Settings.store.customTitleBar)
find: ".wordmarkWindows",
replacement: [
{
// TODO: Fix eslint rule
// eslint-disable-next-line no-useless-escape
match: /case \i\.\i\.WINDOWS:/,
replace: 'case "WEB":'
}
@@ -27,14 +25,10 @@ if (Settings.store.customTitleBar)
find: ".systemBar,",
replacement: [
{
// TODO: Fix eslint rule
// eslint-disable-next-line no-useless-escape
match: /\i===\i\.PlatformTypes\.WINDOWS/g,
replace: "true"
},
{
// TODO: Fix eslint rule
// eslint-disable-next-line no-useless-escape
match: /\i===\i\.PlatformTypes\.WEB/g,
replace: "false"
}