@kikiutils/eslint-config 9.3.2 → 10.1.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/README.md +8 -0
- 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/rules/consistent-parameter-layout.d.ts.map +1 -1
- package/dist/_internals/rules/consistent-parameter-layout.js +102 -55
- package/dist/_internals/rules/consistent-parameter-layout.js.map +1 -1
- package/dist/_internals/rules/statement-padding.js +21 -11
- package/dist/_internals/rules/statement-padding.js.map +1 -1
- package/dist/_internals/type-aware.d.ts +3 -0
- package/dist/_internals/type-aware.d.ts.map +1 -0
- package/dist/_internals/type-aware.js +25 -0
- package/dist/_internals/type-aware.js.map +1 -0
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +84 -18
- package/dist/base.js.map +1 -1
- package/dist/style.js +1 -5
- package/dist/style.js.map +1 -1
- package/dist/vue.d.ts.map +1 -1
- package/dist/vue.js +13 -4
- package/dist/vue.js.map +1 -1
- package/package.json +11 -38
- package/src/_internals/jsdoc.ts +70 -0
- package/src/_internals/rules/consistent-parameter-layout.ts +179 -98
- package/src/_internals/rules/statement-padding.ts +33 -22
- package/src/_internals/type-aware.ts +28 -0
- package/src/base.ts +132 -23
- package/src/style.ts +1 -2
- package/src/vue.ts +15 -3
package/dist/base.js
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
|
+
import { jsdocSettings, typescriptJsdocConfig } from "./_internals/jsdoc.js";
|
|
1
2
|
import { customPlugins } from "./_internals/plugins.js";
|
|
3
|
+
import { createTypeAwareConfig } from "./_internals/type-aware.js";
|
|
4
|
+
import { GLOB_JS, GLOB_JSX, GLOB_TESTS, GLOB_TS, GLOB_TSX } from "@antfu/eslint-config";
|
|
2
5
|
import promise from "eslint-plugin-promise";
|
|
3
6
|
// src/base.ts
|
|
4
7
|
const basePerfectionistSortOptions = {
|
|
5
8
|
ignoreCase: false,
|
|
6
9
|
type: "natural"
|
|
7
10
|
};
|
|
11
|
+
const vscodeOrderSensitiveArrayProperties = [
|
|
12
|
+
"args",
|
|
13
|
+
"autoAttachSmartPattern",
|
|
14
|
+
"dependsOn",
|
|
15
|
+
"options",
|
|
16
|
+
"outFiles",
|
|
17
|
+
"problemMatcher",
|
|
18
|
+
"resolveSourceMapLocations",
|
|
19
|
+
"runtimeArgs",
|
|
20
|
+
"skipFiles"
|
|
21
|
+
].join("|");
|
|
8
22
|
function createBaseConfigs(environment = "node") {
|
|
9
23
|
return [
|
|
10
24
|
{ rules: {
|
|
11
|
-
"e18e/ban-dependencies": ["error", { allowed: ["axios"
|
|
12
|
-
"e18e/prefer-static-regex":
|
|
25
|
+
"e18e/ban-dependencies": ["error", { allowed: ["axios"] }],
|
|
26
|
+
"e18e/prefer-static-regex": "off"
|
|
13
27
|
} },
|
|
14
28
|
{
|
|
15
|
-
files: [
|
|
29
|
+
files: [
|
|
30
|
+
GLOB_JS,
|
|
31
|
+
GLOB_JSX,
|
|
32
|
+
GLOB_TS,
|
|
33
|
+
GLOB_TSX
|
|
34
|
+
],
|
|
16
35
|
plugins: {
|
|
17
36
|
kikiutils: customPlugins,
|
|
18
37
|
promise
|
|
@@ -20,19 +39,51 @@ function createBaseConfigs(environment = "node") {
|
|
|
20
39
|
rules: {
|
|
21
40
|
...createBaseRules(environment),
|
|
22
41
|
"node/prefer-global/process": ["error", "always"]
|
|
23
|
-
}
|
|
42
|
+
},
|
|
43
|
+
settings: jsdocSettings
|
|
24
44
|
},
|
|
25
45
|
{
|
|
26
|
-
files: [
|
|
27
|
-
plugins: {
|
|
28
|
-
kikiutils: customPlugins,
|
|
29
|
-
promise
|
|
30
|
-
},
|
|
46
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
31
47
|
rules: {
|
|
32
|
-
...
|
|
33
|
-
"
|
|
48
|
+
...typescriptJsdocConfig.rules,
|
|
49
|
+
"ts/array-type": ["error", { default: "array-simple" }],
|
|
34
50
|
"ts/consistent-generic-constructors": ["error", "constructor"],
|
|
35
51
|
"ts/no-redeclare": "off"
|
|
52
|
+
},
|
|
53
|
+
settings: typescriptJsdocConfig.settings
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
...createTypeAwareConfig(),
|
|
57
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
58
|
+
ignores: ["**/*.config.?([cm])ts"]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
files: GLOB_TESTS,
|
|
62
|
+
rules: {
|
|
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",
|
|
81
|
+
"test/valid-expect": "error",
|
|
82
|
+
"test/valid-expect-in-promise": "error",
|
|
83
|
+
"test/valid-title": ["error", {
|
|
84
|
+
mustMatch: { it: "^should " },
|
|
85
|
+
mustNotMatch: { it: String.raw`\.$` }
|
|
86
|
+
}]
|
|
36
87
|
}
|
|
37
88
|
},
|
|
38
89
|
{
|
|
@@ -43,7 +94,7 @@ function createBaseConfigs(environment = "node") {
|
|
|
43
94
|
natural: true,
|
|
44
95
|
type: "asc"
|
|
45
96
|
},
|
|
46
|
-
pathPattern: "
|
|
97
|
+
pathPattern: String.raw`^(?!.*(?:^|\.|\[")(?:${vscodeOrderSensitiveArrayProperties})(?:$|\.|\[|"\])).*`
|
|
47
98
|
}],
|
|
48
99
|
"jsonc/sort-keys": [
|
|
49
100
|
"error",
|
|
@@ -54,7 +105,8 @@ function createBaseConfigs(environment = "node") {
|
|
|
54
105
|
}
|
|
55
106
|
]
|
|
56
107
|
}
|
|
57
|
-
}
|
|
108
|
+
},
|
|
109
|
+
{ ignores: ["**/*.md/**"] }
|
|
58
110
|
];
|
|
59
111
|
}
|
|
60
112
|
function createBaseRules(environment = "node") {
|
|
@@ -69,21 +121,32 @@ function createBaseRules(environment = "node") {
|
|
|
69
121
|
"antfu/reasonable-newline": "off",
|
|
70
122
|
"arrow-body-style": ["error", "as-needed"],
|
|
71
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
|
+
],
|
|
72
136
|
"kikiutils/compact-iteration-layout": "error",
|
|
73
137
|
"kikiutils/consistent-condition-layout": "error",
|
|
74
138
|
"kikiutils/consistent-parameter-layout": "error",
|
|
75
139
|
"kikiutils/statement-padding": "error",
|
|
76
140
|
"max-classes-per-file": ["error", 1],
|
|
141
|
+
"no-constant-binary-expression": "error",
|
|
77
142
|
"no-promise-executor-return": ["error", { allowVoid: true }],
|
|
143
|
+
"no-useless-assignment": "error",
|
|
78
144
|
"perfectionist/sort-array-includes": ["error", basePerfectionistSortOptions],
|
|
79
145
|
"perfectionist/sort-enums": ["error", {
|
|
80
146
|
...basePerfectionistSortOptions,
|
|
81
147
|
sortByValue: "never"
|
|
82
148
|
}],
|
|
83
|
-
"perfectionist/sort-heritage-clauses": ["error",
|
|
84
|
-
ignoreCase: false,
|
|
85
|
-
type: "natural"
|
|
86
|
-
}],
|
|
149
|
+
"perfectionist/sort-heritage-clauses": ["error", basePerfectionistSortOptions],
|
|
87
150
|
"perfectionist/sort-imports": ["error", {
|
|
88
151
|
environment,
|
|
89
152
|
groups: [
|
|
@@ -133,6 +196,7 @@ function createBaseRules(environment = "node") {
|
|
|
133
196
|
}],
|
|
134
197
|
"perfectionist/sort-union-types": ["error", basePerfectionistSortOptions],
|
|
135
198
|
"perfectionist/sort-variable-declarations": ["error", basePerfectionistSortOptions],
|
|
199
|
+
"preserve-caught-error": "error",
|
|
136
200
|
"promise/no-multiple-resolved": "error",
|
|
137
201
|
"promise/no-return-in-finally": "error",
|
|
138
202
|
"promise/no-return-wrap": "error",
|
|
@@ -155,7 +219,9 @@ function createBaseRules(environment = "node") {
|
|
|
155
219
|
"style/indent": ["error", 4],
|
|
156
220
|
"style/max-len": ["warn", {
|
|
157
221
|
code: 120,
|
|
158
|
-
comments: 120
|
|
222
|
+
comments: 120,
|
|
223
|
+
ignoreStrings: true,
|
|
224
|
+
ignoreTemplateLiterals: true
|
|
159
225
|
}],
|
|
160
226
|
"style/member-delimiter-style": ["error", { multiline: {
|
|
161
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';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nimport { customPlugins } from './_internals/plugins';\n\n// Constants/Variables\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\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 {\n allowed: [\n 'axios',\n 'rimraf',\n ],\n },\n ],\n 'e18e/prefer-static-regex': ['off'],\n },\n },\n // JavaScript\n {\n files: ['**/*.{cjs,js,mjs}'],\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: ['**/*.{ts,tsx}'],\n plugins: {\n kikiutils: customPlugins,\n promise,\n },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n // VsCode 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 pathPattern: '^.*$',\n },\n ],\n 'jsonc/sort-keys': [\n 'error',\n 'asc',\n {\n caseSensitive: true,\n natural: true,\n },\n ],\n },\n },\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-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\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 {\n ignoreCase: false,\n type: 'natural',\n },\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 '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":";;;AAUA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;AACV;AAGA,SAAgB,kBAAkB,cAA8B,QAA+B;CAC3F,OAAO;EAEH,EACI,OAAO;GACH,yBAAyB,CACrB,SACA,EACI,SAAS,CACL,SACA,QACJ,EACJ,CACJ;G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ACJ;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,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":";;;;;;AAsBA,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;IAC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AC7B,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,yBAAyB;EACzB,0BAA0B,CACtB,SACA;GACI,oBAAoB;GACpB,gBAAgB,CACZ,QACA,QACJ;EACJ,CACJ;EACA,yBAAyB,CACrB,SACA,EAAE,aAAa,KAAK,CACxB;EACA,iCAAiC;EACjC,iDAAiD;GAC7C;GACA;GACA,EAAE,MAAM,EAAE,WAAW,SAAS,EAAE;EACpC;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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;EACJ;EACA,cAAc,CACV,SACA,QACJ;CACJ;AACJ"}
|
package/dist/style.js
CHANGED
|
@@ -14,11 +14,7 @@ function createPrettierCssConfig(parser) {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
function createStyleFilesConfigs() {
|
|
17
|
-
return [
|
|
18
|
-
createPrettierCssConfig("css"),
|
|
19
|
-
createPrettierCssConfig("sass"),
|
|
20
|
-
createPrettierCssConfig("scss")
|
|
21
|
-
];
|
|
17
|
+
return [createPrettierCssConfig("css"), createPrettierCssConfig("scss")];
|
|
22
18
|
}
|
|
23
19
|
export { createStyleFilesConfigs };
|
|
24
20
|
|
package/dist/style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":[],"sources":["../src/style.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport format from 'eslint-plugin-format';\n\nfunction createPrettierCssConfig(parser: 'css' | '
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../src/style.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport format from 'eslint-plugin-format';\n\nfunction createPrettierCssConfig(parser: 'css' | 'scss'): TypedFlatConfigItem {\n return {\n files: [`**/*.${parser}`],\n languageOptions: { parser: format.parserPlain },\n plugins: { format },\n rules: {\n 'format/prettier': [\n 'error',\n {\n parser,\n printWidth: 120,\n singleQuote: true,\n tabWidth: 4,\n },\n ],\n },\n };\n}\n\nexport function createStyleFilesConfigs(): TypedFlatConfigItem[] {\n return [\n createPrettierCssConfig('css'),\n createPrettierCssConfig('scss'),\n ];\n}\n"],"mappings":";;AAGA,SAAS,wBAAwB,QAA6C;CAC1E,OAAO;EACH,OAAO,CAAC,QAAQ,QAAQ;EACxB,iBAAiB,EAAE,QAAQ,OAAO,YAAY;EAC9C,SAAS,EAAE,OAAO;EAClB,OAAO,EACH,mBAAmB,CACf,SACA;GACI;GACA,YAAY;GACZ,aAAa;GACb,UAAU;EACd,CACJ,EACJ;CACJ;AACJ;AAEA,SAAgB,0BAAiD;CAC7D,OAAO,CACH,wBAAwB,KAAK,GAC7B,wBAAwB,MAAM,CAClC;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,20 +1,26 @@
|
|
|
1
|
+
import { typescriptJsdocConfig } from "./_internals/jsdoc.js";
|
|
1
2
|
import { customPlugins } from "./_internals/plugins.js";
|
|
3
|
+
import { createTypeAwareConfig } from "./_internals/type-aware.js";
|
|
2
4
|
import { createBaseRules } from "./base.js";
|
|
3
5
|
import promise from "eslint-plugin-promise";
|
|
4
6
|
import kikiutilsEslintPluginVue from "@kikiutils/eslint-plugin-vue";
|
|
5
|
-
import
|
|
7
|
+
import betterTailwindcss from "eslint-plugin-better-tailwindcss";
|
|
6
8
|
// src/vue.ts
|
|
7
9
|
function createVueConfig(environment = "node") {
|
|
10
|
+
const typeAwareConfig = createTypeAwareConfig();
|
|
8
11
|
return {
|
|
9
12
|
files: ["**/*.vue"],
|
|
13
|
+
languageOptions: typeAwareConfig.languageOptions,
|
|
10
14
|
plugins: {
|
|
11
15
|
"@kikiutils/vue": kikiutilsEslintPluginVue,
|
|
12
|
-
"better-tailwindcss":
|
|
16
|
+
"better-tailwindcss": betterTailwindcss,
|
|
13
17
|
"kikiutils": customPlugins,
|
|
14
18
|
promise
|
|
15
19
|
},
|
|
16
20
|
rules: {
|
|
17
21
|
...createBaseRules(environment),
|
|
22
|
+
...typescriptJsdocConfig.rules,
|
|
23
|
+
...typeAwareConfig.rules,
|
|
18
24
|
"@kikiutils/vue/attributes-order": ["error", {
|
|
19
25
|
alphabetical: true,
|
|
20
26
|
alphabeticalEnhanced: true
|
|
@@ -29,6 +35,7 @@ function createVueConfig(environment = "node") {
|
|
|
29
35
|
"better-tailwindcss/no-duplicate-classes": "error",
|
|
30
36
|
"better-tailwindcss/no-unnecessary-whitespace": "error",
|
|
31
37
|
"style/max-len": "off",
|
|
38
|
+
"ts/array-type": ["error", { default: "array-simple" }],
|
|
32
39
|
"vue/attribute-hyphenation": "error",
|
|
33
40
|
"vue/attributes-order": "off",
|
|
34
41
|
"vue/block-order": ["error", { order: [
|
|
@@ -50,6 +57,8 @@ function createVueConfig(environment = "node") {
|
|
|
50
57
|
"vue/max-len": ["warn", {
|
|
51
58
|
code: 120,
|
|
52
59
|
comments: 120,
|
|
60
|
+
ignoreStrings: true,
|
|
61
|
+
ignoreTemplateLiterals: true,
|
|
53
62
|
template: 120
|
|
54
63
|
}],
|
|
55
64
|
"vue/no-dupe-keys": "error",
|
|
@@ -60,10 +69,10 @@ function createVueConfig(environment = "node") {
|
|
|
60
69
|
"vue/no-template-target-blank": "error",
|
|
61
70
|
"vue/no-v-html": "error",
|
|
62
71
|
"vue/prefer-define-options": "error",
|
|
63
|
-
"vue/prefer-separate-static-class": "error",
|
|
64
72
|
"vue/require-explicit-emits": "error",
|
|
65
73
|
"vue/require-typed-ref": "error"
|
|
66
|
-
}
|
|
74
|
+
},
|
|
75
|
+
settings: typescriptJsdocConfig.settings
|
|
67
76
|
};
|
|
68
77
|
}
|
|
69
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
|
|
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": "
|
|
4
|
+
"version": "10.1.0",
|
|
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",
|
|
@@ -12,38 +12,10 @@
|
|
|
12
12
|
"keywords": [],
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"exports": {
|
|
15
|
-
"./
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
"./_internals/rules/compact-iteration-layout": {
|
|
21
|
-
"types": null,
|
|
22
|
-
"import": null,
|
|
23
|
-
"require": null
|
|
24
|
-
},
|
|
25
|
-
"./_internals/rules/consistent-condition-layout": {
|
|
26
|
-
"types": null,
|
|
27
|
-
"import": null,
|
|
28
|
-
"require": null
|
|
29
|
-
},
|
|
30
|
-
"./_internals/rules/consistent-parameter-layout": {
|
|
31
|
-
"types": null,
|
|
32
|
-
"import": null,
|
|
33
|
-
"require": null
|
|
34
|
-
},
|
|
35
|
-
"./_internals/rules/statement-padding": {
|
|
36
|
-
"types": null,
|
|
37
|
-
"import": null,
|
|
38
|
-
"require": null
|
|
39
|
-
},
|
|
40
|
-
"./_internals/utils": {
|
|
41
|
-
"types": null,
|
|
42
|
-
"import": null,
|
|
43
|
-
"require": null
|
|
44
|
-
},
|
|
45
|
-
"./package.json": "./package.json",
|
|
46
|
-
"./*": "./dist/*.js"
|
|
15
|
+
"./base": "./dist/base.js",
|
|
16
|
+
"./style": "./dist/style.js",
|
|
17
|
+
"./vue": "./dist/vue.js",
|
|
18
|
+
"./package.json": "./package.json"
|
|
47
19
|
},
|
|
48
20
|
"files": [
|
|
49
21
|
"./dist",
|
|
@@ -85,19 +57,20 @@
|
|
|
85
57
|
"eslint-plugin-better-tailwindcss": "^4.10.0",
|
|
86
58
|
"eslint-plugin-format": "^2.0.1",
|
|
87
59
|
"eslint-plugin-promise": "^7.3.0",
|
|
88
|
-
"tailwind-csstree": "^0.4.
|
|
60
|
+
"tailwind-csstree": "^0.4.2",
|
|
89
61
|
"vue-eslint-parser": "^10.4.1"
|
|
90
62
|
},
|
|
91
63
|
"devDependencies": {
|
|
92
64
|
"@antfu/eslint-config": "^10.0.0",
|
|
65
|
+
"@arethetypeswrong/core": "^0.18.5",
|
|
93
66
|
"@kikiutils/tsconfigs": "^7.0.0",
|
|
94
|
-
"@types/node": "^26.6.
|
|
67
|
+
"@types/node": "^26.6.6",
|
|
95
68
|
"@vitest/coverage-v8": "^5.0.5",
|
|
96
69
|
"changelogen": "^0.6.2",
|
|
97
|
-
"eslint": "^10.
|
|
98
|
-
"knip": "^6.
|
|
70
|
+
"eslint": "^10.14.0",
|
|
71
|
+
"knip": "^6.44.1",
|
|
99
72
|
"publint": "^0.3.25",
|
|
100
|
-
"tsdown": "^0.23.
|
|
73
|
+
"tsdown": "^0.23.4",
|
|
101
74
|
"typescript": "^6.0.3",
|
|
102
75
|
"unplugin-unused": "^0.6.0",
|
|
103
76
|
"vitest": "^5.0.5"
|
|
@@ -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;
|