Skip to content

Releases: ESLint-Plugin-Code-Style/plugin

Organization Migration, Automated Website Sync & Context7 Integration

10 Apr 00:17

Choose a tag to compare

Version Range: v3.0.6 → v3.1.0

Changed

  • Organization - Moved repository from Mohamed-Elhawary/eslint-plugin-code-style to ESLint-Plugin-Code-Style/plugin under a dedicated GitHub organization
  • Website - Extracted documentation website into a separate repository (ESLint-Plugin-Code-Style/website), fully independent with no local cross-repo dependencies
  • Structure - Moved docs/rules/ to rules/ at the root level, removed docs/ directory
  • Sync - Replaced manual website sync with fully automated pipeline via metadata.json and GitHub Actions (repository_dispatch)
  • Website - All hardcoded rule counts (30+ instances) replaced with dynamic imports from auto-generated data
  • URLs - Updated all GitHub URLs across README, AGENTS, package.json, recommended configs, and website source code to new org

Added

  • metadata.json - Single source of truth for all rule data, version, examples, options, and metadata consumed by the website
  • .github/workflows/sync-website.yml - GitHub Action to trigger website sync on plugin changes
  • context7.json - Context7 library ownership claim
  • Automated website pipeline: plugin push → GitHub Action → website fetches metadata + changelog → auto-generates rules.ts, config.ts, navigation.ts → Vercel deploys

