@ghettoddos/eslint-config 1.0.3 → 1.2.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +408 -279
  2. package/dist/index.js +115 -50
  3. package/package.json +22 -14
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"];
@@ -1012,22 +1059,73 @@ async function react(options = {}) {
1012
1059
  },
1013
1060
  name: "react/rules",
1014
1061
  rules: {
1015
- // recommended rules from @eslint-react/dom
1016
- "react-dom/no-children-in-void-dom-elements": "warn",
1062
+ // recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules
1063
+ "react/no-access-state-in-setstate": "error",
1064
+ "react/no-array-index-key": "warn",
1065
+ "react/no-children-count": "warn",
1066
+ "react/no-children-for-each": "warn",
1067
+ "react/no-children-map": "warn",
1068
+ "react/no-children-only": "warn",
1069
+ "react/no-children-to-array": "warn",
1070
+ "react/no-clone-element": "warn",
1071
+ "react/no-comment-textnodes": "warn",
1072
+ "react/no-component-will-mount": "error",
1073
+ "react/no-component-will-receive-props": "error",
1074
+ "react/no-component-will-update": "error",
1075
+ "react/no-context-provider": "warn",
1076
+ "react/no-create-ref": "error",
1077
+ "react/no-default-props": "error",
1078
+ "react/no-direct-mutation-state": "error",
1079
+ "react/no-duplicate-jsx-props": "warn",
1080
+ "react/no-duplicate-key": "warn",
1081
+ "react/no-forward-ref": "warn",
1082
+ "react/no-implicit-key": "warn",
1083
+ "react/no-missing-key": "error",
1084
+ "react/no-nested-component-definitions": "error",
1085
+ "react/no-prop-types": "error",
1086
+ "react/no-redundant-should-component-update": "error",
1087
+ "react/no-set-state-in-component-did-mount": "warn",
1088
+ "react/no-set-state-in-component-did-update": "warn",
1089
+ "react/no-set-state-in-component-will-update": "warn",
1090
+ "react/no-string-refs": "error",
1091
+ "react/no-unsafe-component-will-mount": "warn",
1092
+ "react/no-unsafe-component-will-receive-props": "warn",
1093
+ "react/no-unsafe-component-will-update": "warn",
1094
+ "react/no-unstable-context-value": "warn",
1095
+ "react/no-unstable-default-props": "warn",
1096
+ "react/no-unused-class-component-members": "warn",
1097
+ "react/no-unused-state": "warn",
1098
+ "react/no-use-context": "warn",
1099
+ "react/no-useless-forward-ref": "warn",
1100
+ "react/use-jsx-vars": "warn",
1101
+ // recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rules
1017
1102
  "react-dom/no-dangerously-set-innerhtml": "warn",
1018
1103
  "react-dom/no-dangerously-set-innerhtml-with-children": "error",
1019
1104
  "react-dom/no-find-dom-node": "error",
1105
+ "react-dom/no-flush-sync": "error",
1106
+ "react-dom/no-hydrate": "error",
1020
1107
  "react-dom/no-missing-button-type": "warn",
1021
1108
  "react-dom/no-missing-iframe-sandbox": "warn",
1022
1109
  "react-dom/no-namespace": "error",
1110
+ "react-dom/no-render": "error",
1023
1111
  "react-dom/no-render-return-value": "error",
1024
1112
  "react-dom/no-script-url": "warn",
1025
1113
  "react-dom/no-unsafe-iframe-sandbox": "warn",
1026
1114
  "react-dom/no-unsafe-target-blank": "warn",
1027
- // recommended rules react-hooks
1115
+ "react-dom/no-use-form-state": "error",
1116
+ "react-dom/no-void-elements-with-children": "error",
1117
+ // recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks/src/rules
1028
1118
  "react-hooks/exhaustive-deps": "warn",
1029
1119
  "react-hooks/rules-of-hooks": "error",
1030
- // react refresh
1120
+ // recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
1121
+ "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
1122
+ "react-hooks-extra/no-unnecessary-use-prefix": "warn",
1123
+ // recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
1124
+ "react-web-api/no-leaked-event-listener": "warn",
1125
+ "react-web-api/no-leaked-interval": "warn",
1126
+ "react-web-api/no-leaked-resize-observer": "warn",
1127
+ "react-web-api/no-leaked-timeout": "warn",
1128
+ // preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
1031
1129
  "react-refresh/only-export-components": [
1032
1130
  "warn",
1033
1131
  {
@@ -1052,52 +1150,6 @@ async function react(options = {}) {
1052
1150
  ]
1053
1151
  }
1054
1152
  ],
1055
- // recommended rules from @eslint-react/web-api
1056
- "react-web-api/no-leaked-event-listener": "warn",
1057
- "react-web-api/no-leaked-interval": "warn",
1058
- "react-web-api/no-leaked-resize-observer": "warn",
1059
- "react-web-api/no-leaked-timeout": "warn",
1060
- // recommended rules from @eslint-react
1061
- "react/ensure-forward-ref-using-ref": "warn",
1062
- "react/jsx-no-duplicate-props": "warn",
1063
- "react/jsx-uses-vars": "warn",
1064
- "react/no-access-state-in-setstate": "error",
1065
- "react/no-array-index-key": "warn",
1066
- "react/no-children-count": "warn",
1067
- "react/no-children-for-each": "warn",
1068
- "react/no-children-map": "warn",
1069
- "react/no-children-only": "warn",
1070
- "react/no-children-to-array": "warn",
1071
- "react/no-clone-element": "warn",
1072
- "react/no-comment-textnodes": "warn",
1073
- "react/no-component-will-mount": "error",
1074
- "react/no-component-will-receive-props": "error",
1075
- "react/no-component-will-update": "error",
1076
- "react/no-context-provider": "warn",
1077
- "react/no-create-ref": "error",
1078
- "react/no-default-props": "error",
1079
- "react/no-direct-mutation-state": "error",
1080
- "react/no-duplicate-key": "error",
1081
- "react/no-forward-ref": "warn",
1082
- "react/no-implicit-key": "warn",
1083
- "react/no-missing-key": "error",
1084
- "react/no-nested-components": "error",
1085
- "react/no-prop-types": "error",
1086
- "react/no-redundant-should-component-update": "error",
1087
- "react/no-set-state-in-component-did-mount": "warn",
1088
- "react/no-set-state-in-component-did-update": "warn",
1089
- "react/no-set-state-in-component-will-update": "warn",
1090
- "react/no-string-refs": "error",
1091
- "react/no-unsafe-component-will-mount": "warn",
1092
- "react/no-unsafe-component-will-receive-props": "warn",
1093
- "react/no-unsafe-component-will-update": "warn",
1094
- "react/no-unstable-context-value": "warn",
1095
- "react/no-unstable-default-props": "warn",
1096
- "react/no-unused-class-component-members": "warn",
1097
- "react/no-unused-state": "warn",
1098
- "react/prefer-destructuring-assignment": "warn",
1099
- "react/prefer-shorthand-boolean": "warn",
1100
- "react/prefer-shorthand-fragment": "warn",
1101
1153
  // overrides
1102
1154
  ...overrides
1103
1155
  }
