@html-validate/eslint-config-vitest 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
@@ -12,10 +12,28 @@ 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
+ rules: { ...a.rules, ...b.rules },
25
+ };
26
+ }
27
+
15
28
  const { configs } = vitest;
16
29
 
17
- export default defineConfig({
30
+ const defaultConfig = defineConfig({
31
+ name: "@html-validate/eslint-config-vitest",
32
+ files: ["**/*.spec.[jt]s"],
33
+ ignores: ["cypress/**", "tests/e2e/**"],
34
+
18
35
  plugins: { vitest },
36
+
19
37
  rules: {
20
38
  ...configs.recommended.rules,
21
39
 
@@ -87,3 +105,10 @@ export default defineConfig({
87
105
  "unicorn/no-top-level-assignment-in-function": "off", // variables are often assigned from {beforeEach,beforeAll} */
88
106
  },
89
107
  });
108
+
109
+ /**
110
+ * @param {Config} [override]
111
+ * @returns {Config}
112
+ */
113
+ const config = (override) => merge(defaultConfig, override ?? {});
114
+ export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/eslint-config-vitest",
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",
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "a8e7a32c4adce29e3277aa419a5a3227950ad25e"
44
+ "gitHead": "e6b5a6d80111c3de4ef5bfbe63f3844d4500caff"
45
45
  }
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;