@octohash/eslint-config 0.2.4 → 0.2.5
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.d.mts +20 -13
- package/dist/index.mjs +2 -6
- package/package.json +19 -13
package/dist/index.d.mts
CHANGED
|
@@ -201,7 +201,7 @@ interface JSONSchema4 {
|
|
|
201
201
|
format?: string | undefined;
|
|
202
202
|
}
|
|
203
203
|
//#endregion
|
|
204
|
-
//#region node_modules/.pnpm/@eslint+core@1.1.
|
|
204
|
+
//#region node_modules/.pnpm/@eslint+core@1.1.1/node_modules/@eslint/core/dist/esm/types.d.ts
|
|
205
205
|
/**
|
|
206
206
|
* Represents an error inside of a file.
|
|
207
207
|
*/
|
|
@@ -528,7 +528,7 @@ type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit
|
|
|
528
528
|
* Data that can be used to fill placeholders in error messages.
|
|
529
529
|
*/
|
|
530
530
|
type MessagePlaceholderData = Record<string, string | number | boolean | bigint | null | undefined>;
|
|
531
|
-
interface ViolationReportBase {
|
|
531
|
+
interface ViolationReportBase<MessageIds extends string = string> {
|
|
532
532
|
/**
|
|
533
533
|
* The data to insert into the message.
|
|
534
534
|
*/
|
|
@@ -541,9 +541,9 @@ interface ViolationReportBase {
|
|
|
541
541
|
* An array of suggested fixes for the problem. These fixes may change the
|
|
542
542
|
* behavior of the code, so they are not applied automatically.
|
|
543
543
|
*/
|
|
544
|
-
suggest?: SuggestedEdit[] | null | undefined;
|
|
544
|
+
suggest?: SuggestedEdit<MessageIds>[] | null | undefined;
|
|
545
545
|
}
|
|
546
|
-
type ViolationMessage<MessageIds = string> = {
|
|
546
|
+
type ViolationMessage<MessageIds extends string = string> = {
|
|
547
547
|
message: string;
|
|
548
548
|
} | {
|
|
549
549
|
messageId: MessageIds;
|
|
@@ -553,7 +553,7 @@ type ViolationLocation<Node> = {
|
|
|
553
553
|
} | {
|
|
554
554
|
node: Node;
|
|
555
555
|
};
|
|
556
|
-
type ViolationReport<Node = unknown, MessageIds = string> = ViolationReportBase & ViolationMessage<MessageIds> & ViolationLocation<Node>;
|
|
556
|
+
type ViolationReport<Node = unknown, MessageIds extends string = string> = ViolationReportBase<MessageIds> & ViolationMessage<MessageIds> & ViolationLocation<Node>;
|
|
557
557
|
interface SuggestedEditBase {
|
|
558
558
|
/**
|
|
559
559
|
* The data to insert into the message.
|
|
@@ -564,15 +564,15 @@ interface SuggestedEditBase {
|
|
|
564
564
|
*/
|
|
565
565
|
fix: RuleFixer;
|
|
566
566
|
}
|
|
567
|
-
type SuggestionMessage = {
|
|
567
|
+
type SuggestionMessage<MessageIds extends string = string> = {
|
|
568
568
|
desc: string;
|
|
569
569
|
} | {
|
|
570
|
-
messageId:
|
|
570
|
+
messageId: MessageIds;
|
|
571
571
|
};
|
|
572
572
|
/**
|
|
573
573
|
* A suggested edit for a rule violation.
|
|
574
574
|
*/
|
|
575
|
-
type SuggestedEdit = SuggestedEditBase & SuggestionMessage
|
|
575
|
+
type SuggestedEdit<MessageIds extends string = string> = SuggestedEditBase & SuggestionMessage<MessageIds>;
|
|
576
576
|
/**
|
|
577
577
|
* The normalized version of a lint suggestion.
|
|
578
578
|
*/
|
|
@@ -1300,19 +1300,26 @@ interface Directive {
|
|
|
1300
1300
|
justification?: string;
|
|
1301
1301
|
}
|
|
1302
1302
|
//#endregion
|
|
1303
|
-
//#region node_modules/.pnpm/@eslint+config-helpers@0.5.
|
|
1303
|
+
//#region node_modules/.pnpm/@eslint+config-helpers@0.5.3/node_modules/@eslint/config-helpers/dist/esm/types.d.ts
|
|
1304
1304
|
/**
|
|
1305
1305
|
* Infinite array type.
|
|
1306
1306
|
*/
|
|
1307
1307
|
type InfiniteArray<T> = T | InfiniteArray<T>[];
|
|
1308
|
+
/**
|
|
1309
|
+
* A config object that may appear inside of `extends`.
|
|
1310
|
+
* `basePath` and nested `extends` are not allowed on extension config objects.
|
|
1311
|
+
*/
|
|
1312
|
+
type ExtensionConfigObject = Omit<ConfigObject, "basePath"> & {
|
|
1313
|
+
extends?: never;
|
|
1314
|
+
};
|
|
1308
1315
|
/**
|
|
1309
1316
|
* The type of array element in the `extends` property after flattening.
|
|
1310
1317
|
*/
|
|
1311
|
-
type SimpleExtendsElement = string |
|
|
1318
|
+
type SimpleExtendsElement = string | ExtensionConfigObject;
|
|
1312
1319
|
/**
|
|
1313
1320
|
* The type of array element in the `extends` property before flattening.
|
|
1314
1321
|
*/
|
|
1315
|
-
type ExtendsElement = SimpleExtendsElement | InfiniteArray<
|
|
1322
|
+
type ExtendsElement = SimpleExtendsElement | InfiniteArray<ExtensionConfigObject>;
|
|
1316
1323
|
/**
|
|
1317
1324
|
* Config with extends. Valid only inside of `defineConfig()`.
|
|
1318
1325
|
*/
|
|
@@ -1320,10 +1327,10 @@ interface ConfigWithExtends$1 extends ConfigObject {
|
|
|
1320
1327
|
extends?: ExtendsElement[];
|
|
1321
1328
|
}
|
|
1322
1329
|
//#endregion
|
|
1323
|
-
//#region node_modules/.pnpm/@eslint+config-helpers@0.5.
|
|
1330
|
+
//#region node_modules/.pnpm/@eslint+config-helpers@0.5.3/node_modules/@eslint/config-helpers/dist/esm/index.d.ts
|
|
1324
1331
|
type ConfigWithExtends = ConfigWithExtends$1;
|
|
1325
1332
|
//#endregion
|
|
1326
|
-
//#region node_modules/.pnpm/eslint-flat-config-utils@3.0.
|
|
1333
|
+
//#region node_modules/.pnpm/eslint-flat-config-utils@3.0.2/node_modules/eslint-flat-config-utils/dist/index.d.mts
|
|
1327
1334
|
/**
|
|
1328
1335
|
* A type that can be awaited. Promise<T> or T.
|
|
1329
1336
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import antfu, { GLOB_HTML, GLOB_SRC, GLOB_VUE, ensurePackages, interopDefault } from "@antfu/eslint-config";
|
|
2
2
|
import catalogsSort, { configs } from "eslint-plugin-catalogs-sort";
|
|
3
3
|
import { getPackageInfo } from "local-pkg";
|
|
4
|
-
|
|
5
4
|
//#region src/configs/octohash.ts
|
|
6
5
|
async function octohash() {
|
|
7
6
|
return [{
|
|
@@ -12,7 +11,6 @@ async function octohash() {
|
|
|
12
11
|
}
|
|
13
12
|
}];
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
//#endregion
|
|
17
15
|
//#region src/configs/sort.ts
|
|
18
16
|
async function sortPackageJson() {
|
|
@@ -72,6 +70,7 @@ async function sortPackageJson() {
|
|
|
72
70
|
"husky",
|
|
73
71
|
"simple-git-hooks",
|
|
74
72
|
"lint-staged",
|
|
73
|
+
"nano-staged",
|
|
75
74
|
"eslintConfig"
|
|
76
75
|
],
|
|
77
76
|
pathPattern: "^$"
|
|
@@ -113,7 +112,6 @@ async function sortPackageJson() {
|
|
|
113
112
|
...configs.recommended
|
|
114
113
|
];
|
|
115
114
|
}
|
|
116
|
-
|
|
117
115
|
//#endregion
|
|
118
116
|
//#region src/configs/tailwindcss.ts
|
|
119
117
|
async function tailwindcss(options = {}) {
|
|
@@ -147,7 +145,6 @@ async function tailwindcss(options = {}) {
|
|
|
147
145
|
settings: { "better-tailwindcss": settings }
|
|
148
146
|
}];
|
|
149
147
|
}
|
|
150
|
-
|
|
151
148
|
//#endregion
|
|
152
149
|
//#region src/index.ts
|
|
153
150
|
function defineConfig(options, ...userConfigs) {
|
|
@@ -165,6 +162,5 @@ function mergeOptions(options) {
|
|
|
165
162
|
formatters
|
|
166
163
|
};
|
|
167
164
|
}
|
|
168
|
-
|
|
169
165
|
//#endregion
|
|
170
|
-
export { defineConfig };
|
|
166
|
+
export { defineConfig };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octohash/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"description": "Personal ESLint config based on @antfu/eslint-config with opinionated extensions.",
|
|
6
6
|
"author": "jinghaihan",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,34 +38,40 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@antfu/eslint-config": "^7.
|
|
41
|
+
"@antfu/eslint-config": "^7.7.0",
|
|
42
42
|
"eslint-plugin-catalogs-sort": "^0.0.0-alpha.0",
|
|
43
43
|
"find-up-simple": "^1.0.1",
|
|
44
44
|
"local-pkg": "^1.1.2",
|
|
45
45
|
"pathe": "^2.0.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"tsdown": "^0.
|
|
48
|
+
"tsdown": "^0.21.2",
|
|
49
49
|
"@octohash/tsconfig": "^0.2.0",
|
|
50
50
|
"bumpp": "^10.4.1",
|
|
51
|
-
"
|
|
51
|
+
"nano-staged": "^0.9.0",
|
|
52
|
+
"pncat": "^0.10.4",
|
|
52
53
|
"simple-git-hooks": "^2.13.1",
|
|
53
|
-
"taze": "^19.
|
|
54
|
+
"taze": "^19.10.0",
|
|
54
55
|
"typescript": "^5.9.3",
|
|
55
|
-
"eslint": "^10.0.
|
|
56
|
-
"eslint-flat-config-utils": "^3.0.
|
|
57
|
-
"eslint-plugin-better-tailwindcss": "^4.3.
|
|
58
|
-
"lint-staged": "^16.2.7",
|
|
56
|
+
"eslint": "^10.0.3",
|
|
57
|
+
"eslint-flat-config-utils": "^3.0.2",
|
|
58
|
+
"eslint-plugin-better-tailwindcss": "^4.3.2",
|
|
59
59
|
"vitest": "^4.0.18",
|
|
60
|
-
"@types/node": "^25.
|
|
61
|
-
"@octohash/eslint-config": "0.2.
|
|
60
|
+
"@types/node": "^25.4.0",
|
|
61
|
+
"@octohash/eslint-config": "0.2.5"
|
|
62
62
|
},
|
|
63
63
|
"simple-git-hooks": {
|
|
64
|
-
"pre-commit": "pnpm
|
|
64
|
+
"pre-commit": "pnpm nano-staged"
|
|
65
65
|
},
|
|
66
|
-
"
|
|
66
|
+
"nano-staged": {
|
|
67
67
|
"*": "eslint --fix"
|
|
68
68
|
},
|
|
69
|
+
"inlinedDependencies": {
|
|
70
|
+
"@types/json-schema": "7.0.15",
|
|
71
|
+
"@eslint/core": "1.1.1",
|
|
72
|
+
"@eslint/config-helpers": "0.5.3",
|
|
73
|
+
"eslint-flat-config-utils": "3.0.2"
|
|
74
|
+
},
|
|
69
75
|
"scripts": {
|
|
70
76
|
"build": "tsdown",
|
|
71
77
|
"typecheck": "tsc",
|