@html-validate/eslint-config-typescript-typeinfo 9.16.3 → 9.17.1
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/index.d.mts +1 -1
- package/index.mjs +34 -1
- package/package.json +2 -2
package/index.d.mts
CHANGED
package/index.mjs
CHANGED
|
@@ -12,6 +12,20 @@ function defineConfig(config) {
|
|
|
12
12
|
return config;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @param {Config} a
|
|
17
|
+
* @param {Config} b
|
|
18
|
+
* @returns {Config}
|
|
19
|
+
*/
|
|
20
|
+
function merge(a, b) {
|
|
21
|
+
return {
|
|
22
|
+
...a,
|
|
23
|
+
...b,
|
|
24
|
+
languageOptions: { ...a.languageOptions, ...b.languageOptions },
|
|
25
|
+
rules: { ...a.rules, ...b.rules },
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
15
29
|
function flatten(result, it) {
|
|
16
30
|
return {
|
|
17
31
|
rules: {
|
|
@@ -27,7 +41,14 @@ const strict = tseConfig.strictTypeCheckedOnly.reduce(flatten, {});
|
|
|
27
41
|
/** @type {Config} */
|
|
28
42
|
const stylistic = tseConfig.stylisticTypeCheckedOnly.reduce(flatten, {});
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
const defaultConfig = defineConfig({
|
|
45
|
+
name: "@html-validate/eslint-config-typeinfo",
|
|
46
|
+
files: ["src/**/*.{ts,cts,mts}"],
|
|
47
|
+
languageOptions: {
|
|
48
|
+
parserOptions: {
|
|
49
|
+
projectService: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
31
52
|
rules: {
|
|
32
53
|
...strict.rules,
|
|
33
54
|
...stylistic.rules,
|
|
@@ -122,3 +143,15 @@ export default defineConfig({
|
|
|
122
143
|
"import-x/no-deprecated": "off",
|
|
123
144
|
},
|
|
124
145
|
});
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @param {string} tsconfigRootDir
|
|
149
|
+
* @param {Config} [override]
|
|
150
|
+
* @returns {Config}
|
|
151
|
+
*/
|
|
152
|
+
const config = (tsconfigrootDir, override) => {
|
|
153
|
+
const merged = merge(defaultConfig, override ?? {});
|
|
154
|
+
merged.languageOptions.parserOptions.tsconfigRootDir = tsconfigrootDir;
|
|
155
|
+
return merged;
|
|
156
|
+
};
|
|
157
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@html-validate/eslint-config-typescript-typeinfo",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.17.1",
|
|
4
4
|
"description": "Eslint sharable config used by the various HTML-validate packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "2d7141ef6d076cdd091a61b29fc154ff02d60823"
|
|
45
45
|
}
|