Some FIxes

This commit is contained in:
thororen1234 2025-09-10 06:19:47 -04:00
parent 8c37242abd
commit 1c2651382f
No known key found for this signature in database
7 changed files with 689 additions and 902 deletions

View file

@ -88,7 +88,7 @@ export default tseslint.config(
"@stylistic/no-extra-semi": "error",
// TS Rules
"@/func-call-spacing": ["error", "never"],
"@stylistic/func-call-spacing": ["error", "never"],
// ESLint Rules
"yoda": "error",

View file

@ -38,11 +38,11 @@
"testTsc": "tsc --noEmit"
},
"dependencies": {
"@ffmpeg/ffmpeg": "^0.12.15",
"@ffmpeg/util": "^0.12.2",
"@ffmpeg/ffmpeg": "^0.12.10",
"@ffmpeg/util": "^0.12.1",
"@intrnl/xxhash64": "^0.1.2",
"@types/less": "^3.0.8",
"@types/stylus": "^0.48.43",
"@types/less": "^3.0.6",
"@types/stylus": "^0.48.42",
"@types/tinycolor2": "^1.4.6",
"@vap/core": "0.0.12",
"@vap/shiki": "0.10.5",
@ -50,51 +50,53 @@
"gifenc": "github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3",
"idb": "8.0.3",
"jsqr": "1.4.0",
"monaco-editor": "^0.53.0",
"monaco-editor": "^0.52.2",
"nanoid": "^5.1.5",
"usercss-meta": "^0.12.0",
"virtual-merge": "^1.0.2"
"virtual-merge": "^1.0.1"
},
"devDependencies": {
"@electron/asar": "^4.0.1",
"@stylistic/eslint-plugin": "^5.3.1",
"@stylistic/eslint-plugin": "^4.2.0",
"@types/adm-zip": "^0.5.7",
"@types/chrome": "^0.1.9",
"@types/lodash": "^4.17.20",
"@types/node": "^24.3.1",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.9",
"@types/yazl": "^3.3.0",
"@types/chrome": "^0.0.312",
"@types/diff": "^7.0.2",
"@types/lodash": "^4.17.14",
"@types/node": "^22.13.13",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@types/yazl": "^2.4.5",
"@vencord/discord-types": "link:packages/discord-types",
"adm-zip": "^0.5.16",
"diff": "^8.0.2",
"esbuild": "^0.25.9",
"eslint": "9.35.0",
"diff": "^7.0.0",
"esbuild": "^0.25.1",
"eslint": "9.20.1",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-simple-header": "^1.2.2",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-simple-header": "^1.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unused-imports": "^4.2.0",
"eslint-plugin-unused-imports": "^4.1.4",
"highlight.js": "11.11.1",
"html-minifier-terser": "^7.2.0",
"moment": "^2.30.1",
"puppeteer-core": "^24.19.0",
"moment": "^2.22.2",
"puppeteer-core": "^24.4.0",
"standalone-electron-types": "^34.2.0",
"stylelint": "^16.24.0",
"stylelint-config-standard": "^39.0.0",
"stylelint": "^16.17.0",
"stylelint-config-standard": "^37.0.0",
"ts-patch": "^3.3.0",
"ts-pattern": "^5.8.0",
"tsx": "^4.20.5",
"type-fest": "^4.41.0",
"typescript": "^5.9.2",
"typescript-eslint": "^8.43.0",
"typescript-transform-paths": "^3.5.5"
"ts-pattern": "^5.6.0",
"tsx": "^4.19.3",
"type-fest": "^4.38.0",
"typescript": "^5.8.2",
"typescript-eslint": "^8.28.0",
"typescript-transform-paths": "^3.5.5",
"zip-local": "^0.3.5"
},
"packageManager": "pnpm@10.14.0",
"pnpm": {
"patchedDependencies": {
"eslint@9.35.0": "patches/eslint@9.35.0.patch",
"@types/less@3.0.8": "patches/@types__less@3.0.8.patch"
"eslint@9.20.1": "patches/eslint@9.20.1.patch",
"@types/less@3.0.6": "patches/@types__less@3.0.6.patch"
},
"peerDependencyRules": {
"ignoreMissing": [

View file

@ -0,0 +1,49 @@
diff --git a/lib/rules/no-useless-escape.js b/lib/rules/no-useless-escape.js
index 0e0f6f09f2c35f3276173c08f832cde9f2cf56a0..7dc22851715f3574d935f513c1b5e35552985711 100644
--- a/lib/rules/no-useless-escape.js
+++ b/lib/rules/no-useless-escape.js
@@ -65,13 +65,31 @@ module.exports = {
escapeBackslash: "Replace the `\\` with `\\\\` to include the actual backslash character."
},
- schema: []
+ schema: [{
+ type: "object",
+ properties: {
+ extra: {
+ type: "string",
+ default: ""
+ },
+ extraCharClass: {
+ type: "string",
+ default: ""
+ },
+ },
+ additionalProperties: false
+ }]
},
create(context) {
+ const options = context.options[0] || {};
+ const { extra, extraCharClass } = options;
const sourceCode = context.sourceCode;
const parser = new RegExpParser();
+ const NON_CHARCLASS_ESCAPES = union(REGEX_NON_CHARCLASS_ESCAPES, new Set(extra));
+ const CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set(extraCharClass));
+
/**
* Reports a node
* @param {ASTNode} node The node to report
@@ -200,9 +218,9 @@ module.exports = {
let allowedEscapes;
if (characterClassStack.length) {
- allowedEscapes = unicodeSets ? REGEX_CLASSSET_CHARACTER_ESCAPES : REGEX_GENERAL_ESCAPES;
+ allowedEscapes = unicodeSets ? REGEX_CLASSSET_CHARACTER_ESCAPES : CHARCLASS_ESCAPES;
} else {
- allowedEscapes = REGEX_NON_CHARCLASS_ESCAPES;
+ allowedEscapes = NON_CHARCLASS_ESCAPES;
}
if (allowedEscapes.has(escapedChar)) {
return;

View file

@ -1,105 +0,0 @@
diff --git a/lib/rules/no-useless-escape.js b/lib/rules/no-useless-escape.js
index 480b51597..3e8cdbaf1 100644
--- a/lib/rules/no-useless-escape.js
+++ b/lib/rules/no-useless-escape.js
@@ -95,6 +95,14 @@ module.exports = {
},
uniqueItems: true,
},
+ extra: {
+ type: "string",
+ default: ""
+ },
+ extraCharClass: {
+ type: "string",
+ default: ""
+ }
},
additionalProperties: false,
},
@@ -102,10 +110,15 @@ module.exports = {
},
create(context) {
+ const options = context.options[0] || {};
+ const { extra, extraCharClass } = options;
const sourceCode = context.sourceCode;
const [{ allowRegexCharacters }] = context.options;
const parser = new RegExpParser();
+ const NON_CHARCLASS_ESCAPES = union(REGEX_NON_CHARCLASS_ESCAPES, new Set(extra));
+ const CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set(extraCharClass));
+
/**
* Reports a node
* @param {ASTNode} node The node to report
@@ -145,16 +158,16 @@ module.exports = {
...(disableEscapeBackslashSuggest
? []
: [
- {
- messageId: "escapeBackslash",
- fix(fixer) {
- return fixer.insertTextBeforeRange(
- range,
- "\\",
- );
- },
+ {
+ messageId: "escapeBackslash",
+ fix(fixer) {
+ return fixer.insertTextBeforeRange(
+ range,
+ "\\",
+ );
},
- ]),
+ },
+ ]),
],
});
}
@@ -238,7 +251,7 @@ module.exports = {
if (
escapedChar !==
- String.fromCodePoint(characterNode.value) ||
+ String.fromCodePoint(characterNode.value) ||
allowRegexCharacters.includes(escapedChar)
) {
// It's a valid escape.
@@ -247,11 +260,9 @@ module.exports = {
let allowedEscapes;
if (characterClassStack.length) {
- allowedEscapes = unicodeSets
- ? REGEX_CLASSSET_CHARACTER_ESCAPES
- : REGEX_GENERAL_ESCAPES;
+ allowedEscapes = unicodeSets ? REGEX_CLASSSET_CHARACTER_ESCAPES : CHARCLASS_ESCAPES;
} else {
- allowedEscapes = REGEX_NON_CHARCLASS_ESCAPES;
+ allowedEscapes = NON_CHARCLASS_ESCAPES;
}
if (allowedEscapes.has(escapedChar)) {
return;
@@ -287,9 +298,9 @@ module.exports = {
*/
if (
characterClassNode.start + 1 !==
- characterNode.start &&
+ characterNode.start &&
characterNode.end !==
- characterClassNode.end - 1
+ characterClassNode.end - 1
) {
return;
}
@@ -334,7 +345,7 @@ module.exports = {
if (
characterNode.parent.type ===
- "ClassIntersection" ||
+ "ClassIntersection" ||
characterNode.parent.type === "ClassSubtraction"
) {
disableEscapeBackslashSuggest = true;

1370
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -212,7 +212,6 @@ if (!process.argv.includes("--skip-extension")) {
firefoxZip.addLocalFolder("dist/browser/firefox-unpacked");
firefoxZip.writeZip(path.resolve("dist/extension-firefox.zip"));
console.info("Packed Firefox Extension written to dist/extension-firefox.zip");
} else {
await appendCssRuntime;
}