diff options
author | Justice Almanzar <superdash993@gmail.com> | 2022-12-19 17:59:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-19 22:59:54 +0000 |
commit | 989bd36eeb6dd6c4b391900765847cdcf87484d9 (patch) | |
tree | 86b15ce6804500b56f9f3c6b807d5fbb8aa6dad4 /patches | |
parent | 4974c53f9cc3a3adccfa11f4af68ac4f190b0fc8 (diff) | |
download | Vencord-989bd36eeb6dd6c4b391900765847cdcf87484d9.tar.gz Vencord-989bd36eeb6dd6c4b391900765847cdcf87484d9.tar.bz2 Vencord-989bd36eeb6dd6c4b391900765847cdcf87484d9.zip |
refactor: identifier escapes + "self" group (#339)
Co-authored-by: Ven <vendicated@riseup.net>
Diffstat (limited to 'patches')
-rw-r--r-- | patches/eslint@8.28.0.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/patches/eslint@8.28.0.patch b/patches/eslint@8.28.0.patch new file mode 100644 index 0000000..994481b --- /dev/null +++ b/patches/eslint@8.28.0.patch @@ -0,0 +1,45 @@ +diff --git a/lib/rules/no-useless-escape.js b/lib/rules/no-useless-escape.js +index 2046a148a17fd1d5f3a4bbc9f45f7700259d11fa..f4898c6b57355a4fd72c43a9f32bf1a36a6ccf4a 100644 +--- a/lib/rules/no-useless-escape.js ++++ b/lib/rules/no-useless-escape.js +@@ -97,12 +97,30 @@ 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.getSourceCode(); + ++ 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 +@@ -238,7 +256,7 @@ module.exports = { + .filter(charInfo => charInfo.escaped) + + // Filter out characters that are valid to escape, based on their position in the regular expression. +- .filter(charInfo => !(charInfo.inCharClass ? REGEX_GENERAL_ESCAPES : REGEX_NON_CHARCLASS_ESCAPES).has(charInfo.text)) ++ .filter(charInfo => !(charInfo.inCharClass ? CHARCLASS_ESCAPES : NON_CHARCLASS_ESCAPES).has(charInfo.text)) + + // Report all the remaining characters. + .forEach(charInfo => report(node, charInfo.index, charInfo.text));
\ No newline at end of file |