eco-vue-js 0.10.64 → 0.10.65

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.
@@ -1,4 +1,4 @@
1
- declare type SVGComponent = import('vue').Raw<import('vue').FunctionalComponent<import('vue').SVGAttributes, Record<string, never>>>
1
+ declare type SVGComponent = import('vue').Raw<import('vue').FunctionalComponent<import('vue').SVGAttributes>>
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
4
  declare type ComponentInstance<T> = T extends new (...args: any[]) => infer R
@@ -0,0 +1,47 @@
1
+ import importPlugin from 'eslint-plugin-import'
2
+
3
+ export default ({tsConfig = './tsconfig.vue.json'}) => [
4
+ {
5
+ files: ['**/*.{ts,js,vue}'],
6
+ plugins: {
7
+ import: importPlugin,
8
+ },
9
+ rules: {
10
+ ...importPlugin.flatConfigs.recommended.rules,
11
+ 'import/order': [
12
+ 1,
13
+ {
14
+ 'newlines-between': 'always',
15
+ named: true,
16
+ groups: ['type', 'external', 'builtin', 'internal', 'sibling', 'parent', 'index'],
17
+ distinctGroup: true,
18
+ pathGroups: [
19
+ {pattern: 'eco-vue-js/**/W**', group: 'builtin', position: 'before'},
20
+ {pattern: '**/W**', group: 'builtin', position: 'before'},
21
+ {pattern: 'eco-vue-js/**/Icon**', group: 'builtin', position: 'before'},
22
+ {pattern: '**/Icon**', group: 'builtin', position: 'before'},
23
+ {pattern: 'eco-vue-js/**', group: 'external', position: 'after'},
24
+ ],
25
+ pathGroupsExcludedImportTypes: ['builtin'],
26
+ alphabetize: {order: 'asc', caseInsensitive: false},
27
+ },
28
+ ],
29
+ 'import/no-useless-path-segments': [1, {noUselessIndex: true}],
30
+ // 'import/extensions': [1, 'never'],
31
+ 'import/first': 1,
32
+ 'import/newline-after-import': 1,
33
+ },
34
+ settings: {
35
+ 'import/parsers': {
36
+ '@typescript-eslint/parser': ['.ts', '.js'],
37
+ },
38
+ 'import/resolver': {
39
+ typescript: {
40
+ alwaysTryTypes: true,
41
+ project: tsConfig,
42
+ },
43
+ node: true,
44
+ },
45
+ },
46
+ },
47
+ ]
@@ -0,0 +1,15 @@
1
+ import eslintPluginJsonc from 'eslint-plugin-jsonc'
2
+
3
+ export default [
4
+ ...eslintPluginJsonc.configs['flat/recommended-with-json'],
5
+ {
6
+ files: ['**/*.json'],
7
+ rules: {
8
+ 'jsonc/indent': ['error', 2, {}],
9
+ 'jsonc/key-spacing': ['error', {beforeColon: false, afterColon: true, mode: 'strict'}],
10
+ 'jsonc/comma-style': ['error', 'last'],
11
+ 'jsonc/object-curly-newline': ['error', 'always'],
12
+ 'jsonc/object-property-newline': 'error',
13
+ },
14
+ },
15
+ ]
@@ -0,0 +1,14 @@
1
+ import tailwind from 'eslint-plugin-tailwindcss'
2
+
3
+ export default [
4
+ ...tailwind.configs['flat/recommended'],
5
+
6
+ {
7
+ files: ['**/*.{ts,js,vue}'],
8
+ rules: {
9
+ 'tailwindcss/no-custom-classname': 'off',
10
+ 'tailwindcss/migration-from-tailwind-2': 'off',
11
+ 'tailwindcss/enforces-negative-arbitrary-values': 'off',
12
+ },
13
+ },
14
+ ]
@@ -0,0 +1,73 @@
1
+ import stylistic from '@stylistic/eslint-plugin'
2
+ import unusedImports from 'eslint-plugin-unused-imports'
3
+ import pluginVue from 'eslint-plugin-vue'
4
+ import {parser as tseslintParser, plugin as tseslintPlugin} from 'typescript-eslint'
5
+
6
+ export default [
7
+ {
8
+ files: ['**/*.{ts,js,vue}'],
9
+ plugins: {
10
+ 'unused-imports': unusedImports,
11
+ '@stylistic': stylistic,
12
+ '@typescript-eslint': tseslintPlugin,
13
+ },
14
+ languageOptions: {
15
+ parser: pluginVue.parser,
16
+ ecmaVersion: 'latest',
17
+ sourceType: 'module',
18
+ },
19
+ rules: {
20
+ semi: ['error', 'never'],
21
+ quotes: ['error', 'single', {allowTemplateLiterals: true}],
22
+ indent: ['error', 2, {SwitchCase: 1}],
23
+ 'comma-dangle': ['error', 'always-multiline'],
24
+ 'comma-spacing': ['error', {before: false, after: true}],
25
+ 'object-curly-spacing': ['error', 'never'],
26
+ 'func-call-spacing': 'off',
27
+ 'template-curly-spacing': ['error', 'always'],
28
+ 'space-before-function-paren': ['error', {anonymous: 'always', named: 'never', asyncArrow: 'always'}],
29
+ 'no-undef': 'off',
30
+ 'default-case-last': 'off',
31
+ 'no-console': ['warn'],
32
+ 'no-unused-vars': 'off',
33
+ 'unused-imports/no-unused-imports': 'error',
34
+ 'no-multiple-empty-lines': [1, {max: 1, maxEOF: 0, maxBOF: 0}],
35
+ 'keyword-spacing': 1,
36
+ 'key-spacing': 1,
37
+ '@stylistic/function-call-spacing': 1,
38
+ '@stylistic/member-delimiter-style': [1, {multiline: {delimiter: 'none'}, singleline: {delimiter: 'comma'}}],
39
+ '@stylistic/type-annotation-spacing': [1, {before: false, after: true, overrides: {arrow: {before: true, after: true}}}],
40
+ '@stylistic/quote-props': [1, 'as-needed'],
41
+
42
+ '@typescript-eslint/no-explicit-any': 'error',
43
+ '@typescript-eslint/no-unused-vars': ['error', {args: 'after-used', caughtErrors: 'none'}],
44
+ },
45
+ },
46
+
47
+ {
48
+ files: ['**/*.ts'],
49
+ plugins: {
50
+ '@typescript-eslint': tseslintPlugin,
51
+ },
52
+ languageOptions: {
53
+ parser: tseslintParser,
54
+ parserOptions: {
55
+ projectService: true,
56
+ },
57
+ },
58
+ rules: {
59
+ '@typescript-eslint/naming-convention': [
60
+ 'error',
61
+ {selector: 'enum', format: ['PascalCase']},
62
+ {selector: 'enumMember', format: ['UPPER_CASE', 'snake_case']},
63
+ ],
64
+ },
65
+ },
66
+
67
+ {
68
+ files: ['**/*.cjs'],
69
+ rules: {
70
+ '@typescript-eslint/no-require-imports': 'off',
71
+ },
72
+ },
73
+ ]
@@ -0,0 +1,46 @@
1
+ export default [
2
+ {
3
+ files: ['**/*.vue'],
4
+ rules: {
5
+ 'vue/script-indent': ['error', 2, {
6
+ baseIndent: 0,
7
+ switchCase: 1,
8
+ ignores: [],
9
+ }],
10
+ 'vue/component-name-in-template-casing': ['error', 'PascalCase', {registeredComponentsOnly: false}],
11
+ 'vue/block-order': ['error', {
12
+ order: ['template', 'script[setup]', 'style'],
13
+ }],
14
+ 'vue/multiline-html-element-content-newline': ['error', {
15
+ ignoreWhenEmpty: true,
16
+ ignores: ['pre', 'textarea', 'span', 'tspan', 'template'],
17
+ allowEmptyLines: false,
18
+ }],
19
+ 'vue/attributes-order': ['error', {
20
+ order: [
21
+ 'DEFINITION',
22
+ 'LIST_RENDERING',
23
+ 'CONDITIONALS',
24
+ 'RENDER_MODIFIERS',
25
+ 'GLOBAL',
26
+ ['UNIQUE', 'SLOT'],
27
+ 'TWO_WAY_BINDING',
28
+ 'OTHER_DIRECTIVES',
29
+ ['ATTR_DYNAMIC', 'ATTR_STATIC', 'ATTR_SHORTHAND_BOOL'],
30
+ 'EVENTS',
31
+ 'CONTENT',
32
+ ],
33
+ alphabetical: false,
34
+ }],
35
+ 'vue/prefer-use-template-ref': 'error',
36
+ 'vue/require-macro-variable-name': ['error', {defineProps: 'props', defineEmits: 'emit', defineSlots: 'slots', useSlots: 'slots', useAttrs: 'attrs'}],
37
+ 'vue/require-typed-ref': 'error',
38
+ 'vue/padding-line-between-blocks': ['error', 'always'],
39
+ 'vue/block-tag-newline': [1, {
40
+ singleline: 'always',
41
+ multiline: 'always',
42
+ }],
43
+ 'vue/no-lone-template': ['error', {ignoreAccessible: false}],
44
+ },
45
+ },
46
+ ]
package/eslint/plugin.js CHANGED
@@ -15,33 +15,36 @@ const plugin = {
15
15
  configs: {},
16
16
  }
17
17
 
18
- plugin.configs.recommended = [
19
- ...recommended,
20
- {
21
- name: 'custom-rules',
22
- plugins: {
23
- 'custom-rules': plugin,
24
- },
25
- files: ['**/*.{ts,js,vue}'],
26
- rules: {
27
- 'custom-rules/modal-declaration': ['error'],
28
- 'custom-rules/modal-import-async': ['error'],
29
- 'custom-rules/modal-import': ['error'],
30
- 'custom-rules/ui-kit-imports': ['error'],
18
+ const customRules = {
19
+ name: 'custom-rules',
20
+ plugins: {
21
+ 'custom-rules': plugin,
22
+ },
23
+ files: ['**/*.{ts,js,vue}'],
24
+ rules: {
25
+ 'custom-rules/modal-declaration': ['error'],
26
+ 'custom-rules/modal-import-async': ['error'],
27
+ 'custom-rules/modal-import': ['error'],
28
+ 'custom-rules/ui-kit-imports': ['error'],
31
29
 
32
- 'no-restricted-imports': [
33
- 'error',
34
- {
35
- name: 'eco-vue-js',
36
- message: 'Use import eco-vue-js/dist/',
37
- },
38
- {
39
- name: '@/main',
40
- message: 'Import direcrlty',
41
- },
42
- ],
43
- },
30
+ 'no-restricted-imports': [
31
+ 'error',
32
+ {
33
+ name: 'eco-vue-js',
34
+ message: 'Use import eco-vue-js/dist/',
35
+ },
36
+ {
37
+ name: '@/main',
38
+ message: 'Import direcrlty',
39
+ },
40
+ ],
44
41
  },
42
+ }
43
+
44
+ plugin.configs.recommended = (config = {}) => [
45
+ ...recommended(config),
46
+
47
+ ...config.noCustom ? [] : [customRules],
45
48
  ]
46
49
 
47
50
  export default plugin
@@ -1,199 +1,28 @@
1
- import stylistic from '@stylistic/eslint-plugin'
2
1
  import pluginQuery from '@tanstack/eslint-plugin-query'
3
2
  import {
4
3
  defineConfigWithVueTs,
5
4
  vueTsConfigs,
6
5
  } from '@vue/eslint-config-typescript'
7
- import importPlugin from 'eslint-plugin-import'
8
- import eslintPluginJsonc from 'eslint-plugin-jsonc'
9
- import tailwind from 'eslint-plugin-tailwindcss'
10
- import unusedImports from 'eslint-plugin-unused-imports'
11
6
  import pluginVue from 'eslint-plugin-vue'
12
7
 
13
- export default [
14
- ...defineConfigWithVueTs(
8
+ import configImports from './configs/configImports.js'
9
+ import configJson from './configs/configJson.js'
10
+ import configTailwind from './configs/configTailwind.js'
11
+ import configTypescript from './configs/configTypescript.js'
12
+ import configVue from './configs/configVue.js'
13
+
14
+ export default (config = {}) => [
15
+ ...config.noVue ? [] : defineConfigWithVueTs(
15
16
  pluginVue.configs['flat/recommended'],
16
17
  vueTsConfigs.recommendedTypeChecked,
17
18
  ).map(item => ({...item, files: ['**/*.{ts,tsx,vue}']})),
18
19
 
19
- ...tailwind.configs['flat/recommended'],
20
+ ...config.noVue ? [] : configVue,
21
+
20
22
  ...pluginQuery.configs['flat/recommended'],
21
23
 
22
- {
23
- files: ['**/*.cjs'],
24
- rules: {
25
- '@typescript-eslint/no-require-imports': 'off',
26
- },
27
- },
28
-
29
- {
30
- files: ['**/*.{ts,js,tsx}'],
31
- rules: {
32
- indent: ['error', 2, {
33
- SwitchCase: 1,
34
- }],
35
- },
36
- },
37
-
38
- ...eslintPluginJsonc.configs['flat/recommended-with-json'],
39
- {
40
- files: ['**/*.json'],
41
- rules: {
42
- 'jsonc/indent': ['error', 2, {}],
43
- 'jsonc/key-spacing': ['error', {beforeColon: false, afterColon: true, mode: 'strict'}],
44
- 'jsonc/comma-style': ['error', 'last'],
45
- 'jsonc/object-curly-newline': ['error', 'always'],
46
- 'jsonc/object-property-newline': 'error',
47
- },
48
- },
49
-
50
- {
51
- files: ['**/*.ts'],
52
- rules: {
53
- '@typescript-eslint/naming-convention': [
54
- 'error',
55
- {selector: 'enum', format: ['PascalCase']},
56
- {selector: 'enumMember', format: ['UPPER_CASE', 'snake_case']},
57
- ],
58
- },
59
- },
60
-
61
- {
62
- files: ['**/*.{ts,tsx,vue}'],
63
- rules: {
64
- '@typescript-eslint/no-unused-vars': ['error', {args: 'after-used', caughtErrors: 'none'}],
65
- },
66
- },
67
-
68
- {
69
- files: ['**/*.{ts,js,vue}'],
70
- plugins: {
71
- import: importPlugin,
72
- },
73
- languageOptions: {
74
- parser: pluginVue.parser,
75
- ecmaVersion: 'latest',
76
- sourceType: 'module',
77
- },
78
- rules: {
79
- ...importPlugin.flatConfigs.recommended.rules,
80
- 'import/order': [
81
- 1,
82
- {
83
- 'newlines-between': 'always',
84
- named: true,
85
- groups: ['type', 'external', 'builtin', 'internal', 'sibling', 'parent', 'index'],
86
- distinctGroup: true,
87
- pathGroups: [
88
- {pattern: 'eco-vue-js/**/W**', group: 'builtin', position: 'before'},
89
- {pattern: '**/W**', group: 'builtin', position: 'before'},
90
- {pattern: 'eco-vue-js/**/Icon**', group: 'builtin', position: 'before'},
91
- {pattern: '**/Icon**', group: 'builtin', position: 'before'},
92
- {pattern: 'eco-vue-js/**', group: 'external', position: 'after'},
93
- ],
94
- pathGroupsExcludedImportTypes: ['builtin'],
95
- alphabetize: {order: 'asc', caseInsensitive: false},
96
- },
97
- ],
98
- 'import/no-useless-path-segments': [1, {noUselessIndex: true}],
99
- // 'import/extensions': [1, 'never'],
100
- 'import/first': 1,
101
- 'import/newline-after-import': 1,
102
- },
103
- settings: {
104
- 'import/parsers': {
105
- '@typescript-eslint/parser': ['.ts', '.js'],
106
- },
107
- 'import/resolver': {
108
- typescript: {
109
- alwaysTryTypes: true,
110
- project: './tsconfig.vue.json',
111
- },
112
- node: true,
113
- },
114
- },
115
- },
116
-
117
- {
118
- files: ['**/*.{ts,js,vue}'],
119
- plugins: {
120
- 'unused-imports': unusedImports,
121
- '@stylistic': stylistic,
122
- },
123
- languageOptions: {
124
- parser: vueTsConfigs.parser,
125
- ecmaVersion: 'latest',
126
- sourceType: 'module',
127
- },
128
- rules: {
129
- semi: ['error', 'never'],
130
- quotes: ['error', 'single', {allowTemplateLiterals: true}],
131
- 'comma-dangle': ['error', 'always-multiline'],
132
- 'comma-spacing': ['error', {before: false, after: true}],
133
- 'object-curly-spacing': ['error', 'never'],
134
- 'func-call-spacing': 'off',
135
- 'template-curly-spacing': ['error', 'always'],
136
- 'space-before-function-paren': ['error', {anonymous: 'always', named: 'never', asyncArrow: 'always'}],
137
- 'no-undef': 'off',
138
- 'default-case-last': 'off',
139
- 'no-console': ['warn'],
140
- 'no-unused-vars': 'off',
141
- 'unused-imports/no-unused-imports': 'error',
142
- 'tailwindcss/no-custom-classname': 'off',
143
- 'tailwindcss/migration-from-tailwind-2': 'off',
144
- 'tailwindcss/enforces-negative-arbitrary-values': 'off',
145
- 'no-multiple-empty-lines': [1, {max: 1, maxEOF: 0, maxBOF: 0}],
146
- 'keyword-spacing': 1,
147
- 'key-spacing': 1,
148
- '@stylistic/function-call-spacing': 1,
149
- '@stylistic/member-delimiter-style': [1, {multiline: {delimiter: 'none'}, singleline: {delimiter: 'comma'}}],
150
- '@stylistic/type-annotation-spacing': [1, {before: false, after: true, overrides: {arrow: {before: true, after: true}}}],
151
- '@stylistic/quote-props': [1, 'as-needed'],
152
- },
153
- },
154
-
155
- {
156
- files: ['**/*.vue'],
157
- rules: {
158
- 'vue/script-indent': ['error', 2, {
159
- baseIndent: 0,
160
- switchCase: 1,
161
- ignores: [],
162
- }],
163
- 'vue/component-name-in-template-casing': ['error', 'PascalCase', {registeredComponentsOnly: false}],
164
- 'vue/block-order': ['error', {
165
- order: ['template', 'script[setup]', 'style'],
166
- }],
167
- 'vue/multiline-html-element-content-newline': ['error', {
168
- ignoreWhenEmpty: true,
169
- ignores: ['pre', 'textarea', 'span', 'tspan', 'template'],
170
- allowEmptyLines: false,
171
- }],
172
- 'vue/attributes-order': ['error', {
173
- order: [
174
- 'DEFINITION',
175
- 'LIST_RENDERING',
176
- 'CONDITIONALS',
177
- 'RENDER_MODIFIERS',
178
- 'GLOBAL',
179
- ['UNIQUE', 'SLOT'],
180
- 'TWO_WAY_BINDING',
181
- 'OTHER_DIRECTIVES',
182
- ['ATTR_DYNAMIC', 'ATTR_STATIC', 'ATTR_SHORTHAND_BOOL'],
183
- 'EVENTS',
184
- 'CONTENT',
185
- ],
186
- alphabetical: false,
187
- }],
188
- 'vue/prefer-use-template-ref': 'error',
189
- 'vue/require-macro-variable-name': ['error', {defineProps: 'props', defineEmits: 'emit', defineSlots: 'slots', useSlots: 'slots', useAttrs: 'attrs'}],
190
- 'vue/require-typed-ref': 'error',
191
- 'vue/padding-line-between-blocks': ['error', 'always'],
192
- 'vue/block-tag-newline': [1, {
193
- singleline: 'always',
194
- multiline: 'always',
195
- }],
196
- 'vue/no-lone-template': ['error', {ignoreAccessible: false}],
197
- },
198
- },
24
+ ...configJson,
25
+ ...configTypescript,
26
+ ...configTailwind,
27
+ ...configImports(config),
199
28
  ]
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rsmple/eco-vue-js.git"
6
6
  },
7
- "version": "0.10.64",
7
+ "version": "0.10.65",
8
8
  "scripts": {
9
9
  "build": "run-p type-check \"build-only {@}\" --",
10
10
  "dev": "vite build --mode development --watch",