Registry / testing / eslint-plugin-fsd-lint

eslint-plugin-fsd-lint

JSON →
library1.2.1jsnpmunverified

ESLint 9+ plugin for enforcing Feature-Sliced Design (FSD) architecture rules with Flat Config support. Current stable version is 1.2.1, regularly released on npm. Provides presets (recommended, strict, base) and individual rules for layer boundaries, public API discipline, relative import hygiene, UI/business-logic separation, and import ordering. Built for modern ESLint, works with TypeScript, path aliases, custom folder naming, and tsconfig mapping. Key differentiator: opinionated FSD rules with flexible configuration and real file resolution.

npm install eslint-plugin-fsd-lint
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-FSD-
E
eslint-plugin-fsd-lint
testingjavascriptv1.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import fsdPlugin from 'eslint-plugin-fsd-lint'
✗ const fsdPlugin = require('eslint-plugin-fsd-lint')
ESM only; CommonJS require will fail because the plugin is ESM-only.
fsd-plugin configs
✓ fsdPlugin.configs.recommended
✗ fsdPlugin.configs.recommended.rules
Presets are full flat config objects, not rule objects. Do not destructure .rules.
rules
✓ import fsdPlugin from 'eslint-plugin-fsd-lint'; export default [{ plugins: { fsd: fsdPlugin }, rules: { 'fsd/no-relative-imports': 'error' } }]
✗ module.exports = { rules: { 'fsd/no-relative-imports': 'error' } }
Flat Config requires the new object format with plugins and rules, not the old .eslintrc style.

Shows how to import the plugin and use the recommended preset with an additional rule override in ESLint 9 flat config.

import fsdPlugin from 'eslint-plugin-fsd-lint'; export default [ fsdPlugin.configs.recommended, { rules: { 'fsd/ordered-imports': 'warn', }, }, ];
Debug
Known issues
breakingESM-only: the plugin only exports an ESM module; using require() will throw a Module not found error.
fix
Use import syntax with an ESLint 9 flat config. Do not use require().
affects: >=1.0.0
breakingPeer dependency ESLint >=9: the plugin does not work with ESLint 8 or older.
fix
Upgrade ESLint to version 9 or later.
affects: >=1.0.0
gotchaPresets in v1.0.10 and earlier were not actual flat config presets and could not be used directly. Fixed in v1.0.11.
fix
Update to v1.0.11 or later to use presets as flat config arrays.
affects: <=1.0.10
gotchaTests were silently no-op in v1.2.0 and earlier due to missing RuleTester bindings; the test suite reported zero tests.
fix
Update to v1.2.1 for the test infrastructure fix.
affects: <=1.2.0
deprecatedSome rules used deprecated ESLint context methods in v1.0.11 and earlier; now replaced with context properties.
fix
Update to v1.0.12 or later for ESLint v10 readiness.
affects: <=1.0.11
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/eslint-plugin-fsd-lint/dist/index.js not supported.
The plugin is ESM-only; using require() to import it.
fix
Change to import syntax: import fsdPlugin from 'eslint-plugin-fsd-lint';
ESLint configuration is invalid: The config 'plugin:fsd/recommended' is not found.
Using the old eslintrc extend format instead of the flat config preset.
fix
Use the new flat config: export default [fsdPlugin.configs.recommended];
TypeError: fsdPlugin.configs.recommended.rules is not iterable
Trying to access .rules from a flat config preset that is an array of config objects.
fix
Use the preset directly as a flat config array item, do not destructure .rules.
Error: Cannot find module 'eslint-plugin-fsd-lint'
Plugin not installed or ESLint cannot resolve it in flat config.
fix
Run npm install --save-dev eslint-plugin-fsd-lint and ensure it is in the project's dependencies.
Upgrade
Version history
1.2.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency, requires eslint >=9.0.0
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-fsd-lint — npm install eslint-plugin-fsd-lint · libregistry