@ethang/eslint-config 19.2.1 → 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 +1 -1
- package/build/update-react-rules.js +10 -0
- package/build/update-readme.js +1 -1
- package/build/update-rules.js +2 -2
- package/build/update-solid-rules.js +2 -2
- package/build.mjs +6 -7
- package/config.react.js +3 -0
- package/package.json +2 -2
|
@@ -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 const updateAstroRules =
|
|
5
|
+
export const updateAstroRules = () => {
|
|
6
6
|
let configFile = "";
|
|
7
7
|
|
|
8
8
|
const rulesJson = JSON.stringify(astroRules).slice(1, -1);
|
|
@@ -4,6 +4,13 @@ import { join } from "node:path";
|
|
|
4
4
|
|
|
5
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 const updateReactRules = async () => {
|
|
|
29
36
|
react,
|
|
30
37
|
"react-hooks": reactHooks,
|
|
31
38
|
},
|
|
39
|
+
settings: {
|
|
40
|
+
${settings}
|
|
41
|
+
},
|
|
32
42
|
rules: {
|
|
33
43
|
${rulesJson}
|
|
34
44
|
},
|
package/build/update-readme.js
CHANGED
|
@@ -21,7 +21,7 @@ import { astroRules } from "../setup/astro.js";
|
|
|
21
21
|
import { reactRules } from "../setup/react.js";
|
|
22
22
|
import { solidRules } from "../setup/solid.js";
|
|
23
23
|
|
|
24
|
-
export const updateReadme =
|
|
24
|
+
export const updateReadme = () => {
|
|
25
25
|
const md = new MarkdownGenerator();
|
|
26
26
|
md.header(1, "Opinionated, Strict, Brutal, Unforgiving", 2);
|
|
27
27
|
md.link("View Config", "https://eslint-config-ethang.pages.dev/rules", 2);
|
package/build/update-rules.js
CHANGED
|
@@ -18,7 +18,7 @@ import { deprecatedRules } from "../setup/deprecated.js";
|
|
|
18
18
|
import { markdownRules } from "../setup/markdown.js";
|
|
19
19
|
import { jsonRules } from "../setup/json.js";
|
|
20
20
|
|
|
21
|
-
export const updateRules =
|
|
21
|
+
export const updateRules = () => {
|
|
22
22
|
let configFile = "";
|
|
23
23
|
|
|
24
24
|
const jsRules = {
|
|
@@ -119,7 +119,7 @@ export default tseslint.config(
|
|
|
119
119
|
},
|
|
120
120
|
);\n`;
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
writeFileSync(
|
|
123
123
|
join(import.meta.dirname, "../eslint.config.js"),
|
|
124
124
|
configFile,
|
|
125
125
|
"utf8",
|
|
@@ -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 const updateSolidRules =
|
|
5
|
+
export const updateSolidRules = () => {
|
|
6
6
|
let configFile = "";
|
|
7
7
|
|
|
8
8
|
const rulesJson = JSON.stringify(solidRules).slice(1, -1);
|
|
@@ -31,7 +31,7 @@ export const updateSolidRules = async () => {
|
|
|
31
31
|
});
|
|
32
32
|
`;
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
writeFileSync(
|
|
35
35
|
join(import.meta.dirname, "../config.solid.js"),
|
|
36
36
|
configFile,
|
|
37
37
|
"utf8",
|
package/build.mjs
CHANGED
|
@@ -10,13 +10,12 @@ await projectBuilder("eslint-config-ethang", "master", {
|
|
|
10
10
|
isLibrary: true,
|
|
11
11
|
scripts: ["UPDATE", "DEDUPE", "LINT"],
|
|
12
12
|
postInstall: async () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]);
|
|
13
|
+
console.log("Updating Rules...");
|
|
14
|
+
updateRules();
|
|
15
|
+
await updateReactRules();
|
|
16
|
+
updateSolidRules();
|
|
17
|
+
updateAstroRules();
|
|
18
|
+
updateReadme();
|
|
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
|
},
|
|
@@ -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"
|