@shayanthenerd/eslint-config 0.32.0 → 0.34.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 (37) hide show
  1. package/README.md +65 -40
  2. package/dist/configs/astro.mjs +5 -1
  3. package/dist/configs/css.mjs +3 -3
  4. package/dist/configs/packageJson.mjs +1 -1
  5. package/dist/configs/react.mjs +2 -2
  6. package/dist/configs/tailwind.mjs +7 -1
  7. package/dist/configs/typescript.mjs +4 -6
  8. package/dist/helpers/ignores/defaultIgnorePatterns.mjs +1 -6
  9. package/dist/helpers/options/defaultOptions.mjs +13 -3
  10. package/dist/helpers/options/enableDetectedConfigs.mjs +20 -8
  11. package/dist/index.d.mts +1 -0
  12. package/dist/rules/astro.mjs +61 -54
  13. package/dist/rules/baseline.mjs +1 -1
  14. package/dist/rules/css.mjs +30 -10
  15. package/dist/rules/html.mjs +11 -3
  16. package/dist/rules/importX.mjs +2 -2
  17. package/dist/rules/javascript.mjs +6 -5
  18. package/dist/rules/markdown.mjs +7 -1
  19. package/dist/rules/next.mjs +2 -0
  20. package/dist/rules/node.mjs +1 -1
  21. package/dist/rules/packageJson.mjs +166 -153
  22. package/dist/rules/perfectionist.mjs +41 -11
  23. package/dist/rules/playwright.mjs +10 -0
  24. package/dist/rules/react.mjs +56 -54
  25. package/dist/rules/stylistic.mjs +1 -1
  26. package/dist/rules/tanstack.mjs +1 -1
  27. package/dist/rules/typescript.mjs +3 -2
  28. package/dist/rules/unicorn.mjs +38 -7
  29. package/dist/rules/vue.mjs +38 -41
  30. package/dist/rules/zod.mjs +2 -0
  31. package/dist/types/eslint-schema.d.mts +1086 -669
  32. package/dist/types/index.d.mts +44 -9
  33. package/dist/types/options/baseline.d.mts +24 -3
  34. package/dist/types/options/react.d.mts +9 -9
  35. package/dist/types/options/typescript.d.mts +3 -3
  36. package/dist/types/options/vue.d.mts +1 -1
  37. package/package.json +39 -37
@@ -46,9 +46,10 @@ const allowedPhysicalProperties = [
46
46
  "contain-intrinsic-height"
47
47
  ];
48
48
  function getCssRules(options) {
49
- const { unicorn, tailwind, baseline } = options.configs;
49
+ const { css, tailwind, baseline } = options.configs;
50
+ const { allowedUnknownPseudoSelectors: userAllowedUnknownPseudoSelectors } = isEnabled(css) ? css : defaultOptions.configs.css;
50
51
  const { allowedAtRules: userAllowedAtRules, allowedFunctions: userAllowedFunctions, allowedMediaConditions: userAllowedMediaConditions, allowedProperties: userAllowedProperties, allowedPropertyValues: userAllowedPropertyValues, allowedSelectors: userAllowedSelectors, allowedUnits: userAllowedUnits } = isEnabled(baseline) ? baseline.css : defaultOptions.configs.baseline.css;
51
- const cssRules = {
52
+ return {
52
53
  "css/font-family-fallbacks": "warn",
53
54
  "css/no-duplicate-imports": "error",
54
55
  "css/no-duplicate-keyframe-selectors": "error",
@@ -82,16 +83,35 @@ function getCssRules(options) {
82
83
  allowFunctions: userAllowedFunctions,
83
84
  allowMediaConditions: userAllowedMediaConditions,
84
85
  allowProperties: userAllowedProperties,
85
- allowPropertyValues: userAllowedPropertyValues,
86
- allowSelectors: userAllowedSelectors,
86
+ allowPropertyValues: {
87
+ "background-clip": ["text"],
88
+ ...userAllowedPropertyValues
89
+ },
90
+ allowSelectors: ["selection", ...userAllowedSelectors],
87
91
  allowUnits: userAllowedUnits
88
- }] : "off"
92
+ }] : "off",
93
+ "cssicorn/lowercase": "error",
94
+ "cssicorn/no-declarations-after-nested-rules": "warn",
95
+ "cssicorn/no-deprecated-features": "error",
96
+ "cssicorn/no-descending-specificity": "warn",
97
+ "cssicorn/no-duplicate-font-family-names": "error",
98
+ "cssicorn/no-duplicate-properties": "warn",
99
+ "cssicorn/no-duplicate-selectors": "warn",
100
+ "cssicorn/no-invalid-media-features": "error",
101
+ "cssicorn/no-nesting-with-mixed-specificity": "warn",
102
+ "cssicorn/no-redundant-nested-style-rules": "warn",
103
+ "cssicorn/no-redundant-shorthand-values": "warn",
104
+ "cssicorn/no-self-referencing-custom-properties": "error",
105
+ "cssicorn/no-unknown-animations": "error",
106
+ "cssicorn/no-unknown-annotations": "error",
107
+ "cssicorn/no-unknown-pseudo-selectors": ["error", { allow: userAllowedUnknownPseudoSelectors }],
108
+ "cssicorn/no-unscoped-nesting-selector": isEnabled(tailwind) ? "error" : ["error", { scopingRootAtRules: [] }],
109
+ "cssicorn/no-zero-length-unit": "warn",
110
+ "cssicorn/prefer-explicit-viewport-units": "warn",
111
+ "cssicorn/prefer-media-feature-range-syntax": "warn",
112
+ "cssicorn/prefer-modern-syntax": "warn",
113
+ "cssicorn/require-property-descriptors": "error"
89
114
  };
