-
Notifications
You must be signed in to change notification settings - Fork 32
UDT part for @ckb-ccc/rgbpp #338
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Dependencies | ||
| node_modules | ||
| .pnp | ||
| .pnp.js | ||
|
|
||
| # Testing | ||
| coverage | ||
| __snapshots__ | ||
|
|
||
| # Production | ||
| build | ||
| dist | ||
| lib | ||
|
|
||
| # Misc | ||
| .DS_Store | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
|
|
||
| # Debug logs | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # IDE | ||
| .idea | ||
| .vscode | ||
|
|
||
| # Cache | ||
| .cache | ||
| .eslintcache |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "singleQuote": false, | ||
| "trailingComma": "all", | ||
| "plugins": ["prettier-plugin-organize-imports"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| // @ts-check | ||
|
|
||
| import eslint from "@eslint/js"; | ||
| import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; | ||
| import tseslint from "typescript-eslint"; | ||
|
|
||
| import { dirname } from "path"; | ||
| import { fileURLToPath } from "url"; | ||
|
|
||
| export default [ | ||
| ...tseslint.config({ | ||
| files: ["**/*.ts"], | ||
| extends: [ | ||
| eslint.configs.recommended, | ||
| ...tseslint.configs.recommendedTypeChecked, | ||
| ], | ||
| rules: { | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "error", | ||
| { | ||
| args: "all", | ||
| argsIgnorePattern: "^_", | ||
| caughtErrors: "all", | ||
| caughtErrorsIgnorePattern: "^_", | ||
| destructuredArrayIgnorePattern: "^_", | ||
| varsIgnorePattern: "^_", | ||
| ignoreRestSiblings: true, | ||
| }, | ||
| ], | ||
| "@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }], | ||
| "@typescript-eslint/no-unsafe-member-access": "off", | ||
| "@typescript-eslint/require-await": "off", | ||
| "@typescript-eslint/only-throw-error": [ | ||
| "error", | ||
| { | ||
| allowThrowingAny: true, | ||
| allowThrowingUnknown: true, | ||
| allowRethrowing: true, | ||
| }, | ||
| ], | ||
| "@typescript-eslint/prefer-promise-reject-errors": [ | ||
| "error", | ||
| { | ||
| allowThrowingAny: true, | ||
| allowThrowingUnknown: true, | ||
| }, | ||
| ], | ||
| "no-empty": "off", | ||
| "prefer-const": [ | ||
| "error", | ||
| { ignoreReadBeforeAssign: true, destructuring: "all" }, | ||
| ], | ||
| }, | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: true, | ||
| tsconfigRootDir: dirname(fileURLToPath(import.meta.url)), | ||
| }, | ||
| }, | ||
| }), | ||
| eslintPluginPrettierRecommended, | ||
| ]; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| { | ||
| "name": "@ckb-ccc/rgbpp", | ||
| "version": "1.0.0", | ||
| "description": "RGB++ for CKB", | ||
| "types": "dist/index.d.ts", | ||
| "source": "src/index.ts", | ||
| "type": "module", | ||
| "main": "dist.commonjs/index.js", | ||
| "module": "dist/index.js", | ||
| "exports": { | ||
| ".": { | ||
| "import": "./dist/index.js", | ||
| "require": "./dist.commonjs/index.js", | ||
| "default": "./dist.commonjs/index.js" | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "test": "jest", | ||
| "build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .", | ||
| "lint": "eslint ./src", | ||
| "format": "prettier --write . && eslint --fix ./src" | ||
| }, | ||
| "keywords": [], | ||
| "author": "", | ||
| "license": "ISC", | ||
| "devDependencies": { | ||
| "@ckb-ccc/spore": "workspace:*", | ||
| "@ckb-ccc/udt": "workspace:*", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UDT imported, reasonable, where is it used? |
||
| "@eslint/js": "^9.34.0", | ||
| "@exact-realty/multipart-parser": "^1.0.13", | ||
| "@types/jest": "^29.5.14", | ||
| "@types/lodash": "^4.17.14", | ||
| "@types/node": "^22.10.6", | ||
| "copyfiles": "^2.4.1", | ||
| "dotenv": "^16.4.7", | ||
| "eslint": "^9.34.0", | ||
| "eslint-config-prettier": "^10.1.8", | ||
| "eslint-plugin-prettier": "^5.5.4", | ||
| "jest": "^29.7.0", | ||
| "prettier": "^3.6.2", | ||
| "prettier-plugin-organize-imports": "^4.2.0", | ||
| "rimraf": "^6.0.1", | ||
| "ts-jest": "^29.2.5", | ||
| "tsx": "^4.20.6", | ||
| "typescript": "^5.7.3", | ||
| "typescript-eslint": "^8.41.0" | ||
| }, | ||
| "dependencies": { | ||
| "@bitcoinerlab/secp256k1": "1.1.1", | ||
| "@ckb-ccc/core": "workspace:*", | ||
| "@ckb-lumos/base": "^0.23.0", | ||
| "@ckb-lumos/bi": "^0.23.0", | ||
| "@ckb-lumos/codec": "^0.23.0", | ||
| "bip32": "4.0.0", | ||
| "bitcoinjs-lib": "6.1.6", | ||
| "ecpair": "2.1.0", | ||
| "js-sha256": "^0.11.0", | ||
| "lodash": "^4.17.21" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /** | ||
| * @see https://prettier.io/docs/configuration | ||
| * @type {import("prettier").Config} | ||
| */ | ||
| const config = { | ||
| singleQuote: false, | ||
| trailingComma: "all", | ||
| plugins: [require.resolve("prettier-plugin-organize-imports")], | ||
| }; | ||
|
|
||
| module.exports = config; | ||
|
Comment on lines
+1
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This Prettier configuration file ( |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling
@typescript-eslint/no-unsafe-member-accessis highly discouraged as it can hide potential runtime errors by allowing member access onanytypes without checks. This undermines the benefits of TypeScript's type safety. It's better to handleanytypes explicitly (e.g., with type guards or assertions) or, if necessary, disable the rule on a case-by-case basis with an inline comment explaining why it's safe. Consider re-enabling this rule or setting it to"warn"to avoid introducing bugs.