{"id":25511,"library":"eslint-plugin-fsd-lint","title":"eslint-plugin-fsd-lint","description":"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.","status":"active","version":"1.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/effozen/eslint-plugin-fsd-lint","tags":["javascript","eslint","plugin","feature-sliced-design","fsd","lint"],"install":[{"cmd":"npm install eslint-plugin-fsd-lint","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-fsd-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-fsd-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, requires eslint >=9.0.0","package":"eslint","optional":false}],"imports":[{"note":"ESM only; CommonJS require will fail because the plugin is ESM-only.","wrong":"const fsdPlugin = require('eslint-plugin-fsd-lint')","symbol":"default","correct":"import fsdPlugin from 'eslint-plugin-fsd-lint'"},{"note":"Presets are full flat config objects, not rule objects. Do not destructure .rules.","wrong":"fsdPlugin.configs.recommended.rules","symbol":"fsd-plugin configs","correct":"fsdPlugin.configs.recommended"},{"note":"Flat Config requires the new object format with plugins and rules, not the old .eslintrc style.","wrong":"module.exports = { rules: { 'fsd/no-relative-imports': 'error' } }","symbol":"rules","correct":"import fsdPlugin from 'eslint-plugin-fsd-lint'; export default [{ plugins: { fsd: fsdPlugin }, rules: { 'fsd/no-relative-imports': 'error' } }]"}],"quickstart":{"code":"import fsdPlugin from 'eslint-plugin-fsd-lint';\n\nexport default [\n  fsdPlugin.configs.recommended,\n  {\n    rules: {\n      'fsd/ordered-imports': 'warn',\n    },\n  },\n];","lang":"javascript","description":"Shows how to import the plugin and use the recommended preset with an additional rule override in ESLint 9 flat config."},"warnings":[{"fix":"Use import syntax with an ESLint 9 flat config. Do not use require().","message":"ESM-only: the plugin only exports an ESM module; using require() will throw a Module not found error.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Upgrade ESLint to version 9 or later.","message":"Peer dependency ESLint >=9: the plugin does not work with ESLint 8 or older.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Update to v1.0.11 or later to use presets as flat config arrays.","message":"Presets in v1.0.10 and earlier were not actual flat config presets and could not be used directly. Fixed in v1.0.11.","severity":"gotcha","affected_versions":"<=1.0.10"},{"fix":"Update to v1.2.1 for the test infrastructure fix.","message":"Tests were silently no-op in v1.2.0 and earlier due to missing RuleTester bindings; the test suite reported zero tests.","severity":"gotcha","affected_versions":"<=1.2.0"},{"fix":"Update to v1.0.12 or later for ESLint v10 readiness.","message":"Some rules used deprecated ESLint context methods in v1.0.11 and earlier; now replaced with context properties.","severity":"deprecated","affected_versions":"<=1.0.11"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to import syntax: import fsdPlugin from 'eslint-plugin-fsd-lint';","cause":"The plugin is ESM-only; using require() to import it.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/eslint-plugin-fsd-lint/dist/index.js not supported."},{"fix":"Use the new flat config: export default [fsdPlugin.configs.recommended];","cause":"Using the old eslintrc extend format instead of the flat config preset.","error":"ESLint configuration is invalid: The config 'plugin:fsd/recommended' is not found."},{"fix":"Use the preset directly as a flat config array item, do not destructure .rules.","cause":"Trying to access .rules from a flat config preset that is an array of config objects.","error":"TypeError: fsdPlugin.configs.recommended.rules is not iterable"},{"fix":"Run npm install --save-dev eslint-plugin-fsd-lint and ensure it is in the project's dependencies.","cause":"Plugin not installed or ESLint cannot resolve it in flat config.","error":"Error: Cannot find module 'eslint-plugin-fsd-lint'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}