@byloth/eslint-config-vue 2.8.3 → 3.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.
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+
3
+ export default Readonly<Linter.RulesRecord>[];
package/index.mjs ADDED
@@ -0,0 +1,60 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+
4
+ import { FlatCompat } from "@eslint/eslintrc";
5
+ import eslintVue from "eslint-plugin-vue";
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+
10
+ const compat = new FlatCompat({ baseDirectory: __dirname });
11
+
12
+ const DYNAMIC_LEVEL = process.env.NODE_ENV === "production" ? "error" : "warn";
13
+
14
+ export default [...compat.extends("plugin:vue/vue3-recommended"), {
15
+ ignores: ["!**/.vitepress/"],
16
+ languageOptions: {
17
+ globals: {
18
+ defineEmits: true,
19
+ defineExpose: true,
20
+ defineModel: true,
21
+ defineProps: true,
22
+ withDefaults: true
23
+ }
24
+ },
25
+ plugins: { "vue": eslintVue },
26
+ rules: {
27
+ "vue/html-closing-bracket-newline": ["error", {
28
+ singleline: "never",
29
+ multiline: "never"
30
+ }],
31
+ "vue/html-indent": ["error", 4],
32
+ "vue/html-self-closing": ["error", {
33
+ html: {
34
+ void: "always",
35
+ normal: "never"
36
+ }
37
+ }],
38
+ "vue/max-attributes-per-line": ["error", {
39
+ multiline: 1,
40
+ singleline: 2
41
+ }],
42
+ "vue/first-attribute-linebreak": ["error", {
43
+ multiline: "beside",
44
+ singleline: "beside"
45
+ }],
46
+ "vue/no-unused-components": DYNAMIC_LEVEL,
47
+ "vue/no-unused-vars": [DYNAMIC_LEVEL, { ignorePattern: "^_[a-z]?[0-9]*$" }],
48
+ "vue/no-v-model-argument": "off",
49
+ "vue/script-indent": ["error", 4, {
50
+ baseIndent: 1,
51
+ switchCase: 1
52
+ }]
53
+ }
54
+ }, {
55
+ files: ["**/*.vue"],
56
+ rules: {
57
+ "indent": "off",
58
+ "no-unused-vars": "off"
59
+ }
60
+ }];
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "@byloth/eslint-config-vue",
3
- "version": "2.8.3",
3
+ "version": "3.0.0",
4
4
  "description": "A collection of some common sense linting rules for Vue.js projects. ✔",
5
- "keywords": ["ESLint", "Vue.js", "Linting", "Rules", "Configuration"],
5
+ "keywords": [
6
+ "ESLint",
7
+ "Vue.js",
8
+ "Linting",
9
+ "Rules",
10
+ "Configuration"
11
+ ],
6
12
  "homepage": "https://github.com/Byloth/eslint-config/tree/master/packages/eslint-config-vue#readme",
7
13
  "repository": {
8
14
  "type": "git",
@@ -17,11 +23,20 @@
17
23
  "url": "https://www.byloth.dev/"
18
24
  },
19
25
  "license": "Apache-2.0",
20
- "main": "index.cjs",
21
- "files": ["index.cjs"],
22
- "dependencies": { "@byloth/eslint-config": "2.8.3" },
23
- "peerDependencies": {
24
- "eslint-plugin-vue": "^9.28.0",
26
+ "type": "module",
27
+ "files": [
28
+ "index.mjs",
29
+ "index.d.ts"
30
+ ],
31
+ "main": "index.mjs",
32
+ "types": "index.d.ts",
33
+ "dependencies": {
34
+ "@byloth/eslint-config": "3.0.0",
35
+ "eslint-plugin-vue": "^9.29.0",
25
36
  "vue-eslint-parser": "^9.4.3"
26
- }
37
+ },
38
+ "devDependencies": {
39
+ "@types/eslint__eslintrc": "^2.1.2"
40
+ },
41
+ "packageManager": "pnpm@9.12.1+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4"
27
42
  }
package/index.cjs DELETED
@@ -1,32 +0,0 @@
1
- const DYNAMIC_LEVEL = process.env.NODE_ENV === "production" ? "error" : "warn";
2
- const IGNORED_PATTERN = "^_[a-z]?[0-9]*$";
3
-
4
- module.exports = {
5
- extends: ["plugin:vue/vue3-recommended"],
6
- globals: {
7
- defineEmits: true,
8
- defineExpose: true,
9
- defineModel: true,
10
- defineProps: true
11
- },
12
- ignorePatterns: ["!**/.vitepress/"],
13
- plugins: ["vue"],
14
- rules: {
15
- "vue/html-closing-bracket-newline": ["error", { singleline: "never", multiline: "never" }],
16
- "vue/html-indent": ["error", 4],
17
- "vue/html-self-closing": ["error", { html: { void: "always", normal: "never" } }],
18
- "vue/max-attributes-per-line": ["error", { multiline: 1, singleline: 2 }],
19
- "vue/first-attribute-linebreak": ["error", { multiline: "beside", singleline: "beside" }],
20
- "vue/no-unused-components": DYNAMIC_LEVEL,
21
- "vue/no-unused-vars": [DYNAMIC_LEVEL, { ignorePattern: IGNORED_PATTERN }],
22
- "vue/no-v-model-argument": "off",
23
- "vue/script-indent": ["error", 4, { baseIndent: 1, switchCase: 1 }]
24
- },
25
- overrides: [{
26
- files: ["*.vue"],
27
- rules: {
28
- "indent": "off",
29
- "no-unused-vars": "off"
30
- }
31
- }]
32
- };