Skip to content

Simplify linting#30

Draft
raycashmore wants to merge 1 commit into
mainfrom
dev/ray/simplify-deps
Draft

Simplify linting#30
raycashmore wants to merge 1 commit into
mainfrom
dev/ray/simplify-deps

Conversation

@raycashmore
Copy link
Copy Markdown
Contributor

Linting Migration Notes

Overview

This document records the migration to a centralized ESLint v9 flat config shared across all workspaces, plus follow-up cleanup that removed markdownlint from the repo's automation.

Motivation

The previous setup had significant duplication and drift:

  • Multiple identical .eslintrc.js files across workspaces
  • Repeated ESLint plugin dependencies per workspace
  • Legacy ESLint v8 config format
  • Markdown linting wired into docs/scripts even though it was not needed

Changes Made

1. Centralized ESLint config (flat config)

Shared package:

  • Location: packages/eslint-config/
  • Package: @openfin-web-starter/eslint-config
  • Entrypoint: packages/eslint-config/eslint.config.js

The shared config is preset-driven and type-aware:

  • @eslint/js recommended
  • eslint-plugin-import flat recommended
  • eslint-plugin-promise flat recommended
  • typescript-eslint recommendedTypeChecked with:
    • parserOptions.project: './tsconfig.eslint.json'
    • parserOptions.tsconfigRootDir: process.cwd()
  • eslint-plugin-jsdoc flat recommended for TypeScript

Repo-specific rules/overrides kept in the shared config:

  • Monorepo-friendly import resolution (import/no-unresolved + import/named off)
  • Import ordering (import/order) aligned to legacy behavior (currently warn)
  • Security restriction: disallow crypto.randomUUID / window.crypto.randomUUID
  • TypeScript migration pragmatism: some "unsafe" rules disabled where the codebase currently relies on them
  • jsdoc/require-jsdoc kept enabled as warn to avoid blocking during migration cleanup

2. Workspace config simplification

Each workspace now uses a tiny flat config that spreads the shared config:

import sharedConfig from '@openfin-web-starter/eslint-config';

export default [...sharedConfig];

Workspace config files are named eslint.config.mjs.

3. Removed markdownlint from automation

markdownlint is no longer part of this repo's workflow:

  • The CI workflow no longer runs npm run markdownlint: .github/workflows/ci.yml
  • Agent guidance no longer mentions markdownlint: AGENTS.md
  • VS Code extension recommendation removed: .vscode/extensions.json

Historical markdownlint artifacts were removed from workspaces during the migration (e.g. .markdownlint.json).

4. Prettier check stability (generated/auxiliary files)

Some workspaces generate files during build (for example public/style/core-web-styles.css). To keep prettier-check stable, workspace .prettierignore files were updated to ignore:

  • eslint.config.mjs
  • public/style/core-web-styles.css

Root Scripts / CI

Recommended check-only pipeline:

  • npm ci
  • npm run prettier-check
  • npm run eslint
  • npm run build

References

@raycashmore raycashmore changed the base branch from web/v23.0.0 to main March 12, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant