@ethang/eslint-config 19.2.0 → 19.2.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/build/update-astro-rules.js +2 -2
- package/build/update-react-rules.js +12 -2
- package/build/update-rules.js +1 -1
- package/build/update-solid-rules.js +2 -2
- package/build.mjs +3 -4
- package/config.react.js +3 -0
- package/package.json +4 -4
|
@@ -2,7 +2,7 @@ import { writeFileSync } from "node:fs";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { astroRules } from "../setup/astro.js";
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export const updateAstroRules = () => {
|
|
6
6
|
let configFile = "";
|
|
7
7
|
|
|
8
8
|
const rulesJson = JSON.stringify(astroRules).slice(1, -1);
|
|
@@ -36,4 +36,4 @@ export function updateAstroRules() {
|
|
|
36
36
|
configFile,
|
|
37
37
|
"utf8",
|
|
38
38
|
);
|
|
39
|
-
}
|
|
39
|
+
};
|
|
@@ -2,8 +2,15 @@ import { reactRules } from "../setup/react.js";
|
|
|
2
2
|
import { writeFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export const updateReactRules = async () => {
|
|
6
6
|
let configFile = "";
|
|
7
|
+
const reactLatestResponse = await fetch(
|
|
8
|
+
"https://registry.npmjs.org/react/latest",
|
|
9
|
+
);
|
|
10
|
+
const reactLatest = await reactLatestResponse.json();
|
|
11
|
+
const settings = JSON.stringify({
|
|
12
|
+
react: { version: reactLatest.version },
|
|
13
|
+
}).slice(1, -1);
|
|
7
14
|
|
|
8
15
|
const rulesJson = JSON.stringify(reactRules).slice(1, -1);
|
|
9
16
|
|
|
@@ -29,6 +36,9 @@ export function updateReactRules() {
|
|
|
29
36
|
react,
|
|
30
37
|
"react-hooks": reactHooks,
|
|
31
38
|
},
|
|
39
|
+
settings: {
|
|
40
|
+
${settings}
|
|
41
|
+
},
|
|
32
42
|
rules: {
|
|
33
43
|
${rulesJson}
|
|
34
44
|
},
|
|
@@ -40,4 +50,4 @@ export function updateReactRules() {
|
|
|
40
50
|
configFile,
|
|
41
51
|
"utf8",
|
|
42
52
|
);
|
|
43
|
-
}
|
|
53
|
+
};
|
package/build/update-rules.js
CHANGED
|
@@ -12,7 +12,7 @@ import { tailwindRules } from "../setup/tailwind.js";
|
|
|
12
12
|
import { stylisticRules } from "../setup/stylistic.js";
|
|
13
13
|
import { perfectionistRules } from "../setup/perfectionist.js";
|
|
14
14
|
import { a11yRules } from "../setup/a11y.js";
|
|
15
|
-
import {
|
|
15
|
+
import { writeFileSync } from "node:fs";
|
|
16
16
|
import { join } from "node:path";
|
|
17
17
|
import { deprecatedRules } from "../setup/deprecated.js";
|
|
18
18
|
import { markdownRules } from "../setup/markdown.js";
|
|
@@ -2,7 +2,7 @@ import { solidRules } from "../setup/solid.js";
|
|
|
2
2
|
import { writeFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export const updateSolidRules = () => {
|
|
6
6
|
let configFile = "";
|
|
7
7
|
|
|
8
8
|
const rulesJson = JSON.stringify(solidRules).slice(1, -1);
|
|
@@ -36,4 +36,4 @@ export function updateSolidRules() {
|
|
|
36
36
|
configFile,
|
|
37
37
|
"utf8",
|
|
38
38
|
);
|
|
39
|
-
}
|
|
39
|
+
};
|
package/build.mjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { projectBuilder } from "@ethang/project-builder/project-builder.js";
|
|
3
3
|
import { updateRules } from "./build/update-rules.js";
|
|
4
4
|
import { updateReadme } from "./build/update-readme.js";
|
|
5
|
-
import { execSync } from "node:child_process";
|
|
6
5
|
import { updateReactRules } from "./build/update-react-rules.js";
|
|
7
6
|
import { updateSolidRules } from "./build/update-solid-rules.js";
|
|
8
7
|
import { updateAstroRules } from "./build/update-astro-rules.js";
|
|
@@ -10,13 +9,13 @@ import { updateAstroRules } from "./build/update-astro-rules.js";
|
|
|
10
9
|
await projectBuilder("eslint-config-ethang", "master", {
|
|
11
10
|
isLibrary: true,
|
|
12
11
|
scripts: ["UPDATE", "DEDUPE", "LINT"],
|
|
13
|
-
postInstall: () => {
|
|
12
|
+
postInstall: async () => {
|
|
13
|
+
console.log("Updating Rules...");
|
|
14
14
|
updateRules();
|
|
15
|
-
updateReactRules();
|
|
15
|
+
await updateReactRules();
|
|
16
16
|
updateSolidRules();
|
|
17
17
|
updateAstroRules();
|
|
18
18
|
updateReadme();
|
|
19
|
-
execSync("pnpm lint");
|
|
20
19
|
},
|
|
21
20
|
tsupOptions: {
|
|
22
21
|
bundle: true,
|
package/config.react.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.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "git+https://github.com/eglove/eslint-config-ethang.git"
|
|
6
6
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
29
29
|
"eslint-plugin-lodash": "^8.0.0",
|
|
30
30
|
"eslint-plugin-n": "^17.10.2",
|
|
31
|
-
"eslint-plugin-perfectionist": "^3.
|
|
31
|
+
"eslint-plugin-perfectionist": "^3.3.0",
|
|
32
32
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
33
33
|
"eslint-plugin-solid": "^0.14.2",
|
|
34
34
|
"eslint-plugin-sonarjs": "2.0.1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@ethang/markdown-generator": "^1.1.1",
|
|
42
|
-
"@ethang/project-builder": "^2.5.
|
|
42
|
+
"@ethang/project-builder": "^2.5.1",
|
|
43
43
|
"@tsconfig/node-lts": "^20.1.3",
|
|
44
44
|
"@tsconfig/strictest": "^2.0.5",
|
|
45
45
|
"prettier": "^3.3.3"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
61
61
|
"eslint-plugin-lodash": "^8.0.0",
|
|
62
62
|
"eslint-plugin-n": "^17.10.2",
|
|
63
|
-
"eslint-plugin-perfectionist": "^3.
|
|
63
|
+
"eslint-plugin-perfectionist": "^3.3.0",
|
|
64
64
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
65
65
|
"eslint-plugin-solid": "^0.14.2",
|
|
66
66
|
"eslint-plugin-sonarjs": "2.0.1",
|