npm eslint-plugin-boundaries 6.0.0-beta.1
Object-based elements selector syntax - Beta

latest releases: 7.4.4, 7.4.3, 7.4.2...
8 months ago

eslint-plugin-boundaries v6.0.0-beta.1

Added

  • feat(#383, #388): Add object-based element selector syntax as the recommended way to define element selectors, providing better readability and access to advanced matching features.
  • feat(#395): Support from and to dependency selector objects in the boundaries/dependencies rule, enabling matching based on dependency relationship, origin, source, internal path, and more.
  • feat(#387): Add optional category field to element descriptors to enable multi-dimensional architectural classification.
  • feat(#386): Support a name property in the additional-dependency-nodes setting on each node definition, allowing to identify custom dependency nodes by name in rules and messages.
  • feat: Add checkAllOrigins, checkUnknownLocals and checkInternals options to dependencies (old element-types) rule to allow checking or ignoring dependencies based on their properties. By default, only local dependencies with known elements are checked, and internal dependencies are ignored, as in previous versions.
  • feat: Improve debug output, and add boundaries/debug setting to allow enabling/disabling it and filtering the traces that are printed.
  • feat: Support all element description properties in custom messages templates by using handlebars syntax. Old message templates will continue working as they are, without any change.

Changed

  • feat(#403): Rename boundaries/element-types rule to boundaries/dependencies. The legacy name is still supported with a deprecation warning.
  • feat(#393): Deprecate rule-level importKind option in favor of selector-level dependency.kind, allowing more granular per-selector control over dependency kind matching.
  • feat(#392): Add deprecation warning when using legacy template format (${ }), and introduce new Handlebars-style template syntax ({{ }}). The legacy format is still supported but will be removed in a future major version.
  • feat(#384): Add deprecation warning when using legacy element selector syntax (string or tuple formats).
  • feat: Validate and transform different settings and rules only once per different configuration object, and not per rule execution, to improve performance.
  • refactor: Refactor the core of the plugin to support the new features and improvements, and to improve code organization, readability and maintainability. It is now fully typed with TypeScript.

Breaking Changes

  • feat(#429): Change default value of boundaries/dependency-nodes setting to ["import", "export", "require", "dynamic-import"]. Previously only import statements were analyzed by default. To preserve previous behavior, set "boundaries/dependency-nodes": ["import"] explicitly in your configuration.
  • Remove isExternalLibrarySelector and isExternalLibrariesSelector type guards. They are not needed anymore, as external rule is deprecated and external library selectors can be defined using the same ElementSelector format.

Docs

  • docs(#396): Improve TypeScript typings documentation, enabling better IDE support and autocompletion.

elements 2.0.0-beta.1

Added

  • feat: Add support for captured as an array in element selectors, where each element in the array represents an alternative (OR logic). The selector matches if any of the array elements matches.
  • feat: Support matching null values in selectors.
  • feat: Add support for parent selector property to match against first parent (parents[0]) properties (type, category, elementPath, and captured).

Breaking Changes

  • feat: Remove source and baseSource properties from the to and from objects in element descriptions and selectors. Move them to the dependency object instead, as they are properties of the dependency rather than the target element. This change may require updates to any custom rules or configurations that reference these properties in the to object. Refactor all types, tests, and documentation to reflect this change.
  • feat: Rename "baseSource" property to "module" to better reflect its purpose and avoid confusion with the "source" property. Update all types, tests, and documentation to reflect this change.
  • feat: Support array of dependency metadata selectors in the dependency property of dependency selectors, allowing for more flexible matching of dependencies based on their metadata. Each selector in the array represents an alternative (OR logic), and the dependency matches if any of the selectors in the array matches its metadata.
  • feat: Remove external library selectors types and helpers.
  • feat: Remove deprecated dependencySelectorGlobals option from matching methods and types.
  • feat: Remove getSelectorMatchingDescription method, as it was too generic and caused confusion. Instead, provide specific methods for matching element and dependency descriptions against their respective selectors (getElementSelectorMatchingDescription and getDependencySelectorMatchingDescription) to improve clarity and usability.

website (next version)

Added

  • feat(#401): Publish v6.0.0 documentation website with migration guides, updated rules reference, and new selector syntax documentation.
  • feat: Add keywords to all pages to improve searchability and SEO.

Changed

  • feat: Adapt docs to the new object-based selectors syntax.
  • feat: Add "Deprecated Rules" subsection to the sidebar, and move there the deprecated rules documentation.

Don't miss a new eslint-plugin-boundaries release

NewReleases is sending notifications on new releases.