@component-hook/eslint-plugin 1.5.1 → 1.6.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/dist/index.mjs CHANGED
@@ -8,6 +8,9 @@ import pluginVue from "eslint-plugin-vue";
8
8
  import vueParser from "vue-eslint-parser";
9
9
  import pluginPrettier from "eslint-plugin-prettier";
10
10
  import pluginPrettierRecommended from "eslint-plugin-prettier/recommended";
11
+ import configPrettier from "eslint-config-prettier";
12
+ import configPrettierOverrides from "eslint-config-prettier/prettier";
13
+ import pluginOxfmt from "eslint-plugin-oxfmt";
11
14
  import pluginSonarjs from "eslint-plugin-sonarjs";
12
15
  import pluginSecurity from "eslint-plugin-security";
13
16
  import pluginPlaywright from "eslint-plugin-playwright";
@@ -189,7 +192,7 @@ const jsdocConfig = {
189
192
  }
190
193
  };
191
194
  //#endregion
192
- //#region configs/jsonc.ts
195
+ //#region configs/jsonc/index.ts
193
196
  const recommendedRules$1 = pluginJsonc.configs["recommended-with-jsonc"].map((config) => config.rules).reduce((acc, rules) => ({
194
197
  ...acc,
195
198
  ...rules
@@ -221,59 +224,6 @@ const jsoncConfigs = [
221
224
  }],
222
225
  "jsonc/sort-keys": [
223
226
  "error",
224
- {
225
- order: [
226
- "publisher",
227
- "name",
228
- "displayName",
229
- "type",
230
- "version",
231
- "private",
232
- "packageManager",
233
- "description",
234
- "author",
235
- "contributors",
236
- "license",
237
- "funding",
238
- "homepage",
239
- "repository",
240
- "bugs",
241
- "keywords",
242
- "categories",
243
- "sideEffects",
244
- "imports",
245
- "exports",
246
- "main",
247
- "module",
248
- "unpkg",
249
- "jsdelivr",
250
- "types",
251
- "typesVersions",
252
- "bin",
253
- "icon",
254
- "files",
255
- "engines",
256
- "activationEvents",
257
- "contributes",
258
- "scripts",
259
- "peerDependencies",
260
- "peerDependenciesMeta",
261
- "dependencies",
262
- "inlinedDependencies",
263
- "optionalDependencies",
264
- "devDependencies",
265
- "pnpm",
266
- "overrides",
267
- "resolutions",
268
- "husky",
269
- "simple-git-hooks",
270
- "lint-staged",
271
- "eslintConfig",
272
- "prettier",
273
- "tsdown"
274
- ],
275
- pathPattern: "^$"
276
- },
277
227
  {
278
228
  order: { type: "asc" },
279
229
  pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
@@ -367,6 +317,7 @@ const jsoncConfigs = [
367
317
  "noImplicitThis",
368
318
  "noPropertyAccessFromIndexSignature",
369
319
  "noUncheckedIndexedAccess",
320
+ "noUncheckedSideEffectImports",
370
321
  "noUnusedLocals",
371
322
  "noUnusedParameters",
372
323
  "useUnknownInCatchVariables",
@@ -441,6 +392,18 @@ const markdownConfigs = [...pluginMarkdown.configs.processor.map((config) => ({
441
392
  }
442
393
  }];
443
394
  //#endregion
395
+ //#region configs/oxfmt/index.ts
396
+ const rules$2 = Object.fromEntries(Object.entries(configPrettier.rules ?? {}).filter(([name]) => name !== "vue/html-self-closing"));
397
+ const oxfmtConfig = {
398
+ name: "component-hook/oxfmt",
399
+ plugins: { oxfmt: pluginOxfmt },
400
+ rules: {
401
+ ...rules$2,
402
+ ...configPrettierOverrides.rules,
403
+ "oxfmt/oxfmt": "warn"
404
+ }
405
+ };
406
+ //#endregion
444
407
  //#region configs/perfectionist.ts
445
408
  const perfectionistConfig = {
446
409
  name: "component-hook/perfectionist/imports",
@@ -588,7 +551,7 @@ const testingLibraryMarkoConfig = {
588
551
  rules: { ...configs$1["flat/marko"].rules }
589
552
  };
590
553
  //#endregion
591
- //#region configs/typescript.ts
554
+ //#region configs/typescript/index.ts
592
555
  const typescriptCoreConfig = defineConfig({
593
556
  extends: [...typescriptEslint.configs.recommended],
594
557
  files: ["**/*.ts", "**/*.tsx"],
@@ -624,16 +587,16 @@ const typescriptCoreConfig = defineConfig({
624
587
  ]
625
588
  }
626
589
  });
627
- const typescriptConfigs = [...typescriptCoreConfig, {
590
+ const typescriptDtsConfig = {
628
591
  files: ["**/*.d.ts"],
629
592
  name: "component-hook/typescript/dts-rules",
630
593
  rules: {
631
- "eslint-comments/no-unlimited-disable": "off",
594
+ "@eslint-community/eslint-comments/no-unlimited-disable": "off",
632
595
  "import/no-duplicates": "off",
633
- "no-restricted-syntax": "off",
634
- "unused-imports/no-unused-vars": "off"
596
+ "no-restricted-syntax": "off"
635
597
  }
636
- }];
598
+ };
599
+ [...typescriptCoreConfig];
637
600
  //#endregion
638
601
  //#region configs/unicorn.ts
639
602
  const unicornConfigs = [
@@ -814,9 +777,10 @@ const yamlConfigs = [{
814
777
  //#region index.ts
815
778
  const basicConfigs = [
816
779
  ...jsConfigs,
817
- ...typescriptConfigs,
780
+ ...typescriptCoreConfig,
818
781
  ...commentsConfigs,
819
782
  ...importConfigs,
783
+ typescriptDtsConfig,
820
784
  ...unicornConfigs,
821
785
  jsdocConfig,
822
786
  regexpConfig,
@@ -832,6 +796,7 @@ var eslint_plugin_default = { configs: {
832
796
  vue: vueConfigs,
833
797
  markdown: markdownConfigs,
834
798
  prettier: prettierConfig,
799
+ oxfmt: oxfmtConfig,
835
800
  sonarjs: sonarjsConfigs,
836
801
  security: securityConfig,
837
802
  playwright: playwrightConfig,
package/package.json CHANGED
@@ -1,76 +1,74 @@
1
1
  {
2
2
  "name": "@component-hook/eslint-plugin",
3
- "type": "module",
4
- "version": "1.5.1",
3
+ "version": "1.6.0",
5
4
  "description": "ESLint config for component hook",
6
- "author": "Tzuyi",
7
- "license": "MIT",
5
+ "keywords": [
6
+ "eslint",
7
+ "eslint-plugin",
8
+ "eslintplugin",
9
+ "oxfmt"
10
+ ],
8
11
  "homepage": "https://github.com/tzuyi0817/component-hook/tree/master/packages/eslint-plugin#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/tzuyi0817/component-hook/issues"
14
+ },
15
+ "license": "MIT",
16
+ "author": "Tzuyi",
9
17
  "repository": {
10
18
  "type": "git",
11
19
  "url": "git+https://github.com/tzuyi0817/component-hook.git",
12
20
  "directory": "packages/eslint-plugin"
13
21
  },
14
- "bugs": {
15
- "url": "https://github.com/tzuyi0817/component-hook/issues"
16
- },
17
- "keywords": [
18
- "eslint",
19
- "eslintplugin",
20
- "eslint-plugin"
22
+ "files": [
23
+ "dist"
21
24
  ],
25
+ "type": "module",
22
26
  "exports": {
23
27
  ".": {
24
- "import": {
25
- "types": "./dist/index.d.mts",
26
- "default": "./dist/index.mjs"
27
- },
28
- "require": {
29
- "types": "./dist/index.d.cts",
30
- "default": "./dist/index.cjs"
31
- }
28
+ "types": "./dist/index.d.mts",
29
+ "default": "./dist/index.mjs"
32
30
  }
33
31
  },
34
- "files": [
35
- "dist"
36
- ],
37
32
  "publishConfig": {
38
33
  "tag": "latest"
39
34
  },
40
- "peerDependencies": {
41
- "eslint": "^9.39.5"
42
- },
43
35
  "dependencies": {
44
- "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
36
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.8.1",
45
37
  "@eslint/js": "^9.39.5",
46
38
  "@eslint/markdown": "^8.0.3",
47
39
  "eslint-config-prettier": "^10.1.8",
48
40
  "eslint-plugin-de-morgan": "^2.1.3",
49
41
  "eslint-plugin-import": "^2.32.0",
50
- "eslint-plugin-jsdoc": "^64.0.2",
51
- "eslint-plugin-jsonc": "^3.4.1",
42
+ "eslint-plugin-jsdoc": "^64.5.2",
43
+ "eslint-plugin-jsonc": "^3.4.2",
52
44
  "eslint-plugin-jsx-a11y": "^6.10.2",
53
- "eslint-plugin-perfectionist": "^5.10.1",
54
- "eslint-plugin-playwright": "^2.11.0",
45
+ "eslint-plugin-oxfmt": "^0.26.0",
46
+ "eslint-plugin-perfectionist": "^5.11.1",
47
+ "eslint-plugin-playwright": "^2.12.0",
55
48
  "eslint-plugin-prettier": "^5.5.6",
56
49
  "eslint-plugin-react": "^7.37.5",
57
50
  "eslint-plugin-react-hooks": "^7.1.1",
58
- "eslint-plugin-regexp": "^3.1.1",
51
+ "eslint-plugin-regexp": "^3.3.0",
59
52
  "eslint-plugin-security": "^4.0.1",
60
- "eslint-plugin-sonarjs": "^4.2.0",
53
+ "eslint-plugin-sonarjs": "^4.2.1",
61
54
  "eslint-plugin-testing-library": "^7.16.2",
62
55
  "eslint-plugin-unicorn": "^73.0.0",
63
- "eslint-plugin-vue": "^10.10.0",
56
+ "eslint-plugin-vue": "^10.11.0",
64
57
  "eslint-plugin-yml": "^3.8.1",
65
- "globals": "^17.9.0",
58
+ "globals": "^17.12.0",
66
59
  "jsonc-eslint-parser": "^3.3.0",
67
- "typescript-eslint": "^8.66.0",
60
+ "typescript-eslint": "^8.70.0",
68
61
  "vue-eslint-parser": "^10.4.1"
69
62
  },
70
63
  "devDependencies": {
71
- "@eslint/config-inspector": "^3.2.0",
64
+ "@eslint/config-inspector": "^3.5.0",
72
65
  "@types/eslint-plugin-security": "^3.0.1",
73
- "eslint-typegen": "^2.3.1"
66
+ "eslint-typegen": "^2.3.1",
67
+ "oxfmt": "^0.71.0"
68
+ },
69
+ "peerDependencies": {
70
+ "eslint": "^9.39.5",
71
+ "oxfmt": ">=0.71.0"
74
72
  },
75
73
  "scripts": {
76
74
  "dev": "eslint-config-inspector --config ../../eslint.config.js",