Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: format #133

Merged
merged 15 commits into from
Jan 9, 2025
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

39 changes: 39 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Install cached modules'
description: 'Run pnpm install with cached modules'

runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Fix URLs in pnpm-lock.yaml
shell: bash
run: sed -i 's|git/github\.com+\(.*\)|github.com/\1|g' pnpm-lock.yaml

- name: Install pnpm
uses: pnpm/action-setup@v4
id: pnpm-install
with:
run_install: false
version: 8

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-

- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
15 changes: 3 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 18
- uses: ./.github/actions/install

- name: Install Node.js dependencies
run: yarn install

- name: Run lint
uses: wearerequired/lint-action@v1
with:
eslint: true
eslint_extensions: json
- name: Lint
run: pnpm lint
10 changes: 2 additions & 8 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 18

- name: Install Node.js dependencies
run: yarn install
- uses: ./.github/actions/install

- name: Validate
run: yarn test
run: pnpm test
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules

.idea
.vscode
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# dump files
.github
18 changes: 18 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"arrowParens": "always",
"overrides": [
{
"files": "*.json",
"options": {
"parser": "json",
"bracketSpacing": true,
"bracketSameLine": true,
"singleQuote": false
}
}
]
}
16 changes: 16 additions & 0 deletions denyTokenExpectedSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "object",
"properties": {
"address": {
"type": "string"
},
"chainId": {
"type": "integer"
},
"reason": {
"type": "string"
}
},
"required": ["address", "chainId"],
"additionalProperties": false
}
23 changes: 23 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import path from 'path'
import json from '@eslint/json'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import { includeIgnoreFile } from '@eslint/compat'
import { fileURLToPath } from 'url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

export default [
{
files: ['**/*.json'],
language: 'json/jsonc',
...json.configs.recommended,
},
{
ignores: ['.github'],
},
includeIgnoreFile(path.join(__dirname, '.gitignore')),
eslintConfigPrettier,
eslintPluginPrettierRecommended,
]
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
}
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"description": "Custom token list for li.finance",
"scripts": {
"eslint": "eslint . --ext .json",
"lint": "eslint .",
"test": "jest"
},
"repository": {
Expand All @@ -17,13 +17,17 @@
},
"homepage": "https://github.com/lifinance/customized-token-list#readme",
"devDependencies": {
"@eslint/compat": "^1.2.4",
"@eslint/json": "^0.9.0",
"@types/jest": "^29.5.3",
"@types/node": "^22.10.2",
"ajv": "^8.12.0",
"eslint": "^8.9.0",
"eslint-plugin-json": "^3.1.0",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"jest": "^29.6.1",
"prettier": "^3.4.2",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
},
"dependencies": {}
}
}
Loading
Loading