@ghettoddos/eslint-config 1.1.0 → 1.3.0
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/README.md +61 -0
- package/dist/index.d.ts +636 -298
- package/dist/index.js +65 -4
- package/package.json +23 -22
package/dist/index.js
CHANGED
|
@@ -950,6 +950,53 @@ async function perfectionist() {
|
|
|
950
950
|
];
|
|
951
951
|
}
|
|
952
952
|
|
|
953
|
+
// src/configs/pnpm.ts
|
|
954
|
+
async function pnpm() {
|
|
955
|
+
const [
|
|
956
|
+
pluginPnpm,
|
|
957
|
+
yamlParser,
|
|
958
|
+
jsoncParser
|
|
959
|
+
] = await Promise.all([
|
|
960
|
+
interopDefault(import("eslint-plugin-pnpm")),
|
|
961
|
+
interopDefault(import("yaml-eslint-parser")),
|
|
962
|
+
interopDefault(import("jsonc-eslint-parser"))
|
|
963
|
+
]);
|
|
964
|
+
return [
|
|
965
|
+
{
|
|
966
|
+
files: [
|
|
967
|
+
"package.json",
|
|
968
|
+
"**/package.json"
|
|
969
|
+
],
|
|
970
|
+
languageOptions: {
|
|
971
|
+
parser: jsoncParser
|
|
972
|
+
},
|
|
973
|
+
name: "pnpm/package-json",
|
|
974
|
+
plugins: {
|
|
975
|
+
pnpm: pluginPnpm
|
|
976
|
+
},
|
|
977
|
+
rules: {
|
|
978
|
+
"pnpm/json-enforce-catalog": "error",
|
|
979
|
+
"pnpm/json-prefer-workspace-settings": "error",
|
|
980
|
+
"pnpm/json-valid-catalog": "error"
|
|
981
|
+
}
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
files: ["pnpm-workspace.yaml"],
|
|
985
|
+
languageOptions: {
|
|
986
|
+
parser: yamlParser
|
|
987
|
+
},
|
|
988
|
+
name: "pnpm/pnpm-workspace-yaml",
|
|
989
|
+
plugins: {
|
|
990
|
+
pnpm: pluginPnpm
|
|
991
|
+
},
|
|
992
|
+
rules: {
|
|
993
|
+
"pnpm/yaml-no-duplicate-catalog-item": "error",
|
|
994
|
+
"pnpm/yaml-no-unused-catalog-item": "error"
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
];
|
|
998
|
+
}
|
|
999
|
+
|
|
953
1000
|
// src/configs/react.ts
|
|
954
1001
|
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
955
1002
|
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
@@ -1013,6 +1060,8 @@ async function react(options = {}) {
|
|
|
1013
1060
|
name: "react/rules",
|
|
1014
1061
|
rules: {
|
|
1015
1062
|
// recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules
|
|
1063
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
1064
|
+
"react/jsx-uses-vars": "warn",
|
|
1016
1065
|
"react/no-access-state-in-setstate": "error",
|
|
1017
1066
|
"react/no-array-index-key": "warn",
|
|
1018
1067
|
"react/no-children-count": "warn",
|
|
@@ -1029,7 +1078,6 @@ async function react(options = {}) {
|
|
|
1029
1078
|
"react/no-create-ref": "error",
|
|
1030
1079
|
"react/no-default-props": "error",
|
|
1031
1080
|
"react/no-direct-mutation-state": "error",
|
|
1032
|
-
"react/no-duplicate-jsx-props": "warn",
|
|
1033
1081
|
"react/no-duplicate-key": "warn",
|
|
1034
1082
|
"react/no-forward-ref": "warn",
|
|
1035
1083
|
"react/no-implicit-key": "warn",
|
|
@@ -1050,7 +1098,6 @@ async function react(options = {}) {
|
|
|
1050
1098
|
"react/no-unused-state": "warn",
|
|
1051
1099
|
"react/no-use-context": "warn",
|
|
1052
1100
|
"react/no-useless-forward-ref": "warn",
|
|
1053
|
-
"react/use-jsx-vars": "warn",
|
|
1054
1101
|
// recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rules
|
|
1055
1102
|
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1056
1103
|
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
@@ -1073,6 +1120,7 @@ async function react(options = {}) {
|
|
|
1073
1120
|
// recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
|
|
1074
1121
|
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1075
1122
|
"react-hooks-extra/no-unnecessary-use-prefix": "warn",
|
|
1123
|
+
"react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
|
1076
1124
|
// recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
|
|
1077
1125
|
"react-web-api/no-leaked-event-listener": "warn",
|
|
1078
1126
|
"react-web-api/no-leaked-interval": "warn",
|
|
@@ -1182,6 +1230,7 @@ async function sortPackageJson() {
|
|
|
1182
1230
|
"keywords",
|
|
1183
1231
|
"categories",
|
|
1184
1232
|
"sideEffects",
|
|
1233
|
+
"imports",
|
|
1185
1234
|
"exports",
|
|
1186
1235
|
"main",
|
|
1187
1236
|
"module",
|
|
@@ -1594,6 +1643,10 @@ async function typescript(options = {}) {
|
|
|
1594
1643
|
|
|
1595
1644
|
// src/configs/unicorn.ts
|
|
1596
1645
|
async function unicorn(options = {}) {
|
|
1646
|
+
const {
|
|
1647
|
+
allRecommended = false,
|
|
1648
|
+
overrides = {}
|
|
1649
|
+
} = options;
|
|
1597
1650
|
return [
|
|
1598
1651
|
{
|
|
1599
1652
|
name: "unicorn/rules",
|
|
@@ -1601,7 +1654,7 @@ async function unicorn(options = {}) {
|
|
|
1601
1654
|
unicorn: default6
|
|
1602
1655
|
},
|
|
1603
1656
|
rules: {
|
|
1604
|
-
...
|
|
1657
|
+
...allRecommended ? default6.configs.recommended.rules : {
|
|
1605
1658
|
"unicorn/consistent-empty-array-spread": "error",
|
|
1606
1659
|
"unicorn/error-message": "error",
|
|
1607
1660
|
"unicorn/escape-case": "error",
|
|
@@ -1617,7 +1670,8 @@ async function unicorn(options = {}) {
|
|
|
1617
1670
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1618
1671
|
"unicorn/prefer-type-error": "error",
|
|
1619
1672
|
"unicorn/throw-new-error": "error"
|
|
1620
|
-
}
|
|
1673
|
+
},
|
|
1674
|
+
...overrides
|
|
1621
1675
|
}
|
|
1622
1676
|
}
|
|
1623
1677
|
];
|
|
@@ -1767,6 +1821,7 @@ function config(options = {}, ...userConfigs) {
|
|
|
1767
1821
|
componentExts = [],
|
|
1768
1822
|
gitignore: enableGitignore = true,
|
|
1769
1823
|
jsx: enableJsx = true,
|
|
1824
|
+
pnpm: enableCatalogs = false,
|
|
1770
1825
|
react: enableReact = ReactPackages.some((i) => isPackageExists3(i)),
|
|
1771
1826
|
regexp: enableRegexp = true,
|
|
1772
1827
|
typescript: enableTypeScript = isPackageExists3("typescript"),
|
|
@@ -1878,6 +1933,11 @@ function config(options = {}, ...userConfigs) {
|
|
|
1878
1933
|
sortTsconfig()
|
|
1879
1934
|
);
|
|
1880
1935
|
}
|
|
1936
|
+
if (enableCatalogs) {
|
|
1937
|
+
configs2.push(
|
|
1938
|
+
pnpm()
|
|
1939
|
+
);
|
|
1940
|
+
}
|
|
1881
1941
|
if (options.yaml ?? true) {
|
|
1882
1942
|
configs2.push(
|
|
1883
1943
|
yaml({
|
|
@@ -2002,6 +2062,7 @@ export {
|
|
|
2002
2062
|
node,
|
|
2003
2063
|
parserPlain,
|
|
2004
2064
|
perfectionist,
|
|
2065
|
+
pnpm,
|
|
2005
2066
|
react,
|
|
2006
2067
|
regexp,
|
|
2007
2068
|
renameRules,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghettoddos/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"description": "ghettoDdOS ESLint config",
|
|
6
6
|
"author": "ghettoDdOS <pen.egor2002@gamil.com> (https://github.com/ghettoDdOS/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,30 +42,31 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@antfu/install-pkg": "^1.
|
|
46
|
-
"@clack/prompts": "^0.10.
|
|
47
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
48
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
49
|
-
"@eslint/markdown": "^6.
|
|
45
|
+
"@antfu/install-pkg": "^1.1.0",
|
|
46
|
+
"@clack/prompts": "^0.10.1",
|
|
47
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
48
|
+
"@eslint-react/eslint-plugin": "^1.49.0",
|
|
49
|
+
"@eslint/markdown": "^6.4.0",
|
|
50
50
|
"@stylistic/eslint-plugin": "^4.2.0",
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
52
|
-
"@typescript-eslint/parser": "^8.
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
|
52
|
+
"@typescript-eslint/parser": "^8.32.0",
|
|
53
53
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
54
54
|
"eslint-flat-config-utils": "^2.0.1",
|
|
55
55
|
"eslint-merge-processors": "^2.0.0",
|
|
56
56
|
"eslint-plugin-antfu": "^3.1.1",
|
|
57
|
-
"eslint-plugin-import-x": "^4.
|
|
57
|
+
"eslint-plugin-import-x": "^4.11.1",
|
|
58
58
|
"eslint-plugin-jsonc": "^2.20.0",
|
|
59
|
-
"eslint-plugin-n": "^17.
|
|
60
|
-
"eslint-plugin-perfectionist": "^4.
|
|
59
|
+
"eslint-plugin-n": "^17.18.0",
|
|
60
|
+
"eslint-plugin-perfectionist": "^4.12.3",
|
|
61
|
+
"eslint-plugin-pnpm": "^0.3.1",
|
|
61
62
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
62
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
63
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
63
64
|
"eslint-plugin-regexp": "^2.7.0",
|
|
64
65
|
"eslint-plugin-toml": "^0.12.0",
|
|
65
|
-
"eslint-plugin-unicorn": "^
|
|
66
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
66
67
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
67
|
-
"eslint-plugin-yml": "^1.
|
|
68
|
-
"globals": "^16.
|
|
68
|
+
"eslint-plugin-yml": "^1.18.0",
|
|
69
|
+
"globals": "^16.1.0",
|
|
69
70
|
"jsonc-eslint-parser": "^2.4.0",
|
|
70
71
|
"local-pkg": "^1.1.1",
|
|
71
72
|
"parse-gitignore": "^2.0.0",
|
|
@@ -75,17 +76,17 @@
|
|
|
75
76
|
"devDependencies": {
|
|
76
77
|
"@eslint/config-inspector": "^1.0.2",
|
|
77
78
|
"@prettier/plugin-xml": "^3.4.1",
|
|
78
|
-
"@types/node": "^22.
|
|
79
|
+
"@types/node": "^22.15.17",
|
|
79
80
|
"@unocss/eslint-plugin": "66.1.0-beta.3",
|
|
80
81
|
"bumpp": "^10.1.0",
|
|
81
|
-
"eslint": "^9.
|
|
82
|
+
"eslint": "^9.26.0",
|
|
82
83
|
"eslint-plugin-format": "^1.0.1",
|
|
83
|
-
"eslint-typegen": "^2.
|
|
84
|
-
"lint-staged": "^
|
|
85
|
-
"simple-git-hooks": "^2.
|
|
84
|
+
"eslint-typegen": "^2.2.0",
|
|
85
|
+
"lint-staged": "^16.0.0",
|
|
86
|
+
"simple-git-hooks": "^2.13.0",
|
|
86
87
|
"tsup": "^8.4.0",
|
|
87
|
-
"tsx": "^4.19.
|
|
88
|
-
"typescript": "^5.8.
|
|
88
|
+
"tsx": "^4.19.4",
|
|
89
|
+
"typescript": "^5.8.3"
|
|
89
90
|
},
|
|
90
91
|
"simple-git-hooks": {
|
|
91
92
|
"pre-commit": "npx lint-staged"
|