@@ -1280,6 +1332,7 @@ function sortTsconfig() {
1280
1332
  "useDefineForClassFields",
1281
1333
  "emitDecoratorMetadata",
1282
1334
  "experimentalDecorators",
1335
+ "libReplacement",
1283
1336
  /* Modules */
1284
1337
  "baseUrl",
1285
1338
  "rootDir",
@@ -1354,6 +1407,7 @@ function sortTsconfig() {
1354
1407
  "isolatedModules",
1355
1408
  "preserveSymlinks",
1356
1409
  "verbatimModuleSyntax",
1410
+ "erasableSyntaxOnly",
1357
1411
  /* Completeness */
1358
1412
  "skipDefaultLibCheck",
1359
1413
  "skipLibCheck"
@@ -1721,6 +1775,10 @@ async function yaml(options = {}) {
1721
1775
  "supportedArchitectures"
1722
1776
  ],
1723
1777
  pathPattern: "^$"
1778
+ },
1779
+ {
1780
+ order: { type: "asc" },
1781
+ pathPattern: ".*"
1724
1782
  }
1725
1783
  ]
1726
1784
  }
@@ -1756,6 +1814,7 @@ function config(options = {}, ...userConfigs) {
1756
1814
  componentExts = [],
1757
1815
  gitignore: enableGitignore = true,
1758
1816
  jsx: enableJsx = true,
1817
+ pnpm: enableCatalogs = false,
1759
1818
  react: enableReact = ReactPackages.some((i) => isPackageExists3(i)),
1760
1819
  regexp: enableRegexp = true,
1761
1820
  typescript: enableTypeScript = isPackageExists3("typescript"),
@@ -1867,6 +1926,11 @@ function config(options = {}, ...userConfigs) {
1867
1926
  sortTsconfig()
1868
1927
  );
1869
1928
  }
