Skip to content

Commit 1ecab34

Browse files
JasonVMotido64
andauthored
fix(eslint-plugin): Fix (dev)dependency cycle in the repo between eslint-config and eslint-plugin (#3518)
* remove dependency cycle between eslint-config and eslint-plugin * docs(changeset): Tooling only change to use locally defined eslint.config.js to break dependency cycle * Update .changeset/forty-doors-itch.md Co-authored-by: Tommy Nguyen <[email protected]> --------- Co-authored-by: Tommy Nguyen <[email protected]>
1 parent bd3353a commit 1ecab34

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

.changeset/forty-doors-itch.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---
+23-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
module.exports = require("@rnx-kit/eslint-config");
1+
const sdl = require("@microsoft/eslint-plugin-sdl");
2+
const rnx = require("./src");
3+
4+
/**
5+
* Note that we don't directly use `sdl.configs.required` because:
6+
*
7+
* 1. It includes rules for Angular and Electron
8+
* 2. Its `react` preset conflicts with our direct use of `eslint-plugin-react`
9+
*
10+
* https://github.com/microsoft/eslint-plugin-sdl/blob/957996315c80fdadcd1a9f7bb76fc4663d33ef1e/lib/index.js#L47-L54
11+
*/
12+
module.exports = [
13+
...sdl.configs.common,
14+
...sdl.configs.node,
15+
...rnx.configs.strict,
16+
...rnx.configs.stylistic,
17+
{
18+
rules: {
19+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
20+
...sdl.configs.react[0].rules,
21+
},
22+
},
23+
];

packages/eslint-plugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"eslint": ">=8.57.0"
5454
},
5555
"devDependencies": {
56-
"@rnx-kit/eslint-config": "*",
56+
"@microsoft/eslint-plugin-sdl": "^1.0.0",
5757
"@rnx-kit/scripts": "*",
5858
"@rnx-kit/tsconfig": "*",
5959
"@types/eslint": "^9.0.0",

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -3905,8 +3905,8 @@ __metadata:
39053905
version: 0.0.0-use.local
39063906
resolution: "@rnx-kit/eslint-plugin@workspace:packages/eslint-plugin"
39073907
dependencies:
3908+
"@microsoft/eslint-plugin-sdl": "npm:^1.0.0"
39083909
"@react-native/eslint-plugin": "npm:^0.76.0"
3909-
"@rnx-kit/eslint-config": "npm:*"
39103910
"@rnx-kit/scripts": "npm:*"
39113911
"@rnx-kit/tsconfig": "npm:*"
39123912
"@types/eslint": "npm:^9.0.0"

0 commit comments

Comments
 (0)