chore: publish shared eslint-config-tikka flat config (Closes #1286) - #1445
Open
Shollyhano wants to merge 1 commit into
Open
Shollyhano wants to merge 1 commit into
Shollyhano wants to merge 1 commit into
Conversation
Unify the five copy-pasted per-package ESLint flat configs into a single internal `eslint-config-tikka` workspace package that exports a base config plus `node` and `react` variants. Each package's `eslint.config.mjs` is now a short extension of the shared variant plus its own overrides. Align every package on ESLint ^10.9.1 and typescript-eslint ^8.68.0 (shared as dependencies of the config package), so lint rules and plugins are versioned in one place. Encode repo-wide decisions: `@typescript-eslint/no-explicit-any` and `no-console` as warning ratchets, with `no-console` disabled for CLI/script/bin files. `pnpm -r lint` is clean (0 errors) across client, sdk, backend, indexer, and oracle. Also fixes the pre-existing issues that blocked a clean lint after unifying onto typescript-eslint recommended rules: a mangled comment (t/**) in Settings.tsx, a hook-called-after-early-return in ImageCarousel.tsx, an async Promise executor in walletService.ts, and several `let`-that-is-never-reassigned cases (backend metadata.service, sdk fee-estimator, indexer integration spec, oracle multi-oracle coordinator). Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@Shollyhano is attempting to deploy a commit to the otaiki1's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
FIX CONFLICTS |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the five copy-pasted, already-diverged
eslint.config.jsfiles (inclient/,sdk/,backend/,indexer/,oracle/) with a single internaleslint-config-tikkaworkspace package that exports one base flat config plusnodeandreactvariants. Each package's config is now a short extension of the shared variant plus its own documented overrides, and every package is aligned on one ESLint major and one typescript-eslint version.Closes #1286
Problem
clienton^9, whilesdk/backend/indexer/oraclewere on^10.0.2/^10.6.0/^10.8.0/^10.7.0.@typescript-eslint/parser+eslint-pluginwere declared per-package at slightly different versions.indexerdeclared the prettier integration; even then it wasn't actually wired into a config.no-console,@typescript-eslint/no-explicit-any).What changed
1. New
eslint-config-tikkaworkspace packageeslint-config-tikka/base.js— shared baseline:tseslint.configs.recommended+eslint-config-prettier, the repo-wide decision rules, and the CLI/script/binno-consoleoverride.eslint-config-tikka/node.js— extends base with Node globals (process,require,__dirname, …) forsdk/backend/indexer/oracle.eslint-config-tikka/react.js— extends base with ESLint core recommended, browser globals, and the classic React Hooks / React Refresh rule sets forclient.workspace:*).2. Each package's config is now a short extension
client/eslint.config.mjs→...react()+react-refresh/only-export-components: off.sdk/eslint.config.mjs→node().backend/indexer/oracleeslint.config.mjs→...node()+ the small set of pre-existing "rot" overrides they each need (e.g.@typescript-eslint/no-require-imports,ban-ts-comment, andoracle's known-challenging file ignores). Configs were renamed.js→.mjsso CJS packages canimportthe ESM config package.3. One ESLint major & one typescript-eslint version
^10.9.1(includingclient, bumped from^9.33.0).^8.68.0is declared once, as a dependency ofeslint-config-tikka, and consumed by every package — the per-package@typescript-eslint/*declarations were removed.@eslint/js,globals,eslint-config-prettier,eslint-plugin-react-hooks, andeslint-plugin-react-refreshare likewise versioned in the shared package only.eslint-plugin-react-hookswas bumped (peer dependency needed to support ESLint 10); the React config keeps only the two classic Hooks rules so the stricter neweslint-plugin-react-hooksv7 rules are not force-fed onto existing code.4. Rules encoding repo-wide decisions
@typescript-eslint/no-explicit-any→ warning ratchet (previously'off'in several packages).no-console→ warning ratchet, turned fullyofffor**/*.cli.*,**/cli/**,**/scripts/**, and**/bin/**(CLI tooling may legitimately print to a terminal).@typescript-eslint/no-unused-vars→ warning ratchet ignoring_-prefixed vars/args (the convention already used).5. Pre-existing violations fixed to reach a clean lint
Unifying onto
typescript-eslint/core recommended rules surfaced a handful of real, pre-existing defects. These are fixed minimally:client/src/pages/Settings.tsx— a mangled comment (t/**→/**) that previously caused ano-unused-expressionserror.client/src/components/ImageCarousel.tsx— auseEffectcalled after an earlyreturn(hooks-order violation); moved the single-image early-return below the hooks.client/src/services/walletService.ts— anasyncPromise executor; hoistedgetKit()out of the executor (kept the same inferred return type).letthat is never reassigned →constinbackend/src/services/metadata.service.ts,sdk/src/fee-estimator/fee-estimator.service.ts,indexer/src/test/integration/ingestion-pipeline.integration.spec.ts, andoracle/src/multi-oracle/multi-oracle-coordinator.service.ts.Acceptance criteria
^10.9.1everywhere, resolved to the same build).pnpm -r lintis clean — verified locally with 0 errors across all five packages:(The remaining output is the intended
@typescript-eslint/no-explicit-anyandno-consolewarning ratchet.)Testing performed
pnpm installat the workspace root and regenerated the rootpnpm-lock.yamlwith the neweslint-config-tikkaimporter.pnpm -r lint→ exit 0, zero errors in every package.Notes / decisions
js.configs.recommendedis applied by the react variant only (preservingclient's existing behavior) rather than in the shared base, so this PR does not surface unrelated core-rule failures in the Node services. This is documented ineslint-config-tikka/base.js.no-consoleandno-explicit-anyare warning ratchets (not errors) so existing uses stay visible but don't block CI; they can be tightened toerrorover time as violations are cleaned up.eslint-plugin-react-hooksv7 strict rules (e.g.set-state-in-effect, refs-during-render) are intentionally not enabled in the React config; enabling them repo-wide is a good follow-up.pnpm-lock.yamlfiles underclient|sdk|backend|indexer|oraclewere left untouched; the root workspace lockfile is the source of truth forpnpm -r.Files changed
eslint-config-tikka/{base,node,react,index,package.json}.mjs& reduced:client|sdk|backend|indexer|oracle/eslint.config.{js→mjs}package.json,pnpm-workspace.yaml, all five*/package.json,pnpm-lock.yaml