Skip to content

Commit 2f653eb

Browse files
authored
new-log-viewer: Fix lint errors introduced in #59. (#70)
1 parent cfa9274 commit 2f653eb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

new-log-viewer/src/components/MenuBar/PageNumInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ const PageNumInput = () => {
5555
return;
5656
}
5757
inputRef.current.style.width = "0";
58-
inputRef.current.style.width = `${inputRef.current.scrollWidth + PAGE_NUM_INPUT_FIT_EXTRA_WIDTH}px`;
58+
inputRef.current.style.width =
59+
`${inputRef.current.scrollWidth + PAGE_NUM_INPUT_FIT_EXTRA_WIDTH}px`;
5960
};
6061

6162
const handleInputChange = () => {

new-log-viewer/src/utils/config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const CONFIG_DEFAULT: ConfigMap = Object.freeze({
3131
* @param props.key
3232
* @param props.value
3333
* @return `null` if the value is valid, or an error message otherwise.
34+
* @throws {Error} If the config item cannot be managed by these config utilities.
3435
*/
3536
const testConfig = ({key, value}: ConfigUpdate): Nullable<string> => {
3637
let result = null;
@@ -41,7 +42,7 @@ const testConfig = ({key, value}: ConfigUpdate): Nullable<string> => {
4142
}
4243
break;
4344
case CONFIG_KEY.THEME:
44-
throw new Error(`${key} should be handled by JoyUI instead.`);
45+
throw new Error(`"${key}" cannot be managed using these utilities.`);
4546
case CONFIG_KEY.PAGE_SIZE:
4647
if (0 >= value || MAX_PAGE_SIZE < value) {
4748
result = `Page size must be greater than 0 and less than ${MAX_PAGE_SIZE + 1}.`;
@@ -61,6 +62,7 @@ const testConfig = ({key, value}: ConfigUpdate): Nullable<string> => {
6162
* @param props.key
6263
* @param props.value
6364
* @return `null` if the update succeeds, or an error message otherwise.
65+
* @throws {Error} If the config item cannot be managed by these config utilities.
6466
*/
6567
const setConfig = ({key, value}: ConfigUpdate): Nullable<string> => {
6668
const error = testConfig({key, value} as ConfigUpdate);
@@ -86,7 +88,7 @@ const setConfig = ({key, value}: ConfigUpdate): Nullable<string> => {
8688
);
8789
break;
8890
case CONFIG_KEY.THEME:
89-
throw new Error(`${key} should be handled by JoyUI instead.`);
91+
throw new Error(`"${key}" cannot be managed using these utilities.`);
9092
case CONFIG_KEY.PAGE_SIZE:
9193
window.localStorage.setItem(LOCAL_STORAGE_KEY.PAGE_SIZE, value.toString());
9294
break;
@@ -101,6 +103,7 @@ const setConfig = ({key, value}: ConfigUpdate): Nullable<string> => {
101103
*
102104
* @param key
103105
* @return The value.
106+
* @throws {Error} If the config item cannot be managed by these config utilities.
104107
*/
105108
const getConfig = <T extends CONFIG_KEY>(key: T): ConfigMap[T] => {
106109
let value = null;
@@ -121,7 +124,7 @@ const getConfig = <T extends CONFIG_KEY>(key: T): ConfigMap[T] => {
121124
} as DecoderOptionsType;
122125
break;
123126
case CONFIG_KEY.THEME:
124-
throw new Error(`${key} should be handled by JoyUI instead.`);
127+
throw new Error(`"${key}" cannot be managed using these utilities.`);
125128
case CONFIG_KEY.PAGE_SIZE:
126129
value = window.localStorage.getItem(LOCAL_STORAGE_KEY.PAGE_SIZE);
127130
break;

0 commit comments

Comments
 (0)