Remove useless u flags in regular expressions (#18509)
This commit is contained in:
1 parent
97f2e81d06
commit
c9eb4bcd9e
131 files changed
+388
-405
No files matched your search
@@ -1,11 +1,11 @@
|
||||
import { Teleport } from "vue";
|
||||
|
||||
export default function VersionLink({ version }) {
|
||||
const match = version.match(/^pr-(\d+)$/u);
|
||||
const match = version.match(/^pr-(\d+)$/);
|
||||
let href;
|
||||
if (match) {
|
||||
href = `pull/${match[1]}`;
|
||||
} else if (/\.0$/u.test(version)) {
|
||||
} else if (/\.0$/.test(version)) {
|
||||
href = `releases/tag/${version}`;
|
||||
} else {
|
||||
href = `blob/main/CHANGELOG.md#${version.replaceAll(".", "")}`;
|
||||
|
||||
@@ -48,7 +48,7 @@ function getRandomElement(array) {
|
||||
}
|
||||
|
||||
function camelCase(string) {
|
||||
return string.replaceAll(/_(\w)/gu, (_, c) => c.toUpperCase());
|
||||
return string.replaceAll(/_(\w)/g, (_, c) => c.toUpperCase());
|
||||
}
|
||||
|
||||
export default function generateDummyId() {
|
||||
|
||||
@@ -123,7 +123,7 @@ function augmentOption(option) {
|
||||
option.cliName =
|
||||
"--" +
|
||||
(option.inverted ? "no-" : "") +
|
||||
option.name.replaceAll(/(?<=[a-z])(?=[A-Z])/gu, "-").toLowerCase();
|
||||
option.name.replaceAll(/(?<=[a-z])(?=[A-Z])/g, "-").toLowerCase();
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ function formatCLIOptions(cliOptions) {
|
||||
}
|
||||
|
||||
function codeBlock(content, syntax) {
|
||||
const backtickSequences = content.match(/`+/gu) || [];
|
||||
const backtickSequences = content.match(/`+/g) || [];
|
||||
const longestBacktickSequenceLength = Math.max(
|
||||
...backtickSequences.map(({ length }) => length),
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export function fixPrettierVersion(version) {
|
||||
const match = version.match(/^\d+\.\d+\.\d+-pr.(\d+)$/u);
|
||||
const match = version.match(/^\d+\.\d+\.\d+-pr.(\d+)$/);
|
||||
if (match) {
|
||||
return `pr-${match[1]}`;
|
||||
}
|
||||
@@ -53,13 +53,13 @@ export function getCodemirrorMode(parser) {
|
||||
}
|
||||
|
||||
const astAutoFold = {
|
||||
estree: /^\s*"(loc|start|end|tokens|\w+Comments|comments)":/u,
|
||||
postcss: /^\s*"(source|input|raws|file)":/u,
|
||||
html: /^\s*"(\w+Span|valueTokens|tokens|file|tagDefinition)":/u,
|
||||
mdast: /^\s*"position":/u,
|
||||
yaml: /^\s*"position":/u,
|
||||
glimmer: /^\s*"loc":/u,
|
||||
graphql: /^\s*"loc":/u,
|
||||
estree: /^\s*"(loc|start|end|tokens|\w+Comments|comments)":/,
|
||||
postcss: /^\s*"(source|input|raws|file)":/,
|
||||
html: /^\s*"(\w+Span|valueTokens|tokens|file|tagDefinition)":/,
|
||||
mdast: /^\s*"position":/,
|
||||
yaml: /^\s*"position":/,
|
||||
glimmer: /^\s*"loc":/,
|
||||
graphql: /^\s*"loc":/,
|
||||
};
|
||||
|
||||
export function getAstAutoFold(parser) {
|
||||
|
||||
Reference in new issue
Block a user