Merge pull request #21708 from calixteman/regexp-no-super-linear-move

Enable the `regexp/no-super-linear-move` ESLint rule
This commit is contained in:
Tim van der Meij 2026-08-04 20:50:14 +02:00 committed by GitHub
commit 724950b457
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 4 deletions

View File

@ -62,6 +62,7 @@ export default [
rules: { rules: {
...regexpPlugin.configs["flat/recommended"].rules, ...regexpPlugin.configs["flat/recommended"].rules,
"regexp/no-legacy-features": "off", "regexp/no-legacy-features": "off",
"regexp/no-super-linear-move": "error",
}, },
}, },
{ {

View File

@ -53,7 +53,7 @@ function preprocess(inFilename, outFilename, defines) {
} }
return content.replaceAll( return content.replaceAll(
/^\s*@import\s+url\(([^)]+)\);\s*$/gm, /^[ \t]*@import\s+url\(([^)]+)\);[ \t]*$/gm,
function (all, url) { function (all, url) {
const file = path.join(path.dirname(baseUrl), url); const file = path.join(path.dirname(baseUrl), url);
const imported = fs.readFileSync(file, "utf8").toString(); const imported = fs.readFileSync(file, "utf8").toString();

View File

@ -37,7 +37,7 @@ function parseAdobeCMap(content) {
result.usecmap = m[1]; result.usecmap = m[1];
} }
const re = const re =
/(\d+)\s+(begincodespacerange|beginnotdefrange|begincidchar|begincidrange|beginbfchar|beginbfrange)\n([\s\S]*?)\n(?:endcodespacerange|endnotdefrange|endcidchar|endcidrange|endbfchar|endbfrange)/g; /\b(\d+)\s+(begincodespacerange|beginnotdefrange|begincidchar|begincidrange|beginbfchar|beginbfrange)\n([\s\S]*?)\n(?:endcodespacerange|endnotdefrange|endcidchar|endcidrange|endbfchar|endbfrange)/g;
while ((m = re.exec(body))) { while ((m = re.exec(body))) {
const lines = m[3].toLowerCase().split("\n"); const lines = m[3].toLowerCase().split("\n");

View File

@ -753,10 +753,10 @@ describe("Scripting", function () {
it("should parse a date with a format", async () => { it("should parse a date with a format", async () => {
const check = async (date, format, expected) => { const check = async (date, format, expected) => {
const value = await myeval( const value = await myeval(
`AFParseDateEx("${date}", "${format}").toISOString().replace(/T.*$/, "")` `AFParseDateEx("${date}", "${format}").toISOString().replace(/T.*/, "")`
); );
expect(value).toEqual( expect(value).toEqual(
new Date(expected).toISOString().replace(/T.*$/, "") new Date(expected).toISOString().replace(/T.*/, "")
); );
}; };