@ethang/eslint-config 19.2.2 → 19.2.4
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/build/get-react-version.mjs +4 -0
- package/build/update-react-rules.js +3 -5
- package/build/update-rules.js +9 -1
- package/build.mjs +1 -1
- package/eslint.config.js +3 -0
- package/package.json +5 -5
- package/update-rules.mjs +11 -0
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { reactRules } from "../setup/react.js";
|
|
2
2
|
import { writeFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { getLatestReact } from "./get-react-version.mjs";
|
|
4
5
|
|
|
5
6
|
export const updateReactRules = async () => {
|
|
6
7
|
let configFile = "";
|
|
7
|
-
const
|
|
8
|
-
"https://registry.npmjs.org/react/latest",
|
|
9
|
-
);
|
|
10
|
-
const reactLatest = await reactLatestResponse.json();
|
|
8
|
+
const react = await getLatestReact();
|
|
11
9
|
const settings = JSON.stringify({
|
|
12
|
-
react: { version:
|
|
10
|
+
react: { version: react.version },
|
|
13
11
|
}).slice(1, -1);
|
|
14
12
|
|
|
15
13
|
const rulesJson = JSON.stringify(reactRules).slice(1, -1);
|
package/build/update-rules.js
CHANGED
|
@@ -17,9 +17,14 @@ import { join } from "node:path";
|
|
|
17
17
|
import { deprecatedRules } from "../setup/deprecated.js";
|
|
18
18
|
import { markdownRules } from "../setup/markdown.js";
|
|
19
19
|
import { jsonRules } from "../setup/json.js";
|
|
20
|
+
import { getLatestReact } from "./get-react-version.mjs";
|
|
20
21
|
|
|
21
|
-
export const updateRules = () => {
|
|
22
|
+
export const updateRules = async () => {
|
|
22
23
|
let configFile = "";
|
|
24
|
+
const react = await getLatestReact();
|
|
25
|
+
const settings = JSON.stringify({
|
|
26
|
+
react: { version: react.version },
|
|
27
|
+
}).slice(1, -1);
|
|
23
28
|
|
|
24
29
|
const jsRules = {
|
|
25
30
|
...dependRules,
|
|
@@ -82,6 +87,9 @@ export default tseslint.config(
|
|
|
82
87
|
files: ["**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts}"],
|
|
83
88
|
ignores,
|
|
84
89
|
languageOptions,
|
|
90
|
+
settings: {
|
|
91
|
+
${settings}
|
|
92
|
+
},
|
|
85
93
|
plugins: {
|
|
86
94
|
"@tanstack/query": tanstack,
|
|
87
95
|
"@typescript-eslint": tseslint.plugin,
|
package/build.mjs
CHANGED
|
@@ -11,7 +11,7 @@ await projectBuilder("eslint-config-ethang", "master", {
|
|
|
11
11
|
scripts: ["UPDATE", "DEDUPE", "LINT"],
|
|
12
12
|
postInstall: async () => {
|
|
13
13
|
console.log("Updating Rules...");
|
|
14
|
-
updateRules();
|
|
14
|
+
await updateRules();
|
|
15
15
|
await updateReactRules();
|
|
16
16
|
updateSolidRules();
|
|
17
17
|
updateAstroRules();
|
package/eslint.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethang/eslint-config",
|
|
3
|
-
"version": "19.2.
|
|
3
|
+
"version": "19.2.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "git+https://github.com/eglove/eslint-config-ethang.git"
|
|
6
6
|
},
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"lint": "prettier . -w"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@eslint-react/eslint-plugin": "^1.12.
|
|
16
|
+
"@eslint-react/eslint-plugin": "^1.12.3",
|
|
17
17
|
"@eslint/js": "^9.9.1",
|
|
18
18
|
"@eslint/json": "^0.4.0",
|
|
19
19
|
"@eslint/markdown": "^6.0.0",
|
|
20
|
-
"@stylistic/eslint-plugin": "^2.6.
|
|
20
|
+
"@stylistic/eslint-plugin": "^2.6.5",
|
|
21
21
|
"@tanstack/eslint-plugin-query": "^5.52.0",
|
|
22
22
|
"@typescript-eslint/parser": "^8.3.0",
|
|
23
23
|
"eslint": "^9.9.1",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"prettier": "^3.3.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@eslint-react/eslint-plugin": "^1.12.
|
|
48
|
+
"@eslint-react/eslint-plugin": "^1.12.3",
|
|
49
49
|
"@eslint/js": "^9.9.1",
|
|
50
50
|
"@eslint/json": "^0.4.0",
|
|
51
51
|
"@eslint/markdown": "^6.0.0",
|
|
52
|
-
"@stylistic/eslint-plugin": "^2.6.
|
|
52
|
+
"@stylistic/eslint-plugin": "^2.6.5",
|
|
53
53
|
"@tanstack/eslint-plugin-query": "^5.52.0",
|
|
54
54
|
"@typescript-eslint/parser": "^8.3.0",
|
|
55
55
|
"eslint": "^9.9.1",
|
package/update-rules.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { updateRules } from "./build/update-rules.js";
|
|
2
|
+
import { updateReactRules } from "./build/update-react-rules.js";
|
|
3
|
+
import { updateSolidRules } from "./build/update-solid-rules.js";
|
|
4
|
+
import { updateAstroRules } from "./build/update-astro-rules.js";
|
|
5
|
+
import { updateReadme } from "./build/update-readme.js";
|
|
6
|
+
|
|
7
|
+
await updateRules();
|
|
8
|
+
await updateReactRules();
|
|
9
|
+
updateSolidRules();
|
|
10
|
+
updateAstroRules();
|
|
11
|
+
updateReadme();
|