@kikiutils/eslint-config 10.0.0 → 10.1.1
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/dist/_internals/jsdoc.d.ts +53 -0
- package/dist/_internals/jsdoc.d.ts.map +1 -0
- package/dist/_internals/jsdoc.js +57 -0
- package/dist/_internals/jsdoc.js.map +1 -0
- package/dist/_internals/type-aware.js +5 -1
- package/dist/_internals/type-aware.js.map +1 -1
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +43 -4
- package/dist/base.js.map +1 -1
- package/dist/vue.d.ts.map +1 -1
- package/dist/vue.js +6 -1
- package/dist/vue.js.map +1 -1
- package/package.json +2 -2
- package/src/_internals/jsdoc.ts +70 -0
- package/src/_internals/type-aware.ts +12 -1
- package/src/base.ts +67 -1
- package/src/vue.ts +5 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const jsdocSettings: {
|
|
2
|
+
jsdoc: {
|
|
3
|
+
tagNamePreference: {
|
|
4
|
+
arg: string;
|
|
5
|
+
argument: string;
|
|
6
|
+
desc: boolean;
|
|
7
|
+
description: boolean;
|
|
8
|
+
exception: string;
|
|
9
|
+
return: string;
|
|
10
|
+
types: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const typescriptJsdocConfig: {
|
|
15
|
+
rules: {
|
|
16
|
+
'jsdoc/check-tag-names': ["error", {
|
|
17
|
+
definedTags: string[];
|
|
18
|
+
}];
|
|
19
|
+
'jsdoc/multiline-blocks': ["error", {
|
|
20
|
+
noSingleLineBlocks: true;
|
|
21
|
+
singleLineTags: never[];
|
|
22
|
+
}];
|
|
23
|
+
'jsdoc/no-types': "error";
|
|
24
|
+
};
|
|
25
|
+
settings: {
|
|
26
|
+
jsdoc: {
|
|
27
|
+
mode: string;
|
|
28
|
+
tagNamePreference: {
|
|
29
|
+
callback: boolean;
|
|
30
|
+
class: boolean;
|
|
31
|
+
constructor: boolean;
|
|
32
|
+
default: string;
|
|
33
|
+
function: boolean;
|
|
34
|
+
method: boolean;
|
|
35
|
+
readonly: boolean;
|
|
36
|
+
static: boolean;
|
|
37
|
+
template: boolean;
|
|
38
|
+
type: boolean;
|
|
39
|
+
typedef: boolean;
|
|
40
|
+
typeParam: string;
|
|
41
|
+
virtual: string;
|
|
42
|
+
arg: string;
|
|
43
|
+
argument: string;
|
|
44
|
+
desc: boolean;
|
|
45
|
+
description: boolean;
|
|
46
|
+
exception: string;
|
|
47
|
+
return: string;
|
|
48
|
+
types: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=jsdoc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsdoc.d.ts","names":[],"sources":["../../src/_internals/jsdoc.ts"],"mappings":"A,qBAEa;;;;;;;;;;;;;qBAcA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/_internals/jsdoc.ts
|
|
2
|
+
const jsdocSettings = { jsdoc: { tagNamePreference: {
|
|
3
|
+
arg: "param",
|
|
4
|
+
argument: "param",
|
|
5
|
+
desc: false,
|
|
6
|
+
description: false,
|
|
7
|
+
exception: "throws",
|
|
8
|
+
return: "returns",
|
|
9
|
+
types: false
|
|
10
|
+
} } };
|
|
11
|
+
const typescriptJsdocConfig = {
|
|
12
|
+
rules: {
|
|
13
|
+
"jsdoc/check-tag-names": ["error", { definedTags: [
|
|
14
|
+
"alpha",
|
|
15
|
+
"beta",
|
|
16
|
+
"defaultValue",
|
|
17
|
+
"eventProperty",
|
|
18
|
+
"experimental",
|
|
19
|
+
"hidden",
|
|
20
|
+
"inheritDoc",
|
|
21
|
+
"internal",
|
|
22
|
+
"packageDocumentation",
|
|
23
|
+
"privateRemarks",
|
|
24
|
+
"remarks",
|
|
25
|
+
"sealed",
|
|
26
|
+
"typeParam",
|
|
27
|
+
"virtual"
|
|
28
|
+
] }],
|
|
29
|
+
"jsdoc/multiline-blocks": ["error", {
|
|
30
|
+
noSingleLineBlocks: true,
|
|
31
|
+
singleLineTags: []
|
|
32
|
+
}],
|
|
33
|
+
"jsdoc/no-types": "error"
|
|
34
|
+
},
|
|
35
|
+
settings: { jsdoc: {
|
|
36
|
+
mode: "typescript",
|
|
37
|
+
tagNamePreference: {
|
|
38
|
+
...jsdocSettings.jsdoc.tagNamePreference,
|
|
39
|
+
callback: false,
|
|
40
|
+
class: false,
|
|
41
|
+
constructor: false,
|
|
42
|
+
default: "defaultValue",
|
|
43
|
+
function: false,
|
|
44
|
+
method: false,
|
|
45
|
+
readonly: false,
|
|
46
|
+
static: false,
|
|
47
|
+
template: false,
|
|
48
|
+
type: false,
|
|
49
|
+
typedef: false,
|
|
50
|
+
typeParam: "typeParam",
|
|
51
|
+
virtual: "virtual"
|
|
52
|
+
}
|
|
53
|
+
} }
|
|
54
|
+
};
|
|
55
|
+
export { jsdocSettings, typescriptJsdocConfig };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=jsdoc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsdoc.js","names":[],"sources":["../../src/_internals/jsdoc.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport const jsdocSettings = {\n jsdoc: {\n tagNamePreference: {\n arg: 'param',\n argument: 'param',\n desc: false,\n description: false,\n exception: 'throws',\n return: 'returns',\n types: false,\n },\n },\n};\n\nexport const typescriptJsdocConfig = {\n rules: {\n 'jsdoc/check-tag-names': [\n 'error',\n {\n definedTags: [\n 'alpha',\n 'beta',\n 'defaultValue',\n 'eventProperty',\n 'experimental',\n 'hidden',\n 'inheritDoc',\n 'internal',\n 'packageDocumentation',\n 'privateRemarks',\n 'remarks',\n 'sealed',\n 'typeParam',\n 'virtual',\n ],\n },\n ],\n 'jsdoc/multiline-blocks': [\n 'error',\n {\n noSingleLineBlocks: true,\n singleLineTags: [],\n },\n ],\n 'jsdoc/no-types': 'error',\n },\n settings: {\n jsdoc: {\n mode: 'typescript',\n tagNamePreference: {\n ...jsdocSettings.jsdoc.tagNamePreference,\n callback: false,\n class: false,\n constructor: false,\n default: 'defaultValue',\n function: false,\n method: false,\n readonly: false,\n static: false,\n template: false,\n type: false,\n typedef: false,\n typeParam: 'typeParam',\n virtual: 'virtual',\n },\n },\n },\n} satisfies TypedFlatConfigItem;\n"],"mappings":";AAEA,MAAa,gBAAgB,EACzB,OAAO,EACH,mBAAmB;CACf,KAAK;CACL,UAAU;CACV,MAAM;CACN,aAAa;CACb,WAAW;CACX,QAAQ;CACR,OAAO;AACX,EACJ,EACJ;AAEA,MAAa,wBAAwB;CACjC,OAAO;EACH,yBAAyB,CACrB,SACA,EACI,aAAa;GACT;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ,EACJ,CACJ;EACA,0BAA0B,CACtB,SACA;GACI,oBAAoB;GACpB,gBAAgB,CAAC;EACrB,CACJ;EACA,kBAAkB;CACtB;CACA,UAAU,EACN,OAAO;EACH,MAAM;EACN,mBAAmB;GACf,GAAG,cAAc,MAAM;GACvB,UAAU;GACV,OAAO;GACP,aAAa;GACb,SAAS;GACT,UAAU;GACV,QAAQ;GACR,UAAU;GACV,QAAQ;GACR,UAAU;GACV,MAAM;GACN,SAAS;GACT,WAAW;GACX,SAAS;EACb;CACJ,EACJ;AACJ"}
|
|
@@ -9,7 +9,11 @@ function createTypeAwareConfig() {
|
|
|
9
9
|
"require-await": "off",
|
|
10
10
|
"ts/await-thenable": "error",
|
|
11
11
|
"ts/no-base-to-string": "error",
|
|
12
|
-
"ts/no-floating-promises": "error",
|
|
12
|
+
"ts/no-floating-promises": ["error", { allowForKnownSafePromises: [{
|
|
13
|
+
from: "package",
|
|
14
|
+
name: "SafePromise",
|
|
15
|
+
package: "@kikiutils/shared"
|
|
16
|
+
}] }],
|
|
13
17
|
"ts/no-for-in-array": "error",
|
|
14
18
|
"ts/no-misused-promises": "error",
|
|
15
19
|
"ts/no-misused-spread": "error",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-aware.js","names":[],"sources":["../../src/_internals/type-aware.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport function createTypeAwareConfig(): TypedFlatConfigItem {\n return {\n languageOptions: {\n parserOptions: {\n projectService: true,\n tsconfigRootDir: process.cwd(),\n },\n },\n rules: {\n 'require-await': 'off',\n 'ts/await-thenable': 'error',\n 'ts/no-base-to-string': 'error',\n 'ts/no-floating-promises': 'error',\n 'ts/no-for-in-array': 'error',\n 'ts/no-misused-promises': 'error',\n 'ts/no-misused-spread': 'error',\n 'ts/no-unnecessary-type-assertion': 'error',\n 'ts/require-await': 'error',\n 'ts/return-await': 'error',\n 'ts/switch-exhaustiveness-check': [\n 'error',\n { considerDefaultExhaustiveForUnions: true },\n ],\n },\n };\n}\n"],"mappings":";AAEA,SAAgB,wBAA6C;CACzD,OAAO;EACH,iBAAiB,EACb,eAAe;GACX,gBAAgB;GAChB,iBAAiB,QAAQ,IAAI;EACjC,EACJ;EACA,OAAO;GACH,iBAAiB;GACjB,qBAAqB;GACrB,wBAAwB;GACxB,2BAA2B;
|
|
1
|
+
{"version":3,"file":"type-aware.js","names":[],"sources":["../../src/_internals/type-aware.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport function createTypeAwareConfig(): TypedFlatConfigItem {\n return {\n languageOptions: {\n parserOptions: {\n projectService: true,\n tsconfigRootDir: process.cwd(),\n },\n },\n rules: {\n 'require-await': 'off',\n 'ts/await-thenable': 'error',\n 'ts/no-base-to-string': 'error',\n 'ts/no-floating-promises': [\n 'error',\n {\n allowForKnownSafePromises: [\n {\n from: 'package',\n name: 'SafePromise',\n package: '@kikiutils/shared',\n },\n ],\n },\n ],\n 'ts/no-for-in-array': 'error',\n 'ts/no-misused-promises': 'error',\n 'ts/no-misused-spread': 'error',\n 'ts/no-unnecessary-type-assertion': 'error',\n 'ts/require-await': 'error',\n 'ts/return-await': 'error',\n 'ts/switch-exhaustiveness-check': [\n 'error',\n { considerDefaultExhaustiveForUnions: true },\n ],\n },\n };\n}\n"],"mappings":";AAEA,SAAgB,wBAA6C;CACzD,OAAO;EACH,iBAAiB,EACb,eAAe;GACX,gBAAgB;GAChB,iBAAiB,QAAQ,IAAI;EACjC,EACJ;EACA,OAAO;GACH,iBAAiB;GACjB,qBAAqB;GACrB,wBAAwB;GACxB,2BAA2B,CACvB,SACA,EACI,2BAA2B,CACvB;IACI,MAAM;IACN,MAAM;IACN,SAAS;GACb,CACJ,EACJ,CACJ;GACA,sBAAsB;GACtB,0BAA0B;GAC1B,wBAAwB;GACxB,oCAAoC;GACpC,oBAAoB;GACpB,mBAAmB;GACnB,kCAAkC,CAC9B,SACA,EAAE,oCAAoC,KAAK,CAC/C;EACJ;CACJ;AACJ"}
|
package/dist/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":[],"sources":["../src/base.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"base.d.ts","names":[],"sources":["../src/base.ts"],"mappings":";wBAwCgB,kBAAkB,+BAAuC;wBA6IzD,gBAAgB,+BAAuC"}
|
package/dist/base.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsdocSettings, typescriptJsdocConfig } from "./_internals/jsdoc.js";
|
|
1
2
|
import { customPlugins } from "./_internals/plugins.js";
|
|
2
3
|
import { createTypeAwareConfig } from "./_internals/type-aware.js";
|
|
3
4
|
import { GLOB_JS, GLOB_JSX, GLOB_TESTS, GLOB_TS, GLOB_TSX } from "@antfu/eslint-config";
|
|
@@ -38,15 +39,18 @@ function createBaseConfigs(environment = "node") {
|
|
|
38
39
|
rules: {
|
|
39
40
|
...createBaseRules(environment),
|
|
40
41
|
"node/prefer-global/process": ["error", "always"]
|
|
41
|
-
}
|
|
42
|
+
},
|
|
43
|
+
settings: jsdocSettings
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
46
|
files: [GLOB_TS, GLOB_TSX],
|
|
45
47
|
rules: {
|
|
48
|
+
...typescriptJsdocConfig.rules,
|
|
46
49
|
"ts/array-type": ["error", { default: "array-simple" }],
|
|
47
50
|
"ts/consistent-generic-constructors": ["error", "constructor"],
|
|
48
51
|
"ts/no-redeclare": "off"
|
|
49
|
-
}
|
|
52
|
+
},
|
|
53
|
+
settings: typescriptJsdocConfig.settings
|
|
50
54
|
},
|
|
51
55
|
{
|
|
52
56
|
...createTypeAwareConfig(),
|
|
@@ -57,8 +61,29 @@ function createBaseConfigs(environment = "node") {
|
|
|
57
61
|
files: GLOB_TESTS,
|
|
58
62
|
rules: {
|
|
59
63
|
"kikiutils/consistent-parameter-layout": ["error", { compactTestCalls: true }],
|
|
64
|
+
"no-restricted-imports": ["error", { paths: [{
|
|
65
|
+
importNames: ["expect"],
|
|
66
|
+
message: "Use `expect` from the test context.",
|
|
67
|
+
name: "vitest"
|
|
68
|
+
}] }],
|
|
69
|
+
"test/consistent-each-for": ["error", {
|
|
70
|
+
it: "for",
|
|
71
|
+
test: "for"
|
|
72
|
+
}],
|
|
73
|
+
"test/prefer-each": "error",
|
|
74
|
+
"test/prefer-hooks-on-top": "error",
|
|
75
|
+
"test/prefer-lowercase-title": ["error", {
|
|
76
|
+
ignoreTopLevelDescribe: true,
|
|
77
|
+
lowercaseFirstCharacterOnly: true
|
|
78
|
+
}],
|
|
79
|
+
"test/prefer-to-be": "error",
|
|
80
|
+
"test/valid-describe-callback": "error",
|
|
60
81
|
"test/valid-expect": "error",
|
|
61
|
-
"test/valid-expect-in-promise": "error"
|
|
82
|
+
"test/valid-expect-in-promise": "error",
|
|
83
|
+
"test/valid-title": ["error", {
|
|
84
|
+
mustMatch: { it: "^should " },
|
|
85
|
+
mustNotMatch: { it: String.raw`\.$` }
|
|
86
|
+
}]
|
|
62
87
|
}
|
|
63
88
|
},
|
|
64
89
|
{
|
|
@@ -96,6 +121,18 @@ function createBaseRules(environment = "node") {
|
|
|
96
121
|
"antfu/reasonable-newline": "off",
|
|
97
122
|
"arrow-body-style": ["error", "as-needed"],
|
|
98
123
|
"curly": ["error", "multi-line"],
|
|
124
|
+
"jsdoc/check-tag-names": "error",
|
|
125
|
+
"jsdoc/multiline-blocks": ["error", {
|
|
126
|
+
noSingleLineBlocks: true,
|
|
127
|
+
singleLineTags: ["type", "import"]
|
|
128
|
+
}],
|
|
129
|
+
"jsdoc/no-blank-blocks": ["error", { enableFixer: true }],
|
|
130
|
+
"jsdoc/require-asterisk-prefix": "error",
|
|
131
|
+
"jsdoc/require-hyphen-before-param-description": [
|
|
132
|
+
"error",
|
|
133
|
+
"always",
|
|
134
|
+
{ tags: { typeParam: "always" } }
|
|
135
|
+
],
|
|
99
136
|
"kikiutils/compact-iteration-layout": "error",
|
|
100
137
|
"kikiutils/consistent-condition-layout": "error",
|
|
101
138
|
"kikiutils/consistent-parameter-layout": "error",
|
|
@@ -182,7 +219,9 @@ function createBaseRules(environment = "node") {
|
|
|
182
219
|
"style/indent": ["error", 4],
|
|
183
220
|
"style/max-len": ["warn", {
|
|
184
221
|
code: 120,
|
|
185
|
-
comments: 120
|
|
222
|
+
comments: 120,
|
|
223
|
+
ignoreStrings: true,
|
|
224
|
+
ignoreTemplateLiterals: true
|
|
186
225
|
}],
|
|
187
226
|
"style/member-delimiter-style": ["error", { multiline: {
|
|
188
227
|
delimiter: "semi",
|
package/dist/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","names":[],"sources":["../src/base.ts"],"sourcesContent":["import type {\n Rules,\n TypedFlatConfigItem,\n} from '@antfu/eslint-config';\nimport {\n GLOB_JS,\n GLOB_JSX,\n GLOB_TESTS,\n GLOB_TS,\n GLOB_TSX,\n} from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nimport { customPlugins } from './_internals/plugins';\nimport { createTypeAwareConfig } from './_internals/type-aware';\n\n// Constants/Variables\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nconst vscodeOrderSensitiveArrayProperties = [\n 'args',\n 'autoAttachSmartPattern',\n 'dependsOn',\n 'options',\n 'outFiles',\n 'problemMatcher',\n 'resolveSourceMapLocations',\n 'runtimeArgs',\n 'skipFiles',\n].join('|');\n\n// Functions\nexport function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {\n return [\n // All files\n {\n rules: {\n 'e18e/ban-dependencies': [\n 'error',\n { allowed: ['axios'] },\n ],\n 'e18e/prefer-static-regex': 'off',\n },\n },\n // JavaScript and TypeScript\n {\n files: [\n GLOB_JS,\n GLOB_JSX,\n GLOB_TS,\n GLOB_TSX,\n ],\n plugins: {\n kikiutils: customPlugins,\n promise,\n },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n },\n },\n // TypeScript\n {\n files: [\n GLOB_TS,\n GLOB_TSX,\n ],\n rules: {\n 'ts/array-type': [\n 'error',\n { default: 'array-simple' },\n ],\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n // Type-aware TypeScript\n {\n ...createTypeAwareConfig(),\n files: [\n GLOB_TS,\n GLOB_TSX,\n ],\n ignores: ['**/*.config.?([cm])ts'],\n },\n // Tests\n {\n files: GLOB_TESTS,\n rules: {\n 'kikiutils/consistent-parameter-layout': [\n 'error',\n { compactTestCalls: true },\n ],\n 'test/valid-expect': 'error',\n 'test/valid-expect-in-promise': 'error',\n },\n },\n // VS Code JSONC\n {\n files: ['**/.vscode/*.json'],\n rules: {\n 'jsonc/sort-array-values': [\n 'error',\n {\n order: {\n natural: true,\n type: 'asc',\n },\n // Preserve ordered fields and any argument or option arrays nested inside them.\n // eslint-disable-next-line style/max-len\n pathPattern: String.raw`^(?!.*(?:^|\\.|\\[\")(?:${vscodeOrderSensitiveArrayProperties})(?:$|\\.|\\[|\"\\])).*`,\n },\n ],\n 'jsonc/sort-keys': [\n 'error',\n 'asc',\n {\n caseSensitive: true,\n natural: true,\n },\n ],\n },\n },\n // Ignore all extracted Markdown code blocks, but keep linting Markdown itself.\n { ignores: ['**/*.md/**'] },\n ];\n}\n\nexport function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {\n return {\n 'antfu/consistent-list-newline': [\n 'error',\n {\n ArrayExpression: false,\n ArrayPattern: false,\n },\n ],\n 'antfu/curly': 'off',\n 'antfu/if-newline': 'off',\n 'antfu/no-top-level-await': 'off',\n 'antfu/reasonable-newline': 'off',\n 'arrow-body-style': [\n 'error',\n 'as-needed',\n ],\n 'curly': [\n 'error',\n 'multi-line',\n ],\n 'kikiutils/compact-iteration-layout': 'error',\n 'kikiutils/consistent-condition-layout': 'error',\n 'kikiutils/consistent-parameter-layout': 'error',\n 'kikiutils/statement-padding': 'error',\n 'max-classes-per-file': [\n 'error',\n 1,\n ],\n 'no-constant-binary-expression': 'error',\n 'no-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\n 'no-useless-assignment': 'error',\n 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-enums': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n sortByValue: 'never',\n },\n ],\n 'perfectionist/sort-heritage-clauses': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n environment,\n groups: [\n 'side-effect',\n 'side-effect-style',\n 'style',\n [\n 'value-builtin',\n 'type-builtin',\n ],\n [\n 'value-external',\n 'type-external',\n ],\n [\n 'value-internal',\n 'type-internal',\n ],\n [\n 'value-parent',\n 'type-parent',\n ],\n [\n 'value-sibling',\n 'type-sibling',\n ],\n [\n 'value-index',\n 'type-index',\n ],\n 'unknown',\n ],\n ignoreCase: false,\n internalPattern: [\n '^#.*',\n '^@/.*',\n '^~/.*',\n ],\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-intersection-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-maps': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-modules': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n groups: [\n 'declare-type',\n [\n 'export-type',\n 'type',\n ],\n 'declare-interface',\n [\n 'export-interface',\n 'interface',\n ],\n 'declare-enum',\n [\n 'enum',\n 'export-enum',\n ],\n 'declare-class',\n [\n 'class',\n 'export-class',\n ],\n 'declare-function',\n [\n 'export-function',\n 'function',\n ],\n ],\n },\n ],\n 'perfectionist/sort-object-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-objects': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-sets': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-switch-case': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-union-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-variable-declarations': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'preserve-caught-error': 'error',\n 'promise/no-multiple-resolved': 'error',\n 'promise/no-return-in-finally': 'error',\n 'promise/no-return-wrap': 'error',\n 'require-await': 'error',\n 'style/array-bracket-newline': [\n 'error',\n { multiline: true },\n ],\n 'style/array-element-newline': [\n 'error',\n {\n ArrayExpression: {\n consistent: true,\n minItems: 2,\n },\n ArrayPattern: { minItems: 3 },\n },\n ],\n 'style/arrow-parens': [\n 'error',\n 'always',\n ],\n 'style/brace-style': [\n 'error',\n '1tbs',\n { allowSingleLine: false },\n ],\n 'style/function-call-spacing': [\n 'error',\n 'never',\n ],\n 'style/indent': [\n 'error',\n 4,\n ],\n 'style/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n },\n ],\n 'style/member-delimiter-style': [\n 'error',\n {\n multiline: {\n delimiter: 'semi',\n requireLast: true,\n },\n },\n ],\n 'style/no-extra-parens': [\n 'error',\n 'all',\n { nestedBinaryExpressions: false },\n ],\n 'style/no-extra-semi': 'error',\n 'style/object-curly-newline': [\n 'error',\n {\n ExportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ImportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ObjectExpression: {\n minProperties: 2,\n multiline: true,\n },\n ObjectPattern: {\n minProperties: 3,\n multiline: true,\n },\n },\n ],\n 'style/operator-linebreak': [\n 'error',\n 'before',\n { overrides: { '=': 'after' } },\n ],\n 'style/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: [\n 'class',\n 'enum',\n 'function',\n ],\n prev: '*',\n },\n {\n blankLine: 'always',\n next: '*',\n prev: [\n 'class',\n 'function',\n ],\n },\n ],\n 'style/semi': [\n 'error',\n 'always',\n ],\n };\n}\n"],"mappings":";;;;;AAkBA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;AACV;AAEA,MAAM,sCAAsC;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC,CAAC,KAAK,GAAG;AAGV,SAAgB,kBAAkB,cAA8B,QAA+B;CAC3F,OAAO;EAEH,EACI,OAAO;GACH,yBAAyB,CACrB,SACA,EAAE,SAAS,CAAC,OAAO,EAAE,CACzB;GACA,4BAA4B;EAChC,EACJ;EAEA;GACI,OAAO;IACH;IACA;IACA;IACA;GACJ;GACA,SAAS;IACL,WAAW;IACX;GACJ;GACA,OAAO;IACH,GAAG,gBAAgB,WAAW;IAC9B,8BAA8B,CAC1B,SACA,QACJ;GACJ;EACJ;EAEA;GACI,OAAO,CACH,SACA,QACJ;GACA,OAAO;IACH,iBAAiB,CACb,SACA,EAAE,SAAS,eAAe,CAC9B;IACA,sCAAsC,CAClC,SACA,aACJ;IACA,mBAAmB;GACvB;EACJ;EAEA;GACI,GAAG,sBAAsB;GACzB,OAAO,CACH,SACA,QACJ;GACA,SAAS,CAAC,uBAAuB;EACrC;EAEA;GACI,OAAO;GACP,OAAO;IACH,yCAAyC,CACrC,SACA,EAAE,kBAAkB,KAAK,CAC7B;IACA,qBAAqB;IACrB,gCAAgC;GACpC;EACJ;EAEA;GACI,OAAO,CAAC,mBAAmB;GAC3B,OAAO;IACH,2BAA2B,CACvB,SACA;KACI,OAAO;MACH,SAAS;MACT,MAAM;KACV;KAGA,aAAa,OAAO,GAAG,wBAAwB,oCAAoC;IACvF,CACJ;IACA,mBAAmB;KACf;KACA;KACA;MACI,eAAe;MACf,SAAS;KACb;IACJ;GACJ;EACJ;EAEA,EAAE,SAAS,CAAC,YAAY,EAAE;CAC9B;AACJ;AAEA,SAAgB,gBAAgB,cAA8B,QAAe;CACzE,OAAO;EACH,iCAAiC,CAC7B,SACA;GACI,iBAAiB;GACjB,cAAc;EAClB,CACJ;EACA,eAAe;EACf,oBAAoB;EACpB,4BAA4B;EAC5B,4BAA4B;EAC5B,oBAAoB,CAChB,SACA,WACJ;EACA,SAAS,CACL,SACA,YACJ;EACA,sCAAsC;EACtC,yCAAyC;EACzC,yCAAyC;EACzC,+BAA+B;EAC/B,wBAAwB,CACpB,SACA,CACJ;EACA,iCAAiC;EACjC,8BAA8B,CAC1B,SACA,EAAE,WAAW,KAAK,CACtB;EACA,yBAAyB;EACzB,qCAAqC,CACjC,SACA,4BACJ;EACA,4BAA4B,CACxB,SACA;GACI,GAAG;GACH,aAAa;EACjB,CACJ;EACA,uCAAuC,CACnC,SACA,4BACJ;EACA,8BAA8B,CAC1B,SACA;GACI;GACA,QAAQ;IACJ;IACA;IACA;IACA,CACI,iBACA,cACJ;IACA,CACI,kBACA,eACJ;IACA,CACI,kBACA,eACJ;IACA,CACI,gBACA,aACJ;IACA,CACI,iBACA,cACJ;IACA,CACI,eACA,YACJ;IACA;GACJ;GACA,YAAY;GACZ,iBAAiB;IACb;IACA;IACA;GACJ;GACA,MAAM;EACV,CACJ;EACA,iCAAiC,CAC7B,SACA,4BACJ;EACA,yCAAyC,CACrC,SACA,4BACJ;EACA,2BAA2B,CACvB,SACA,4BACJ;EACA,8BAA8B,CAC1B,SACA;GACI,GAAG;GACH,QAAQ;IACJ;IACA,CACI,eACA,MACJ;IACA;IACA,CACI,oBACA,WACJ;IACA;IACA,CACI,QACA,aACJ;IACA;IACA,CACI,SACA,cACJ;IACA;IACA,CACI,mBACA,UACJ;GACJ;EACJ,CACJ;EACA,mCAAmC,CAC/B,SACA,4BACJ;EACA,8BAA8B,CAC1B,SACA,4BACJ;EACA,2BAA2B,CACvB,SACA,4BACJ;EACA,kCAAkC,CAC9B,SACA;GACI,YAAY;GACZ,MAAM;EACV,CACJ;EACA,kCAAkC,CAC9B,SACA,4BACJ;EACA,4CAA4C,CACxC,SACA,4BACJ;EACA,yBAAyB;EACzB,gCAAgC;EAChC,gCAAgC;EAChC,0BAA0B;EAC1B,iBAAiB;EACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,KAAK,CACtB;EACA,+BAA+B,CAC3B,SACA;GACI,iBAAiB;IACb,YAAY;IACZ,UAAU;GACd;GACA,cAAc,EAAE,UAAU,EAAE;EAChC,CACJ;EACA,sBAAsB,CAClB,SACA,QACJ;EACA,qBAAqB;GACjB;GACA;GACA,EAAE,iBAAiB,MAAM;EAC7B;EACA,+BAA+B,CAC3B,SACA,OACJ;EACA,gBAAgB,CACZ,SACA,CACJ;EACA,iBAAiB,CACb,QACA;GACI,MAAM;GACN,UAAU;EACd,CACJ;EACA,gCAAgC,CAC5B,SACA,EACI,WAAW;GACP,WAAW;GACX,aAAa;EACjB,EACJ,CACJ;EACA,yBAAyB;GACrB;GACA;GACA,EAAE,yBAAyB,MAAM;EACrC;EACA,uBAAuB;EACvB,8BAA8B,CAC1B,SACA;GACI,mBAAmB;IACf,eAAe;IACf,WAAW;GACf;GACA,mBAAmB;IACf,eAAe;IACf,WAAW;GACf;GACA,kBAAkB;IACd,eAAe;IACf,WAAW;GACf;GACA,eAAe;IACX,eAAe;IACf,WAAW;GACf;EACJ,CACJ;EACA,4BAA4B;GACxB;GACA;GACA,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE;EAClC;EACA,yCAAyC;GACrC;GACA;IACI,WAAW;IACX,MAAM;KACF;KACA;KACA;IACJ;IACA,MAAM;GACV;GACA;IACI,WAAW;IACX,MAAM;IACN,MAAM,CACF,SACA,UACJ;GACJ;EACJ;EACA,cAAc,CACV,SACA,QACJ;CACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"base.js","names":[],"sources":["../src/base.ts"],"sourcesContent":["import type {\n Rules,\n TypedFlatConfigItem,\n} from '@antfu/eslint-config';\nimport {\n GLOB_JS,\n GLOB_JSX,\n GLOB_TESTS,\n GLOB_TS,\n GLOB_TSX,\n} from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nimport {\n jsdocSettings,\n typescriptJsdocConfig,\n} from './_internals/jsdoc';\nimport { customPlugins } from './_internals/plugins';\nimport { createTypeAwareConfig } from './_internals/type-aware';\n\n// Constants/Variables\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nconst vscodeOrderSensitiveArrayProperties = [\n 'args',\n 'autoAttachSmartPattern',\n 'dependsOn',\n 'options',\n 'outFiles',\n 'problemMatcher',\n 'resolveSourceMapLocations',\n 'runtimeArgs',\n 'skipFiles',\n].join('|');\n\n// Functions\nexport function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {\n return [\n // All files\n {\n rules: {\n 'e18e/ban-dependencies': [\n 'error',\n { allowed: ['axios'] },\n ],\n 'e18e/prefer-static-regex': 'off',\n },\n },\n // JavaScript and TypeScript\n {\n files: [\n GLOB_JS,\n GLOB_JSX,\n GLOB_TS,\n GLOB_TSX,\n ],\n plugins: {\n kikiutils: customPlugins,\n promise,\n },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n },\n settings: jsdocSettings,\n },\n // TypeScript\n {\n files: [\n GLOB_TS,\n GLOB_TSX,\n ],\n rules: {\n ...typescriptJsdocConfig.rules,\n 'ts/array-type': [\n 'error',\n { default: 'array-simple' },\n ],\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n settings: typescriptJsdocConfig.settings,\n },\n // Type-aware TypeScript\n {\n ...createTypeAwareConfig(),\n files: [\n GLOB_TS,\n GLOB_TSX,\n ],\n ignores: ['**/*.config.?([cm])ts'],\n },\n // Tests\n {\n files: GLOB_TESTS,\n rules: {\n 'kikiutils/consistent-parameter-layout': [\n 'error',\n { compactTestCalls: true },\n ],\n 'no-restricted-imports': [\n 'error',\n {\n paths: [\n {\n importNames: ['expect'],\n message: 'Use `expect` from the test context.',\n name: 'vitest',\n },\n ],\n },\n ],\n 'test/consistent-each-for': [\n 'error',\n {\n it: 'for',\n test: 'for',\n },\n ],\n 'test/prefer-each': 'error',\n 'test/prefer-hooks-on-top': 'error',\n 'test/prefer-lowercase-title': [\n 'error',\n {\n ignoreTopLevelDescribe: true,\n lowercaseFirstCharacterOnly: true,\n },\n ],\n 'test/prefer-to-be': 'error',\n 'test/valid-describe-callback': 'error',\n 'test/valid-expect': 'error',\n 'test/valid-expect-in-promise': 'error',\n 'test/valid-title': [\n 'error',\n {\n mustMatch: { it: '^should ' },\n mustNotMatch: { it: String.raw`\\.$` },\n },\n ],\n },\n },\n // VS Code JSONC\n {\n files: ['**/.vscode/*.json'],\n rules: {\n 'jsonc/sort-array-values': [\n 'error',\n {\n order: {\n natural: true,\n type: 'asc',\n },\n // Preserve ordered fields and any argument or option arrays nested inside them.\n pathPattern: String.raw`^(?!.*(?:^|\\.|\\[\")(?:${vscodeOrderSensitiveArrayProperties})(?:$|\\.|\\[|\"\\])).*`,\n },\n ],\n 'jsonc/sort-keys': [\n 'error',\n 'asc',\n {\n caseSensitive: true,\n natural: true,\n },\n ],\n },\n },\n // Ignore all extracted Markdown code blocks, but keep linting Markdown itself.\n { ignores: ['**/*.md/**'] },\n ];\n}\n\nexport function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {\n return {\n 'antfu/consistent-list-newline': [\n 'error',\n {\n ArrayExpression: false,\n ArrayPattern: false,\n },\n ],\n 'antfu/curly': 'off',\n 'antfu/if-newline': 'off',\n 'antfu/no-top-level-await': 'off',\n 'antfu/reasonable-newline': 'off',\n 'arrow-body-style': [\n 'error',\n 'as-needed',\n ],\n 'curly': [\n 'error',\n 'multi-line',\n ],\n 'jsdoc/check-tag-names': 'error',\n 'jsdoc/multiline-blocks': [\n 'error',\n {\n noSingleLineBlocks: true,\n singleLineTags: [\n 'type',\n 'import',\n ],\n },\n ],\n 'jsdoc/no-blank-blocks': [\n 'error',\n { enableFixer: true },\n ],\n 'jsdoc/require-asterisk-prefix': 'error',\n 'jsdoc/require-hyphen-before-param-description': [\n 'error',\n 'always',\n { tags: { typeParam: 'always' } },\n ],\n 'kikiutils/compact-iteration-layout': 'error',\n 'kikiutils/consistent-condition-layout': 'error',\n 'kikiutils/consistent-parameter-layout': 'error',\n 'kikiutils/statement-padding': 'error',\n 'max-classes-per-file': [\n 'error',\n 1,\n ],\n 'no-constant-binary-expression': 'error',\n 'no-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\n 'no-useless-assignment': 'error',\n 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-enums': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n sortByValue: 'never',\n },\n ],\n 'perfectionist/sort-heritage-clauses': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n environment,\n groups: [\n 'side-effect',\n 'side-effect-style',\n 'style',\n [\n 'value-builtin',\n 'type-builtin',\n ],\n [\n 'value-external',\n 'type-external',\n ],\n [\n 'value-internal',\n 'type-internal',\n ],\n [\n 'value-parent',\n 'type-parent',\n ],\n [\n 'value-sibling',\n 'type-sibling',\n ],\n [\n 'value-index',\n 'type-index',\n ],\n 'unknown',\n ],\n ignoreCase: false,\n internalPattern: [\n '^#.*',\n '^@/.*',\n '^~/.*',\n ],\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-intersection-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-maps': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-modules': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n groups: [\n 'declare-type',\n [\n 'export-type',\n 'type',\n ],\n 'declare-interface',\n [\n 'export-interface',\n 'interface',\n ],\n 'declare-enum',\n [\n 'enum',\n 'export-enum',\n ],\n 'declare-class',\n [\n 'class',\n 'export-class',\n ],\n 'declare-function',\n [\n 'export-function',\n 'function',\n ],\n ],\n },\n ],\n 'perfectionist/sort-object-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-objects': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-sets': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-switch-case': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-union-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-variable-declarations': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'preserve-caught-error': 'error',\n 'promise/no-multiple-resolved': 'error',\n 'promise/no-return-in-finally': 'error',\n 'promise/no-return-wrap': 'error',\n 'require-await': 'error',\n 'style/array-bracket-newline': [\n 'error',\n { multiline: true },\n ],\n 'style/array-element-newline': [\n 'error',\n {\n ArrayExpression: {\n consistent: true,\n minItems: 2,\n },\n ArrayPattern: { minItems: 3 },\n },\n ],\n 'style/arrow-parens': [\n 'error',\n 'always',\n ],\n 'style/brace-style': [\n 'error',\n '1tbs',\n { allowSingleLine: false },\n ],\n 'style/function-call-spacing': [\n 'error',\n 'never',\n ],\n 'style/indent': [\n 'error',\n 4,\n ],\n 'style/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n ignoreStrings: true,\n ignoreTemplateLiterals: true,\n },\n ],\n 'style/member-delimiter-style': [\n 'error',\n {\n multiline: {\n delimiter: 'semi',\n requireLast: true,\n },\n },\n ],\n 'style/no-extra-parens': [\n 'error',\n 'all',\n { nestedBinaryExpressions: false },\n ],\n 'style/no-extra-semi': 'error',\n 'style/object-curly-newline': [\n 'error',\n {\n ExportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ImportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ObjectExpression: {\n minProperties: 2,\n multiline: true,\n },\n ObjectPattern: {\n minProperties: 3,\n multiline: true,\n },\n },\n ],\n 'style/operator-linebreak': [\n 'error',\n 'before',\n { overrides: { '=': 'after' } },\n ],\n 'style/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: [\n 'class',\n 'enum',\n 'function',\n ],\n prev: '*',\n },\n {\n blankLine: 'always',\n next: '*',\n prev: [\n 'class',\n 'function',\n ],\n },\n ],\n 'style/semi': [\n 'error',\n 'always',\n ],\n };\n}\n"],"mappings":"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AC1B,SACA;GACI,GAAG;GACH,QAAQ;IACJ;IACA,CACI,eACA,MACJ;IACA;IACA,CACI,oBACA,WACJ;IACA;IACA,CACI,QACA,aACJ;IACA;IACA,CACI,SACA,cACJ;IACA;IACA,CACI,mBACA,UACJ;GACJ;EACJ,CACJ;EACA,mCAAmC,CAC/B,SACA,4BACJ;EACA,8BAA8B,CAC1B,SACA,4BACJ;EACA,2BAA2B,CACvB,SACA,4BACJ;EACA,kCAAkC,CAC9B,SACA;GACI,YAAY;GACZ,MAAM;EACV,CACJ;EACA,kCAAkC,CAC9B,SACA,4BACJ;EACA,4CAA4C,CACxC,SACA,4BACJ;EACA,yBAAyB;EACzB,gCAAgC;EAChC,gCAAgC;EAChC,0BAA0B;EAC1B,iBAAiB;EACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,KAAK,CACtB;EACA,+BAA+B,CAC3B,SACA;GACI,iBAAiB;IACb,YAAY;IACZ,UAAU;GACd;GACA,cAAc,EAAE,UAAU,EAAE;EAChC,CACJ;EACA,sBAAsB,CAClB,SACA,QACJ;EACA,qBAAqB;GACjB;GACA;GACA,EAAE,iBAAiB,MAAM;EAC7B;EACA,+BAA+B,CAC3B,SACA,OACJ;EACA,gBAAgB,CACZ,SACA,CACJ;EACA,iBAAiB,CACb,QACA;GACI,MAAM;GACN,UAAU;GACV,eAAe;GACf,wBAAwB;EAC5B,CACJ;EACA,gCAAgC,CAC5B,SACA,EACI,WAAW;GACP,WAAW;GACX,aAAa;EACjB,EACJ,CACJ;EACA,yBAAyB;GACrB;GACA;GACA,EAAE,yBAAyB,MAAM;EACrC;EACA,uBAAuB;EACvB,8BAA8B,CAC1B,SACA;GACI,mBAAmB;IACf,eAAe;IACf,WAAW;GACf;GACA,mBAAmB;IACf,eAAe;IACf,WAAW;GACf;GACA,kBAAkB;IACd,eAAe;IACf,WAAW;GACf;GACA,eAAe;IACX,eAAe;IACf,WAAW;GACf;EACJ,CACJ;EACA,4BAA4B;GACxB;GACA;GACA,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE;EAClC;EACA,yCAAyC;GACrC;GACA;IACI,WAAW;IACX,MAAM;KACF;KACA;KACA;IACJ;IACA,MAAM;GACV;GACA;IACI,WAAW;IACX,MAAM;IACN,MAAM,CACF,SACA,UACJ;GACJ;EACJ;EACA,cAAc,CACV,SACA,QACJ;CACJ;AACJ"}
|
package/dist/vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue.d.ts","names":[],"sources":["../src/vue.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"vue.d.ts","names":[],"sources":["../src/vue.ts"],"mappings":";wBAWgB,gBAAgB,+BAAuC"}
|
package/dist/vue.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { typescriptJsdocConfig } from "./_internals/jsdoc.js";
|
|
1
2
|
import { customPlugins } from "./_internals/plugins.js";
|
|
2
3
|
import { createTypeAwareConfig } from "./_internals/type-aware.js";
|
|
3
4
|
import { createBaseRules } from "./base.js";
|
|
@@ -18,6 +19,7 @@ function createVueConfig(environment = "node") {
|
|
|
18
19
|
},
|
|
19
20
|
rules: {
|
|
20
21
|
...createBaseRules(environment),
|
|
22
|
+
...typescriptJsdocConfig.rules,
|
|
21
23
|
...typeAwareConfig.rules,
|
|
22
24
|
"@kikiutils/vue/attributes-order": ["error", {
|
|
23
25
|
alphabetical: true,
|
|
@@ -55,6 +57,8 @@ function createVueConfig(environment = "node") {
|
|
|
55
57
|
"vue/max-len": ["warn", {
|
|
56
58
|
code: 120,
|
|
57
59
|
comments: 120,
|
|
60
|
+
ignoreStrings: true,
|
|
61
|
+
ignoreTemplateLiterals: true,
|
|
58
62
|
template: 120
|
|
59
63
|
}],
|
|
60
64
|
"vue/no-dupe-keys": "error",
|
|
@@ -67,7 +71,8 @@ function createVueConfig(environment = "node") {
|
|
|
67
71
|
"vue/prefer-define-options": "error",
|
|
68
72
|
"vue/require-explicit-emits": "error",
|
|
69
73
|
"vue/require-typed-ref": "error"
|
|
70
|
-
}
|
|
74
|
+
},
|
|
75
|
+
settings: typescriptJsdocConfig.settings
|
|
71
76
|
};
|
|
72
77
|
}
|
|
73
78
|
export { createVueConfig };
|
package/dist/vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue.js","names":[],"sources":["../src/vue.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';\nimport betterTailwindcss from 'eslint-plugin-better-tailwindcss';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nimport { customPlugins } from './_internals/plugins';\nimport { createTypeAwareConfig } from './_internals/type-aware';\nimport { createBaseRules } from './base';\n\nexport function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem {\n const typeAwareConfig = createTypeAwareConfig();\n return {\n files: ['**/*.vue'],\n languageOptions: typeAwareConfig.languageOptions,\n plugins: {\n '@kikiutils/vue': kikiutilsEslintPluginVue,\n 'better-tailwindcss': betterTailwindcss,\n 'kikiutils': customPlugins,\n promise,\n },\n rules: {\n ...createBaseRules(environment),\n ...typeAwareConfig.rules,\n '@kikiutils/vue/attributes-order': [\n 'error',\n {\n alphabetical: true,\n alphabeticalEnhanced: true,\n },\n ],\n '@kikiutils/vue/class-hex-color-case': 'error',\n 'better-tailwindcss/enforce-consistent-class-order': 'error',\n 'better-tailwindcss/enforce-consistent-important-position': 'error',\n 'better-tailwindcss/enforce-consistent-variable-syntax': 'error',\n 'better-tailwindcss/enforce-consistent-variant-order': 'error',\n 'better-tailwindcss/enforce-shorthand-classes': 'error',\n 'better-tailwindcss/no-deprecated-classes': 'warn',\n 'better-tailwindcss/no-duplicate-classes': 'error',\n 'better-tailwindcss/no-unnecessary-whitespace': 'error',\n 'style/max-len': 'off',\n 'ts/array-type': [\n 'error',\n { default: 'array-simple' },\n ],\n 'vue/attribute-hyphenation': 'error',\n 'vue/attributes-order': 'off',\n 'vue/block-order': [\n 'error',\n {\n order: [\n 'template',\n 'script',\n 'style',\n ],\n },\n ],\n 'vue/component-api-style': 'error',\n 'vue/define-emits-declaration': 'error',\n 'vue/define-props-declaration': 'error',\n 'vue/enforce-style-attribute': 'error',\n 'vue/html-closing-bracket-newline': 'error',\n 'vue/html-closing-bracket-spacing': 'error',\n 'vue/html-indent': [\n 'error',\n 4,\n ],\n 'vue/max-attributes-per-line': [\n 'error',\n {\n multiline: 1,\n singleline: 1,\n },\n ],\n 'vue/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n template: 120,\n },\n ],\n 'vue/no-dupe-keys': 'error',\n 'vue/no-lone-template': 'error',\n 'vue/no-multi-spaces': 'error',\n 'vue/no-multiple-objects-in-class': 'error',\n 'vue/no-root-v-if': 'error',\n 'vue/no-template-target-blank': 'error',\n 'vue/no-v-html': 'error',\n 'vue/prefer-define-options': 'error',\n 'vue/require-explicit-emits': 'error',\n 'vue/require-typed-ref': 'error',\n },\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vue.js","names":[],"sources":["../src/vue.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';\nimport betterTailwindcss from 'eslint-plugin-better-tailwindcss';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nimport { typescriptJsdocConfig } from './_internals/jsdoc';\nimport { customPlugins } from './_internals/plugins';\nimport { createTypeAwareConfig } from './_internals/type-aware';\nimport { createBaseRules } from './base';\n\nexport function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem {\n const typeAwareConfig = createTypeAwareConfig();\n return {\n files: ['**/*.vue'],\n languageOptions: typeAwareConfig.languageOptions,\n plugins: {\n '@kikiutils/vue': kikiutilsEslintPluginVue,\n 'better-tailwindcss': betterTailwindcss,\n 'kikiutils': customPlugins,\n promise,\n },\n rules: {\n ...createBaseRules(environment),\n ...typescriptJsdocConfig.rules,\n ...typeAwareConfig.rules,\n '@kikiutils/vue/attributes-order': [\n 'error',\n {\n alphabetical: true,\n alphabeticalEnhanced: true,\n },\n ],\n '@kikiutils/vue/class-hex-color-case': 'error',\n 'better-tailwindcss/enforce-consistent-class-order': 'error',\n 'better-tailwindcss/enforce-consistent-important-position': 'error',\n 'better-tailwindcss/enforce-consistent-variable-syntax': 'error',\n 'better-tailwindcss/enforce-consistent-variant-order': 'error',\n 'better-tailwindcss/enforce-shorthand-classes': 'error',\n 'better-tailwindcss/no-deprecated-classes': 'warn',\n 'better-tailwindcss/no-duplicate-classes': 'error',\n 'better-tailwindcss/no-unnecessary-whitespace': 'error',\n 'style/max-len': 'off',\n 'ts/array-type': [\n 'error',\n { default: 'array-simple' },\n ],\n 'vue/attribute-hyphenation': 'error',\n 'vue/attributes-order': 'off',\n 'vue/block-order': [\n 'error',\n {\n order: [\n 'template',\n 'script',\n 'style',\n ],\n },\n ],\n 'vue/component-api-style': 'error',\n 'vue/define-emits-declaration': 'error',\n 'vue/define-props-declaration': 'error',\n 'vue/enforce-style-attribute': 'error',\n 'vue/html-closing-bracket-newline': 'error',\n 'vue/html-closing-bracket-spacing': 'error',\n 'vue/html-indent': [\n 'error',\n 4,\n ],\n 'vue/max-attributes-per-line': [\n 'error',\n {\n multiline: 1,\n singleline: 1,\n },\n ],\n 'vue/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n ignoreStrings: true,\n ignoreTemplateLiterals: true,\n template: 120,\n },\n ],\n 'vue/no-dupe-keys': 'error',\n 'vue/no-lone-template': 'error',\n 'vue/no-multi-spaces': 'error',\n 'vue/no-multiple-objects-in-class': 'error',\n 'vue/no-root-v-if': 'error',\n 'vue/no-template-target-blank': 'error',\n 'vue/no-v-html': 'error',\n 'vue/prefer-define-options': 'error',\n 'vue/require-explicit-emits': 'error',\n 'vue/require-typed-ref': 'error',\n },\n settings: typescriptJsdocConfig.settings,\n };\n}\n"],"mappings":";;;;;;;;AAWA,SAAgB,gBAAgB,cAA8B,QAA6B;CACvF,MAAM,kBAAkB,sBAAsB;CAC9C,OAAO;EACH,OAAO,CAAC,UAAU;EAClB,iBAAiB,gBAAgB;EACjC,SAAS;GACL,kBAAkB;GAClB,sBAAsB;GACtB,aAAa;GACb;EACJ;EACA,OAAO;GACH,GAAG,gBAAgB,WAAW;GAC9B,GAAG,sBAAsB;GACzB,GAAG,gBAAgB;GACnB,mCAAmC,CAC/B,SACA;IACI,cAAc;IACd,sBAAsB;GAC1B,CACJ;GACA,uCAAuC;GACvC,qDAAqD;GACrD,4DAA4D;GAC5D,yDAAyD;GACzD,uDAAuD;GACvD,gDAAgD;GAChD,4CAA4C;GAC5C,2CAA2C;GAC3C,gDAAgD;GAChD,iBAAiB;GACjB,iBAAiB,CACb,SACA,EAAE,SAAS,eAAe,CAC9B;GACA,6BAA6B;GAC7B,wBAAwB;GACxB,mBAAmB,CACf,SACA,EACI,OAAO;IACH;IACA;IACA;GACJ,EACJ,CACJ;GACA,2BAA2B;GAC3B,gCAAgC;GAChC,gCAAgC;GAChC,+BAA+B;GAC/B,oCAAoC;GACpC,oCAAoC;GACpC,mBAAmB,CACf,SACA,CACJ;GACA,+BAA+B,CAC3B,SACA;IACI,WAAW;IACX,YAAY;GAChB,CACJ;GACA,eAAe,CACX,QACA;IACI,MAAM;IACN,UAAU;IACV,eAAe;IACf,wBAAwB;IACxB,UAAU;GACd,CACJ;GACA,oBAAoB;GACpB,wBAAwB;GACxB,uBAAuB;GACvB,oCAAoC;GACpC,oBAAoB;GACpB,gCAAgC;GAChC,iBAAiB;GACjB,6BAA6B;GAC7B,8BAA8B;GAC9B,yBAAyB;EAC7B;EACA,UAAU,sBAAsB;CACpC;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kikiutils/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.1.1",
|
|
5
5
|
"description": "Using antfu/eslint-config as a base for eslint-config, slightly modified the settings and added additional plugins, mainly for my own use.",
|
|
6
6
|
"author": "kiki-kanri",
|
|
7
7
|
"license": "MIT",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@vitest/coverage-v8": "^5.0.5",
|
|
69
69
|
"changelogen": "^0.6.2",
|
|
70
70
|
"eslint": "^10.14.0",
|
|
71
|
-
"knip": "^6.44.
|
|
71
|
+
"knip": "^6.44.1",
|
|
72
72
|
"publint": "^0.3.25",
|
|
73
73
|
"tsdown": "^0.23.4",
|
|
74
74
|
"typescript": "^6.0.3",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
2
|
+
|
|
3
|
+
export const jsdocSettings = {
|
|
4
|
+
jsdoc: {
|
|
5
|
+
tagNamePreference: {
|
|
6
|
+
arg: 'param',
|
|
7
|
+
argument: 'param',
|
|
8
|
+
desc: false,
|
|
9
|
+
description: false,
|
|
10
|
+
exception: 'throws',
|
|
11
|
+
return: 'returns',
|
|
12
|
+
types: false,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const typescriptJsdocConfig = {
|
|
18
|
+
rules: {
|
|
19
|
+
'jsdoc/check-tag-names': [
|
|
20
|
+
'error',
|
|
21
|
+
{
|
|
22
|
+
definedTags: [
|
|
23
|
+
'alpha',
|
|
24
|
+
'beta',
|
|
25
|
+
'defaultValue',
|
|
26
|
+
'eventProperty',
|
|
27
|
+
'experimental',
|
|
28
|
+
'hidden',
|
|
29
|
+
'inheritDoc',
|
|
30
|
+
'internal',
|
|
31
|
+
'packageDocumentation',
|
|
32
|
+
'privateRemarks',
|
|
33
|
+
'remarks',
|
|
34
|
+
'sealed',
|
|
35
|
+
'typeParam',
|
|
36
|
+
'virtual',
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
'jsdoc/multiline-blocks': [
|
|
41
|
+
'error',
|
|
42
|
+
{
|
|
43
|
+
noSingleLineBlocks: true,
|
|
44
|
+
singleLineTags: [],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
'jsdoc/no-types': 'error',
|
|
48
|
+
},
|
|
49
|
+
settings: {
|
|
50
|
+
jsdoc: {
|
|
51
|
+
mode: 'typescript',
|
|
52
|
+
tagNamePreference: {
|
|
53
|
+
...jsdocSettings.jsdoc.tagNamePreference,
|
|
54
|
+
callback: false,
|
|
55
|
+
class: false,
|
|
56
|
+
constructor: false,
|
|
57
|
+
default: 'defaultValue',
|
|
58
|
+
function: false,
|
|
59
|
+
method: false,
|
|
60
|
+
readonly: false,
|
|
61
|
+
static: false,
|
|
62
|
+
template: false,
|
|
63
|
+
type: false,
|
|
64
|
+
typedef: false,
|
|
65
|
+
typeParam: 'typeParam',
|
|
66
|
+
virtual: 'virtual',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
} satisfies TypedFlatConfigItem;
|
|
@@ -12,7 +12,18 @@ export function createTypeAwareConfig(): TypedFlatConfigItem {
|
|
|
12
12
|
'require-await': 'off',
|
|
13
13
|
'ts/await-thenable': 'error',
|
|
14
14
|
'ts/no-base-to-string': 'error',
|
|
15
|
-
'ts/no-floating-promises':
|
|
15
|
+
'ts/no-floating-promises': [
|
|
16
|
+
'error',
|
|
17
|
+
{
|
|
18
|
+
allowForKnownSafePromises: [
|
|
19
|
+
{
|
|
20
|
+
from: 'package',
|
|
21
|
+
name: 'SafePromise',
|
|
22
|
+
package: '@kikiutils/shared',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
16
27
|
'ts/no-for-in-array': 'error',
|
|
17
28
|
'ts/no-misused-promises': 'error',
|
|
18
29
|
'ts/no-misused-spread': 'error',
|
package/src/base.ts
CHANGED
|
@@ -12,6 +12,10 @@ import {
|
|
|
12
12
|
// @ts-expect-error No declare file.
|
|
13
13
|
import promise from 'eslint-plugin-promise';
|
|
14
14
|
|
|
15
|
+
import {
|
|
16
|
+
jsdocSettings,
|
|
17
|
+
typescriptJsdocConfig,
|
|
18
|
+
} from './_internals/jsdoc';
|
|
15
19
|
import { customPlugins } from './_internals/plugins';
|
|
16
20
|
import { createTypeAwareConfig } from './_internals/type-aware';
|
|
17
21
|
|
|
@@ -65,6 +69,7 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
|
|
|
65
69
|
'always',
|
|
66
70
|
],
|
|
67
71
|
},
|
|
72
|
+
settings: jsdocSettings,
|
|
68
73
|
},
|
|
69
74
|
// TypeScript
|
|
70
75
|
{
|
|
@@ -73,6 +78,7 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
|
|
|
73
78
|
GLOB_TSX,
|
|
74
79
|
],
|
|
75
80
|
rules: {
|
|
81
|
+
...typescriptJsdocConfig.rules,
|
|
76
82
|
'ts/array-type': [
|
|
77
83
|
'error',
|
|
78
84
|
{ default: 'array-simple' },
|
|
@@ -83,6 +89,7 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
|
|
|
83
89
|
],
|
|
84
90
|
'ts/no-redeclare': 'off',
|
|
85
91
|
},
|
|
92
|
+
settings: typescriptJsdocConfig.settings,
|
|
86
93
|
},
|
|
87
94
|
// Type-aware TypeScript
|
|
88
95
|
{
|
|
@@ -101,8 +108,45 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
|
|
|
101
108
|
'error',
|
|
102
109
|
{ compactTestCalls: true },
|
|
103
110
|
],
|
|
111
|
+
'no-restricted-imports': [
|
|
112
|
+
'error',
|
|
113
|
+
{
|
|
114
|
+
paths: [
|
|
115
|
+
{
|
|
116
|
+
importNames: ['expect'],
|
|
117
|
+
message: 'Use `expect` from the test context.',
|
|
118
|
+
name: 'vitest',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
'test/consistent-each-for': [
|
|
124
|
+
'error',
|
|
125
|
+
{
|
|
126
|
+
it: 'for',
|
|
127
|
+
test: 'for',
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
'test/prefer-each': 'error',
|
|
131
|
+
'test/prefer-hooks-on-top': 'error',
|
|
132
|
+
'test/prefer-lowercase-title': [
|
|
133
|
+
'error',
|
|
134
|
+
{
|
|
135
|
+
ignoreTopLevelDescribe: true,
|
|
136
|
+
lowercaseFirstCharacterOnly: true,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
'test/prefer-to-be': 'error',
|
|
140
|
+
'test/valid-describe-callback': 'error',
|
|
104
141
|
'test/valid-expect': 'error',
|
|
105
142
|
'test/valid-expect-in-promise': 'error',
|
|
143
|
+
'test/valid-title': [
|
|
144
|
+
'error',
|
|
145
|
+
{
|
|
146
|
+
mustMatch: { it: '^should ' },
|
|
147
|
+
mustNotMatch: { it: String.raw`\.$` },
|
|
148
|
+
},
|
|
149
|
+
],
|
|
106
150
|
},
|
|
107
151
|
},
|
|
108
152
|
// VS Code JSONC
|
|
@@ -117,7 +161,6 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
|
|
|
117
161
|
type: 'asc',
|
|
118
162
|
},
|
|
119
163
|
// Preserve ordered fields and any argument or option arrays nested inside them.
|
|
120
|
-
// eslint-disable-next-line style/max-len
|
|
121
164
|
pathPattern: String.raw`^(?!.*(?:^|\.|\[")(?:${vscodeOrderSensitiveArrayProperties})(?:$|\.|\[|"\])).*`,
|
|
122
165
|
},
|
|
123
166
|
],
|
|
@@ -157,6 +200,27 @@ export function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {
|
|
|
157
200
|
'error',
|
|
158
201
|
'multi-line',
|
|
159
202
|
],
|
|
203
|
+
'jsdoc/check-tag-names': 'error',
|
|
204
|
+
'jsdoc/multiline-blocks': [
|
|
205
|
+
'error',
|
|
206
|
+
{
|
|
207
|
+
noSingleLineBlocks: true,
|
|
208
|
+
singleLineTags: [
|
|
209
|
+
'type',
|
|
210
|
+
'import',
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
'jsdoc/no-blank-blocks': [
|
|
215
|
+
'error',
|
|
216
|
+
{ enableFixer: true },
|
|
217
|
+
],
|
|
218
|
+
'jsdoc/require-asterisk-prefix': 'error',
|
|
219
|
+
'jsdoc/require-hyphen-before-param-description': [
|
|
220
|
+
'error',
|
|
221
|
+
'always',
|
|
222
|
+
{ tags: { typeParam: 'always' } },
|
|
223
|
+
],
|
|
160
224
|
'kikiutils/compact-iteration-layout': 'error',
|
|
161
225
|
'kikiutils/consistent-condition-layout': 'error',
|
|
162
226
|
'kikiutils/consistent-parameter-layout': 'error',
|
|
@@ -342,6 +406,8 @@ export function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {
|
|
|
342
406
|
{
|
|
343
407
|
code: 120,
|
|
344
408
|
comments: 120,
|
|
409
|
+
ignoreStrings: true,
|
|
410
|
+
ignoreTemplateLiterals: true,
|
|
345
411
|
},
|
|
346
412
|
],
|
|
347
413
|
'style/member-delimiter-style': [
|
package/src/vue.ts
CHANGED
|
@@ -4,6 +4,7 @@ import betterTailwindcss from 'eslint-plugin-better-tailwindcss';
|
|
|
4
4
|
// @ts-expect-error No declare file.
|
|
5
5
|
import promise from 'eslint-plugin-promise';
|
|
6
6
|
|
|
7
|
+
import { typescriptJsdocConfig } from './_internals/jsdoc';
|
|
7
8
|
import { customPlugins } from './_internals/plugins';
|
|
8
9
|
import { createTypeAwareConfig } from './_internals/type-aware';
|
|
9
10
|
import { createBaseRules } from './base';
|
|
@@ -21,6 +22,7 @@ export function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlat
|
|
|
21
22
|
},
|
|
22
23
|
rules: {
|
|
23
24
|
...createBaseRules(environment),
|
|
25
|
+
...typescriptJsdocConfig.rules,
|
|
24
26
|
...typeAwareConfig.rules,
|
|
25
27
|
'@kikiutils/vue/attributes-order': [
|
|
26
28
|
'error',
|
|
@@ -77,6 +79,8 @@ export function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlat
|
|
|
77
79
|
{
|
|
78
80
|
code: 120,
|
|
79
81
|
comments: 120,
|
|
82
|
+
ignoreStrings: true,
|
|
83
|
+
ignoreTemplateLiterals: true,
|
|
80
84
|
template: 120,
|
|
81
85
|
},
|
|
82
86
|
],
|
|
@@ -91,5 +95,6 @@ export function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlat
|
|
|
91
95
|
'vue/require-explicit-emits': 'error',
|
|
92
96
|
'vue/require-typed-ref': 'error',
|
|
93
97
|
},
|
|
98
|
+
settings: typescriptJsdocConfig.settings,
|
|
94
99
|
};
|
|
95
100
|
}
|