@html-validate/eslint-config-typescript 9.16.2 → 9.17.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/index.d.mts ADDED
@@ -0,0 +1,5 @@
1
+ import { Linter } from "eslint";
2
+
3
+ declare const config: (config?: Linter.Config) => Linter.Config;
4
+
5
+ export default config;
package/index.mjs CHANGED
@@ -14,6 +14,19 @@ function defineConfig(config) {
14
14
  return config;
15
15
  }
16
16
 
17
+ /**
18
+ * @param {Config} a
19
+ * @param {Config} b
20
+ * @returns {Config}
21
+ */
22
+ function merge(a, b) {
23
+ return {
24
+ ...a,
25
+ ...b,
26
+ rules: { ...a.rules, ...b.rules },
27
+ };
28
+ }
29
+
17
30
  function flatten(result, it) {
18
31
  return {
19
32
  ...result,
@@ -42,18 +55,24 @@ const stylistic = tseConfig.stylistic.reduce(flatten, {});
42
55
  /** @type {Config} */
43
56
  const importConfig = importX.flatConfigs.typescript;
44
57
 
45
- export default defineConfig({
58
+ const defaultConfig = defineConfig({
59
+ name: "@html-validate/eslint-config-typescript",
60
+ files: ["**/*.{ts,cts,mts}"],
61
+
46
62
  languageOptions: {
47
63
  parser: tseParser,
48
64
  sourceType: "module",
49
65
  },
66
+
50
67
  plugins: {
51
68
  "@typescript-eslint": tsePlugin,
52
69
  tsdoc: tsdocPlugin,
53
70
  },
71
+
54
72
  settings: {
55
73
  ...importConfig.settings,
56
74
  },
75
+
57
76
  rules: {
58
77
  ...strict.rules,
59
78
  ...stylistic.rules,
@@ -133,3 +152,10 @@ export default defineConfig({
133
152
  "off" /* @typescript-eslint/prefer-string-starts-ends-with */,
134
153
  },
135
154
  });
155
+
156
+ /**
157
+ * @param {Config} [override]
158
+ * @returns {Config}
159
+ */
160
+ const config = (override) => merge(defaultConfig, override ?? {});
161
+ export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/eslint-config-typescript",
3
- "version": "9.16.2",
3
+ "version": "9.17.0",
4
4
  "description": "Eslint sharable config used by the various HTML-validate packages",
5
5
  "keywords": [
6
6
  "eslint",
@@ -21,7 +21,7 @@
21
21
  "main": "index.mjs",
22
22
  "files": [
23
23
  "index.mjs",
24
- "index.d.ts"
24
+ "index.d.mts"
25
25
  ],
26
26
  "scripts": {
27
27
  "prepack": "release-prepack --retain-scripts",
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "a8e7a32c4adce29e3277aa419a5a3227950ad25e"
46
+ "gitHead": "e6b5a6d80111c3de4ef5bfbe63f3844d4500caff"
47
47
  }
package/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { Linter } from "eslint";
2
-
3
- declare const config: Linter.Config;
4
-
5
- export default config;