@noctcore/eslint-plugin-architecture
A bad fit for a codebase organised by technical layer (hooks/, components/, utils/ at the top) rather than by feature, and for a small app where a component folder with five siblings is ceremony.
Folder-per-component, barrels and feature boundaries, anchored on a configurable directory.
What it solves
Section titled “What it solves”Folder structure that nobody enforces decays one convenient shortcut at a time: a barrel that grows a helper function, a component folder missing its test, a feature importing another feature’s internals, a relative import that climbs five parents. These rules make the layout a checked property of the codebase instead of a paragraph in a contributing guide.
What it will yell at you about
Section titled “What it will yell at you about”It will yell at you about file layout, and several rules read the file system: component-folder-structure wants every <Name>/<Name>.tsx to ship its full sibling set, colocated-test-required wants a test next to each source file it covers. Run ESLint on real file paths, not virtual sources. Every rule anchors on a directory segment (default components) instead of an absolute path, so it behaves the same from the repo root or a package. It is a bad fit for a codebase organised by technical layer (hooks/, components/, utils/ at the top) rather than by feature, and for a small app where a component folder with five siblings is ceremony. colocated-test-required and single-semantic-module ship off because they are opinions many good codebases do not share. file-naming-pattern also ships off: it does nothing until folders and pattern are set.
Install and configure
Section titled “Install and configure”npm install --save-dev @noctcore/eslint-plugin-architecture @typescript-eslint/parser# or: bun add -D / pnpm add -D @noctcore/eslint-plugin-architecture @typescript-eslint/parserThe recommended preset turns none of its 10 rules on: each is a house convention or needs options, so the board starts from strict, which enables 6. The rules board below builds the flat config: start from a preset, switch single rules between error and off, and copy the result.
Each rule links to its page, with the options it takes and Incorrect and Correct examples. A good first
read is no-cross-feature-imports.
--fixsuggestionsneeds optionstype infoEach switch sets a rule to error or off.
index.* file with an export … from re-export) must contain only re-exports, never local declarations, side effects, or default-exported values.include glob must have a colocated *.test.* / *.spec.* sibling on disk.<Name>/<Name>.tsx under <componentRoot>/<feature>/... must have its sibling set (.hooks.ts, .types.ts, .stories.tsx, .test.tsx, index.ts) present on disk.folders, a file's basename must match pattern, a regular expression built from the folder's name.index.ts must re-export the component default (export { default as <Name> } from './<Name>').max parent levels (default 3). Autofixed to a path alias when one is configured.import().