@infernodesign/eslint-config 2.17.0 → 2.18.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/cli.js +2 -2
- package/dist/constants-CZLDK59m.js +120 -0
- package/dist/index.d.ts +58 -26
- package/dist/index.js +4 -89
- package/package.json +1 -1
- package/dist/constants-JlDUTs3Q.js +0 -3
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as PACKAGE_NAME } from "./constants-CZLDK59m.js";
|
|
2
2
|
import fsPromises from "node:fs/promises";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
@@ -8,7 +8,7 @@ import { cac } from "cac";
|
|
|
8
8
|
import parse from "parse-gitignore";
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
// package.json
|
|
11
|
-
var version = "2.
|
|
11
|
+
var version = "2.18.0";
|
|
12
12
|
// src/cli/constants.ts
|
|
13
13
|
const vscodeSettingsString = `
|
|
14
14
|
// Disable the default formatter, use eslint instead
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// src/constants.ts
|
|
2
|
+
const PACKAGE_NAME = "@infernodesign/eslint-config";
|
|
3
|
+
/**
|
|
4
|
+
* PACKAGE_SORT_ORDER
|
|
5
|
+
*
|
|
6
|
+
* Specifies the order in which package.json properties should appear.
|
|
7
|
+
*
|
|
8
|
+
* This array establishes a preferred sequence to maintain consistency and readability
|
|
9
|
+
* when managing package.json files in JavaScript projects. It categorizes common properties
|
|
10
|
+
* such as metadata details, scripts, dependencies, and configuration settings in a logical
|
|
11
|
+
* and organized manner.
|
|
12
|
+
*
|
|
13
|
+
* Complex logic explanation:
|
|
14
|
+
* - The list starts with high-level metadata properties such as 'publisher', 'name', 'description',
|
|
15
|
+
* and 'version', which are typically the primary identifiers of the package.
|
|
16
|
+
* - After the initial metadata, configuration and module-related fields like 'type', 'private',
|
|
17
|
+
* and 'author' are listed to group related attributes together.
|
|
18
|
+
* - Dependency-related fields are grouped towards the end, including 'dependencies', 'devDependencies',
|
|
19
|
+
* and 'optionalDependencies'.
|
|
20
|
+
* - Special configurations and overrides, such as 'resolutions' and 'overrides', are at the end
|
|
21
|
+
* to keep the file manageable and to separate primary package information from auxiliary settings.
|
|
22
|
+
*
|
|
23
|
+
* @type {string[]}
|
|
24
|
+
*
|
|
25
|
+
* @returns {string[]} Returns the package.json sort order
|
|
26
|
+
*/
|
|
27
|
+
const PACKAGE_SORT_ORDER = [
|
|
28
|
+
"publisher",
|
|
29
|
+
"name",
|
|
30
|
+
"displayName",
|
|
31
|
+
"description",
|
|
32
|
+
"version",
|
|
33
|
+
"type",
|
|
34
|
+
"private",
|
|
35
|
+
"author",
|
|
36
|
+
"contributors",
|
|
37
|
+
"license",
|
|
38
|
+
"funding",
|
|
39
|
+
"homepage",
|
|
40
|
+
"repository",
|
|
41
|
+
"bugs",
|
|
42
|
+
"keywords",
|
|
43
|
+
"categories",
|
|
44
|
+
"sideEffects",
|
|
45
|
+
"exports",
|
|
46
|
+
"main",
|
|
47
|
+
"module",
|
|
48
|
+
"unpkg",
|
|
49
|
+
"jsdelivr",
|
|
50
|
+
"types",
|
|
51
|
+
"typesVersions",
|
|
52
|
+
"bin",
|
|
53
|
+
"icon",
|
|
54
|
+
"files",
|
|
55
|
+
"browserslist",
|
|
56
|
+
"engines",
|
|
57
|
+
"engineStrict",
|
|
58
|
+
"packageManager",
|
|
59
|
+
"publishConfig",
|
|
60
|
+
"activationEvents",
|
|
61
|
+
"contributes",
|
|
62
|
+
"scripts",
|
|
63
|
+
"dependencies",
|
|
64
|
+
"devDependencies",
|
|
65
|
+
"optionalDependencies",
|
|
66
|
+
"peerDependencies",
|
|
67
|
+
"peerDependenciesMeta",
|
|
68
|
+
"pnpm",
|
|
69
|
+
"overrides",
|
|
70
|
+
"resolutions",
|
|
71
|
+
"husky",
|
|
72
|
+
"simple-git-hooks",
|
|
73
|
+
"lint-staged",
|
|
74
|
+
"eslintConfig",
|
|
75
|
+
"prettier"
|
|
76
|
+
];
|
|
77
|
+
/**
|
|
78
|
+
* PACKAGE_EXPORTS_SORT_ORDER
|
|
79
|
+
*
|
|
80
|
+
* Specifies the order in which package.json exports should appear.
|
|
81
|
+
*
|
|
82
|
+
* This array establishes a preferred sequence to maintain consistency and readability
|
|
83
|
+
* when managing package.json exports in JavaScript projects.
|
|
84
|
+
*
|
|
85
|
+
* @type {string[]}
|
|
86
|
+
*
|
|
87
|
+
* @returns {string[]} Returns the package.json exports sort order
|
|
88
|
+
*/
|
|
89
|
+
const PACKAGE_EXPORTS_SORT_ORDER = [
|
|
90
|
+
"types",
|
|
91
|
+
"node-addons",
|
|
92
|
+
"node",
|
|
93
|
+
"browser",
|
|
94
|
+
"import",
|
|
95
|
+
"require",
|
|
96
|
+
"development",
|
|
97
|
+
"production",
|
|
98
|
+
"default"
|
|
99
|
+
];
|
|
100
|
+
/**
|
|
101
|
+
* packageSortOrder
|
|
102
|
+
*
|
|
103
|
+
* @type {string[]}
|
|
104
|
+
*
|
|
105
|
+
* @deprecated Use PACKAGE_SORT_ORDER instead
|
|
106
|
+
*
|
|
107
|
+
* @returns {string[]} Returns the package.json sort order
|
|
108
|
+
*/
|
|
109
|
+
const packageSortOrder = PACKAGE_SORT_ORDER;
|
|
110
|
+
/**
|
|
111
|
+
* packageExportsSortOrder
|
|
112
|
+
*
|
|
113
|
+
* @type {string[]}
|
|
114
|
+
*
|
|
115
|
+
* @deprecated Use PACKAGE_EXPORTS_SORT_ORDER instead
|
|
116
|
+
*
|
|
117
|
+
* @returns {string[]} Returns the package.json exports sort order
|
|
118
|
+
*/
|
|
119
|
+
const packageExportsSortOrder = PACKAGE_EXPORTS_SORT_ORDER;
|
|
120
|
+
export { packageSortOrder as a, packageExportsSortOrder as i, PACKAGE_NAME as n, PACKAGE_SORT_ORDER as r, PACKAGE_EXPORTS_SORT_ORDER as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -23851,32 +23851,6 @@ export declare function shadcn(options?: {
|
|
|
23851
23851
|
vue?: boolean;
|
|
23852
23852
|
} & OptionsOverrides & OptionsShadcn): Promise<TypedFlatConfigItem[]>;
|
|
23853
23853
|
export declare function solid(options?: OptionsFiles & OptionsHasTypeScript & OptionsOverrides & OptionsTypeScriptWithTypes): Promise<TypedFlatConfigItem[]>;
|
|
23854
|
-
/**
|
|
23855
|
-
* packageSortOrder
|
|
23856
|
-
*
|
|
23857
|
-
* Specifies the order in which package.json properties should appear.
|
|
23858
|
-
*
|
|
23859
|
-
* This array establishes a preferred sequence to maintain consistency and readability
|
|
23860
|
-
* when managing package.json files in JavaScript projects. It categorizes common properties
|
|
23861
|
-
* such as metadata details, scripts, dependencies, and configuration settings in a logical
|
|
23862
|
-
* and organized manner.
|
|
23863
|
-
*
|
|
23864
|
-
* Complex logic explanation:
|
|
23865
|
-
* - The list starts with high-level metadata properties such as 'publisher', 'name', 'description',
|
|
23866
|
-
* and 'version', which are typically the primary identifiers of the package.
|
|
23867
|
-
* - After the initial metadata, configuration and module-related fields like 'type', 'private',
|
|
23868
|
-
* and 'author' are listed to group related attributes together.
|
|
23869
|
-
* - Dependency-related fields are grouped towards the end, including 'dependencies', 'devDependencies',
|
|
23870
|
-
* and 'optionalDependencies'.
|
|
23871
|
-
* - Special configurations and overrides, such as 'resolutions' and 'overrides', are at the end
|
|
23872
|
-
* to keep the file manageable and to separate primary package information from auxiliary settings.
|
|
23873
|
-
*
|
|
23874
|
-
* @type {string[]}
|
|
23875
|
-
*
|
|
23876
|
-
* @returns {string[]} Returns the package.json sort order
|
|
23877
|
-
*/
|
|
23878
|
-
export declare const packageSortOrder: string[];
|
|
23879
|
-
export declare const packageExportsSortOrder: string[];
|
|
23880
23854
|
/**
|
|
23881
23855
|
* Sort package.json
|
|
23882
23856
|
*
|
|
@@ -23913,6 +23887,64 @@ export declare function unocss(options?: OptionsUnoCSS): Promise<TypedFlatConfig
|
|
|
23913
23887
|
export declare function vue(options?: OptionsFiles & OptionsHasTypeScript & OptionsOverrides & OptionsStylistic & OptionsVue): Promise<TypedFlatConfigItem[]>;
|
|
23914
23888
|
export declare function yaml(options?: OptionsFiles & OptionsOverrides & OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
23915
23889
|
export declare const PACKAGE_NAME: "@infernodesign/eslint-config";
|
|
23890
|
+
/**
|
|
23891
|
+
* PACKAGE_SORT_ORDER
|
|
23892
|
+
*
|
|
23893
|
+
* Specifies the order in which package.json properties should appear.
|
|
23894
|
+
*
|
|
23895
|
+
* This array establishes a preferred sequence to maintain consistency and readability
|
|
23896
|
+
* when managing package.json files in JavaScript projects. It categorizes common properties
|
|
23897
|
+
* such as metadata details, scripts, dependencies, and configuration settings in a logical
|
|
23898
|
+
* and organized manner.
|
|
23899
|
+
*
|
|
23900
|
+
* Complex logic explanation:
|
|
23901
|
+
* - The list starts with high-level metadata properties such as 'publisher', 'name', 'description',
|
|
23902
|
+
* and 'version', which are typically the primary identifiers of the package.
|
|
23903
|
+
* - After the initial metadata, configuration and module-related fields like 'type', 'private',
|
|
23904
|
+
* and 'author' are listed to group related attributes together.
|
|
23905
|
+
* - Dependency-related fields are grouped towards the end, including 'dependencies', 'devDependencies',
|
|
23906
|
+
* and 'optionalDependencies'.
|
|
23907
|
+
* - Special configurations and overrides, such as 'resolutions' and 'overrides', are at the end
|
|
23908
|
+
* to keep the file manageable and to separate primary package information from auxiliary settings.
|
|
23909
|
+
*
|
|
23910
|
+
* @type {string[]}
|
|
23911
|
+
*
|
|
23912
|
+
* @returns {string[]} Returns the package.json sort order
|
|
23913
|
+
*/
|
|
23914
|
+
export declare const PACKAGE_SORT_ORDER: string[];
|
|
23915
|
+
/**
|
|
23916
|
+
* PACKAGE_EXPORTS_SORT_ORDER
|
|
23917
|
+
*
|
|
23918
|
+
* Specifies the order in which package.json exports should appear.
|
|
23919
|
+
*
|
|
23920
|
+
* This array establishes a preferred sequence to maintain consistency and readability
|
|
23921
|
+
* when managing package.json exports in JavaScript projects.
|
|
23922
|
+
*
|
|
23923
|
+
* @type {string[]}
|
|
23924
|
+
*
|
|
23925
|
+
* @returns {string[]} Returns the package.json exports sort order
|
|
23926
|
+
*/
|
|
23927
|
+
export declare const PACKAGE_EXPORTS_SORT_ORDER: string[];
|
|
23928
|
+
/**
|
|
23929
|
+
* packageSortOrder
|
|
23930
|
+
*
|
|
23931
|
+
* @type {string[]}
|
|
23932
|
+
*
|
|
23933
|
+
* @deprecated Use PACKAGE_SORT_ORDER instead
|
|
23934
|
+
*
|
|
23935
|
+
* @returns {string[]} Returns the package.json sort order
|
|
23936
|
+
*/
|
|
23937
|
+
export declare const packageSortOrder: string[];
|
|
23938
|
+
/**
|
|
23939
|
+
* packageExportsSortOrder
|
|
23940
|
+
*
|
|
23941
|
+
* @type {string[]}
|
|
23942
|
+
*
|
|
23943
|
+
* @deprecated Use PACKAGE_EXPORTS_SORT_ORDER instead
|
|
23944
|
+
*
|
|
23945
|
+
* @returns {string[]} Returns the package.json exports sort order
|
|
23946
|
+
*/
|
|
23947
|
+
export declare const packageExportsSortOrder: string[];
|
|
23916
23948
|
export declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
23917
23949
|
export declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
23918
23950
|
export declare const GLOB_JS = "**/*.?([cm])js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as packageSortOrder, i as packageExportsSortOrder, n as PACKAGE_NAME, r as PACKAGE_SORT_ORDER, t as PACKAGE_EXPORTS_SORT_ORDER } from "./constants-CZLDK59m.js";
|
|
2
2
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
3
|
import process$1 from "node:process";
|
|
4
4
|
import fsPromises from "node:fs/promises";
|
|
@@ -2082,91 +2082,6 @@ async function solid(options = {}) {
|
|
|
2082
2082
|
}
|
|
2083
2083
|
// src/configs/sort.ts
|
|
2084
2084
|
/**
|
|
2085
|
-
* packageSortOrder
|
|
2086
|
-
*
|
|
2087
|
-
* Specifies the order in which package.json properties should appear.
|
|
2088
|
-
*
|
|
2089
|
-
* This array establishes a preferred sequence to maintain consistency and readability
|
|
2090
|
-
* when managing package.json files in JavaScript projects. It categorizes common properties
|
|
2091
|
-
* such as metadata details, scripts, dependencies, and configuration settings in a logical
|
|
2092
|
-
* and organized manner.
|
|
2093
|
-
*
|
|
2094
|
-
* Complex logic explanation:
|
|
2095
|
-
* - The list starts with high-level metadata properties such as 'publisher', 'name', 'description',
|
|
2096
|
-
* and 'version', which are typically the primary identifiers of the package.
|
|
2097
|
-
* - After the initial metadata, configuration and module-related fields like 'type', 'private',
|
|
2098
|
-
* and 'author' are listed to group related attributes together.
|
|
2099
|
-
* - Dependency-related fields are grouped towards the end, including 'dependencies', 'devDependencies',
|
|
2100
|
-
* and 'optionalDependencies'.
|
|
2101
|
-
* - Special configurations and overrides, such as 'resolutions' and 'overrides', are at the end
|
|
2102
|
-
* to keep the file manageable and to separate primary package information from auxiliary settings.
|
|
2103
|
-
*
|
|
2104
|
-
* @type {string[]}
|
|
2105
|
-
*
|
|
2106
|
-
* @returns {string[]} Returns the package.json sort order
|
|
2107
|
-
*/
|
|
2108
|
-
const packageSortOrder = [
|
|
2109
|
-
"publisher",
|
|
2110
|
-
"name",
|
|
2111
|
-
"displayName",
|
|
2112
|
-
"description",
|
|
2113
|
-
"version",
|
|
2114
|
-
"type",
|
|
2115
|
-
"private",
|
|
2116
|
-
"author",
|
|
2117
|
-
"contributors",
|
|
2118
|
-
"license",
|
|
2119
|
-
"funding",
|
|
2120
|
-
"homepage",
|
|
2121
|
-
"repository",
|
|
2122
|
-
"bugs",
|
|
2123
|
-
"keywords",
|
|
2124
|
-
"categories",
|
|
2125
|
-
"sideEffects",
|
|
2126
|
-
"exports",
|
|
2127
|
-
"main",
|
|
2128
|
-
"module",
|
|
2129
|
-
"unpkg",
|
|
2130
|
-
"jsdelivr",
|
|
2131
|
-
"types",
|
|
2132
|
-
"typesVersions",
|
|
2133
|
-
"bin",
|
|
2134
|
-
"icon",
|
|
2135
|
-
"files",
|
|
2136
|
-
"browserslist",
|
|
2137
|
-
"engines",
|
|
2138
|
-
"engineStrict",
|
|
2139
|
-
"packageManager",
|
|
2140
|
-
"publishConfig",
|
|
2141
|
-
"activationEvents",
|
|
2142
|
-
"contributes",
|
|
2143
|
-
"scripts",
|
|
2144
|
-
"dependencies",
|
|
2145
|
-
"devDependencies",
|
|
2146
|
-
"optionalDependencies",
|
|
2147
|
-
"peerDependencies",
|
|
2148
|
-
"peerDependenciesMeta",
|
|
2149
|
-
"pnpm",
|
|
2150
|
-
"overrides",
|
|
2151
|
-
"resolutions",
|
|
2152
|
-
"husky",
|
|
2153
|
-
"simple-git-hooks",
|
|
2154
|
-
"lint-staged",
|
|
2155
|
-
"eslintConfig",
|
|
2156
|
-
"prettier"
|
|
2157
|
-
];
|
|
2158
|
-
const packageExportsSortOrder = [
|
|
2159
|
-
"types",
|
|
2160
|
-
"node-addons",
|
|
2161
|
-
"node",
|
|
2162
|
-
"browser",
|
|
2163
|
-
"import",
|
|
2164
|
-
"require",
|
|
2165
|
-
"development",
|
|
2166
|
-
"production",
|
|
2167
|
-
"default"
|
|
2168
|
-
];
|
|
2169
|
-
/**
|
|
2170
2085
|
* Sort package.json
|
|
2171
2086
|
*
|
|
2172
2087
|
* Requires `jsonc` config
|
|
@@ -2183,7 +2098,7 @@ async function sortPackageJson() {
|
|
|
2183
2098
|
"jsonc/sort-keys": [
|
|
2184
2099
|
"error",
|
|
2185
2100
|
{
|
|
2186
|
-
order:
|
|
2101
|
+
order: PACKAGE_SORT_ORDER,
|
|
2187
2102
|
pathPattern: "^$"
|
|
2188
2103
|
},
|
|
2189
2104
|
{
|
|
@@ -2203,7 +2118,7 @@ async function sortPackageJson() {
|
|
|
2203
2118
|
pathPattern: "^workspaces\\.catalogs\\.[^.]+$"
|
|
2204
2119
|
},
|
|
2205
2120
|
{
|
|
2206
|
-
order:
|
|
2121
|
+
order: PACKAGE_EXPORTS_SORT_ORDER,
|
|
2207
2122
|
pathPattern: "^exports.*$"
|
|
2208
2123
|
},
|
|
2209
2124
|
{
|
|
@@ -3610,4 +3525,4 @@ const CONFIG_PRESET_FULL_OFF = {
|
|
|
3610
3525
|
vue: false,
|
|
3611
3526
|
yaml: false
|
|
3612
3527
|
};
|
|
3613
|
-
export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SANITY, GLOB_SCSS, GLOB_SEARCH_EXCLUDE, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, PACKAGE_NAME, StylisticConfigDefaults, astro, combine, command, comments, config, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, medusa, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sanity, shadcn, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
3528
|
+
export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SANITY, GLOB_SCSS, GLOB_SEARCH_EXCLUDE, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, PACKAGE_EXPORTS_SORT_ORDER, PACKAGE_NAME, PACKAGE_SORT_ORDER, StylisticConfigDefaults, astro, combine, command, comments, config, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, medusa, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sanity, shadcn, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
package/package.json
CHANGED