1929
+ if (enableCatalogs) {
1930
+ configs2.push(
1931
+ pnpm()
1932
+ );
1933
+ }
1870
1934
  if (options.yaml ?? true) {
1871
1935
  configs2.push(
1872
1936
  yaml({
@@ -1991,6 +2055,7 @@ export {
1991
2055
  node,
1992
2056
  parserPlain,
1993
2057
  perfectionist,
2058
+ pnpm,
1994
2059
  react,
1995
2060
  regexp,
1996
2061
  renameRules,
package/package.json CHANGED
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "name": "@ghettoddos/eslint-config",
3
3
  "type": "module",
4
- "version": "1.0.3",
4
+ "version": "1.2.0",
5
5
  "description": "ghettoDdOS ESLint config",
6
6
  "author": "ghettoDdOS <pen.egor2002@gamil.com> (https://github.com/ghettoDdOS/)",
7
7
  "license": "MIT",
8
8
  "homepage": "https://github.com/ghettoDdOS/eslint-config",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/ghettoDdOS/eslint-config.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/ghettoDdOS/eslint-config/issues"
15
+ },
9
16
  "keywords": [
10
17
  "eslint-config"
11
18
  ],
@@ -38,24 +45,25 @@
38
45
  "@antfu/install-pkg": "^1.0.0",
39
46
  "@clack/prompts": "^0.10.0",
40
47
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
41
- "@eslint-react/eslint-plugin": "^1.31.0",
48
+ "@eslint-react/eslint-plugin": "^1.38.3",
42
49
  "@eslint/markdown": "^6.3.0",
43
50
  "@stylistic/eslint-plugin": "^4.2.0",
44
- "@typescript-eslint/eslint-plugin": "^8.26.0",
45
- "@typescript-eslint/parser": "^8.26.0",
51
+ "@typescript-eslint/eslint-plugin": "^8.28.0",
52
+ "@typescript-eslint/parser": "^8.28.0",
46
53
  "eslint-config-flat-gitignore": "^2.1.0",
47
54
  "eslint-flat-config-utils": "^2.0.1",
48
55
  "eslint-merge-processors": "^2.0.0",
49
56
  "eslint-plugin-antfu": "^3.1.1",
50
- "eslint-plugin-import-x": "^4.6.1",
51
- "eslint-plugin-jsonc": "^2.19.1",
52
- "eslint-plugin-n": "^17.16.2",
57
+ "eslint-plugin-import-x": "^4.9.3",
58
+ "eslint-plugin-jsonc": "^2.20.0",
59
+ "eslint-plugin-n": "^17.17.0",
53
60
  "eslint-plugin-perfectionist": "^4.10.1",
61
+ "eslint-plugin-pnpm": "^0.3.1",
54
62
  "eslint-plugin-react-hooks": "^5.2.0",
55
63
  "eslint-plugin-react-refresh": "^0.4.19",
56
64
  "eslint-plugin-regexp": "^2.7.0",
57
65
  "eslint-plugin-toml": "^0.12.0",
58
- "eslint-plugin-unicorn": "^57.0.0",
66
+ "eslint-plugin-unicorn": "^58.0.0",
59
67
  "eslint-plugin-unused-imports": "^4.1.4",
60
68
  "eslint-plugin-yml": "^1.17.0",
61
69
  "globals": "^16.0.0",
@@ -68,14 +76,14 @@
68
76
  "devDependencies": {
69
77
  "@eslint/config-inspector": "^1.0.2",
70
78
  "@prettier/plugin-xml": "^3.4.1",
71
- "@types/node": "^22.13.10",
79
+ "@types/node": "^22.13.14",
72
80
  "@unocss/eslint-plugin": "66.1.0-beta.3",
73
- "bumpp": "^10.0.3",
74
- "eslint": "^9.22.0",
81
+ "bumpp": "^10.1.0",
82
+ "eslint": "^9.23.0",
75
83
  "eslint-plugin-format": "^1.0.1",
76
- "eslint-typegen": "^2.0.0",
77
- "lint-staged": "^15.4.3",
78
- "simple-git-hooks": "^2.11.1",
84
+ "eslint-typegen": "^2.1.0",
85
+ "lint-staged": "^15.5.0",
86
+ "simple-git-hooks": "^2.12.1",
79
87
  "tsup": "^8.4.0",
80
88
  "tsx": "^4.19.3",
81
89
  "typescript": "^5.8.2"