@ethang/eslint-config 19.2.1 → 19.2.3
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-astro-rules.js +1 -1
- package/build/update-react-rules.js +8 -0
- package/build/update-readme.js +1 -1
- package/build/update-rules.js +9 -1
- package/build/update-solid-rules.js +2 -2
- package/build.mjs +6 -7
- package/config.react.js +3 -0
- package/eslint.config.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);
|
|
@@ -1,9 +1,14 @@
|
|
|
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 = "";
|
|
8
|
+
const react = await getLatestReact();
|
|
9
|
+
const settings = JSON.stringify({
|
|
10
|
+
react: { version: react.version },
|
|
11
|
+
}).slice(1, -1);
|
|
7
12
|
|
|
8
13
|
const rulesJson = JSON.stringify(reactRules).slice(1, -1);
|
|
9
14
|
|
|
@@ -29,6 +34,9 @@ export const updateReactRules = async () => {
|
|
|
29
34
|
react,
|
|
30
35
|
"react-hooks": reactHooks,
|
|
31
36
|
},
|
|
37
|
+
settings: {
|
|
38
|
+
${settings}
|
|
39
|
+
},
|
|
32
40
|
rules: {
|
|
33
41
|
${rulesJson}
|
|
34
42
|
},
|
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
|
@@ -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
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,
|
|
@@ -119,7 +127,7 @@ export default tseslint.config(
|
|
|
119
127
|
},
|
|
120
128
|
);\n`;
|
|
121
129
|
|
|
122
|
-
|
|
130
|
+
writeFileSync(
|
|
123
131
|
join(import.meta.dirname, "../eslint.config.js"),
|
|
124
132
|
configFile,
|
|
125
133
|
"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
|
+
await 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/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.3",
|
|
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"
|