mirror of https://github.com/astral-sh/ruff
[`ty`] Reject renaming files to start with slash in Playground (#20666)
This commit is contained in:
parent
56d630e303
commit
eb34d12151
|
|
@ -96,6 +96,11 @@ export default function Playground() {
|
||||||
file: FileId,
|
file: FileId,
|
||||||
newName: string,
|
newName: string,
|
||||||
) => {
|
) => {
|
||||||
|
if (newName.startsWith("/")) {
|
||||||
|
setError("File names cannot start with '/'.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const handle = files.handles[file];
|
const handle = files.handles[file];
|
||||||
let newHandle: FileHandle | null = null;
|
let newHandle: FileHandle | null = null;
|
||||||
if (handle == null) {
|
if (handle == null) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue