@sxzz/eslint-config 3.0.0-beta.2 → 3.0.0-beta.3

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/vue.js +16 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sxzz/eslint-config",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.3",
4
4
  "packageManager": "pnpm@7.27.0",
5
5
  "description": "ESLint config for @sxzz.",
6
6
  "type": "module",
package/src/vue.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import { getPackageInfoSync } from 'local-pkg'
2
2
  import vueParser from 'vue-eslint-parser'
3
3
  import vuePlugin from 'eslint-plugin-vue'
4
+ import tsPlugin from '@typescript-eslint/eslint-plugin'
4
5
  import { typescript } from './typescript.js'
6
+ import { GLOB_VUE } from './shared.js'
5
7
 
6
8
  export { vueParser, vuePlugin }
7
9
 
@@ -16,6 +18,7 @@ export function getVueVersion() {
16
18
  }
17
19
  return 3
18
20
  }
21
+ const isVue3 = getVueVersion() === 3
19
22
 
20
23
  /** @type {import('eslint-define-config').FlatESLintConfigItem[]} */
21
24
  export const reactivityTransform = [
@@ -31,6 +34,9 @@ export const reactivityTransform = [
31
34
  $customRef: 'readonly',
32
35
  },
33
36
  },
37
+ plugins: {
38
+ vue: vuePlugin,
39
+ },
34
40
  rules: {
35
41
  'vue/no-setup-props-destructure': 'off',
36
42
  },
@@ -77,10 +83,10 @@ const vue2Rules = {
77
83
  /** @type {import('eslint-define-config').FlatESLintConfigItem[]} */
78
84
  export const vue = [
79
85
  {
80
- files: ['**/*.vue'],
86
+ files: [GLOB_VUE],
81
87
  plugins: {
82
88
  vue: vuePlugin,
83
- ...typescript[0].plugins,
89
+ '@typescript-eslint': tsPlugin,
84
90
  },
85
91
  languageOptions: {
86
92
  parser: vueParser,
@@ -95,9 +101,16 @@ export const vue = [
95
101
  },
96
102
  processor: vuePlugin.processors['.vue'],
97
103
  rules: {
98
- ...(getVueVersion() === 3 ? vue3Rules : vue2Rules),
99
104
  ...typescript[0].rules,
100
105
  },
101
106
  },
107
+ {
108
+ plugins: {
109
+ vue: vuePlugin,
110
+ },
111
+ rules: {
112
+ ...(isVue3 ? vue3Rules : vue2Rules),
113
+ },
114
+ },
102
115
  ...reactivityTransform,
103
116
  ]