Skip to content

Commit 029d9c8

Browse files
committed
Add Zed editor settings and update HTML files
- Add .zed/settings.json with editor configurations - Update dprint.json to include new plugins - Format HTML files in examples to use consistent indentation and DOCTYPE - Convert constVoid, constTrue, and constFalse to functions in eff utilities
1 parent 30e7b7e commit 029d9c8

File tree

7 files changed

+117
-52
lines changed

7 files changed

+117
-52
lines changed

.zed/settings.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
// Whether or not to remove any trailing whitespace from lines of a buffer
3+
// before saving it.
4+
"remove_trailing_whitespace_on_save": true,
5+
// Whether to start a new line with a comment when a previous line is a comment as well.
6+
"extend_comment_on_newline": true,
7+
// Removes any lines containing only whitespace at the end of the file and
8+
// ensures just one newline at the end.
9+
"ensure_final_newline_on_save": true,
10+
// Whether or not to perform a buffer format before saving
11+
//
12+
// Keep in mind, if the autosave with delay is enabled, format_on_save will be ignored
13+
"format_on_save": "on",
14+
// How to perform a buffer format. This setting can take 4 values:
15+
//
16+
// 1. Format code using the current language server:
17+
// "formatter": "language_server"
18+
// 2. Format code using an external command:
19+
// "formatter": {
20+
// "external": {
21+
// "command": "prettier",
22+
// "arguments": ["--stdin-filepath", "{buffer_path}"]
23+
// }
24+
// }
25+
// 3. Format code using Zed's Prettier integration:
26+
// "formatter": "prettier"
27+
// 4. Default. Format files using Zed's Prettier integration (if applicable),
28+
// or falling back to formatting via language server:
29+
// "formatter": "auto"
30+
"formatter": {
31+
"external": {
32+
"command": "node_modules/.bin/dprint",
33+
"arguments": [
34+
"fmt",
35+
"--stdin",
36+
"{buffer_path}"
37+
]
38+
}
39+
},
40+
// How to soft-wrap long lines of text.
41+
// Possible values:
42+
//
43+
// 1. Prefer a single line generally, unless an overly long line is encountered.
44+
// "soft_wrap": "none",
45+
// "soft_wrap": "prefer_line", // (deprecated, same as "none")
46+
// 2. Soft wrap lines that overflow the editor.
47+
// "soft_wrap": "editor_width",
48+
// 3. Soft wrap lines at the preferred line length.
49+
// "soft_wrap": "preferred_line_length",
50+
// 4. Soft wrap lines at the preferred line length or the editor width (whichever is smaller).
51+
// "soft_wrap": "bounded",
52+
"soft_wrap": "none",
53+
// The column at which to soft-wrap lines, for buffers where soft-wrap
54+
// is enabled.
55+
"preferred_line_length": 120,
56+
"prettier": {
57+
"allowed": false
58+
}
59+
}

dprint.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"https://plugins.dprint.dev/typescript-0.94.0.wasm",
2929
"https://plugins.dprint.dev/json-0.20.0.wasm",
3030
"https://plugins.dprint.dev/markdown-0.18.0.wasm",
31-
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
31+
"https://plugins.dprint.dev/toml-0.7.0.wasm",
32+
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm",
33+
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.19.0.wasm"
3234
]
3335
}
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>eslint-react-example</title>
7+
</head>
38

4-
<head>
5-
<meta charset="UTF-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>eslint-react-example</title>
8-
</head>
9-
10-
<body>
11-
<div id="root"></div>
12-
<script type="module" src="/src/main.ts"></script>
13-
</body>
14-
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
1513
</html>
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>eslint-react-example</title>
7+
</head>
38

4-
<head>
5-
<meta charset="UTF-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>eslint-react-example</title>
8-
</head>
9-
10-
<body>
11-
<div id="root"></div>
12-
<script type="module" src="/src/main.js"></script>
13-
</body>
14-
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.js"></script>
12+
</body>
1513
</html>
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>eslint-react-example</title>
7+
</head>
38

4-
<head>
5-
<meta charset="UTF-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>eslint-react-example</title>
8-
</head>
9-
10-
<body>
11-
<div id="root"></div>
12-
<script type="module" src="/src/main.js"></script>
13-
</body>
14-
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.js"></script>
12+
</body>
1513
</html>
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>eslint-react-example</title>
7+
</head>
38

4-
<head>
5-
<meta charset="UTF-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>eslint-react-example</title>
8-
</head>
9-
10-
<body>
11-
<div id="root"></div>
12-
<script type="module" src="/src/main.ts"></script>
13-
</body>
14-
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
1513
</html>

packages/utilities/eff/src/index.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,32 @@ export function identity<T>(x: T): T {
3535
return x;
3636
}
3737

38+
/**
39+
* Returns a function that always returns the same value.
40+
* @param x - The value to return.
41+
*/
42+
export function constant<T>(x: T) {
43+
return () => x;
44+
}
45+
3846
/**
3947
* Do nothing and return void
4048
*/
41-
export const constVoid = () => {};
49+
export function constVoid() {}
4250

4351
/**
4452
* Do nothing and return true
4553
*/
46-
export const constTrue = () => true as const;
54+
export function constTrue() {
55+
return true as const;
56+
}
4757

4858
/**
4959
* Do nothing and return false
5060
*/
51-
export const constFalse = () => false as const;
61+
export function constFalse() {
62+
return false as const;
63+
}
5264

5365
// Ported from https://github.com/Effect-TS/effect/blob/main/packages/effect/src/Function.ts
5466
/**

0 commit comments

Comments
 (0)