chore: eslint 配置
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user