Skip to content

Commit 14266ea

Browse files
committed
feat(no-sync): move ts-declaration-location to peerDependencies
- Set `ts-declaration-location` as an optional peer dependency for the `n/no-sync` rule. - Update the `n/no-sync` documentation to refer the updated peer dependency requirement.
1 parent 42464ab commit 14266ea

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

docs/rules/no-sync.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ Examples of **correct** code for this rule with the `{ ignores: ['readFileSync']
7979
fs.readFileSync(somePath);
8080
```
8181

82+
> [!WARNING]
83+
> Advanced `ignores` options (object specifiers) require TypeScript and the [`ts-declaration-location`](https://www.npmjs.com/package/ts-declaration-location) package. This package is an **optional peer dependency** for the `n/no-sync` rule. If you want to use advanced TypeScript-based ignores, please install it in your project:
84+
>
85+
> ```sh
86+
> npm install --save-dev ts-declaration-location
87+
> ```
88+
8289
##### Advanced (TypeScript only)
8390
8491
You can provide a list of specifiers to ignore. Specifiers are typed as follows:
@@ -102,6 +109,9 @@ type Specifier =
102109
}
103110
```
104111
112+
> [!NOTE]
113+
> To use advanced TypeScript-based ignores, you must have `ts-declaration-location` installed as a dev dependency in your project.
114+
105115
###### From a file
106116

107117
Examples of **correct** code for this rule with the ignore file specifier:

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
"types/index.d.ts"
1515
],
1616
"peerDependencies": {
17-
"eslint": ">=8.23.0"
17+
"eslint": ">=8.23.0",
18+
"ts-declaration-location": "^1.0.6"
19+
},
20+
"peerDependenciesMeta": {
21+
"ts-declaration-location": {
22+
"optional": true
23+
}
1824
},
1925
"dependencies": {
2026
"@eslint-community/eslint-utils": "^4.5.0",
@@ -25,8 +31,7 @@
2531
"globals": "^15.11.0",
2632
"ignore": "^5.3.2",
2733
"minimatch": "^9.0.5",
28-
"semver": "^7.6.3",
29-
"ts-declaration-location": "^1.0.6"
34+
"semver": "^7.6.3"
3035
},
3136
"devDependencies": {
3237
"@eslint/js": "^9.14.0",

0 commit comments

Comments
 (0)