fast-vite-plugins 1.0.1 → 1.0.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.
package/.eslintrc.cjs DELETED
@@ -1,378 +0,0 @@
1
- const { defineConfig } = require("eslint-define-config");
2
-
3
- // @see: http://eslint.cn
4
- module.exports = defineConfig({
5
- root: true,
6
- env: {
7
- es6: true,
8
- browser: true,
9
- node: true,
10
- },
11
- plugins: ["@typescript-eslint", "prettier"],
12
- // 继承某些已有的规则
13
- extends: ["eslint:recommended", "plugin:import/recommended", "plugin:vue/vue3-recommended", "plugin:@typescript-eslint/recommended", "prettier"],
14
- settings: {
15
- // 确保 ESLint 和 eslint-plugin-import 能够正确解析项目中的所有相关文件类型
16
- "import/resolver": {
17
- node: { extensions: [".js", ".mjs", ".ts", ".d.ts", ".tsx"] },
18
- },
19
- },
20
- overrides: [
21
- {
22
- files: ["*.ts", "*.vue", "*.tsx"],
23
- rules: {
24
- // 关闭 - 禁止使用未声明的变量,除非/*global *\/注释中提到
25
- "no-undef": "off",
26
- },
27
- },
28
- {
29
- files: ["*.d.ts"],
30
- rules: {
31
- // 关闭 - 禁止在文件中重复导入相同的模块
32
- "import/no-duplicates": "off",
33
- },
34
- },
35
- {
36
- files: ["*.js"],
37
- rules: {
38
- // 关闭 - 不允许使用 require 语句
39
- "@typescript-eslint/no-var-requires": "off",
40
- },
41
- },
42
- {
43
- files: ["*.cjs"],
44
- rules: {
45
- // 关闭 - 不允许使用 require 语句
46
- "@typescript-eslint/no-var-requires": "off",
47
- "@typescript-eslint/no-require-imports": "off",
48
- },
49
- },
50
- {
51
- files: ["*.vue"],
52
- // 允许 ESLint 处理 Vue 文件中的模板和脚本
53
- parser: "vue-eslint-parser",
54
- parserOptions: {
55
- // 允许在 Vue 文件中的脚本部分使用 TypeScript 语法
56
- parser: "@typescript-eslint/parser",
57
- // 指定额外的文件扩展名,告诉解析器 .vue 文件也需要处理
58
- extraFileExtensions: [".vue"],
59
- // 允许使用最新的 ECMAScript 语法特性
60
- ecmaVersion: "latest",
61
- // 允许使用 JSX/TSX 语法,适用于 Vue 组件中的 JSX/TSX 代码。
62
- ecmaFeatures: {
63
- jsx: true,
64
- tsx: true,
65
- },
66
- },
67
- rules: {
68
- // 关闭 - 禁止使用未声明的变量,以避免在 .vue 文件中出现关于未定义变量的警告,这在 Vue 单文件组件中可能不适用或会导致不必要的警告
69
- "no-undef": "off",
70
- },
71
- },
72
- ],
73
- /**
74
- * "off" 或 0 ==> 关闭规则
75
- * "warn" 或 1 ==> 打开的规则作为警告(不影响代码执行)
76
- * "error" 或 2 ==> 规则作为一个错误(代码不能执行,界面报错)
77
- */
78
- rules: {
79
- // JS/TS (http://eslint.cn/docs/rules)
80
-
81
- // 强制使用 camelCase 命名风格
82
- camelcase: [
83
- "error",
84
- {
85
- // 允许对象属性使用非 camelCase 风格
86
- properties: "never",
87
- },
88
- ],
89
- // 禁止使用控制台
90
- "no-console": [
91
- "warn",
92
- {
93
- // 允许除 warn/error 之外的其他 console.xx 方法
94
- allow: ["warn", "error"],
95
- },
96
- ],
97
- // 禁止使用 debugger
98
- "no-debugger": "warn",
99
- // 禁止在条件语句中使用常量条件
100
- "no-constant-condition": [
101
- "error",
102
- {
103
- // 允许在循环语句中使用常量条件
104
- checkLoops: false,
105
- },
106
- ],
107
- // 禁止使用某些特定的语法
108
- "no-restricted-syntax": [
109
- "error",
110
- // 禁止使用标记语句(labeled statements)
111
- "LabeledStatement",
112
- // 禁止使用 with 语句
113
- "WithStatement",
114
- ],
115
- // 禁止在 return 语句中使用 await
116
- "no-return-await": "error",
117
- // 禁止使用 var 关键字,强制使用 let 或 const
118
- "no-var": "error",
119
- // 禁止使用空的块语句
120
- "no-empty": [
121
- "error",
122
- {
123
- // 允许空的 catch 块
124
- allowEmptyCatch: true,
125
- },
126
- ],
127
- // 该规则禁止使用不规则或不标准的空白字符
128
- "no-irregular-whitespace": "error",
129
- // 禁止在函数或变量定义之前使用它们
130
- "no-use-before-define": "warn",
131
- // 强制使用 const 声明不被修改的变量
132
- "prefer-const": [
133
- "warn",
134
- {
135
- // 在解构赋值时也推荐使用 const
136
- destructuring: "all",
137
- // 允许在变量首次赋值前读取变量的值
138
- ignoreReadBeforeAssign: true,
139
- },
140
- ],
141
- // 强制使用箭头函数而非普通函数
142
- "prefer-arrow-callback": [
143
- "error",
144
- {
145
- // 不允许使用命名函数作为回调函数
146
- allowNamedFunctions: false,
147
- // 允许在箭头函数中使用 this 绑定的上下文
148
- allowUnboundThis: true,
149
- },
150
- ],
151
- // 强制使用对象字面量的方法和属性简写语法
152
- "object-shorthand": [
153
- "error",
154
- "always",
155
- {
156
- // 不忽略构造函数中的属性简写
157
- ignoreConstructors: false,
158
- // 强制避免在属性名中使用引号
159
- avoidQuotes: true,
160
- },
161
- ],
162
- // 强制使用 rest 参数代替 arguments 对象
163
- "prefer-rest-params": "error",
164
- // 强制使用展开运算符(...)代替 Function.prototype.apply
165
- "prefer-spread": "error",
166
- // 强制使用模板字面量代替字符串连接
167
- "prefer-template": "error",
168
- // 禁止在同一作用域中重新声明变量
169
- "no-redeclare": "error",
170
- // 禁止在同一作用域中重新声明 TypeScript 变量
171
- "@typescript-eslint/no-redeclare": "error",
172
-
173
- // 最佳实践
174
- // 确保数组的回调函数(如 Array.prototype.map、Array.prototype.filter、Array.prototype.reduce 等)总是有一个返回值
175
- "array-callback-return": "error",
176
- // 强制使用块级作用域变量(let 或 const),避免使用函数作用域变量(var)
177
- "block-scoped-var": "error",
178
- // 禁止使用 alert、confirm 和 prompt 等浏览器弹出对话框
179
- "no-alert": "warn",
180
- // 禁止在 switch 语句的 case 或 default 子句中声明变量
181
- "no-case-declarations": "error",
182
- // 禁止使用多行字符串,即不允许使用反斜杠 \ 来连接多行字符串
183
- "no-multi-str": "error",
184
- // 禁止使用 with 语句
185
- "no-with": "error",
186
- // 禁止使用 void 操作符
187
- "no-void": "error",
188
- // 禁止多个空行
189
- "no-multiple-empty-lines": [
190
- "error",
191
- {
192
- // 最多允许1行
193
- max: 1,
194
- },
195
- ],
196
-
197
- // import 排序
198
- "sort-imports": [
199
- "warn",
200
- {
201
- // 不忽略导入语句中模块名的大小写
202
- ignoreCase: false,
203
- // 忽略导入声明的排序
204
- ignoreDeclarationSort: true,
205
- // 不忽略导入成员的排序
206
- ignoreMemberSort: false,
207
- // 成员语法排序顺序
208
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
209
- // 不允许分组导入
210
- allowSeparatedGroups: false,
211
- },
212
- ],
213
-
214
- // 强制在数学运算中使用 ** 运算符代替 Math.pow()
215
- "prefer-exponentiation-operator": "error",
216
-
217
- // TS (https://typescript-eslint.io/rules)
218
-
219
- // 要求在导出函数和类的公共方法上显式声明返回类型
220
- "@typescript-eslint/explicit-module-boundary-types": "off",
221
- // 要求在 TypeScript 函数和方法中显式地指定返回类型
222
- "@typescript-eslint/explicit-function-return-type": "error",
223
- // 允许定义未使用的变量
224
- "@typescript-eslint/no-unused-vars": "off",
225
- // 允许使用自定义TypeScript模块和命名空间
226
- "@typescript-eslint/no-namespace": "off",
227
- // 允许使用 any 类型
228
- "@typescript-eslint/no-explicit-any": "off",
229
- // 禁止在 TypeScript 文件中使用 require 函数进行模块导入
230
- "@typescript-eslint/no-var-requires": "error",
231
- // 禁止定义空函数
232
- "@typescript-eslint/no-empty-function": "error",
233
- // 禁止无用的表达式
234
- "@typescript-eslint/no-unused-expressions": [
235
- "error",
236
- {
237
- // 允许短路操作符(&& 和 ||)中的无副作用表达式
238
- allowShortCircuit: true,
239
- // 允许三元操作符中的无副作用表达式
240
- allowTernary: true,
241
- },
242
- ],
243
- // 禁止在 TypeScript 代码中对类型已经可以被推断的变量或参数进行显式的类型注解
244
- "@typescript-eslint/no-inferrable-types": "error",
245
- // 禁止使用后缀运算符的非空断言(!)
246
- "@typescript-eslint/no-non-null-assertion": "error",
247
- // 禁止在可选链(?)后使用非空断言(!)
248
- "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
249
- // 禁止在代码中使用 @ts-ignore 注释
250
- "@typescript-eslint/ban-ts-comment": ["error", { "ts-ignore": false }],
251
- // 一致地使用 TypeScript 类型导入
252
- "@typescript-eslint/consistent-type-imports": [
253
- "error",
254
- {
255
- // 允许使用类型注解
256
- disallowTypeAnnotations: false,
257
- },
258
- ],
259
-
260
- // vue (https://eslint.vuejs.org/rules)
261
-
262
- // 允许使用 v-html
263
- "vue/no-v-html": "off",
264
- // 禁用所有 props 必填时,必须提供默认值
265
- "vue/require-default-prop": "off",
266
- // 强制组件中必须使用 emits 选项声明事件
267
- "vue/require-explicit-emits": "error",
268
- // 禁用组件名称必须是多单词
269
- "vue/multi-word-component-names": "off",
270
- // 关闭 - 强制从 vue 中导入 Vue相关 API
271
- "vue/prefer-import-from-vue": "off",
272
- // 强制 HTML 属性使用 camelCase 风格
273
- "vue/attribute-hyphenation": ["error", "never"],
274
- // 禁止重复的字段名
275
- "vue/no-dupe-keys": "error",
276
- // 禁止直接修改 props 的值
277
- "vue/no-mutating-props": "error",
278
- // 禁止使用 Vue.js 内置的保留组件名称(如 transition、keep-alive 等)作为自定义组件名称
279
- "vue/no-reserved-component-names": "error",
280
- // 禁止在自定义组件上使用 v-text 或 v-html 指令
281
- "vue/no-v-text-v-html-on-component": "off",
282
- // 防止<script setup>使用的变量<template>被标记为未使用,此规则仅在启用该no-unused-vars规则时有效。
283
- "vue/script-setup-uses-vars": "error",
284
- // 强制自定义事件名称使用 camelCase 风格命名
285
- "vue/custom-event-name-casing": ["error", "camelCase"],
286
- // 强制每个 Vue 文件中只包含一个 Vue 组件
287
- "vue/one-component-per-file": "off",
288
- // 闭合标签换行风格
289
- "vue/html-closing-bracket-newline": [
290
- "error",
291
- {
292
- // 强制要求当 HTML 元素跨多行时,闭合标签必须出现在新的一行上
293
- multiline: "always",
294
- // 强制要求当 HTML 元素只有一行时,闭合标签应与开始标签在同一行上
295
- singleline: "never",
296
- },
297
- ],
298
- // 强制 Vue 模板中 HTML 元素的属性按照指定的顺序排列
299
- "vue/attributes-order": [
300
- "error",
301
- {
302
- order: ["DEFINITION", "LIST_RENDERING", "CONDITIONALS", "RENDER_MODIFIERS", "GLOBAL", "UNIQUE", "OTHER_ATTR", "EVENTS", "CONTENT"],
303
- },
304
- ],
305
-
306
- // 确保 Prettier 错误被 ESLint 捕获
307
- "prettier/prettier": "error",
308
-
309
- // import
310
-
311
- // 确保所有的 import 语句位于文件的顶部,紧接在文件的开头部分,且在任何其他代码之前
312
- "import/first": "error",
313
- // 禁止在同一文件中出现重复的 import 语句
314
- "import/no-duplicates": "error",
315
- // 导入模块排序风格
316
- "import/order": [
317
- "error",
318
- {
319
- // 导入模块分组
320
- groups: [
321
- // Node.js 内置模块
322
- "builtin",
323
- // 第三方模块
324
- "external",
325
- [
326
- // 项目内部模块
327
- "internal",
328
- // 父级目录中的模块
329
- "parent",
330
- // 具有相同父级的模块
331
- "sibling",
332
- // 当前目录的 index.js 或 index.ts 文件
333
- "index",
334
- "object",
335
- // "type",
336
- ],
337
- "unknown",
338
- ],
339
- pathGroups: [
340
- {
341
- pattern: "vue",
342
- group: "external",
343
- position: "before",
344
- },
345
- {
346
- pattern: "@vue/**",
347
- group: "external",
348
- position: "before",
349
- },
350
- {
351
- pattern: "@gejia-element-plus/**",
352
- group: "internal",
353
- },
354
- ],
355
- pathGroupsExcludedImportTypes: ["type"],
356
- // 禁止不同组之间进行换行
357
- "newlines-between": "never",
358
- //根据字母顺序对每个组内的顺序进行排序
359
- alphabetize: {
360
- order: "asc",
361
- caseInsensitive: true,
362
- },
363
- },
364
- ],
365
- // 关闭 - 禁用对无法解析的模块导入的检查
366
- "import/no-unresolved": "off",
367
- // 关闭 - 禁用对命名空间导入(例如,import * as)的检查
368
- "import/namespace": "off",
369
- // 关闭 - 禁用对默认导入的检查
370
- "import/default": "off",
371
- // 关闭 - 禁用对以默认导出方式作为命名导入的检查
372
- "import/no-named-as-default": "off",
373
- // 关闭 - 禁用对将默认导出成员当作命名导入的检查
374
- "import/no-named-as-default-member": "off",
375
- // 关闭 - 禁用对命名导入(即从模块中导入特定命名的内容)的检查
376
- "import/named": "off",
377
- },
378
- });
package/.gitattributes DELETED
@@ -1,13 +0,0 @@
1
- ###############################################################################
2
- # Set default behavior to automatically normalize line endings.
3
- # This ensures that text files use LF (Line Feed) for line endings in the repository,
4
- # while Git will handle converting line endings appropriately on checkout and commit
5
- # depending on the operating system.
6
- ###############################################################################
7
- * text=auto
8
-
9
- ###############################################################################
10
- # Force LF line endings for all files.
11
- # This overrides the default behavior and ensures that files use LF for line endings.
12
- ###############################################################################
13
- * eol=lf
package/.prettierignore DELETED
@@ -1,3 +0,0 @@
1
- # Prettier 会忽略的文件
2
-
3
- *.md
package/.prettierrc.cjs DELETED
@@ -1,38 +0,0 @@
1
- // @see: https://www.prettier.cn
2
-
3
- module.exports = {
4
- // 指定最大换行长度
5
- printWidth: 150,
6
- // 缩进制表符宽度 | 空格数
7
- tabWidth: 4,
8
- // 使用制表符而不是空格缩进行 (true:制表符,false:空格)
9
- useTabs: true,
10
- // 结尾不用分号 (true:有,false:没有)
11
- semi: true,
12
- // 使用单引号 (true:单引号,false:双引号)
13
- singleQuote: false,
14
- // 在对象字面量中决定是否将属性名用引号括起来 可选值 "<as-needed|consistent|preserve>"
15
- quoteProps: "as-needed",
16
- // 在JSX中使用单引号而不是双引号 (true:单引号,false:双引号)
17
- jsxSingleQuote: false,
18
- // 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>",默认none
19
- trailingComma: "es5",
20
- // 在对象,数组括号与文字之间加空格 "{ foo: bar }" (true:有,false:没有)
21
- bracketSpacing: true,
22
- // 将 > 多行元素放在最后一行的末尾,而不是单独放在下一行 (true:放末尾,false:单独一行)
23
- bracketSameLine: false,
24
- // (x) => {} 箭头函数参数只有一个时是否要有小括号 (avoid:省略括号,always:不省略括号)
25
- arrowParens: "always",
26
- // 指定要使用的解析器,不需要写文件开头的 @prettier
27
- requirePragma: false,
28
- // 可以在文件顶部插入一个特殊标记,指定该文件已使用 Prettier 格式化
29
- insertPragma: false,
30
- // 用于控制文本是否应该被换行以及如何进行换行
31
- proseWrap: "preserve",
32
- // 在html中空格是否是敏感的 "css" - 遵守 CSS 显示属性的默认值, "strict" - 空格被认为是敏感的 ,"ignore" - 空格被认为是不敏感的
33
- htmlWhitespaceSensitivity: "css",
34
- // 控制在 Vue 单文件组件中 <script> 和 <style> 标签内的代码缩进方式
35
- vueIndentScriptAndStyle: false,
36
- // 换行符使用 lf 结尾是 可选值 "<auto|lf|crlf|cr>"
37
- endOfLine: "lf",
38
- };
@@ -1,10 +0,0 @@
1
- {
2
- "recommendations": [
3
- "editorconfig.editorconfig",
4
- "esbenp.prettier-vscode",
5
- "dbaeumer.vscode-eslint",
6
- "Vue.volar",
7
- "maggie.eslint-rules-zh-plugin",
8
- "PKief.material-icon-theme"
9
- ]
10
- }
@@ -1,40 +0,0 @@
1
- {
2
- "editor.tabSize": 2,
3
- "editor.codeActionsOnSave": {
4
- "source.fixAll.eslint": "explicit"
5
- },
6
- "eslint.validate": ["javascript", "typescript", "typescriptreact", "vue"],
7
- "[vue]": {
8
- "editor.defaultFormatter": "esbenp.prettier-vscode"
9
- },
10
- "[typescriptreact]": {
11
- "editor.defaultFormatter": "esbenp.prettier-vscode"
12
- },
13
- "[javascript]": {
14
- "editor.defaultFormatter": "esbenp.prettier-vscode"
15
- },
16
- "[typescript]": {
17
- "editor.defaultFormatter": "esbenp.prettier-vscode"
18
- },
19
- "[json]": {
20
- "editor.defaultFormatter": "esbenp.prettier-vscode"
21
- },
22
- "[jsonc]": {
23
- "editor.defaultFormatter": "esbenp.prettier-vscode"
24
- },
25
- "[html]": {
26
- "editor.defaultFormatter": "esbenp.prettier-vscode"
27
- },
28
- "[css]": {
29
- "editor.defaultFormatter": "esbenp.prettier-vscode"
30
- },
31
- "[scss]": {
32
- "editor.defaultFormatter": "esbenp.prettier-vscode"
33
- },
34
- "testing.automaticallyOpenPeekView": "never",
35
- "cSpell.words": [],
36
- "editor.fontSize": 14,
37
- "typescript.tsdk": "node_modules/typescript/lib",
38
- "typescript.enablePromptUseWorkspaceTsdk": true,
39
- "prettier.endOfLine": "lf"
40
- }
package/Fast.png DELETED
Binary file