eslint-plugin-custom-rule

โดย coinbase

ใช้สิ่งนี้เมื่อถูกขอให้สร้างกฎ eslint plugin ใหม่สำหรับแพ็กเกจ eslint-plugin-cds

npx skills add https://github.com/coinbase/cds --skill eslint-plugin-custom-rule

Writing new rules

Process

When asked to create a new custom rule for the package, follow these steps in order:

  1. Run the scaffold-new-rule.mjs script found at packages/eslint-plugin-cds/scripts/scaffold-new-rule.mjs. The script should be used every time a new rule is created. This script will ensure that the same format is used for all custom rules created.
  2. Ask the user what the custom rule should do. If the user doesn't provide enough context in the prompt, ask for clarification or follow up. Do not make assumptions about how a custom rule is meant to behave or what guideline it's supposed to enforce. After gathering the needed context, ask the user which package(s) the rule should be applied to.
  3. Once you have all the needed context, ask the user to provide at least one valid and one invalid example demonstrating when the custom rule is being followed or not. This will help you to write tests for the custom rule in a future step. Similar to step 2, if the provided examples do not give you enough context to understand the difference between a valid versus invalid example, ask the user for clarification. Do not proceed until the user has provided at least one valid and one invalid example and you have enough needed context to understand a valid and invalid example.
  4. Based on the user's provided context, fill in the rule file generated under the src/rules directory. The main section you should fill out is the create() function key that's in the rule object. You can refer to packages/eslint-plugin-cds/src/rules/custom-rule.ts for more documentation on how custom rules are formatted and information to enter. Custom rules should use the AST visitor methods to determine when rules have been violated and should report warnings in the linter. Custom rules should also verify the packages being imported before performing AST parsing. If a file doesn't import a package specified in step 2, do not report an error in the custom rule. Most custom rules already do this. As an example, you can refer to the ImportDeclaration() function in the no-v7-imports rule found here: packages/eslint-plugin-cds/src/rules/no-v7-imports.ts. The rule only reports an error when one of the CDS_PACKAGES packages is used,
  5. Using the context from step 3, write in valid and invalid test cases for the test file generated from the scaffold-new-rule.mjs script. The valid and invalid examples provided in step 3 should be included. Based off those examples and the rule criteria provided in step 2, you can add additional valid or invalid examples.

Directory placement

Custom rules should always be placed in the packages/eslint-plugin-cds/src/rules directory. Tests for each custom rule should be placed in the packages/eslint-plugin-cds/tests directory.

Skills เพิ่มเติมจาก coinbase

