lint 로직 변경
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { GatewayPrisma, type GatewayPrismaClient } from '@sammo-ts/infra';
|
import type { GatewayPrisma, GatewayPrismaClient } from '@sammo-ts/infra';
|
||||||
|
|
||||||
import { createSimplePasswordHasher, type PasswordHasher } from './passwordHasher.js';
|
import { createSimplePasswordHasher, type PasswordHasher } from './passwordHasher.js';
|
||||||
import type { CreateUserInput, UserOAuthInfo, UserRecord, UserRepository, UserSanctions } from './userRepository.js';
|
import type { CreateUserInput, UserOAuthInfo, UserRecord, UserRepository, UserSanctions } from './userRepository.js';
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { createRequire } from 'node:module';
|
import { createRequire } from 'node:module';
|
||||||
|
|
||||||
|
import type * as Pm2 from 'pm2';
|
||||||
import type { ProcessManager, ManagedProcessInfo, ProcessDefinition } from './processManager.js';
|
import type { ProcessManager, ManagedProcessInfo, ProcessDefinition } from './processManager.js';
|
||||||
|
|
||||||
type Pm2Module = typeof import('pm2');
|
type Pm2Module = typeof Pm2;
|
||||||
|
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { GatewayPrisma, type GatewayPrismaClient } from '@sammo-ts/infra';
|
import type { GatewayPrisma, GatewayPrismaClient } from '@sammo-ts/infra';
|
||||||
|
|
||||||
export const GATEWAY_PROFILE_STATUSES = [
|
export const GATEWAY_PROFILE_STATUSES = [
|
||||||
'RESERVED',
|
'RESERVED',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ onMounted(async () => {
|
|||||||
try {
|
try {
|
||||||
const me = await trpc.me.query();
|
const me = await trpc.me.query();
|
||||||
if (me) {
|
if (me) {
|
||||||
router.push('/lobby');
|
await router.push('/lobby');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Not logged in or error
|
// Not logged in or error
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ onMounted(async () => {
|
|||||||
try {
|
try {
|
||||||
me.value = await trpc.me.query();
|
me.value = await trpc.me.query();
|
||||||
if (!me.value) {
|
if (!me.value) {
|
||||||
router.push('/');
|
await router.push('/');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ onMounted(async () => {
|
|||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
// TODO: Implement logout mutation in gateway-api
|
// TODO: Implement logout mutation in gateway-api
|
||||||
// await trpc.auth.logout.mutation();
|
// await trpc.auth.logout.mutation();
|
||||||
router.push('/');
|
await router.push('/');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
+17
-1
@@ -74,6 +74,22 @@ export default tseslint.config(
|
|||||||
],
|
],
|
||||||
'@typescript-eslint/no-explicit-any': 'error',
|
'@typescript-eslint/no-explicit-any': 'error',
|
||||||
'@typescript-eslint/no-empty-object-type': 'off',
|
'@typescript-eslint/no-empty-object-type': 'off',
|
||||||
|
'@typescript-eslint/consistent-type-imports': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
fixStyle: 'separate-type-imports',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@typescript-eslint/no-floating-promises': 'error',
|
||||||
|
'@typescript-eslint/no-misused-promises': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
checksVoidReturn: {
|
||||||
|
arguments: false,
|
||||||
|
attributes: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -100,7 +116,7 @@ export default tseslint.config(
|
|||||||
prettier: prettierPlugin,
|
prettier: prettierPlugin,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
'prettier/prettier': 'error',
|
'prettier/prettier': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
prettierConfig
|
prettierConfig
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
import { sha512 as sha512Noble } from '@noble/hashes/sha2.js';
|
import { sha512 as sha512Noble } from '@noble/hashes/sha2.js';
|
||||||
|
|
||||||
|
import type { createHash } from 'node:crypto';
|
||||||
import type { BytesLike } from './BytesLike.js';
|
import type { BytesLike } from './BytesLike.js';
|
||||||
import { convertBytesLikeToUint8Array } from './convertBytesLikeToUint8Array.js';
|
import { convertBytesLikeToUint8Array } from './convertBytesLikeToUint8Array.js';
|
||||||
|
|
||||||
type NodeHash = {
|
type NodeCreateHash = typeof createHash;
|
||||||
update(data: Uint8Array): NodeHash;
|
|
||||||
digest(): Uint8Array;
|
|
||||||
};
|
|
||||||
|
|
||||||
type NodeCreateHash = (algorithm: 'sha512') => NodeHash;
|
|
||||||
|
|
||||||
const isNode = typeof process !== 'undefined' && typeof process.versions?.node === 'string';
|
const isNode = typeof process !== 'undefined' && typeof process.versions?.node === 'string';
|
||||||
|
|
||||||
@@ -17,7 +13,7 @@ const nodeCryptoSpecifier = 'node:crypto';
|
|||||||
let nodeCreateHash: NodeCreateHash | null = null;
|
let nodeCreateHash: NodeCreateHash | null = null;
|
||||||
|
|
||||||
if (isNode) {
|
if (isNode) {
|
||||||
const nodeCrypto = (await import(nodeCryptoSpecifier)) as typeof import('node:crypto');
|
const nodeCrypto = await import(nodeCryptoSpecifier);
|
||||||
nodeCreateHash = nodeCrypto.createHash as NodeCreateHash;
|
nodeCreateHash = nodeCrypto.createHash as NodeCreateHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable prettier/prettier */
|
|
||||||
import type { GeneralTriggerState, Nation } from '@sammo-ts/logic/domain/entities.js';
|
import type { GeneralTriggerState, Nation } from '@sammo-ts/logic/domain/entities.js';
|
||||||
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
|
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
|
||||||
import { beNeutral } from '@sammo-ts/logic/constraints/presets.js';
|
import { beNeutral } from '@sammo-ts/logic/constraints/presets.js';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { RandUtil } from '@sammo-ts/common';
|
import type { RandUtil } from '@sammo-ts/common';
|
||||||
import { TraitRequirement, TraitWeightType } from './requirements.js';
|
import { TraitRequirement, TraitWeightType } from './requirements.js';
|
||||||
import type { TraitModule } from './types.js';
|
import type { TraitModule } from './types.js';
|
||||||
import type { ScenarioStatBlock } from '../../scenario/types.js';
|
import type { ScenarioStatBlock } from '../../scenario/types.js';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import type { TriggerValue } from '@sammo-ts/logic/domain/entities.js';
|
||||||
import type { GeneralActionContext } from '@sammo-ts/logic/triggers/general.js';
|
import type { GeneralActionContext } from '@sammo-ts/logic/triggers/general.js';
|
||||||
import type { GeneralStatName, WarStatName } from '@sammo-ts/logic/triggers/types.js';
|
import type { GeneralStatName, WarStatName } from '@sammo-ts/logic/triggers/types.js';
|
||||||
import type { WarActionContext } from '@sammo-ts/logic/war/actions.js';
|
import type { WarActionContext } from '@sammo-ts/logic/war/actions.js';
|
||||||
@@ -5,7 +6,7 @@ import type { TraitModule } from '@sammo-ts/logic/triggers/special/types.js';
|
|||||||
import { TraitRequirement, TraitWeightType } from '../requirements.js';
|
import { TraitRequirement, TraitWeightType } from '../requirements.js';
|
||||||
import { getMetaNumber } from '@sammo-ts/logic/war/utils.js';
|
import { getMetaNumber } from '@sammo-ts/logic/war/utils.js';
|
||||||
|
|
||||||
import { WarUnit } from '@sammo-ts/logic/war/units.js';
|
import type { WarUnit } from '@sammo-ts/logic/war/units.js';
|
||||||
|
|
||||||
type WarUnitWithGeneral = WarUnit & { getGeneral: () => { meta: Record<string, unknown> } };
|
type WarUnitWithGeneral = WarUnit & { getGeneral: () => { meta: Record<string, unknown> } };
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ export const traitModule: TraitModule = {
|
|||||||
// In a real scenario, we should check if unit is WarUnitGeneral.
|
// In a real scenario, we should check if unit is WarUnitGeneral.
|
||||||
if (hasGeneral(unit)) {
|
if (hasGeneral(unit)) {
|
||||||
const killnum = getMetaNumber(
|
const killnum = getMetaNumber(
|
||||||
unit.getGeneral().meta as Record<string, import('@sammo-ts/logic/domain/entities.js').TriggerValue>,
|
unit.getGeneral().meta as Record<string, TriggerValue>,
|
||||||
'rank_killnum',
|
'rank_killnum',
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import type { ActionLogger } from '@sammo-ts/logic/logging/actionLogger.js';
|
|||||||
import { LogFormat } from '@sammo-ts/logic/logging/types.js';
|
import { LogFormat } from '@sammo-ts/logic/logging/types.js';
|
||||||
import type { WarStatName } from '@sammo-ts/logic/triggers/types.js';
|
import type { WarStatName } from '@sammo-ts/logic/triggers/types.js';
|
||||||
import { getTechAbility, getTechCost } from '@sammo-ts/logic/world/unitSet.js';
|
import { getTechAbility, getTechCost } from '@sammo-ts/logic/world/unitSet.js';
|
||||||
import { WarActionPipeline, type WarActionContext } from './actions.js';
|
import type { WarActionPipeline, WarActionContext } from './actions.js';
|
||||||
import type { WarEngineConfig } from './types.js';
|
import type { WarEngineConfig } from './types.js';
|
||||||
import { WarCrewType } from './crewType.js';
|
import type { WarCrewType } from './crewType.js';
|
||||||
import {
|
import {
|
||||||
clamp,
|
clamp,
|
||||||
clampMin,
|
clampMin,
|
||||||
|
|||||||
Reference in New Issue
Block a user