@lanelint/plugin-boundaries 0.0.0-stage → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Anton Ödman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,57 @@
1
- # Temporary Holding Version
1
+ # @lanelint/plugin-boundaries
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/@lanelint/plugin-boundaries)](https://www.npmjs.com/package/@lanelint/plugin-boundaries)
4
+
5
+ [lanelint](https://github.com/banjo/lanelint) rules for imports: which parts of your
6
+ architecture may import which, and which packages and globals code may use.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm install -D lanelint @lanelint/plugin-boundaries
12
+ ```
13
+
14
+ ## Use
15
+
16
+ ```ts
17
+ // lanelint.config.ts
18
+ import boundaries from '@lanelint/plugin-boundaries';
19
+ import { defineConfig } from 'lanelint';
20
+
21
+ export default defineConfig({
22
+ elements: [
23
+ { type: 'feature', pattern: 'src/features/:name' },
24
+ { type: 'domain', pattern: 'src/common/:name' },
25
+ ],
26
+ extends: [boundaries.configs.recommended],
27
+ rules: {
28
+ 'boundaries/entry-only': ['error', { elements: 'feature' }],
29
+ 'boundaries/allowed-imports': ['error', { rules: [{ from: 'domain', disallow: 'feature' }] }],
30
+ },
31
+ });
32
+ ```
33
+
34
+ `recommended` turns on `no-cycles`, `no-unresolved`, and `no-undeclared-dependency`.
35
+
36
+ ## Rules
37
+
38
+ | Rule | Checks |
39
+ | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
40
+ | [`allowed-imports`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#allowed-imports) | Which elements may import which |
41
+ | [`entry-only`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#entry-only) | Imports from outside an element target its entry files |
42
+ | [`no-cycles`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#no-cycles) | Elements do not depend on each other in a cycle |
43
+ | [`no-entry-import`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#no-entry-import) | Imports target the files they need, not entry files |
44
+ | [`no-orphans`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#no-orphans) | Source files are imported by non-test code, or are an entry point |
45
+ | [`no-undeclared-dependency`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#no-undeclared-dependency) | Imported packages are declared in the nearest package.json |
46
+ | [`no-unresolved`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#no-unresolved) | Imports resolve to a file or an installed package |
47
+ | [`public-api`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#public-api) | Imported files of an element are reachable from its entry files |
48
+ | [`restricted-globals`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#restricted-globals) | Globals such as `fetch` or `Date.now` are not used where they are banned |
49
+ | [`restricted-packages`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#restricted-packages) | Packages, or names from them, are not imported where they are banned |
50
+ | [`workspace-imports`](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md#workspace-imports) | Other workspace packages are imported by name, through what they export |
51
+
52
+ See [all options](https://github.com/banjo/lanelint/blob/main/docs/rules/boundaries.md), or
53
+ run `lanelint rules explain boundaries/<rule>`.
54
+
55
+ ## License
56
+
57
+ MIT