eslint-plugin-custom-rule

tarafından coinbase

USE THIS when asked to create a new eslint plugin rule for the eslint-plugin-cds package

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.

coinbase tarafından daha fazla skill

git.repo-manager
coinbase
git.repo-manager — coinbase/cds tarafından yayınlanan, yapay zeka ajanları için kurulabilir bir beceri.
official
agentic-wallet
coinbase
Awal CLI üzerinden kripto cüzdan işlemleri — giriş yapma, bakiyeleri kontrol etme, USDC/ETH/POL/SOL gönderme, token takası yapma, cüzdanı fonlama ve x402 ödeme protokolünü kullanarak…
official
authenticate-wallet
coinbase
E-posta OTP tabanlı cüzdan kimlik doğrulaması, doğrulama ve durum kontrolü ile birlikte. İki adımlı giriş akışı: e-posta ile başlatılarak 6 haneli OTP alınır, ardından flowId ve kod ile doğrulanarak kimlik doğrulama tamamlanır. Komutları çalıştırmadan önce shell enjeksiyonunu önlemek için e-posta, flowId ve OTP için giriş doğrulama kuralları içerir. Yardımcı CLI komutları aracılığıyla durum kontrolü, bakiye sorgulama, adres alma ve cüzdan penceresi erişimi sağlar. Tüm komutlar makine tarafından okunabilir çıktı için --json çıktısını destekler...
official
fund
coinbase
Coinbase Onramp veya doğrudan transfer yoluyla cüzdana USDC yatırır. Kullanıcıların önceden belirlenmiş miktarları (10$, 20$, 50$) veya özel değerleri seçip Apple Pay, banka kartı, banka havalesi veya Coinbase hesabı finansmanı arasından tercih yapabileceği bir yardımcı arayüz açar. Farklı mutabakat sürelerine sahip birden fazla ödeme yöntemini destekler: kart ve Apple Pay için anlık, ACH banka havaleleri için 1–3 gün. Fonları Base ağında USDC olarak yatırır; alternatif olarak, kullanıcılar npx awal@2.0.3... aracılığıyla doğrudan cüzdan adresine USDC göndere
official
monetize-service
coinbase
Ücretli bir API uç noktası dağıtır; diğer ajanlar bunu x402 protokolü üzerinden keşfedip ödeme yapabilir. Base üzerinde HTTP 402 ödeme protokolü kullanarak istek başına USDC tahsil eder; istemciler imzalı işlemlerle ödeme yapar, API anahtarı veya hesap gerekmez. Keşif uzantılarını bildirdiğinizde uç noktaları otomatik olarak x402 Bazaar'a kaydeder. Express middleware kullanarak uç nokta başına birden fazla fiyatlandırma katmanı, joker karakter rotaları ve birden fazla ödeme seçeneğini destekler. @x402/express ve @x402/core üzerine inşa edilmiştir...
official
pay-for-service
coinbase
Base üzerinde x402 protokolü aracılığıyla otomatik USDC ödemesiyle ücretli API'leri çağırır. Atomik USDC ödemeleriyle x402 destekli uç noktalara HTTP istekleri (GET, POST vb.) yürütür. Yöntem, JSON gövdesi, sorgu parametreleri ve özel başlıklar aracılığıyla istek özelleştirmesini destekler. Ödeme kontrolleri içerir: istek başına maksimum USDC miktarını ayarlayın ve ilgili işlemleri korelasyon kimlikleriyle gruplandırın. Cüzdan kimlik doğrulaması ve yeterli USDC bakiyesi gerektirir; shell'i önlemek için tüm kullanıcı girdilerini doğrular...
official
query-blockchain-data
coinbase
Base üzerinde CDP SQL API aracılığıyla x402 kullanarak zincir üstü blok zinciri verilerini sorgulayın. Siz veya kullanıcınız, çözülmüş bloklar hakkında zincir üstü bilgileri görüntülemek istediğinizde kullanın.
official
query-onchain-data
coinbase
Base üzerinde SQL kullanarak sorgu başına x402 ödemeleriyle zincir üstü verileri sorgulayın. CoinbaseQL aracılığıyla çözülmüş olaylara, işlemlere ve bloklara erişin; bu, birleştirmeleri, CTE'leri, alt sorguları ve standart işlevleri destekleyen ClickHouse tabanlı bir SQL lehçesidir. Üç ana tablo mevcuttur: base.events (çözülmüş akıllı sözleşme günlükleri), base.transactions (tam işlem verileri) ve base.blocks (blok meta verileri). Olay sorgularında tam tablo taramasını önlemek için indekslenmiş alanlarda (event_signature, address, block_timestamp) filtreleme gerektirir.
official