git.repo-manager
coinbase
git.repo-manager — ทักษะที่สามารถติดตั้งได้สำหรับเอเจนต์ AI เผยแพร่โดย coinbase/cds
official
agentic-wallet
coinbase
ดำเนินการกระเป๋าเงินคริปโตผ่าน CLI awal — ลงชื่อเข้าใช้ ตรวจสอบยอดเงิน ส่ง USDC/ETH/POL/SOL ซื้อขายโทเค็น เติมเงินในกระเป๋า และใช้โปรโตคอลการชำระเงิน x402 เพื่อ...
official
authenticate-wallet
coinbase
การยืนยันตัวตนกระเป๋าเงินผ่าน OTP ทางอีเมล พร้อมการตรวจสอบความถูกต้องและสถานะ ขั้นตอนการเข้าสู่ระบบสองขั้นตอน: เริ่มต้นด้วยอีเมลเพื่อรับ OTP 6 หลัก จากนั้นยืนยันด้วย flowId และรหัสเพื่อดำเนินการยืนยันตัวตนให้สมบูรณ์ รวมถึงกฎการตรวจสอบข้อมูลนำเข้าสำหรับอีเมล flowId และ OTP เพื่อป้องกันการแทรกคำสั่งเชลล์ก่อนดำเนินการคำสั่ง ให้การตรวจสอบสถานะ การสอบถามยอดคงเหลือ การดึงที่อยู่ และการเข้าถึงหน้าต่างกระเป๋าเงินผ่านคำสั่ง CLI ที่เกี่ยวข้อง คำสั่งทั้งหมดรองรับเอาต์พุต --json สำหรับการอ่านโดยเครื่อง...
official
fund
coinbase
ฝาก USDC เข้ากระเป๋าเงินผ่าน Coinbase Onramp หรือโอนโดยตรง เปิด UI คู่หูที่ให้ผู้ใช้เลือกจำนวนเงินที่กำหนดไว้ ($10, $20, $50) หรือกำหนดเอง และเลือกจาก Apple Pay, บัตรเดบิต, โอนผ่านธนาคาร หรือการเติมเงินจากบัญชี Coinbase รองรับวิธีการชำระเงินหลายวิธีโดยมีระยะเวลาการชำระที่แตกต่างกัน: ทันทีสำหรับบัตรและ Apple Pay, 1–3 วันสำหรับการโอนผ่านธนาคารแบบ ACH ฝากเงินเป็น USDC บนเครือข่าย Base; หรือผู้ใช้สามารถส่ง USDC ไปยังที่อยู่กระเป๋าเงินโดยตรงผ่าน npx awal@2.0.3...
official
monetize-service
coinbase
ปรับใช้ปลายทาง API แบบชำระเงินที่เอเจนต์อื่นสามารถค้นพบและชำระเงินผ่านโปรโตคอล x402 คิดค่าบริการเป็น USDC ต่อคำขอบน Base โดยใช้โปรโตคอลการชำระเงิน HTTP 402; ลูกค้าชำระเงินด้วยธุรกรรมที่ลงนามแล้ว ไม่ต้องใช้คีย์ API หรือบัญชีใดๆ ลงทะเบียนปลายทางกับ x402 Bazaar โดยอัตโนมัติเพื่อให้เอเจนต์ค้นพบเมื่อคุณประกาศส่วนขยายการค้นพบ รองรับระดับราคาหลายระดับ เส้นทางแบบ Wildcard และตัวเลือกการชำระเงินหลายแบบต่อปลายทางโดยใช้ Express Middleware สร้างบน @x402/express และ @x402/core...
official
pay-for-service
coinbase
เรียกใช้ API แบบชำระเงินบน Base ด้วยการชำระเงิน USDC อัตโนมัติผ่านโปรโตคอล x402 ดำเนินการร้องขอ HTTP (GET, POST ฯลฯ) ไปยังเอนด์พอยต์ที่รองรับ x402 โดยจัดการชำระเงิน USDC แบบอะตอมิกโดยอัตโนมัติ รองรับการปรับแต่งคำขอผ่านเมธอด, เนื้อหา JSON, พารามิเตอร์คิวรี, และส่วนหัวที่กำหนดเอง รวมถึงการควบคุมการชำระเงิน: กำหนดจำนวน USDC สูงสุดต่อคำขอ และจัดกลุ่มการดำเนินการที่เกี่ยวข้องด้วยรหัส correlation ต้องมีการยืนยันตัวตนของกระเป๋าเงินและยอดคงเหลือ USDC ที่เพียงพอ ตรวจสอบอินพุตของผู้ใช้ทั้งหมดเพื่อป้องกันเชลล์...
official
query-blockchain-data
coinbase
สอบถามข้อมูลบล็อกเชนออนเชนบน Base โดยใช้ CDP SQL API ผ่าน x402 ใช้เมื่อคุณหรือผู้ใช้ของคุณต้องการดูข้อมูลออนเชนเกี่ยวกับบล็อกที่ถอดรหัสแล้ว…
official
query-onchain-data
coinbase
สอบถามข้อมูลออนเชนบน Base โดยใช้ SQL พร้อมการชำระเงินแบบ x402 ต่อคำสั่งค้นหา เข้าถึงอีเวนต์ ธุรกรรม และบล็อกที่ถอดรหัสแล้วผ่าน CoinbaseQL ซึ่งเป็นภาษา SQL ที่ใช้ ClickHouse รองรับการ join, CTE, subquery และฟังก์ชันมาตรฐาน มีตารางหลักสามตาราง: base.events (บันทึกสัญญาอัจฉริยะที่ถอดรหัสแล้ว), base.transactions (ข้อมูลธุรกรรมทั้งหมด), และ base.blocks (ข้อมูลเมตาของบล็อก) จำเป็นต้องกรองฟิลด์ที่จัดทำดัชนี (event_signature, address, block_timestamp) ในการค้นหาอีเวนต์เพื่อหลีกเลี่ยงการสแกนทั้งตาราง...
official