90
- if (isEnabled(unicorn)) {
91
- cssRules["unicorn/no-shorthand-property-overrides"] = "warn";
92
- cssRules["unicorn/prefer-explicit-viewport-units"] = "warn";
93
- }
94
- return cssRules;
95
115
  }
96
116
  //#endregion
97
117
  export { getCssRules };
@@ -55,7 +55,7 @@ function getHtmlRules(options) {
55
55
  "@html-eslint/require-input-label": "error",
56
56
  "@html-eslint/require-meta-viewport": "error"
57
57
  };
58
- if (isEnabled(stylistic)) Object.assign(htmlRules, {
58
+ const stylisticRules = {
59
59
  "@html-eslint/attrs-newline": ["warn", {
60
60
  maxLen: maxLineLength,
61
61
  ifAttrsMoreThan: maxAttributesPerLine
@@ -78,9 +78,17 @@ function getHtmlRules(options) {
78
78
  "double",
79
79
  { enforceTemplatedAttrValue: true }
80
80
  ]
81
- });
81
+ };
82
+ const unicornRules = {
83
+ "unicorn/consistent-compound-words": "warn",
84
+ "unicorn/no-ineffective-csp-directives": "error",
85
+ "unicorn/no-invalid-file-input-accept": "error",
86
+ "unicorn/no-invalid-integrity": "error",
87
+ "unicorn/relative-url-style": "warn"
88
+ };
89
+ if (isEnabled(stylistic)) Object.assign(htmlRules, stylisticRules);
90
+ if (isEnabled(unicorn)) Object.assign(htmlRules, unicornRules);
82
91
  if (isEnabled(tailwind)) htmlRules["better-tailwindcss/no-duplicate-classes"] = "off";
83
- if (isEnabled(unicorn)) htmlRules["unicorn/no-invalid-file-input-accept"] = "error";
84
92
  return htmlRules;
85
93
  }
86
94
  //#endregion
@@ -2,7 +2,7 @@ import { isEnabled } from "../utils/isEnabled.mjs";
2
2
  import path from "node:path";
3
3
  //#region src/rules/importX.ts
4
4
  function getImportXRules(options) {
5
- const { packageDir, configs: { typescript } } = options;
5
+ const { packageDir, configs: { unicorn, typescript } } = options;
6
6
  const isTypescriptEnabled = isEnabled(typescript);
7
7
  return {
8
8
  "import-x/export": isTypescriptEnabled ? "off" : "error",
@@ -15,7 +15,7 @@ function getImportXRules(options) {
15
15
  "import-x/no-mutable-exports": "error",
16
16
  "import-x/no-named-as-default": "error",
17
17
  "import-x/no-amd": "error",
18
- "import-x/no-commonjs": "error",
18
+ "import-x/no-commonjs": isEnabled(unicorn) ? "off" : "error",
19
19
  "import-x/no-import-module-exports": "error",
20
20
  "import-x/named": isTypescriptEnabled ? "off" : "error",
21
21
  "import-x/default": isTypescriptEnabled ? "off" : "error",
@@ -1,7 +1,8 @@
1
1
  import { isEnabled } from "../utils/isEnabled.mjs";
2
2
  //#region src/rules/javascript.ts
3
3
  function getJavaScriptRules(options) {
4
- const { unicorn, typescript, javascript: { maxDepth, maxNestedCallbacks } } = options.configs;
4
+ const { importX, unicorn, typescript, javascript: { maxDepth, maxNestedCallbacks } } = options.configs;
5
+ const isImportXEnabled = isEnabled(importX);
5
6
  const isUnicornEnabled = isEnabled(unicorn);
6
7
  const isTypescriptEnabled = isEnabled(typescript);
7
8
  return {
@@ -26,7 +27,7 @@ function getJavaScriptRules(options) {
26
27
  "no-dupe-class-members": isTypescriptEnabled ? "off" : "error",
27
28
  "no-dupe-else-if": "error",
28
29
  "no-dupe-keys": isTypescriptEnabled ? "off" : "error",
29
- "no-duplicate-case": "error",
30
+ "no-duplicate-case": isImportXEnabled ? "off" : "error",
30
31
  "no-duplicate-imports": ["error", {
31
32
  includeExports: true,
32
33
  allowSeparateTypeImports: true
@@ -190,7 +191,7 @@ function getJavaScriptRules(options) {
190
191
  "no-useless-call": "error",
191
192
  "no-useless-catch": "error",
192
193
  "no-useless-computed-key": "error",
193
- "no-useless-concat": "error",
194
+ "no-useless-concat": isUnicornEnabled ? "error" : "off",
194
195
  "no-useless-constructor": "error",
195
196
  "no-useless-escape": "error",
196
197
  "no-useless-rename": "error",
@@ -200,7 +201,7 @@ function getJavaScriptRules(options) {
200
201
  "no-with": "error",
201
202
  "object-shorthand": "warn",
202
203
  "operator-assignment": "warn",
203
- "prefer-arrow-callback": ["warn", { allowUnboundThis: true }],
204
+ "prefer-arrow-callback": "warn",
204
205
  "prefer-const": "error",
205
206
  "prefer-destructuring": isTypescriptEnabled ? "off" : ["warn", {
206
207
  object: true,
@@ -214,7 +215,7 @@ function getJavaScriptRules(options) {
214
215
  "prefer-promise-reject-errors": isTypescriptEnabled ? "off" : ["warn", { allowEmptyReject: true }],
215
216
  "prefer-regex-literals": ["warn", { disallowRedundantWrapping: true }],
216
217
  "prefer-rest-params": "warn",
217
- "prefer-spread": "warn",
218
+ "prefer-spread": isUnicornEnabled ? "warn" : "off",
218
219
  "prefer-template": "warn",
219
220
  "preserve-caught-error": "warn",
220
221
  "radix": "warn",
@@ -47,7 +47,13 @@ function getMarkdownRules(options) {
47
47
  "markdown/require-alt-text": "warn",
48
48
  "markdown/table-column-count": isCommonMark ? "off" : ["error", { checkMissingCells: true }]
49
49
  };
50
- if (isEnabled(unicorn)) markdownRules["unicorn/no-missing-local-resource"] = "error";
50
+ const unicornRules = {
51
+ "unicorn/no-javascript-url": "error",
52
+ "unicorn/no-empty-link-text": "error",
53
+ "unicorn/no-missing-local-resource": "error",
54
+ "unicorn/relative-url-style": "warn"
55
+ };
56
+ if (isEnabled(unicorn)) Object.assign(markdownRules, unicornRules);
51
57
  return markdownRules;
52
58
  }
53
59
  //#endregion
@@ -4,6 +4,7 @@ const nextRules = {
4
4
  "next/google-font-preconnect": "warn",
5
5
  "next/inline-script-id": "error",
6
6
  "next/next-script-for-ga": "warn",
7
+ "next/no-assign-module-variable": "error",
7
8
  "next/no-async-client-component": "error",
8
9
  "next/no-before-interactive-script-outside-document": "error",
9
10
  "next/no-css-tags": "warn",
@@ -13,6 +14,7 @@ const nextRules = {
13
14
  "next/no-head-import-in-document": "error",
14
15
  "next/no-html-link-for-pages": "warn",
15
16
  "next/no-img-element": "warn",
17
+ "next/no-location-assign-relative-destination": "error",
16
18
  "next/no-page-custom-font": "warn",
17
19
  "next/no-script-component-in-head": "error",
18
20
  "next/no-styled-jsx-in-document": "error",
@@ -11,7 +11,7 @@ function getNodeRules(options) {
11
11
  "n/no-path-concat": "error",
12
12
  "n/no-process-env": ["error", { allowedVariables: ["NODE_ENV"] }],
13
13
  "n/no-process-exit": "error",
14
- "n/no-sync": "warn",
14
+ "n/no-sync": isEnabled(typescript) ? "warn" : "off",
15
15
  "n/no-unpublished-import": "error",
16
16
  "n/no-unsupported-features/es-builtins": "error",
17
17
  "n/no-unsupported-features/es-syntax": "error",
@@ -1,157 +1,170 @@
1
+ import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
2
+ import { isEnabled } from "../utils/isEnabled.mjs";
1
3
  //#region src/rules/packageJson.ts
2
- const packageJsonRules = {
3
- "package-json/bin-name-casing": "warn",
4
- "package-json/exports-subpaths-style": ["warn", { prefer: "implicit" }],
5
- "package-json/no-empty-fields": "error",
6
- "package-json/no-local-dependencies": "error",
7
- "package-json/no-redundant-files": "error",
8
- "package-json/no-redundant-publishConfig": "error",
9
- "package-json/order-properties": "warn",
10
- "package-json/repository-shorthand": "warn",
11
- "package-json/require-attribution": ["warn", { ignorePrivate: true }],
12
- "package-json/require-bugs": "warn",
13
- "package-json/require-description": ["warn", { ignorePrivate: true }],
14
- "package-json/require-devEngines": "warn",
15
- "package-json/require-engines": ["warn", { ignorePrivate: true }],
16
- "package-json/require-exports": ["error", { ignorePrivate: true }],
17
- "package-json/require-files": ["error", { ignorePrivate: true }],
18
- "package-json/require-homepage": "warn",
19
- "package-json/require-keywords": "warn",
20
- "package-json/require-license": ["error", { ignorePrivate: true }],
21
- "package-json/require-name": "error",
22
- "package-json/require-repository": "warn",
23
- "package-json/require-type": "warn",
24
- "package-json/require-types": ["error", { ignorePrivate: true }],
25
- "package-json/require-version": "error",
26
- "package-json/restrict-dependency-ranges": ["warn", [{
27
- forDependencyTypes: ["dependencies", "devDependencies"],
28
- rangeType: "pin"
29
- }, {
30
- forDependencyTypes: ["peerDependencies", "optionalDependencies"],
31
- rangeType: ["caret", "tilde"]
32
- }]],
33
- "package-json/restrict-private-properties": ["error", { blockedProperties: [
34
- "files",
35
- "publishConfig",
36
- "keywords",
37
- "funding"
38
- ] }],
39
- "package-json/restrict-top-level-properties": ["warn", { ban: [
40
- {
41
- property: "bun",
42
- message: "use bunfig.toml."
43
- },
44
- {
45
- property: "pnpm",
46
- message: "use pnpm-workspace.yaml."
47
- },
48
- {
49
- property: "commitlint",
50
- message: "use a dedicated config file."
51
- },
52
- {
53
- property: "stylelint",
54
- message: "use a dedicated config file."
55
- },
56
- {
57
- property: "prettier",
58
- message: "use a dedicated config file."
59
- },
60
- {
61
- property: "renovate",
62
- message: "use a dedicated config file."
63
- }
64
- ] }],
65
- "package-json/scripts-name-casing": "warn",
66
- "package-json/sort-collections": ["warn", [
67
- {
68
- key: "author",
69
- order: [
70
- "name",
71
- "email",
72
- "url"
73
- ]
74
- },
75
- {
76
- key: "bugs",
77
- order: ["email", "url"]
78
- },
79
- "config",
80
- "dependencies",
81
- "devEngines",
82
- "devDependencies",
83
- "directories",
84
- {
85
- key: "dist",
86
- order: ["shasum", "tarball"]
87
- },
88
- "engines",
89
- "exports",
90
- "husky",
91
- "husky.hooks",
92
- "lint-staged",
93
- "nano-staged",
94
- "optionalDependencies",
95
- "overrides",
96
- "peerDependencies",
97
- "peerDependenciesMeta",
98
- {
99
- key: "repository",
100
- order: [
101
- "type",
102
- "url",
103
- "directory"
104
- ]
105
- },
106
- "release",
107
- "simple-git-hooks"
108
- ]],
109
- "package-json/specify-peers-locally": "warn",
110
- "package-json/unique-dependencies": "error",
111
- "package-json/valid-author": "error",
112
- "package-json/valid-bin": "error",
113
- "package-json/valid-browser": "error",
114
- "package-json/valid-bugs": "error",
115
- "package-json/valid-bundleDependencies": "error",
116
- "package-json/valid-config": "error",
117
- "package-json/valid-contributors": "error",
118
- "package-json/valid-cpu": "error",
119
- "package-json/valid-dependencies": "error",
120
- "package-json/valid-description": "error",
121
- "package-json/valid-devDependencies": "error",
122
- "package-json/valid-devEngines": "error",
123
- "package-json/valid-directories": "error",
124
- "package-json/valid-engines": "error",
125
- "package-json/valid-exports": "error",
126
- "package-json/valid-files": "error",
127
- "package-json/valid-funding": "error",
128
- "package-json/valid-gypfile": "error",
129
- "package-json/valid-homepage": "error",
130
- "package-json/valid-keywords": "error",
131
- "package-json/valid-libc": "error",
132
- "package-json/valid-license": "error",
133
- "package-json/valid-main": "error",
134
- "package-json/valid-man": "error",
135
- "package-json/valid-module": "error",
136
- "package-json/valid-name": "error",
137
- "package-json/valid-optionalDependencies": "error",
138
- "package-json/valid-os": "error",
139
- "package-json/valid-packageManager": "error",
140
- "package-json/valid-peerDependencies": "error",
141
- "package-json/valid-peerDependenciesMeta": "error",
142
- "package-json/valid-peerDependenciesMeta-relationship": "error",
143
- "package-json/valid-private": "error",
144
- "package-json/valid-publishConfig": "error",
145
- "package-json/valid-repository": "error",
146
- "package-json/valid-repository-directory": "error",
147
- "package-json/valid-scripts": "error",
148
- "package-json/valid-sideEffects": "error",
149
- "package-json/valid-type": "error",
150
- "package-json/valid-version": "error",
151
- "package-json/valid-workspaces": "error"
152
- };
153
- function getPackageJsonRules() {
154
- return packageJsonRules;
4
+ /**
5
+ Using a wildcard to target all objects within an array isn't supported yet.
6
+ @see https://github.com/michaelfaith/eslint-plugin-package-json/issues/1967
7
+ */
8
+ const collectionSortPatterns = [
9
+ {
10
+ key: "author",
11
+ order: [
12
+ "name",
13
+ "email",
14
+ "url"
15
+ ]
16
+ },
17
+ {
18
+ key: "bugs",
19
+ order: ["email", "url"]
20
+ },
21
+ "config",
22
+ "dependencies",
23
+ "devEngines",
24
+ "devDependencies",
25
+ "directories",
26
+ {
27
+ key: "dist",
28
+ order: ["shasum", "tarball"]
29
+ },
30
+ "engines",
31
+ "exports",
32
+ "husky",
33
+ "husky.hooks",
34
+ "lint-staged",
35
+ "nano-staged",
36
+ "optionalDependencies",
37
+ "overrides",
38
+ "peerDependencies",
39
+ "peerDependenciesMeta",
40
+ {
41
+ key: "repository",
42
+ order: [
43
+ "type",
44
+ "url",
45
+ "directory"
46
+ ]
47
+ },
48
+ "release",
49
+ "simple-git-hooks"
50
+ ];
51
+ function getPackageJsonRules(options) {
52
+ const { packageJson } = options.configs;
53
+ const { allowedDistTags: userUseAllowedDistTags, allowedDistTagsFor: userUseAllowedDistTagsFor } = isEnabled(packageJson) ? packageJson : defaultOptions.configs.packageJson;
54
+ return {
55
+ "package-json/bin-name-casing": "warn",
56
+ "package-json/exports-subpaths-style": ["warn", { prefer: "implicit" }],
57
+ "package-json/no-empty-fields": "error",
58
+ "package-json/no-local-dependencies": "error",
59
+ "package-json/no-redundant-files": "error",
60
+ "package-json/no-redundant-publishConfig": "error",
61
+ "package-json/order-properties": "warn",
62
+ "package-json/repository-shorthand": "warn",
63
+ "package-json/require-attribution": "warn",
64
+ "package-json/require-package-json-export": "error",
65
+ "package-json/require-bugs": "warn",
66
+ "package-json/require-description": ["warn", { ignorePrivate: true }],
67
+ "package-json/require-devEngines": "warn",
68
+ "package-json/require-engines": ["warn", { ignorePrivate: true }],
69
+ "package-json/require-exports": ["error", { ignorePrivate: true }],
70
+ "package-json/require-files": ["error", { ignorePrivate: true }],
71
+ "package-json/require-homepage": "warn",
72
+ "package-json/require-keywords": "warn",
73
+ "package-json/require-license": ["error", { ignorePrivate: true }],
74
+ "package-json/require-name": "error",
75
+ "package-json/require-repository": "warn",
76
+ "package-json/require-type": "warn",
77
+ "package-json/require-types": ["error", { ignorePrivate: true }],
78
+ "package-json/require-version": "error",
79
+ "package-json/restrict-dependency-ranges": ["warn", [{
80
+ forDependencyTypes: ["dependencies", "devDependencies"],
81
+ rangeType: "pin"
82
+ }, {
83
+ forDependencyTypes: ["peerDependencies", "optionalDependencies"],
84
+ rangeType: ["caret", "tilde"]
85
+ }]],
86
+ "package-json/restrict-dist-tags": ["warn", {
87
+ allowed: userUseAllowedDistTags,
88
+ allowedFor: userUseAllowedDistTagsFor
89
+ }],
90
+ "package-json/restrict-private-properties": ["error", { blockedProperties: [
91
+ "files",
92
+ "publishConfig",
93
+ "keywords",
94
+ "funding"
95
+ ] }],
96
+ "package-json/restrict-top-level-properties": ["warn", { ban: [
97
+ {
98
+ property: "bun",
99
+ message: "use bunfig.toml."
100
+ },
101
+ {
102
+ property: "pnpm",
103
+ message: "use pnpm-workspace.yaml."
104
+ },
105
+ {
106
+ property: "commitlint",
107
+ message: "use a dedicated config file."
108
+ },
109
+ {
110
+ property: "stylelint",
111
+ message: "use a dedicated config file."
112
+ },
113
+ {
114
+ property: "prettier",
115
+ message: "use a dedicated config file."
116
+ },
117
+ {
118
+ property: "renovate",
119
+ message: "use a dedicated config file."
120
+ }
121
+ ] }],
122
+ "package-json/scripts-name-casing": "warn",
123
+ "package-json/sort-collections": ["warn", collectionSortPatterns],
124
+ "package-json/specify-peers-locally": "warn",
125
+ "package-json/unique-dependencies": "error",
126
+ "package-json/valid-author": "error",
127
+ "package-json/valid-bin": "error",
128
+ "package-json/valid-browser": "error",
129
+ "package-json/valid-bugs": "error",
130
+ "package-json/valid-bundleDependencies": "error",
131
+ "package-json/valid-config": "error",
132
+ "package-json/valid-contributors": "error",
133
+ "package-json/valid-cpu": "error",
134
+ "package-json/valid-dependencies": "error",
135
+ "package-json/valid-description": "error",
136
+ "package-json/valid-devDependencies": "error",
137
+ "package-json/valid-devEngines": "error",
138
+ "package-json/valid-directories": "error",
139
+ "package-json/valid-engines": "error",
140
+ "package-json/valid-exports": "error",
141
+ "package-json/valid-files": "error",
142
+ "package-json/valid-funding": "error",
143
+ "package-json/valid-gypfile": "error",
144
+ "package-json/valid-homepage": "error",
145
+ "package-json/valid-keywords": "error",
146
+ "package-json/valid-libc": "error",
147
+ "package-json/valid-license": "error",
148
+ "package-json/valid-main": "error",
149
+ "package-json/valid-man": "error",
150
+ "package-json/valid-module": "error",
151
+ "package-json/valid-name": "error",
152
+ "package-json/valid-optionalDependencies": "error",
153
+ "package-json/valid-os": "error",
154
+ "package-json/valid-packageManager": "error",
155
+ "package-json/valid-peerDependencies": "error",
156
+ "package-json/valid-peerDependenciesMeta": "error",
157
+ "package-json/valid-peerDependenciesMeta-relationship": "error",
158
+ "package-json/valid-private": "error",
159
+ "package-json/valid-publishConfig": "error",
160
+ "package-json/valid-repository": "error",
161
+ "package-json/valid-repository-directory": "error",
162
+ "package-json/valid-scripts": "error",
163
+ "package-json/valid-sideEffects": "error",
164
+ "package-json/valid-type": "error",
165
+ "package-json/valid-version": "error",
166
+ "package-json/valid-workspaces": "error"
167
+ };
155
168
  }
156
169
  //#endregion
157
170
  export { getPackageJsonRules };
@@ -69,20 +69,47 @@ const sortArrayIncludesOptions = {
69
69
  "unknown"
70
70
  ]
71
71
  };
72
- const sortImportsCustomGroups = [{
73
- groupName: "component",
74
- elementNamePattern: ["\\.(vue|[jt]sx)$"],
75
- modifiers: ["value"]
76
- }, {
77
- groupName: "image",
78
- elementNamePattern: ["\\.(ico|svg|gif|png|jpe?g|webp|avif|heic)$"]
79
- }];
72
+ const componentPattern = ["\\.([jt]sx|astro|vue)$"];
73
+ const sortImportsCustomGroups = [
74
+ {
75
+ groupName: "component-subpath",
76
+ elementNamePattern: componentPattern,
77
+ modifiers: ["value"],
78
+ selector: "subpath"
79
+ },
80
+ {
81
+ groupName: "component-tsconfig-path",
82
+ elementNamePattern: componentPattern,
83
+ modifiers: ["value"],
84
+ selector: "tsconfig-path"
85
+ },
86
+ {
87
+ groupName: "component-internal",
88
+ elementNamePattern: componentPattern,
89
+ modifiers: ["value"],
90
+ selector: "internal"
91
+ },
92
+ {
93
+ groupName: "component",
94
+ elementNamePattern: componentPattern,
95
+ modifiers: ["value"]
96
+ },
97
+ {
98
+ groupName: "image",
99
+ elementNamePattern: ["\\.(apng|avif|bmp|gif|heic|heif|ico|jfif|jpe?g|jxl|pjpeg|png|svgz?|tiff?|webp)$"]
100
+ }
101
+ ];
80
102
  const sortImportsGroups = [
81
103
  ["style", "side-effect-style"],
82
104
  { newlinesBetween: 0 },
83
105
  "side-effect",
84
106
  "image",
85
- "component",
107
+ [
108
+ "component-subpath",
109
+ "component-tsconfig-path",
110
+ "component-internal",
111
+ "component"
112
+ ],
86
113
  "type-external",
87
114
  { newlinesBetween: 0 },
88
115
  "type-builtin",
@@ -98,10 +125,13 @@ const sortImportsGroups = [
98
125
  "external",
99
126
  { newlinesBetween: 0 },
100
127
  "builtin",
101
- ["tsconfig-path", "subpath"],
128
+ [
129
+ "subpath",
130
+ "tsconfig-path",
131
+ "internal"
132
+ ],
102
133
  { newlinesBetween: 0 },
103
134
  [
104
- "internal",
105
135
  "parent",
106
136
  "index",
107
137
  "sibling"