chore: eslint 配置
All checks were successful
/ depcheck (push) Successful in 2m19s
/ playwright (push) Successful in 1m45s
/ surge (push) Successful in 2m48s
/ build-and-deploy-to-vercel (push) Successful in 3m10s

This commit is contained in:
mini2024
2025-03-05 00:57:51 +08:00
parent feb7659b75
commit 2b7186ef69
35 changed files with 455 additions and 458 deletions

View File

@@ -2,10 +2,10 @@
import { $enum } from 'ts-enum-util';
enum Direction {
Up = 'UP',
Down = 'DOWN',
Left = 'LEFT',
Right = 'RIGHT',
Up = 'UP',
}
enum TestEnum {
@@ -15,25 +15,25 @@ enum TestEnum {
const visitValue = (value: Direction | null | undefined) => {
$enum.visitValue(value).with({
[Direction.Up]: () => {},
[Direction.Down]: () => {},
[Direction.Left]: () => {},
[Direction.Right]: () => {},
[$enum.handleNull]: () => {},
[$enum.handleUndefined]: () => {},
[$enum.handleUnexpected]: () => {},
[Direction.Down]: () => {},
[Direction.Left]: () => {},
[Direction.Right]: () => {},
[Direction.Up]: () => {},
});
};
const mapValue = (value: Direction | null | undefined) => {
return $enum.mapValue(value).with({
[Direction.Up]: 'Up',
[Direction.Down]: 'Down',
[Direction.Left]: 'Left',
[Direction.Right]: 'Right',
[$enum.handleNull]: 'Null',
[$enum.handleUndefined]: 'Undefined',
[$enum.handleUnexpected]: 'Unexpected',
[Direction.Down]: 'Down',
[Direction.Left]: 'Left',
[Direction.Right]: 'Right',
[Direction.Up]: 'Up',
});
};
</script>