Skip to content

Commit

Permalink
chore: update eslint and prettier (#135)
Browse files Browse the repository at this point in the history
* chore: update eslint and prettier

* fix: run eslint without cli options
  • Loading branch information
maalni authored Jul 2, 2024
1 parent b72ec4a commit 04c421c
Show file tree
Hide file tree
Showing 55 changed files with 53,138 additions and 53,529 deletions.
19 changes: 0 additions & 19 deletions .eslintrc.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DS_Store
.github/
.husky/
dist/
node_modules/
.env
.env.*
!.env.example
data/

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
53 changes: 27 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@

Data repo for dval.in, exported from paimon.moe

[GOOD Json Format](https://frzyc.github.io/genshin-optimizer/#/doc)
[GOOD Json Format](https://frzyc.github.io/genshin-optimizer/#/doc)

PascalCase ID's
- [x] AchievementCategory
- [x] Artifact
- [x] Bait
- [x] Character
- [x] CharacterExpMaterial
- [x] CommonMaterial
- [x] ElementalStoneMaterial
- [x] Fish
- [x] FishingRod
- [x] Food
- [x] Furnishing
- [ ] number ID's for categories?
- [x] Ingredient
- [x] JewelsMaterial
- [x] LocalMaterial
- [x] Potion
- [x] TalentLvlUpMaterial
- [x] TCGActionCard
- [x] TCGCharacterCard
- [x] TCGMonsterCard
- [x] Weapon
- [x] WeaponEnhancementMaterial
- [x] WeaponPrimaryMaterial
- [x] WeaponSecondaryMaterial
- [x] domains.json

- [x] AchievementCategory
- [x] Artifact
- [x] Bait
- [x] Character
- [x] CharacterExpMaterial
- [x] CommonMaterial
- [x] ElementalStoneMaterial
- [x] Fish
- [x] FishingRod
- [x] Food
- [x] Furnishing
- [ ] number ID's for categories?
- [x] Ingredient
- [x] JewelsMaterial
- [x] LocalMaterial
- [x] Potion
- [x] TalentLvlUpMaterial
- [x] TCGActionCard
- [x] TCGCharacterCard
- [x] TCGMonsterCard
- [x] Weapon
- [x] WeaponEnhancementMaterial
- [x] WeaponPrimaryMaterial
- [x] WeaponSecondaryMaterial
- [x] domains.json
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']};
module.exports = { extends: ['@commitlint/config-conventional'] };
34 changes: 17 additions & 17 deletions dvalin-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@

## Installation

- Install Python 3.11 or later: https://www.python.org/downloads/
- Install poetry: https://python-poetry.org/docs/#installation
- Clone this repository: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
- Install dependencies:
```bash
- Install Python 3.11 or later: https://www.python.org/downloads/
- Install poetry: https://python-poetry.org/docs/#installation
- Clone this repository: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
- Install dependencies:
```bash
cd dvalin-data/dvalin-tools
poetry install
```
- Set your `.env` file (then customize it as needed):
- Set your `.env` file (then customize it as needed):
```bash
cp .env.example .env
```

## Usage (manual)

- Run the tool:
- Windows:
```powershell
dvalin-event-scraper.cmd --help
```
- Linux:
```bash
dvalin-event-scraper --help
```
- Run the tool:
- Windows:
```powershell
dvalin-event-scraper.cmd --help
```
- Linux:
```bash
dvalin-event-scraper --help
```

### Example: Update the event data to save images to S3

```bash
Expand All @@ -39,7 +39,7 @@ Use docker-compose for automation.

### Local development

The local dev mounts the current project into the container, so you can edit the code
The local dev mounts the current project into the container, so you can edit the code
and run the tool without rebuilding the container.
You can use the following command to run the tool in local-dev:

Expand Down
97,034 changes: 48,517 additions & 48,517 deletions dvalin-tools/__scraper_cache__/redirect_links.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions dvalin-tools/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
version: '3.8'

services:
event_agent:
build:
context: .
dockerfile: Dockerfile
target: runtime-localdev
environment:
- DVALIN_REPO_ROOT_DIR=/usr/src/repo/dvalin-data
volumes:
- ..:/usr/src/repo/dvalin-data
- ./__scraper_cache__:/usr/src/app/__scraper_cache__
event_agent:
build:
context: .
dockerfile: Dockerfile
target: runtime-localdev
environment:
- DVALIN_REPO_ROOT_DIR=/usr/src/repo/dvalin-data
volumes:
- ..:/usr/src/repo/dvalin-data
- ./__scraper_cache__:/usr/src/app/__scraper_cache__
52 changes: 26 additions & 26 deletions dvalin-tools/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
version: '3.8'

services:
event_agent:
build:
context: .
dockerfile: Dockerfile
target: runtime-prod
image: ghcr.io/dval-in/dvalin-tools-event-agent:latest
restart: unless-stopped
command: celery -A dvalin_tools.agents.event_agent worker --loglevel=info -B
environment:
- DVALIN_CELERY_BROKER_URL=${DVALIN_CELERY_BROKER_URL}
- DVALIN_CELERY_RESULT_BACKEND=${DVALIN_CELERY_RESULT_BACKEND}
- DVALIN_S3_ENDPOINT=${DVALIN_S3_ENDPOINT}
- DVALIN_S3_ACCESS_KEY=${DVALIN_S3_ACCESS_KEY}
- DVALIN_S3_SECRET_KEY=${DVALIN_S3_SECRET_KEY}
- DVALIN_GIT_USER_EMAIL=${DVALIN_GIT_USER_EMAIL}
- DVALIN_GIT_USER_NAME=${DVALIN_GIT_USER_NAME}
- DVALIN_GIT_GITHUB_USERNAME=${DVALIN_GIT_GITHUB_USERNAME}
- DVALIN_GIT_PRIVATE_ACCESS_TOKEN=${DVALIN_GIT_PRIVATE_ACCESS_TOKEN}
- DVALIN_REPO_ROOT_DIR=/usr/src/repo/dvalin-data
depends_on:
- redis
event_agent:
build:
context: .
dockerfile: Dockerfile
target: runtime-prod
image: ghcr.io/dval-in/dvalin-tools-event-agent:latest
restart: unless-stopped
command: celery -A dvalin_tools.agents.event_agent worker --loglevel=info -B
environment:
- DVALIN_CELERY_BROKER_URL=${DVALIN_CELERY_BROKER_URL}
- DVALIN_CELERY_RESULT_BACKEND=${DVALIN_CELERY_RESULT_BACKEND}
- DVALIN_S3_ENDPOINT=${DVALIN_S3_ENDPOINT}
- DVALIN_S3_ACCESS_KEY=${DVALIN_S3_ACCESS_KEY}
- DVALIN_S3_SECRET_KEY=${DVALIN_S3_SECRET_KEY}
- DVALIN_GIT_USER_EMAIL=${DVALIN_GIT_USER_EMAIL}
- DVALIN_GIT_USER_NAME=${DVALIN_GIT_USER_NAME}
- DVALIN_GIT_GITHUB_USERNAME=${DVALIN_GIT_GITHUB_USERNAME}
- DVALIN_GIT_PRIVATE_ACCESS_TOKEN=${DVALIN_GIT_PRIVATE_ACCESS_TOKEN}
- DVALIN_REPO_ROOT_DIR=/usr/src/repo/dvalin-data
depends_on:
- redis

redis:
image: "redis:alpine"
ports:
- "6379:6379"
restart: unless-stopped
redis:
image: 'redis:alpine'
ports:
- '6379:6379'
restart: unless-stopped
55 changes: 55 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// @ts-check

import tseslint from 'typescript-eslint';
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';

export default tseslint.config(
{
ignores: [
'.github/*',
'.node_modules/*',
'dist/*',
'data/*',
'.DS_Store',
'.env*',
'pnpm-lock.yaml'
]
},
{
plugins: {
'@typescript-eslint': tseslint.plugin
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: true,
sourceType: 'module',
ecmaVersion: 2020
}
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
],
'@typescript-eslint/naming-convention': [
'error',
{ selector: 'typeAlias', format: ['PascalCase'] },
{
selector: 'enumMember',
format: ['PascalCase']
}
]
}
},
{
// disable type-aware linting on JS files
files: ['**/*.js'],
...tseslint.configs.disableTypeChecked
},
eslintPluginPrettier
);
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@
"type": "module",
"scripts": {
"schemas": "node ./scripts/GenerateSchemas.js",
"lint": "eslint . --ext .ts"
"lint": "eslint ."
},
"dependencies": {
"i": "^0.3.7",
"npm": "^10.7.0",
"string-strip-html": "^13.4.8",
"typescript-json-schema": "^0.64.0"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"axios": "^1.7.2",
"cheerio": "^1.0.0-rc.12",
"eslint": "^8.57.0",
"eslint-config-xo": "^0.45.0",
"eslint-config-xo-typescript": "^4.0.0",
"typescript": "^5.5.3"
"eslint": "^9.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.3.0",
"typescript": "^5.5.3",
"typescript-eslint": "^7.11.0"
},
"engines": {
"pnpm": ">= 9",
Expand Down
Loading

0 comments on commit 04c421c

Please sign in to comment.