Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ dist
node_modules
yarn-error.log
package-lock.json

*.csv
.vscode
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run precommit
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ $ crypto bitcoin

## Flags

| Name | Description |
| ------------------------ | ------------------------------------------- |
| `--price-change`, `--pc` | Coin price change (%) in the past 24 hours |
| `--volume`, `--v` | Coin volume in the past 24 hours |
| `--ath-change`, `--athc` | Percent price change from the all time high |
| `--high`, `--h` | Highest price sold in the past 24 hours |
| `--low`, `--l` | Lowest price sold in the past 24 hours |
| `--ath` | Coin all time high price |
| `--save json,csv` | Save coin data via JSON and/or CSV |
| `--help` | Flag description and usage examples |
| `--version` | Current version |
| Name | Description |
| ----------------------- | ------------------------------------------- |
| `--price-change`, `-pc` | Coin price change (%) in the past 24 hours |
| `--volume`, `-v` | Coin volume in the past 24 hours |
| `--ath-change`, `-athc` | Percent price change from the all time high |
| `--high`, `-h` | Highest price sold in the past 24 hours |
| `--low`, `-l` | Lowest price sold in the past 24 hours |
| `--ath` | Coin all time high price |
| `--save json,csv` | Save coin data via JSON and/or CSV |
| `--help` | Flag description and usage examples |
| `--version` | Current version |

## Local Development

Expand Down
31 changes: 31 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { defineConfig, globalIgnores } from "eslint/config";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default defineConfig([globalIgnores(["**/dist/", "**/coverage/", "**/node_modules/"]), {
extends: compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
),

plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
},
}]);
42 changes: 22 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,37 @@
"build": "tsc",
"test": "mocha 'src/*.test.ts'",
"lint": "eslint --fix",
"prepare": "husky install",
"prepare": "husky",
"precommit": "lint-staged"
},
"engines": {
"node": ">=14"
"node": ">=22"
},
"type": "module",
"dependencies": {
"@crypto-coffee/coingecko-api": "^1.2.0",
"@json2csv/node": "^7.0.5",
"chalk": "^5.3.0",
"meow": "^11.0.0"
"@json2csv/node": "^7.0.6",
"chalk": "^5.4.1",
"meow": "^13.2.0"
},
"devDependencies": {
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^20.6.0",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"chai": "^4.3.8",
"eslint": "^8.49.0",
"execa": "^8.0.1",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"mocha": "^10.2.0",
"prettier": "^3.0.3",
"rimraf": "^4.3.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.23.0",
"@types/chai": "^5.2.1",
"@types/mocha": "^10.0.10",
"@types/node": "^22.13.14",
"@typescript-eslint/eslint-plugin": "^8.28.0",
"@typescript-eslint/parser": "^8.28.0",
"chai": "^5.2.0",
"eslint": "^9.23.0",
"execa": "^9.5.2",
"husky": "^9.1.7",
"lint-staged": "^15.5.0",
"mocha": "^11.1.0",
"prettier": "^3.5.3",
"rimraf": "^6.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.8.2"
},
"lint-staged": {
"*.ts": [
Expand Down
1 change: 0 additions & 1 deletion src/actions/saveCoinData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const writeFile = async (
const formatCsvFile = async (coin: Partial<CoinMarkets>): Promise<string> => {
const parser = new AsyncParser({
delimiter: ',',
excelStrings: false,
fields: [
{
label: 'Name',
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,26 @@ const cli = meow(
flags: {
priceChange: {
type: 'boolean',
alias: 'pc'
shortFlag: 'pc'
},
volume: {
type: 'boolean',
alias: 'v'
shortFlag: 'v'
},
high: {
type: 'boolean',
alias: 'h'
shortFlag: 'h'
},
low: {
type: 'boolean',
alias: 'l'
shortFlag: 'l'
},
ath: {
type: 'boolean'
},
athChange: {
type: 'boolean',
alias: 'athc'
shortFlag: 'athc'
},
save: {
type: 'string'
Expand Down
Loading
Loading