Background
The current build pipeline includes a pnpm lint command, but the monorepo lacks a unified ESLint configuration. Without centralized linting rules, code quality, import consistency, and style diverge across packages. This is especially critical during the Stellar/Soroban migration where new patterns (SEP-10, Soroban contracts) need to follow consistent standards.
Problem
- No shared ESLint config: Each package may have its own or no
.eslintrc at all
- Inconsistent import rules: Hardcoded
.js imports (see related issue) suggest linting doesn't enforce best practices
- No type-aware linting: TypeScript strict mode and type safety aren't enforced via ESLint
- Maintenance burden: Linting rules are not documented or synced across packages
Expected Outcome
- Single, shared
.eslintrc.json or eslint.config.js in the workspace root
- All packages inherit and extend consistent rules
- Linting enforces import practices, type safety, and code style
- CI can fail on lint violations
- Developers get immediate feedback during editing (via IDE integration)
Suggested Implementation
-
Create a shared ESLint config in the workspace root:
pnpm install -D eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-import
-
Create .eslintrc.json in the workspace root:
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint",
"import"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
"import/extensions": [
"error",
"ignorePackages",
{
"ts": "never",
"tsx": "never",
"js": "never",
"jsx": "never"
}
],
"import/no-unresolved": "error"
}
}
-
Add .eslintignore to exclude build artifacts, node_modules:
node_modules/
dist/
.next/
build/
-
Update root package.json lint script:
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix"
-
For each package, either:
- Remove local
.eslintrc (inherit from root), or
- Create a minimal
packages/*/eslintrc.json that extends the root config
-
Run linting:
pnpm lint # Check
pnpm lint:fix # Auto-fix
pnpm -r lint # Lint all packages
-
Integrate into CI/CD (e.g., GitHub Actions) to fail on violations
Acceptance Criteria
Affected Files/Directories
.eslintrc.json (create at workspace root)
.eslintignore (create at workspace root)
- All
packages/*/ and apps/*/ directories (inherit config)
package.json (update lint scripts)
- CI/CD workflows (add linting step)
Background
The current build pipeline includes a
pnpm lintcommand, but the monorepo lacks a unified ESLint configuration. Without centralized linting rules, code quality, import consistency, and style diverge across packages. This is especially critical during the Stellar/Soroban migration where new patterns (SEP-10, Soroban contracts) need to follow consistent standards.Problem
.eslintrcat all.jsimports (see related issue) suggest linting doesn't enforce best practicesExpected Outcome
.eslintrc.jsonoreslint.config.jsin the workspace rootSuggested Implementation
Create a shared ESLint config in the workspace root:
Create
.eslintrc.jsonin the workspace root:{ "root": true, "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2020, "sourceType": "module", "project": "./tsconfig.json" }, "plugins": [ "@typescript-eslint", "import" ], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:import/errors", "plugin:import/warnings", "plugin:import/typescript" ], "rules": { "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/no-explicit-any": "warn", "import/extensions": [ "error", "ignorePackages", { "ts": "never", "tsx": "never", "js": "never", "jsx": "never" } ], "import/no-unresolved": "error" } }Add
.eslintignoreto exclude build artifacts, node_modules:Update root
package.jsonlint script:For each package, either:
.eslintrc(inherit from root), orpackages/*/eslintrc.jsonthat extends the root configRun linting:
Integrate into CI/CD (e.g., GitHub Actions) to fail on violations
Acceptance Criteria
.eslintrc.jsondefines shared rulespnpm lintruns without errorspnpm lint:fixauto-fixes common issues.jsextensions in source importspnpm lintand fails on violationsAffected Files/Directories
.eslintrc.json(create at workspace root).eslintignore(create at workspace root)packages/*/andapps/*/directories (inherit config)package.json(update lint scripts)