Skip to content

feat(oxlint-config): add flat-layers config - #218

Merged
dangreen merged 1 commit into
feat/oxlint-react-compilerfrom
feat/oxlint-flat-layers
Nov 25, 2026
Merged

dangreen merged 1 commit into
feat/oxlint-react-compilerfrom
feat/oxlint-flat-layers

Conversation

@dangreen

Copy link
Copy Markdown
Member

Stacked on #217.

A new flat-layers config with one rule, trigen/flat-layers, for apps laid out by the flat-layers-design skill.

The rule resolves every import with oxc-resolver, a new dependency, which reads the tsconfig's paths, so it knows no alias by heart. It then locates both files under root (an option, app by default) and checks:

  • Direction: the skill's table of what each layer may import. uikit takes services as types alone, and assets go to uikit, blocks and pages.
  • Paths: the same layer by a relative path, another layer by its alias.
  • Entry points: a module is imported through its index, except for the entry points imported by their path: skeleton, loadable, *.module.css and *.mock.*. An index that re-exports one of them is reported.
  • Stores: a store base that imports its own subdomain, as plant.ts importing plant.list.ts.
  • Kit internals: uikit/shared imported from outside uikit.
  • Hooks: a module-level use* function outside a .jsx/.tsx file, a hooks.* file or a hooks/ folder, where the rules of hooks don't find it. hooksFiles now takes hooks.{js,ts} and nested hooks/ folders, to match.
  • Story titles: a title that doesn't start with its layer and folder, as UIKit/Button or Blocks/GardenCard, or with the file's name at a layer's root.

The rule does not see an import whose specifier is computed, or a hook declared other than as a function declaration or a function assigned to a variable.

The rule tester now writes nested folders.

On plant1t-web: 17 findings in 0.7 s:

  • 13 hooks in plain .ts modules;
  • 3 deep imports into PhotoField and TextEditor;
  • 1 story titled after another folder.

🤖 Generated with Claude Code

@dangreen
dangreen added this pull request to stack #222 November 25, 2026 17:13
@dangreen
dangreen merged commit a30c330 into main Nov 25, 2026
6 checks passed
@dangreen
dangreen deleted the feat/oxlint-flat-layers branch November 25, 2026 17:22
@github-actions github-actions Bot mentioned this pull request Nov 25, 2026
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