Fixed

  • All ESLint errors in the documentation website resolved (plugin's own rules applied as showcase)
  • Removed all stale references to old docs/website/ structure
  • Removed validate-sync.js (redundant with automated sync)

Full Changelog: v3.0.6...v3.1.0

Documentation Website, Next.js Compatibility & ESLint v10 Support

08 Apr 20:53

Choose a tag to compare

Version Range: v2.2.5 → v3.0.0

Added

  • Production-quality documentation website (docs/website/) built with Next.js 15, React 19, Tailwind CSS v4, and TypeScript — deployed at https://www.eslint-plugin-code-style.org
    • Landing page with hero section, feature highlights, stats, and quick-start guide
    • Getting Started, Configuration, Philosophy, and Contributing guide pages
    • Rules Reference with all 81 rules across 17 category pages — descriptions, rationale, options, good/bad code examples
    • Dark/light mode with system preference detection
    • Responsive layout with sidebar navigation and mobile support
    • Polished code blocks with copy-to-clipboard and horizontal scrolling
    • Per-page SEO metadata (title, description, OpenGraph)
    • Full ESLint compliance with the react-ts-tw recommended config (0 errors, 0 rules disabled)
    • All hardcoded strings extracted to centralized data files
    • Plugin version sourced from single docs/website/src/data/config.ts constant
  • ESLint v10 recommended configurations for all 4 project types (recommended-configs/v10/)
    • v10 configs use @eslint-react/eslint-plugin instead of eslint-plugin-react and eslint-plugin-react-hooks
    • READMEs with migration guide and plugin mapping table for each v10 config
  • ESLint v10 test projects (_tests_/v10/) for all 4 project types
  • Website sync requirements in AGENTS.md and CLAUDE.md — complete checklist for keeping the website 100% in sync with plugin changes

Enhanced

  • function-naming-convention — Skip Next.js reserved exports (generateMetadata, generateStaticParams, generateViewport, GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS); add 16 new verbs (notify, broadcast, emit, dispatch, join, combine, bind, etc.)
  • folder-based-naming-convention — Skip Next.js special folder patterns ([slug], (group), @parallel, _private) inside app/ directory
  • folder-structure-consistency — Skip files inside Next.js app/ directory
  • module-index-exports — Skip Next.js reserved filenames (page, layout, loading, error, not-found, template, default, route, middleware)
  • Added .next/** to ignores in all recommended config and test project ESLint configs

Changed

  • Reorganized recommended configs into recommended-configs/v9/ and recommended-configs/v10/
  • Reorganized test projects into _tests_/v9/ and _tests_/v10/
  • Homepage URL changed to https://www.eslint-plugin-code-style.org
  • Website domain added to README.md and docs/rules/README.md

Removed

  • docs/frontend-guide/ folder (moved to separate repository)

BREAKING CHANGES

  • Recommended config paths changed: recommended-configs/react/recommended-configs/v9/react/ (same for all 4 variants)
  • Test project paths changed: _tests_/react/_tests_/v9/react/ (same for all 4 variants)
  • Removed docs/frontend-guide/ directory

Full Changelog: v2.2.5...v3.0.0


Originally released on 2026-03-26

New Rule, Component Naming Enhancements & Folder Flattening Detection

08 Apr 20:53

Choose a tag to compare

Version Range: v2.1.1 → v2.2.0

Added

New Rules (1)

  • hook-function-naming-convention - Enforce that exported hook function names match the camelCase of the file name (e.g., use-create-super-admin.ts must export useCreateSuperAdmin) 🔧

New Features

  • folder-based-naming-convention — Singularize plural folder names in component chain for named files (e.g., discount/types/code.tsxCodeTypeDiscount not CodeTypesDiscount); index files keep plural
  • folder-based-naming-convention — Configurable chainOrder option: "child-parent" (default) or "parent-child" with per-path overrides via files array
  • folder-structure-consistency — Detect unnecessary nesting when a folder has only one subfolder and no direct code files, suggesting flattening (e.g., discount/types/discount-types/)

Enhanced

  • folder-based-naming-convention — Now configurable with chainOrder and files options ⚙️
  • no-redundant-folder-suffix — Shared singularizeHandler extracted to module level for reuse

Fixed

  • function-object-destructure — Skip array method callbacks, add auto-fix for destructure-and-return pattern (from v2.1.1)

Stats

  • Total Rules: 81 (was 80)
  • Auto-fixable: 71 rules 🔧 (was 70)
  • Configurable: 20 rules ⚙️ (was 19)
  • Report-only: 10 rules

Full Changelog: v2.1.1...v2.2.0


Originally released on 2026-02-24

New Rule: Hook File Naming Convention + 18 Fixes & Enhancements

08 Apr 20:53

Choose a tag to compare

Version Range: v2.0.18 → v2.1.0

Added

New Rules (1)

  • hook-file-naming-convention - Enforce naming conventions for hook files inside hooks/ module subfolders: verb hooks must follow use-{verb}-{module-singular}, list hooks must follow use-{module-plural}-list

Enhanced

  • nested-call-closing-brackets — Collapse closing ) onto the same line as arrow function body for single-arg calls (block bodies, expression bodies, ternaries), removing trailing commas
  • opening-brackets-same-line — Collapse fn(\n () => to fn(() => for zero-param arrow callbacks; split destructured callback params with 2+ properties to multi-line; move arrow body to => line for destructured callback params
  • no-redundant-folder-suffix — Added exception for hook files (use-*) inside hooks/ folders, since they intentionally include the module name as required by hook-file-naming-convention

Fixed

  • folder-structure-consistency — Enforce consistency in nested subfolders (e.g., components/shared/), not just top-level module folders; treat index-file folders and folders with subdirectories as justified wrapping
  • no-redundant-folder-suffix — Detect plural folder suffix in file names (e.g., auth-interfaces.ts in interfaces/ folder), not just singular forms
  • folder-based-naming-convention — Flag PascalCase names in camelCase folders and auto-fix to camelCase; enforce PascalCase for providers/ folder; detect wrong-folder placement by suffix; enforce file name + folder chain in camelCase naming; add schemas folder with Schema suffix
  • single-argument-on-one-line — Collapse method chain inter-call line breaks; collapse method chains to one line when all calls have ≤1 simple argument; skip multi-line template literals
  • no-hardcoded-strings — Fix Tailwind class regex to handle decimal values; detect any function call inside className as a class utility; skip strings inside class utility calls; added missing single-word Tailwind utilities
  • component-naming — Skip generic grouping folders (shared, common, ui, base, general, core) when chaining folder names
  • opening-brackets-same-line — Collapse BinaryExpression, LogicalExpression, and UnaryExpression in JSX attributes to single line
  • function-arguments-format — Remove trailing comma for single template literal arguments; skip single TemplateLiteral arguments
  • type-annotation-spacing — No trailing comma on last generic type parameter; single generic collapses inline; multiple generics expand to separate lines
  • type-format — Enforce trailing comma on last property; detect nested type literals inside array types; closing brace on own line for 2+ properties; single-property collapse; union types with multi-property objects stay expanded; intersection type formatting
  • function-object-destructure — Recognize components inside React.forwardRef(), memo(), observer() wrapper calls
  • enum-type-enforcement — Auto-fix only replaces string literals when enum exists in scope
  • variable-naming-convention — Allow PascalCase for component re-exports from PascalCase namespaces
  • function-params-per-line — Destructured properties in callback arrow params get one-per-line formatting
  • arrow-function-simple-jsx — Fixed multiline JSX collapse and missing space after =>
  • classname-multiline — Added CallExpression handler for class utility calls
  • absolute-imports-only — Auto-fix deep import violations; auto-fix absolute imports to relative within same module
  • component-props-inline-type — Skip qualified library types (React.HTMLAttributes, etc.)

Stats

  • Total Rules: 80 (was 79)
  • Auto-fixable: 70 rules 🔧
  • Configurable: 19 rules ⚙️
  • Report-only: 10 rules (was 9)

Full Changelog: v2.0.18...v2.1.0


Originally released on 2026-02-19

Modular Source Architecture + Minified Build

08 Apr 20:53

Choose a tag to compare

Version Range: v1.20.0 → v2.0.0

Changed

  • BREAKING: Modular source architecture — Split monolithic 23K-line index.js into src/ with 17 category files + shared utilities
    • src/index.js — Entry point importing all rules
    • src/rules/*.js — 17 category files (arrays, arrow-functions, call-expressions, classes, comments, components, control-flow, functions, hooks, imports-exports, jsx, objects, react, spacing, strings, typescript, variables)
    • src/utils/tailwind.js — Shared Tailwind CSS class utilities
  • Build system — Added esbuild to bundle and minify src/ into dist/index.js
    • npm run build generates the bundled output
    • Output is ~269 KB (was ~1 MB), a 73% reduction
  • Package entry pointmain and exports now point to dist/index.js instead of index.js
  • npm package — Publishes dist/index.js instead of root index.js; removed root index.js from package

Added

  • esbuild.config.js — Build configuration
  • esbuild as devDependency
  • npm run build script

Stats

  • Total Rules: 79
  • Auto-fixable: 70 rules 🔧
  • Configurable: 19 rules ⚙️
  • Report-only: 9 rules
  • Unpacked size: ~400 KB (was ~1.26 MB)

Full Changelog: v1.20.0...v2.0.0


Originally released on 2026-02-09

README Reorganization — Split Rules Reference into docs/rules/

08 Apr 20:53

Choose a tag to compare

Version Range: v1.19.0 → v1.20.0

Added

  • Rules Reference Documentation (docs/rules/) — 17 category files with detailed rule documentation, examples, and configuration options
    • arrays.md, arrow-functions.md, call-expressions.md, classes.md, comments.md, components.md, control-flow.md, functions.md, hooks.md, imports-exports.md, jsx.md, objects.md, react.md, spacing.md, strings.md, typescript.md, variables.md
  • Rules index page (docs/rules/README.md) — Overview table linking to all 17 category files

Changed

  • README.md — Reorganized from ~4,150 lines to ~475 lines by moving detailed rule documentation to docs/rules/
    • Kept: badges, Why This Plugin, Recommended Configs, Features, Installation, Quick Start, Enable All Rules, Rules Summary table, Rules Reference links, Auto-fixing, Disabling Rules, Contributing, License
    • Moved: All detailed rule examples, options, and explanations to docs/rules/ category files
  • Recommended config READMEs — Updated rule documentation links to point to docs/rules/ instead of main README
  • AGENTS.md — Updated documentation references to reflect new docs/rules/ structure
  • package.json — Added docs/ to npm files array

Full Changelog: v1.19.0...v1.20.0


Originally released on 2026-02-09

New: React + Tailwind Test Project & Recommended Config

08 Apr 20:52

Choose a tag to compare

Version Range: v1.18.0 → v1.19.0

Added

  • React + Tailwind test project (_tests_/react-tw/) — React + Tailwind CSS project (no TypeScript) with 70 code-style rules enabled and Tailwind CSS v4 plugin
  • React + Tailwind recommended config (recommended-configs/react-tw/) — Ready-to-use ESLint flat config for React + Tailwind CSS projects without TypeScript
    • Includes 70 JavaScript-compatible code-style rules, Tailwind CSS plugin, and recommended third-party plugins
    • Documented with installation instructions, rule explanations, and customization guide

Changed

  • Updated Available Configurations table in README.md — React + Tailwind now links to config instead of "Coming Soon"
  • Updated AGENTS.md — React + Tailwind marked as Available with folder paths

Full Changelog: v1.18.0...v1.19.0


Originally released on 2026-02-09

New: React + TypeScript Test Project & Recommended Config

08 Apr 20:52

Choose a tag to compare

Version Range: v1.17.2 → v1.18.0

Added

  • React + TypeScript test project (_tests_/react-ts/) — React + TypeScript project (no Tailwind) with all 79 code-style rules enabled and @typescript-eslint parser
  • React + TypeScript recommended config (recommended-configs/react-ts/) — Ready-to-use ESLint flat config for React + TypeScript projects without Tailwind CSS
    • Includes all 79 code-style rules, TypeScript parser, and recommended third-party plugins
    • Documented with installation instructions, rule explanations, and customization guide

Changed

  • Updated Available Configurations table in README.md — React + TypeScript now links to config instead of "Coming Soon"
  • Updated AGENTS.md — React + TypeScript marked as Available with folder paths

Full Changelog: v1.17.2...v1.18.0


Originally released on 2026-02-09

New Rule + Enhancements to Naming & Import Rules

08 Apr 20:52

Choose a tag to compare

Version Range: v1.16.0 → v1.17.0

Added

New Rules (1)

  • inline-export-declaration - Enforce inline export declarations (export const x = ...) instead of grouped export statements (export { x }) in non-index files 🔧
    • Auto-fixable: adds export to each declaration and removes the grouped export statement
    • Skips index files (barrel re-exports) and aliased exports (export { a as b })

Enhanced

  • folder-based-naming-convention - Extended camelCase suffix enforcement for data/constants/strings/services/reducers folders
    • Exports in data/ must end with Data (e.g., buttonTypeData)
    • Exports in constants/ must end with Constants (e.g., localeConstants)
    • Exports in strings/ must end with Strings (e.g., appStrings)
    • Exports in services/ must end with Service, reducers/ with Reducer
  • absolute-imports-only - Files within the same module folder must use relative imports instead of absolute to avoid circular dependencies 🔧
    • Detects files at any depth inside module folders (e.g., data/auth/login/guest.tsx)
    • Allows both ./ and ../ relative imports within the same module folder
    • Auto-fixes absolute imports to own module folder (e.g., @/data/auth/login/guest../../login/guest)
    • Now marked as auto-fixable (fixable: "code")
  • folder-structure-consistency - Added loose module file detection: standalone files matching module folder names (e.g., data.js, strings.js) are flagged — must use folder structure instead

Stats

  • Total Rules: 79 (was 78)
  • Auto-fixable: 70 rules (was 69) 🔧
  • Configurable: 19 rules (was 18)
  • Report-only: 9 rules (was 10)

Full Changelog: v1.16.0...v1.17.0


Originally released on 2026-02-09

New Rule + Enhancements + Rule Renames

08 Apr 20:52

Choose a tag to compare

Version Range: v1.15.0 → v1.16.0

Added

New Rules (1)

  • folder-structure-consistency - Enforce consistent folder structure (flat vs wrapped) in module folders
    • Applies to all module folders (same list as module-index-exports)
    • Detects mixed structures (some flat files, some in subfolders)
    • Flags unnecessary wrapper folders when each has only one file
    • Configurable moduleFolders and extraModuleFolders options

Enhanced

  • folder-based-naming-convention (renamed from folder-component-suffix)
    • Support nested files with chained folder names (e.g., layouts/auth/login.tsxLoginAuthLayout)
    • Match files at any depth within module folders
    • Expanded to cover: views, layouts, pages, providers, reducers, services, contexts, themes (with suffix), atoms and components (chaining only, no suffix)
    • Added VariableDeclarator detection for non-JSX folders (contexts, themes)
  • no-redundant-folder-suffix - Also check folder names for redundant suffixes (e.g., views/access-control-view/ is now flagged)

Renamed

  • folder-component-suffixfolder-based-naming-convention (now handles more than just components)
  • svg-component-icon-namingsvg-icon-naming-convention (consistent with other naming convention rules)

Stats

  • Total Rules: 78 (was 77)
  • Auto-fixable: 67 rules
  • Configurable: 18 rules (was 17)
  • Report-only: 11 rules (was 10)

Full Changelog: v1.15.0...v1.16.0


Originally released on 2026-02-09