@component-hook/eslint-plugin 1.5.0 → 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",
@@ -436,10 +387,23 @@ const markdownConfigs = [...pluginMarkdown.configs.processor.map((config) => ({
436
387
  "sonarjs/unused-import": "off",
437
388
  "sonarjs/no-unused-vars": "off",
438
389
  "unicorn/no-useless-undefined": "off",
439
- "unicorn/no-anonymous-default-export": "off"
390
+ "unicorn/no-anonymous-default-export": "off",
391
+ "unicorn/no-top-level-side-effects": "off"
440
392
  }
441
393
  }];
442
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
443
407
  //#region configs/perfectionist.ts
444
408
  const perfectionistConfig = {
445
409
  name: "component-hook/perfectionist/imports",
@@ -587,7 +551,7 @@ const testingLibraryMarkoConfig = {
587
551
  rules: { ...configs$1["flat/marko"].rules }
588
552
  };
589
553
  //#endregion
590
- //#region configs/typescript.ts
554
+ //#region configs/typescript/index.ts
591
555
  const typescriptCoreConfig = defineConfig({
592
556
  extends: [...typescriptEslint.configs.recommended],
593
557
  files: ["**/*.ts", "**/*.tsx"],
@@ -623,16 +587,16 @@ const typescriptCoreConfig = defineConfig({
623
587
  ]
624
588
  }
625
589
  });
626
- const typescriptConfigs = [...typescriptCoreConfig, {
590
+ const typescriptDtsConfig = {
627
591
  files: ["**/*.d.ts"],
628
592
  name: "component-hook/typescript/dts-rules",
629
593
  rules: {
630
- "eslint-comments/no-unlimited-disable": "off",
594
+ "@eslint-community/eslint-comments/no-unlimited-disable": "off",
631
595
  "import/no-duplicates": "off",
632
- "no-restricted-syntax": "off",
633
- "unused-imports/no-unused-vars": "off"
596
+ "no-restricted-syntax": "off"
634
597
  }
635
- }];
598
+ };
599
+ [...typescriptCoreConfig];
636
600
  //#endregion
637
601
  //#region configs/unicorn.ts
638
602
  const unicornConfigs = [
@@ -643,10 +607,8 @@ const unicornConfigs = [
643
607
  {
644
608
  name: "component-hook/unicorn",
645
609
  rules: {
646
- "unicorn/catch-error-name": "error",
647
- "unicorn/consistent-empty-array-spread": "error",
610
+ "unicorn/consistent-arrow-return-style": "off",
648
611
  "unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
649
- "unicorn/custom-error-definition": "error",
650
612
  "unicorn/filename-case": ["error", {
651
613
  cases: {
652
614
  kebabCase: true,
@@ -661,8 +623,10 @@ const unicornConfigs = [
661
623
  "unicorn/import-style": "off",
662
624
  "unicorn/no-abusive-eslint-disable": "off",
663
625
  "unicorn/no-array-for-each": "off",
626
+ "unicorn/no-barrel-files": "off",
664
627
  "unicorn/no-duplicate-set-values": "error",
665
628
  "unicorn/no-empty-file": "off",
629
+ "unicorn/no-for-each": "off",
666
630
  "unicorn/no-for-loop": "error",
667
631
  "unicorn/no-process-exit": "off",
668
632
  "unicorn/no-this-assignment": "off",
@@ -672,6 +636,7 @@ const unicornConfigs = [
672
636
  checkArrowFunctionBody: false
673
637
  }],
674
638
  "unicorn/numeric-separators-style": "off",
639
+ "unicorn/prefer-await": "off",
675
640
  "unicorn/prefer-module": "off",
676
641
  "unicorn/prefer-query-selector": "error",
677
642
  "unicorn/prefer-ternary": "off",
@@ -812,9 +777,10 @@ const yamlConfigs = [{
812
777
  //#region index.ts
813
778
  const basicConfigs = [
814
779
  ...jsConfigs,
815
- ...typescriptConfigs,
780
+ ...typescriptCoreConfig,
816
781
  ...commentsConfigs,
817
782
  ...importConfigs,
783
+ typescriptDtsConfig,
818
784
  ...unicornConfigs,
819
785
  jsdocConfig,
820
786
  regexpConfig,
@@ -830,6 +796,7 @@ var eslint_plugin_default = { configs: {
830
796
  vue: vueConfigs,
831
797
  markdown: markdownConfigs,
832
798
  prettier: prettierConfig,
799
+ oxfmt: oxfmtConfig,
833
800
  sonarjs: sonarjsConfigs,
834
801
  security: securityConfig,
835
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.0",
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.4"
42
- },
43
35
  "dependencies": {
44
- "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
45
- "@eslint/js": "^9.39.4",
36
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.8.1",
37
+ "@eslint/js": "^9.39.5",
46
38
  "@eslint/markdown": "^8.0.3",
47
39
  "eslint-config-prettier": "^10.1.8",
48
- "eslint-plugin-de-morgan": "^2.1.2",
40
+ "eslint-plugin-de-morgan": "^2.1.3",
49
41
  "eslint-plugin-import": "^2.32.0",
50
- "eslint-plugin-jsdoc": "^63.0.13",
51
- "eslint-plugin-jsonc": "^3.3.0",
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.0",
54
- "eslint-plugin-playwright": "^2.10.5",
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.1.0",
53
+ "eslint-plugin-sonarjs": "^4.2.1",
61
54
  "eslint-plugin-testing-library": "^7.16.2",
62
- "eslint-plugin-unicorn": "^69.0.0",
63
- "eslint-plugin-vue": "^10.9.2",
64
- "eslint-plugin-yml": "^3.6.0",
65
- "globals": "^17.7.0",
66
- "jsonc-eslint-parser": "^3.1.0",
67
- "typescript-eslint": "^8.63.0",
55
+ "eslint-plugin-unicorn": "^73.0.0",
56
+ "eslint-plugin-vue": "^10.11.0",
57
+ "eslint-plugin-yml": "^3.8.1",
58
+ "globals": "^17.12.0",
59
+ "jsonc-eslint-parser": "^3.3.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.0.4",
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",