Update README and package, re-add money formatter (#1286)
This commit is contained in:
parent
bac6c22973
commit
f7a7b23dd1
|
@ -24,9 +24,6 @@ dist-ssr
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
# Docummentation
|
|
||||||
docs/*
|
|
||||||
|
|
||||||
public/images/trainer/convert/*
|
public/images/trainer/convert/*
|
||||||
public/images/battle_anims/input/*.png
|
public/images/battle_anims/input/*.png
|
||||||
public/images/pokemon/input/*.png
|
public/images/pokemon/input/*.png
|
||||||
|
|
|
@ -8,7 +8,7 @@ If you have the motivation and experience with Typescript/Javascript (or are wil
|
||||||
|
|
||||||
### 💻 Environment Setup
|
### 💻 Environment Setup
|
||||||
#### Prerequisites
|
#### Prerequisites
|
||||||
- node: 18.3.0
|
- node: 20.13.1
|
||||||
- npm: [how to install](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
|
- npm: [how to install](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
|
||||||
|
|
||||||
#### Running Locally
|
#### Running Locally
|
||||||
|
@ -16,6 +16,9 @@ If you have the motivation and experience with Typescript/Javascript (or are wil
|
||||||
- *if you run into any errors, reach out in the **#dev-corner** channel in discord*
|
- *if you run into any errors, reach out in the **#dev-corner** channel in discord*
|
||||||
2. Run `npm run start:dev` to locally run the project in `localhost:8000`
|
2. Run `npm run start:dev` to locally run the project in `localhost:8000`
|
||||||
|
|
||||||
|
#### Linting
|
||||||
|
We're using ESLint as our common linter and formatter. It will run automatically during the pre-commit hook but if you would like to manually run it, use the `npm run eslint` script.
|
||||||
|
|
||||||
### ❔ FAQ
|
### ❔ FAQ
|
||||||
|
|
||||||
**How do I test a new _______?**
|
**How do I test a new _______?**
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
# ESLint
|
||||||
|
## Key Features
|
||||||
|
|
||||||
|
1. **Automation**:
|
||||||
|
- A pre-commit hook has been added to automatically run ESLint on the added or modified files, ensuring code quality before commits.
|
||||||
|
|
||||||
|
2. **Manual Usage**:
|
||||||
|
- If you prefer not to use the pre-commit hook, you can manually run ESLint to automatically fix issues using the command:
|
||||||
|
```sh
|
||||||
|
npx eslint --fix . or npm run eslint
|
||||||
|
```
|
||||||
|
- Running this command will lint all files in the repository.
|
||||||
|
|
||||||
|
3. **GitHub Action**:
|
||||||
|
- A GitHub Action has been added to automatically run ESLint on every push and pull request, ensuring code quality in the CI/CD pipeline.
|
||||||
|
|
||||||
|
## Summary of ESLint Rules
|
||||||
|
|
||||||
|
1. **General Rules**:
|
||||||
|
- **Equality**: Use `===` and `!==` instead of `==` and `!=` (`eqeqeq`).
|
||||||
|
- **Indentation**: Enforce 2-space indentation (`indent`).
|
||||||
|
- **Quotes**: Use doublequotes for strings (`quotes`).
|
||||||
|
- **Variable Declarations**:
|
||||||
|
- Disallow `var`; use `let` or `const` (`no-var`).
|
||||||
|
- Prefer `const` for variables that are never reassigned (`prefer-const`).
|
||||||
|
- **Unused Variables**: Allow unused function parameters but enforce error for other unused variables (`@typescript-eslint/no-unused-vars`).
|
||||||
|
- **End of Line**: Ensure at least one newline at the end of files (`eol-last`).
|
||||||
|
- **Curly Braces**: Enforce the use of curly braces for all control statements (`curly`).
|
||||||
|
- **Brace Style**: Use one true brace style (`1tbs`) for TypeScript-specific syntax (`@typescript-eslint/brace-style`).
|
||||||
|
|
||||||
|
2. **TypeScript-Specific Rules**:
|
||||||
|
- **Semicolons**:
|
||||||
|
- Enforce semicolons for TypeScript-specific syntax (`@typescript-eslint/semi`).
|
||||||
|
- Disallow unnecessary semicolons (`@typescript-eslint/no-extra-semi`).
|
||||||
|
|
||||||
|
## Benefits
|
||||||
|
|
||||||
|
- **Consistency**: Ensures consistent coding style across the project.
|
||||||
|
- **Code Quality**: Helps catch potential errors and improve overall code quality.
|
||||||
|
- **Readability**: Makes the codebase easier to read and maintain.
|
File diff suppressed because it is too large
Load Diff
|
@ -44,7 +44,7 @@
|
||||||
"phaser3-rex-plugins": "^1.1.84"
|
"phaser3-rex-plugins": "^1.1.84"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0"
|
"node": ">=20.0.0"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"#app": "./src/main.js",
|
"#app": "./src/main.js",
|
||||||
|
|
|
@ -1251,7 +1251,7 @@ export default class BattleScene extends SceneBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMoneyText(): void {
|
updateMoneyText(): void {
|
||||||
this.moneyText.setText(`₽${this.money.toLocaleString("en-US")}`);
|
this.moneyText.setText(`₽${Utils.formatLargeNumber(this.money, 1000)}`);
|
||||||
this.moneyText.setVisible(true);
|
this.moneyText.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1084,6 +1084,7 @@ export class GameData {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return this.scene.ui.showText(`Your ${dataName} data could not be loaded. It may be corrupted.`, null, () => this.scene.ui.showText(null, 0), Utils.fixedInt(1500));
|
return this.scene.ui.showText(`Your ${dataName} data could not be loaded. It may be corrupted.`, null, () => this.scene.ui.showText(null, 0), Utils.fixedInt(1500));
|
||||||
}
|
}
|
||||||
|
this.scene.ui.revertMode();
|
||||||
this.scene.ui.showText(`Your ${dataName} data will be overridden and the page will reload. Proceed?`, null, () => {
|
this.scene.ui.showText(`Your ${dataName} data will be overridden and the page will reload. Proceed?`, null, () => {
|
||||||
this.scene.ui.setOverlayMode(Mode.CONFIRM, () => {
|
this.scene.ui.setOverlayMode(Mode.CONFIRM, () => {
|
||||||
localStorage.setItem(dataKey, encrypt(dataStr, bypassLogin));
|
localStorage.setItem(dataKey, encrypt(dataStr, bypassLogin));
|
||||||
|
|
Loading…
Reference in New Issue