Skip to content

Commit

Permalink
Update linter
Browse files Browse the repository at this point in the history
  • Loading branch information
neki-dev committed Feb 17, 2024
1 parent 5e2efde commit 73eb2a5
Show file tree
Hide file tree
Showing 139 changed files with 349 additions and 101 deletions.
11 changes: 9 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ module.exports = {
"@typescript-eslint/ban-ts-comment": "off",
// Import
"import/no-unresolved": "off",
"import/no-named-as-default-member": "off",
"import/no-named-as-default": "off",
"import/order": [
"warn",
{
"newlines-between": "always",
groups: [
"builtin",
"external",
Expand All @@ -46,6 +45,14 @@ module.exports = {
alphabetize: {
order: "asc",
},
pathGroups: [
{
pattern: './styles',
group: 'unknown',
patternOptions: { matchBase: true },
position: 'after',
},
],
},
],
},
Expand Down
2 changes: 2 additions & 0 deletions src/game/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import Phaser from 'phaser';
import { CONTAINER_ID, DEBUG_MODS, AUDIO_VOLUME } from './const';
import { GameDifficulty, GameState, GameSettings, GameScene, GameEvent,
} from './types';

import type {
IGame, GameStat, GameSavePayload } from './types';
import type { StorageSave } from '~lib/storage/types';
import type { IScreen } from '~scene/screen/types';
import type { IWorld } from '~scene/world/types';

import { registerShaders } from '~lib/shader';
import { Storage } from '~lib/storage';
import { Tutorial } from '~lib/tutorial';
Expand Down
9 changes: 6 additions & 3 deletions src/game/scenes/gameover/interface/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import { useClick, useGame } from 'phaser-react-ui';
import React, { useEffect, useRef } from 'react';

import { Result } from './result';
import {
Wrapper, Label, Button, Head, IconRestart,
} from './styles';

import type { GameStat, IGame } from '../../../types';

import { phrase } from '~lib/lang';
import { Tutorial } from '~lib/tutorial';
import { Overlay } from '~scene/system/interface/overlay';

import {
Wrapper, Label, Button, Head, IconRestart,
} from './styles';

type Props = {
stat: GameStat
record: Nullable<GameStat>
Expand Down
8 changes: 5 additions & 3 deletions src/game/scenes/gameover/interface/result/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { useMemo } from 'react';

import {
Wrapper, Item, Value, Label, Record,
} from './styles';
import type { GameStat } from '../../../../types';
import type { LangPhrase } from '~lib/lang/types';

import { phrase } from '~lib/lang';

import {
Wrapper, Item, Value, Label, Record,
} from './styles';

type Props = {
stat: GameStat
record: Nullable<GameStat>
Expand Down
1 change: 1 addition & 0 deletions src/game/scenes/menu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Scene } from '..';
import { GameScene, GameState } from '../../types';

import { MenuUI } from './interface';

import type { MenuPage } from './types';

export class Menu extends Scene {
Expand Down
3 changes: 2 additions & 1 deletion src/game/scenes/menu/interface/content/about-game/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';

import { Wrapper } from './styles';
import { phrase } from '~lib/lang';

import { Wrapper } from './styles';

export const AboutGame: React.FC = () => (
<Wrapper>
{phrase('GAME_DESCRIPTION')}
Expand Down
5 changes: 3 additions & 2 deletions src/game/scenes/menu/interface/content/controls/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';

import { CONTROLS } from '~lib/controls/const';
import { phrase } from '~lib/lang';

import {
Wrapper, Control, Keys, Key, Description,
} from './styles';
import { CONTROLS } from '~lib/controls/const';
import { phrase } from '~lib/lang';

export const Controls: React.FC = () => (
<Wrapper>
Expand Down
4 changes: 3 additions & 1 deletion src/game/scenes/menu/interface/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import { LoadGame } from './load-game';
import { NewGame } from './new-game';
import { SaveGame } from './save-game';
import { Settings } from './settings';
import { Wrapper } from './styles';

import { MenuPage } from '~scene/menu/types';

import { Wrapper } from './styles';

type Props = {
page?: MenuPage
};
Expand Down
4 changes: 3 additions & 1 deletion src/game/scenes/menu/interface/content/load-game/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { useGame } from 'phaser-react-ui';
import React, { useState } from 'react';

import { Wrapper, Empty } from './styles';
import type { IGame } from '../../../../../types';
import type { LangPhrase } from '~lib/lang/types';

import { phrase } from '~lib/lang';
import { Storage } from '~lib/storage';
import { Button } from '~scene/system/interface/button';
import { Confirm } from '~scene/system/interface/confirm';
import { Table } from '~scene/system/interface/table';

import { Wrapper, Empty } from './styles';

export const LoadGame: React.FC = () => {
const game = useGame<IGame>();

Expand Down
6 changes: 5 additions & 1 deletion src/game/scenes/menu/interface/content/new-game/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ import { useGame } from 'phaser-react-ui';
import React, { useMemo, useState } from 'react';

import { GameDifficulty } from '../../../../../types';

import { Param } from './param';
import { Record } from './record';
import { Wrapper, Params } from './styles';

import type { IGame } from '../../../../../types';

import { phrase } from '~lib/lang';
import { Button } from '~scene/system/interface/button';
import { LevelPlanet } from '~scene/world/level/types';

import { Wrapper, Params } from './styles';

export const NewGame: React.FC = () => {
const game = useGame<IGame>();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';

import type { LangPhrase } from '~lib/lang/types';

import { Setting } from '~scene/system/interface/setting';

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';

import { phrase } from '~lib/lang';

import {
Wrapper, Amount, Icon, Label, Value,
} from './styles';
import { phrase } from '~lib/lang';

type Props = {
value: number
Expand Down
7 changes: 5 additions & 2 deletions src/game/scenes/menu/interface/content/save-game/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ import { useGame } from 'phaser-react-ui';
import React, {
useRef, useEffect, useState,
} from 'react';

import { MAX_GAME_SAVES } from '../../../../../const';
import { Input, Limit, Wrapper } from './styles';

import type { IGame } from '../../../../../types';
import type { ChangeEvent } from 'react';

import type { LangPhrase } from '~lib/lang/types';
import type { StorageSave } from '~lib/storage/types';

import { phrase } from '~lib/lang';
import { Storage } from '~lib/storage';
import { Button } from '~scene/system/interface/button';
import { Confirm } from '~scene/system/interface/confirm';
import { Table } from '~scene/system/interface/table';

import { Input, Limit, Wrapper } from './styles';

export const SaveGame: React.FC = () => {
const game = useGame<IGame>();

Expand Down
1 change: 1 addition & 0 deletions src/game/scenes/menu/interface/content/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
import { GameSettings } from '../../../../../types';

import { Param } from './param';

import { Wrapper } from './styles';

export const Settings: React.FC = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useMemo, useState } from 'react';

import type { GameSettings, IGame } from '../../../../../../types';
import type { LangPhrase } from '~lib/lang/types';

import { InterfaceTextColor } from '~lib/interface/types';
import { Setting } from '~scene/system/interface/setting';

Expand Down
9 changes: 6 additions & 3 deletions src/game/scenes/menu/interface/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import React, { useEffect, useState } from 'react';
import { Content } from './content';
import { Copyright } from './copyright';
import { Navigation } from './navigation';
import {
Wrapper, Logotype, Sidebar, Main,
} from './styles';

import type { MenuPage } from '../types';

import { Tutorial } from '~lib/tutorial';
import { Overlay } from '~scene/system/interface/overlay';

import {
Wrapper, Logotype, Sidebar, Main,
} from './styles';

type Props = {
defaultPage?: MenuPage
};
Expand Down
5 changes: 4 additions & 1 deletion src/game/scenes/menu/interface/navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ import { useGame } from 'phaser-react-ui';
import React, { useMemo, useState } from 'react';

import { GameState } from '../../../../types';
import { Wrapper, Item, Space } from './styles';

import type { IGame } from '../../../../types';
import type { LangPhrase } from '~lib/lang/types';
import type { MenuItem } from '~scene/menu/types';

import { phrase } from '~lib/lang';
import { Tutorial } from '~lib/tutorial';
import { MenuPage } from '~scene/menu/types';
import { Confirm } from '~scene/system/interface/confirm';

import { Wrapper, Item, Space } from './styles';

type Props = {
page?: MenuPage
onSelect: (page: MenuPage) => void
Expand Down
3 changes: 3 additions & 0 deletions src/game/scenes/screen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import VirtualJoystick from 'phaser3-rex-plugins/plugins/virtualjoystick';

import { Scene } from '..';
import { GameScene } from '../../types';

import { ScreenUI } from './interface';
import { ScreenAudio, ScreenEvent } from './types';

import type { IScreen } from './types';
import type { LangPhrase } from '~lib/lang/types';

import { Assets } from '~lib/assets';
import { INTERFACE_SCALE } from '~lib/interface/const';

Expand Down
9 changes: 6 additions & 3 deletions src/game/scenes/screen/interface/builder/building/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import React from 'react';

import { Preview } from './preview';
import {
Container, Info, Name, Text,
} from './styles';

import type { LangPhrase } from '~lib/lang/types';
import type { BuildingVariant } from '~scene/world/entities/building/types';

import { phrase } from '~lib/lang';
import { Hint } from '~scene/system/interface/hint';

import {
Container, Info, Name, Text,
} from './styles';

type Props = {
variant: BuildingVariant
number: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ import {
import React, { useRef, useState } from 'react';

import { GameScene } from '../../../../../../types';
import {
Container, Number, Image, Info, Frame,
} from './styles';

import type { BuildingVariant } from '~scene/world/entities/building/types';
import type { IWorld } from '~scene/world/types';

import { Cost } from '~scene/system/interface/cost';
import { BUILDINGS } from '~scene/world/entities/building/factory/const';

import {
Container, Number, Image, Info, Frame,
} from './styles';

type Props = {
number: number
variant: BuildingVariant
Expand Down
10 changes: 7 additions & 3 deletions src/game/scenes/screen/interface/builder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ import { useGame, useScene, useSceneUpdate } from 'phaser-react-ui';
import React, { useEffect, useMemo, useState } from 'react';

import { GameScene } from '../../../../types';

import { Building } from './building';
import {
Category, Label, Variants, Wrapper,
} from './styles';

import type { IGame } from '../../../../types';
import type { LangPhrase } from '~lib/lang/types';
import type { IWorld } from '~scene/world/types';

import { phrase } from '~lib/lang';
import { Tutorial } from '~lib/tutorial';
import { TutorialStep } from '~lib/tutorial/types';
import { Utils } from '~lib/utils';
import { BUILDINGS } from '~scene/world/entities/building/factory/const';
import { BuildingVariant, BuildingCategory } from '~scene/world/entities/building/types';

import {
Category, Label, Variants, Wrapper,
} from './styles';

export const Builder: React.FC = () => {
const game = useGame<IGame>();
const world = useScene<IWorld>(GameScene.WORLD);
Expand Down
4 changes: 3 additions & 1 deletion src/game/scenes/screen/interface/debug/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { useGame, useScene, useSceneUpdate } from 'phaser-react-ui';
import React, { useState } from 'react';

import { GameScene } from '../../../../types';
import { Value } from './styles';

import type { IGame } from '../../../../types';
import type { IWorld } from '~scene/world/types';

import { Value } from './styles';

export const Debug: React.FC = () => {
const game = useGame<IGame>();
const world = useScene<IWorld>(GameScene.WORLD);
Expand Down
4 changes: 3 additions & 1 deletion src/game/scenes/screen/interface/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import { Modes } from './modes';
import { Notices } from './notices';
import { PlayerHUD } from './player-hud';
import { Skills } from './skills';
import { Column, Grid, Wrapper } from './styles';
import { Superskills } from './superskills';
import { Unlocks } from './unlocks';
import { Wave } from './wave';

import { INTERFACE_SCALE } from '~lib/interface/const';
import { Section } from '~scene/system/interface/section';

import { Column, Grid, Wrapper } from './styles';

export const ScreenUI: React.FC = () => {
const refScale = useRelativeScale<HTMLDivElement>(INTERFACE_SCALE);

Expand Down
4 changes: 3 additions & 1 deletion src/game/scenes/screen/interface/modes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from 'react';

import { Item } from './item';
import { Wrapper } from './styles';

import { Utils } from '~lib/utils';
import { WorldMode } from '~scene/world/types';

import { Wrapper } from './styles';

export const Modes: React.FC = () => (
<Wrapper>
{Utils.MapObject(WorldMode, (key, mode) => (
Expand Down
Loading

0 comments on commit 73eb2a5

Please sign in to comment.