@html-validate/eslint-config-vue 5.28.0 → 6.0.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.
Files changed (3) hide show
  1. package/index.mjs +32 -15
  2. package/package.json +5 -4
  3. package/legacy.cjs +0 -9
package/index.mjs CHANGED
@@ -1,20 +1,37 @@
1
- import { fileURLToPath } from "node:url";
2
- import path from "node:path";
3
- import { FlatCompat } from "@eslint/eslintrc";
4
- import legacyConfig from "./legacy.cjs";
1
+ import eslintConfigPrettier from "eslint-config-prettier";
2
+ import eslintPluginVue from "eslint-plugin-vue";
5
3
 
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = path.dirname(__filename);
8
-
9
- const compat = new FlatCompat({
10
- baseDirectory: __dirname,
11
- resolvePluginsRelativeTo: __dirname,
12
- });
4
+ function filterRules(rules, predicate) {
5
+ return Object.fromEntries(Object.entries(rules).filter(([key]) => predicate(key)));
6
+ }
13
7
 
14
- const migrated = compat.config(legacyConfig);
8
+ /**
9
+ * @typedef {import("eslint").Linter.Config} Config
10
+ */
15
11
 
16
- for (const ruleset of migrated) {
17
- ruleset.files = ["**/*.vue"];
12
+ /**
13
+ * @param {Config} config
14
+ * @returns {Config}
15
+ */
16
+ function defineConfig(config) {
17
+ return config;
18
18
  }
19
19
 
20
- export default migrated;
20
+ const recommended = eslintPluginVue.configs["flat/recommended"][1];
21
+
22
+ export default defineConfig({
23
+ languageOptions: {
24
+ parser: recommended.languageOptions.parser,
25
+ },
26
+
27
+ processor: eslintPluginVue.processors.vue,
28
+
29
+ plugins: {
30
+ vue: eslintPluginVue,
31
+ },
32
+
33
+ rules: {
34
+ ...recommended.rules,
35
+ ...filterRules(eslintConfigPrettier.rules, (rule) => rule.startsWith("vue/")),
36
+ },
37
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/eslint-config-vue",
3
- "version": "5.28.0",
3
+ "version": "6.0.0",
4
4
  "description": "Eslint sharable config used by the various HTML-validate packages",
5
5
  "keywords": [
6
6
  "eslint",
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "license": "MIT",
19
19
  "author": "David Sveningsson <ext@sidvind.com>",
20
+ "type": "module",
20
21
  "main": "index.mjs",
21
22
  "files": [
22
23
  "*.cjs",
@@ -28,11 +29,11 @@
28
29
  "prepublishOnly": "release-prepublish --retain-scripts"
29
30
  },
30
31
  "dependencies": {
31
- "@eslint/eslintrc": "3.3.0",
32
+ "eslint-config-prettier": "10.1.1",
32
33
  "eslint-plugin-vue": "10.0.0"
33
34
  },
34
35
  "peerDependencies": {
35
- "eslint": "^8.0.0"
36
+ "eslint": "^9.0.0"
36
37
  },
37
38
  "engines": {
38
39
  "node": ">= 20.9.0",
@@ -41,5 +42,5 @@
41
42
  "publishConfig": {
42
43
  "access": "public"
43
44
  },
44
- "gitHead": "943b446e6793777ceb880c87aed74551789b2c4a"
45
+ "gitHead": "f54dcbae0ccae318895e34d32fbfa02b05cd38d1"
45
46
  }
package/legacy.cjs DELETED
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "plugin:vue/recommended",
4
-
5
- /* apply prettier again because the order the extends are resolved otherwise
6
- * casues the conflicting vue rules to be renabled by the vue preset */
7
- "plugin:prettier/recommended",
8
- ],
9
- };