@kikiutils/eslint-config 5.0.4 → 7.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","names":[],"sources":["../src/base.ts"],"mappings":";;;iBASgB,iBAAA,CAAkB,WAAA,oBAAuC,mBAAA"}
1
+ {"version":3,"file":"base.d.ts","names":[],"sources":["../src/base.ts"],"mappings":";;;iBAYgB,iBAAA,CAAkB,WAAA,oBAAuC,mBAAA"}
package/dist/base.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import promise from "eslint-plugin-promise";
2
-
3
2
  //#region src/base.ts
4
3
  const basePerfectionistSortOptions = {
5
4
  ignoreCase: false,
@@ -7,157 +6,24 @@ const basePerfectionistSortOptions = {
7
6
  };
8
7
  function createBaseConfigs(environment = "node") {
9
8
  return [
9
+ { rules: {
10
+ "e18e/ban-dependencies": ["error", { allowed: ["axios"] }],
11
+ "e18e/prefer-static-regex": ["off"]
12
+ } },
10
13
  {
11
- files: ["**/*.{cjs,js,mjs,ts,tsx}"],
12
- rules: { "node/prefer-global/process": ["error", "always"] }
14
+ files: ["**/*.{cjs,js,mjs}"],
15
+ plugins: { promise },
16
+ rules: {
17
+ ...createBaseRules(environment),
18
+ "node/prefer-global/process": ["error", "always"]
19
+ }
13
20
  },
14
21
  {
15
- files: ["**/*.{cjs,js,mjs,ts,tsx,vue}"],
22
+ files: ["**/*.{ts,tsx}"],
16
23
  plugins: { promise },
17
24
  rules: {
18
- "antfu/consistent-list-newline": ["error", {
19
- ArrayExpression: false,
20
- ArrayPattern: false
21
- }],
22
- "antfu/curly": "off",
23
- "antfu/if-newline": "off",
24
- "antfu/no-top-level-await": "off",
25
- "curly": ["error", "multi-line"],
26
- "max-classes-per-file": ["error", 1],
27
- "no-promise-executor-return": ["error", { allowVoid: true }],
28
- "perfectionist/sort-array-includes": ["error", basePerfectionistSortOptions],
29
- "perfectionist/sort-enums": ["error", {
30
- ...basePerfectionistSortOptions,
31
- sortByValue: "never"
32
- }],
33
- "perfectionist/sort-heritage-clauses": ["error", {
34
- ignoreCase: false,
35
- type: "natural"
36
- }],
37
- "perfectionist/sort-imports": ["error", {
38
- environment,
39
- groups: [
40
- "side-effect",
41
- "side-effect-style",
42
- "style",
43
- ["value-builtin", "type-builtin"],
44
- ["value-external", "type-external"],
45
- ["value-internal", "type-internal"],
46
- ["value-parent", "type-parent"],
47
- ["value-sibling", "type-sibling"],
48
- ["value-index", "type-index"],
49
- "unknown"
50
- ],
51
- ignoreCase: false,
52
- internalPattern: [
53
- "^#.*",
54
- "^@/.*",
55
- "^~/.*"
56
- ],
57
- type: "natural"
58
- }],
59
- "perfectionist/sort-interfaces": ["error", basePerfectionistSortOptions],
60
- "perfectionist/sort-intersection-types": ["error", basePerfectionistSortOptions],
61
- "perfectionist/sort-maps": ["error", basePerfectionistSortOptions],
62
- "perfectionist/sort-modules": ["error", {
63
- ...basePerfectionistSortOptions,
64
- groups: [
65
- "declare-type",
66
- ["export-type", "type"],
67
- "declare-interface",
68
- ["export-interface", "interface"],
69
- "declare-enum",
70
- ["enum", "export-enum"],
71
- "declare-class",
72
- ["class", "export-class"],
73
- "declare-function",
74
- ["export-function", "function"]
75
- ]
76
- }],
77
- "perfectionist/sort-object-types": ["error", basePerfectionistSortOptions],
78
- "perfectionist/sort-objects": ["error", basePerfectionistSortOptions],
79
- "perfectionist/sort-sets": ["error", basePerfectionistSortOptions],
80
- "perfectionist/sort-switch-case": ["error", {
81
- ignoreCase: false,
82
- type: "natural"
83
- }],
84
- "perfectionist/sort-union-types": ["error", basePerfectionistSortOptions],
85
- "perfectionist/sort-variable-declarations": ["error", basePerfectionistSortOptions],
86
- "promise/no-multiple-resolved": "error",
87
- "promise/no-return-in-finally": "error",
88
- "promise/no-return-wrap": "error",
89
- "require-await": "error",
90
- "style/array-bracket-newline": ["error", { multiline: true }],
91
- "style/array-element-newline": ["error", {
92
- ArrayExpression: {
93
- consistent: true,
94
- minItems: 2
95
- },
96
- ArrayPattern: { minItems: 3 }
97
- }],
98
- "style/arrow-parens": ["error", "always"],
99
- "style/brace-style": [
100
- "error",
101
- "1tbs",
102
- { allowSingleLine: false }
103
- ],
104
- "style/function-call-spacing": ["error", "never"],
105
- "style/indent": ["error", 4],
106
- "style/max-len": ["warn", {
107
- code: 120,
108
- comments: 120
109
- }],
110
- "style/member-delimiter-style": ["error", { multiline: {
111
- delimiter: "semi",
112
- requireLast: true
113
- } }],
114
- "style/no-extra-parens": [
115
- "error",
116
- "all",
117
- { nestedBinaryExpressions: false }
118
- ],
119
- "style/no-extra-semi": "error",
120
- "style/object-curly-newline": ["error", {
121
- ExportDeclaration: {
122
- minProperties: 2,
123
- multiline: true
124
- },
125
- ImportDeclaration: {
126
- minProperties: 2,
127
- multiline: true
128
- },
129
- ObjectExpression: {
130
- minProperties: 2,
131
- multiline: true
132
- },
133
- ObjectPattern: {
134
- minProperties: 3,
135
- multiline: true
136
- }
137
- }],
138
- "style/operator-linebreak": [
139
- "error",
140
- "before",
141
- { overrides: { "=": "after" } }
142
- ],
143
- "style/padding-line-between-statements": [
144
- "error",
145
- {
146
- blankLine: "always",
147
- next: [
148
- "class",
149
- "enum",
150
- "function"
151
- ],
152
- prev: "*"
153
- },
154
- {
155
- blankLine: "always",
156
- next: "*",
157
- prev: ["class", "function"]
158
- }
159
- ],
160
- "style/semi": ["error", "always"],
25
+ ...createBaseRules(environment),
26
+ "node/prefer-global/process": ["error", "always"],
161
27
  "ts/consistent-generic-constructors": ["error", "constructor"],
162
28
  "ts/no-redeclare": "off"
163
29
  }
@@ -181,10 +47,166 @@ function createBaseConfigs(environment = "node") {
181
47
  }
182
48
  ]
183
49
  }
50
+ },
51
+ {
52
+ files: ["**/*.{vue}"],
53
+ plugins: { promise },
54
+ rules: {
55
+ ...createBaseRules(environment),
56
+ "ts/consistent-generic-constructors": ["error", "constructor"],
57
+ "ts/no-redeclare": "off"
58
+ }
184
59
  }
185
60
  ];
186
61
  }
187
-
62
+ function createBaseRules(environment = "node") {
63
+ return {
64
+ "antfu/consistent-list-newline": ["error", {
65
+ ArrayExpression: false,
66
+ ArrayPattern: false
67
+ }],
68
+ "antfu/curly": "off",
69
+ "antfu/if-newline": "off",
70
+ "antfu/no-top-level-await": "off",
71
+ "curly": ["error", "multi-line"],
72
+ "max-classes-per-file": ["error", 1],
73
+ "no-promise-executor-return": ["error", { allowVoid: true }],
74
+ "perfectionist/sort-array-includes": ["error", basePerfectionistSortOptions],
75
+ "perfectionist/sort-enums": ["error", {
76
+ ...basePerfectionistSortOptions,
77
+ sortByValue: "never"
78
+ }],
79
+ "perfectionist/sort-heritage-clauses": ["error", {
80
+ ignoreCase: false,
81
+ type: "natural"
82
+ }],
83
+ "perfectionist/sort-imports": ["error", {
84
+ environment,
85
+ groups: [
86
+ "side-effect",
87
+ "side-effect-style",
88
+ "style",
89
+ ["value-builtin", "type-builtin"],
90
+ ["value-external", "type-external"],
91
+ ["value-internal", "type-internal"],
92
+ ["value-parent", "type-parent"],
93
+ ["value-sibling", "type-sibling"],
94
+ ["value-index", "type-index"],
95
+ "unknown"
96
+ ],
97
+ ignoreCase: false,
98
+ internalPattern: [
99
+ "^#.*",
100
+ "^@/.*",
101
+ "^~/.*"
102
+ ],
103
+ type: "natural"
104
+ }],
105
+ "perfectionist/sort-interfaces": ["error", basePerfectionistSortOptions],
106
+ "perfectionist/sort-intersection-types": ["error", basePerfectionistSortOptions],
107
+ "perfectionist/sort-maps": ["error", basePerfectionistSortOptions],
108
+ "perfectionist/sort-modules": ["error", {
109
+ ...basePerfectionistSortOptions,
110
+ groups: [
111
+ "declare-type",
112
+ ["export-type", "type"],
113
+ "declare-interface",
114
+ ["export-interface", "interface"],
115
+ "declare-enum",
116
+ ["enum", "export-enum"],
117
+ "declare-class",
118
+ ["class", "export-class"],
119
+ "declare-function",
120
+ ["export-function", "function"]
121
+ ]
122
+ }],
123
+ "perfectionist/sort-object-types": ["error", basePerfectionistSortOptions],
124
+ "perfectionist/sort-objects": ["error", basePerfectionistSortOptions],
125
+ "perfectionist/sort-sets": ["error", basePerfectionistSortOptions],
126
+ "perfectionist/sort-switch-case": ["error", {
127
+ ignoreCase: false,
128
+ type: "natural"
129
+ }],
130
+ "perfectionist/sort-union-types": ["error", basePerfectionistSortOptions],
131
+ "perfectionist/sort-variable-declarations": ["error", basePerfectionistSortOptions],
132
+ "promise/no-multiple-resolved": "error",
133
+ "promise/no-return-in-finally": "error",
134
+ "promise/no-return-wrap": "error",
135
+ "require-await": "error",
136
+ "style/array-bracket-newline": ["error", { multiline: true }],
137
+ "style/array-element-newline": ["error", {
138
+ ArrayExpression: {
139
+ consistent: true,
140
+ minItems: 2
141
+ },
142
+ ArrayPattern: { minItems: 3 }
143
+ }],
144
+ "style/arrow-parens": ["error", "always"],
145
+ "style/brace-style": [
146
+ "error",
147
+ "1tbs",
148
+ { allowSingleLine: false }
149
+ ],
150
+ "style/function-call-spacing": ["error", "never"],
151
+ "style/indent": ["error", 4],
152
+ "style/max-len": ["warn", {
153
+ code: 120,
154
+ comments: 120
155
+ }],
156
+ "style/member-delimiter-style": ["error", { multiline: {
157
+ delimiter: "semi",
158
+ requireLast: true
159
+ } }],
160
+ "style/no-extra-parens": [
161
+ "error",
162
+ "all",
163
+ { nestedBinaryExpressions: false }
164
+ ],
165
+ "style/no-extra-semi": "error",
166
+ "style/object-curly-newline": ["error", {
167
+ ExportDeclaration: {
168
+ minProperties: 2,
169
+ multiline: true
170
+ },
171
+ ImportDeclaration: {
172
+ minProperties: 2,
173
+ multiline: true
174
+ },
175
+ ObjectExpression: {
176
+ minProperties: 2,
177
+ multiline: true
178
+ },
179
+ ObjectPattern: {
180
+ minProperties: 3,
181
+ multiline: true
182
+ }
183
+ }],
184
+ "style/operator-linebreak": [
185
+ "error",
186
+ "before",
187
+ { overrides: { "=": "after" } }
188
+ ],
189
+ "style/padding-line-between-statements": [
190
+ "error",
191
+ {
192
+ blankLine: "always",
193
+ next: [
194
+ "class",
195
+ "enum",
196
+ "function"
197
+ ],
198
+ prev: "*"
199
+ },
200
+ {
201
+ blankLine: "always",
202
+ next: "*",
203
+ prev: ["class", "function"]
204
+ }
205
+ ],
206
+ "style/semi": ["error", "always"]
207
+ };
208
+ }
188
209
  //#endregion
189
210
  export { createBaseConfigs };
211
+
190
212
  //# sourceMappingURL=base.js.map
package/dist/base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":[],"sources":["../src/base.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {\n return [\n {\n files: ['**/*.{cjs,js,mjs,ts,tsx}'],\n rules: {\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n },\n },\n {\n files: ['**/*.{cjs,js,mjs,ts,tsx,vue}'],\n plugins: { promise },\n rules: {\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 'curly': [\n 'error',\n 'multi-line',\n ],\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 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\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"],"mappings":";;;AAIA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;CACT;AAED,SAAgB,kBAAkB,cAA8B,QAA+B;AAC3F,QAAO;EACH;GACI,OAAO,CAAC,2BAA2B;GACnC,OAAO,EACH,8BAA8B,CAC1B,SACA,SACH,EACJ;GACJ;EACD;GACI,OAAO,CAAC,+BAA+B;GACvC,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,iCAAiC,CAC7B,SACA;KACI,iBAAiB;KACjB,cAAc;KACjB,CACJ;IACD,eAAe;IACf,oBAAoB;IACpB,4BAA4B;IAC5B,SAAS,CACL,SACA,aACH;IACD,wBAAwB,CACpB,SACA,EACH;IACD,8BAA8B,CAC1B,SACA,EAAE,WAAW,MAAM,CACtB;IACD,qCAAqC,CACjC,SACA,6BACH;IACD,4BAA4B,CACxB,SACA;KACI,GAAG;KACH,aAAa;KAChB,CACJ;IACD,uCAAuC,CACnC,SACA;KACI,YAAY;KACZ,MAAM;KACT,CACJ;IACD,8BAA8B,CAC1B,SACA;KACI;KACA,QAAQ;MACJ;MACA;MACA;MACA,CACI,iBACA,eACH;MACD,CACI,kBACA,gBACH;MACD,CACI,kBACA,gBACH;MACD,CACI,gBACA,cACH;MACD,CACI,iBACA,eACH;MACD,CACI,eACA,aACH;MACD;MACH;KACD,YAAY;KACZ,iBAAiB;MACb;MACA;MACA;MACH;KACD,MAAM;KACT,CACJ;IACD,iCAAiC,CAC7B,SACA,6BACH;IACD,yCAAyC,CACrC,SACA,6BACH;IACD,2BAA2B,CACvB,SACA,6BACH;IACD,8BAA8B,CAC1B,SACA;KACI,GAAG;KACH,QAAQ;MACJ;MACA,CACI,eACA,OACH;MACD;MACA,CACI,oBACA,YACH;MACD;MACA,CACI,QACA,cACH;MACD;MACA,CACI,SACA,eACH;MACD;MACA,CACI,mBACA,WACH;MACJ;KACJ,CACJ;IACD,mCAAmC,CAC/B,SACA,6BACH;IACD,8BAA8B,CAC1B,SACA,6BACH;IACD,2BAA2B,CACvB,SACA,6BACH;IACD,kCAAkC,CAC9B,SACA;KACI,YAAY;KACZ,MAAM;KACT,CACJ;IACD,kCAAkC,CAC9B,SACA,6BACH;IACD,4CAA4C,CACxC,SACA,6BACH;IACD,gCAAgC;IAChC,gCAAgC;IAChC,0BAA0B;IAC1B,iBAAiB;IACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,MAAM,CACtB;IACD,+BAA+B,CAC3B,SACA;KACI,iBAAiB;MACb,YAAY;MACZ,UAAU;MACb;KACD,cAAc,EAAE,UAAU,GAAG;KAChC,CACJ;IACD,sBAAsB,CAClB,SACA,SACH;IACD,qBAAqB;KACjB;KACA;KACA,EAAE,iBAAiB,OAAO;KAC7B;IACD,+BAA+B,CAC3B,SACA,QACH;IACD,gBAAgB,CACZ,SACA,EACH;IACD,iBAAiB,CACb,QACA;KACI,MAAM;KACN,UAAU;KACb,CACJ;IACD,gCAAgC,CAC5B,SACA,EACI,WAAW;KACP,WAAW;KACX,aAAa;KAChB,EACJ,CACJ;IACD,yBAAyB;KACrB;KACA;KACA,EAAE,yBAAyB,OAAO;KACrC;IACD,uBAAuB;IACvB,8BAA8B,CAC1B,SACA;KACI,mBAAmB;MACf,eAAe;MACf,WAAW;MACd;KACD,mBAAmB;MACf,eAAe;MACf,WAAW;MACd;KACD,kBAAkB;MACd,eAAe;MACf,WAAW;MACd;KACD,eAAe;MACX,eAAe;MACf,WAAW;MACd;KACJ,CACJ;IACD,4BAA4B;KACxB;KACA;KACA,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE;KAClC;IACD,yCAAyC;KACrC;KACA;MACI,WAAW;MACX,MAAM;OACF;OACA;OACA;OACH;MACD,MAAM;MACT;KACD;MACI,WAAW;MACX,MAAM;MACN,MAAM,CACF,SACA,WACH;MACJ;KACJ;IACD,cAAc,CACV,SACA,SACH;IACD,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EACD;GACI,OAAO,CAAC,oBAAoB;GAC5B,OAAO;IACH,2BAA2B,CACvB,SACA;KACI,OAAO;MACH,SAAS;MACT,MAAM;MACT;KACD,aAAa;KAChB,CACJ;IACD,mBAAmB;KACf;KACA;KACA;MACI,eAAe;MACf,SAAS;MACZ;KACJ;IACJ;GACJ;EACJ"}
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\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\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\n {\n files: ['**/*.{cjs,js,mjs}'],\n plugins: { promise },\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: { promise },\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 // Vue\n {\n files: ['**/*.{vue}'],\n plugins: { promise },\n rules: {\n ...createBaseRules(environment),\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n ];\n}\n\nfunction 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 'curly': [\n 'error',\n 'multi-line',\n ],\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":";;AAOA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;CACT;AAED,SAAgB,kBAAkB,cAA8B,QAA+B;AAC3F,QAAO;EAEH,EACI,OAAO;GACH,yBAAyB,CACrB,SACA,EAAE,SAAS,CAAC,QAAQ,EAAE,CACzB;GACD,4BAA4B,CAAC,MAAM;GACtC,EACJ;EAED;GACI,OAAO,CAAC,oBAAoB;GAC5B,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,8BAA8B,CAC1B,SACA,SACH;IACJ;GACJ;EAED;GACI,OAAO,CAAC,gBAAgB;GACxB,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,8BAA8B,CAC1B,SACA,SACH;IACD,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EAED;GACI,OAAO,CAAC,oBAAoB;GAC5B,OAAO;IACH,2BAA2B,CACvB,SACA;KACI,OAAO;MACH,SAAS;MACT,MAAM;MACT;KACD,aAAa;KAChB,CACJ;IACD,mBAAmB;KACf;KACA;KACA;MACI,eAAe;MACf,SAAS;MACZ;KACJ;IACJ;GACJ;EAED;GACI,OAAO,CAAC,aAAa;GACrB,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EACJ;;AAGL,SAAS,gBAAgB,cAA8B,QAAe;AAClE,QAAO;EACH,iCAAiC,CAC7B,SACA;GACI,iBAAiB;GACjB,cAAc;GACjB,CACJ;EACD,eAAe;EACf,oBAAoB;EACpB,4BAA4B;EAC5B,SAAS,CACL,SACA,aACH;EACD,wBAAwB,CACpB,SACA,EACH;EACD,8BAA8B,CAC1B,SACA,EAAE,WAAW,MAAM,CACtB;EACD,qCAAqC,CACjC,SACA,6BACH;EACD,4BAA4B,CACxB,SACA;GACI,GAAG;GACH,aAAa;GAChB,CACJ;EACD,uCAAuC,CACnC,SACA;GACI,YAAY;GACZ,MAAM;GACT,CACJ;EACD,8BAA8B,CAC1B,SACA;GACI;GACA,QAAQ;IACJ;IACA;IACA;IACA,CACI,iBACA,eACH;IACD,CACI,kBACA,gBACH;IACD,CACI,kBACA,gBACH;IACD,CACI,gBACA,cACH;IACD,CACI,iBACA,eACH;IACD,CACI,eACA,aACH;IACD;IACH;GACD,YAAY;GACZ,iBAAiB;IACb;IACA;IACA;IACH;GACD,MAAM;GACT,CACJ;EACD,iCAAiC,CAC7B,SACA,6BACH;EACD,yCAAyC,CACrC,SACA,6BACH;EACD,2BAA2B,CACvB,SACA,6BACH;EACD,8BAA8B,CAC1B,SACA;GACI,GAAG;GACH,QAAQ;IACJ;IACA,CACI,eACA,OACH;IACD;IACA,CACI,oBACA,YACH;IACD;IACA,CACI,QACA,cACH;IACD;IACA,CACI,SACA,eACH;IACD;IACA,CACI,mBACA,WACH;IACJ;GACJ,CACJ;EACD,mCAAmC,CAC/B,SACA,6BACH;EACD,8BAA8B,CAC1B,SACA,6BACH;EACD,2BAA2B,CACvB,SACA,6BACH;EACD,kCAAkC,CAC9B,SACA;GACI,YAAY;GACZ,MAAM;GACT,CACJ;EACD,kCAAkC,CAC9B,SACA,6BACH;EACD,4CAA4C,CACxC,SACA,6BACH;EACD,gCAAgC;EAChC,gCAAgC;EAChC,0BAA0B;EAC1B,iBAAiB;EACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,MAAM,CACtB;EACD,+BAA+B,CAC3B,SACA;GACI,iBAAiB;IACb,YAAY;IACZ,UAAU;IACb;GACD,cAAc,EAAE,UAAU,GAAG;GAChC,CACJ;EACD,sBAAsB,CAClB,SACA,SACH;EACD,qBAAqB;GACjB;GACA;GACA,EAAE,iBAAiB,OAAO;GAC7B;EACD,+BAA+B,CAC3B,SACA,QACH;EACD,gBAAgB,CACZ,SACA,EACH;EACD,iBAAiB,CACb,QACA;GACI,MAAM;GACN,UAAU;GACb,CACJ;EACD,gCAAgC,CAC5B,SACA,EACI,WAAW;GACP,WAAW;GACX,aAAa;GAChB,EACJ,CACJ;EACD,yBAAyB;GACrB;GACA;GACA,EAAE,yBAAyB,OAAO;GACrC;EACD,uBAAuB;EACvB,8BAA8B,CAC1B,SACA;GACI,mBAAmB;IACf,eAAe;IACf,WAAW;IACd;GACD,mBAAmB;IACf,eAAe;IACf,WAAW;IACd;GACD,kBAAkB;IACd,eAAe;IACf,WAAW;IACd;GACD,eAAe;IACX,eAAe;IACf,WAAW;IACd;GACJ,CACJ;EACD,4BAA4B;GACxB;GACA;GACA,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE;GAClC;EACD,yCAAyC;GACrC;GACA;IACI,WAAW;IACX,MAAM;KACF;KACA;KACA;KACH;IACD,MAAM;IACT;GACD;IACI,WAAW;IACX,MAAM;IACN,MAAM,CACF,SACA,WACH;IACJ;GACJ;EACD,cAAc,CACV,SACA,SACH;EACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","names":[],"sources":["../src/style.ts"],"mappings":";;;iBAuBgB,uBAAA,CAAA,GAA2B,mBAAA"}
1
+ {"version":3,"file":"style.d.ts","names":[],"sources":["../src/style.ts"],"mappings":";;;iBAsBgB,uBAAA,CAAA,GAA2B,mBAAA"}
package/dist/style.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import format from "eslint-plugin-format";
2
-
3
2
  //#region src/style.ts
4
3
  function createPrettierCssConfig(parser) {
5
4
  return {
@@ -21,7 +20,7 @@ function createStyleFilesConfigs() {
21
20
  createPrettierCssConfig("scss")
22
21
  ];
23
22
  }
24
-
25
23
  //#endregion
26
24
  export { createStyleFilesConfigs };
25
+
27
26
  //# sourceMappingURL=style.js.map
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';\n// @ts-expect-error Ignore this error.\nimport format from 'eslint-plugin-format';\n\nfunction createPrettierCssConfig(parser: 'css' | 'sass' | '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('sass'),\n createPrettierCssConfig('scss'),\n ];\n}\n"],"mappings":";;;AAIA,SAAS,wBAAwB,QAAsD;AACnF,QAAO;EACH,OAAO,CAAC,QAAQ,SAAS;EACzB,iBAAiB,EAAE,QAAQ,OAAO,aAAa;EAC/C,SAAS,EAAE,QAAQ;EACnB,OAAO,EACH,mBAAmB,CACf,SACA;GACI;GACA,YAAY;GACZ,aAAa;GACb,UAAU;GACb,CACJ,EACJ;EACJ;;AAGL,SAAgB,0BAAiD;AAC7D,QAAO;EACH,wBAAwB,MAAM;EAC9B,wBAAwB,OAAO;EAC/B,wBAAwB,OAAO;EAClC"}
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' | 'sass' | '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('sass'),\n createPrettierCssConfig('scss'),\n ];\n}\n"],"mappings":";;AAGA,SAAS,wBAAwB,QAAsD;AACnF,QAAO;EACH,OAAO,CAAC,QAAQ,SAAS;EACzB,iBAAiB,EAAE,QAAQ,OAAO,aAAa;EAC/C,SAAS,EAAE,QAAQ;EACnB,OAAO,EACH,mBAAmB,CACf,SACA;GACI;GACA,YAAY;GACZ,aAAa;GACb,UAAU;GACb,CACJ,EACJ;EACJ;;AAGL,SAAgB,0BAAiD;AAC7D,QAAO;EACH,wBAAwB,MAAM;EAC9B,wBAAwB,OAAO;EAC/B,wBAAwB,OAAO;EAClC"}
package/dist/vue.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import kikiutilsTailwindcss from "@kikiutils/eslint-plugin-tailwindcss";
2
2
  import kikiutilsEslintPluginVue from "@kikiutils/eslint-plugin-vue";
3
3
  import tailwindcss from "eslint-plugin-tailwindcss";
4
-
5
4
  //#region src/vue.ts
6
5
  function createVueConfig() {
7
6
  return {
@@ -57,7 +56,7 @@ function createVueConfig() {
57
56
  }
58
57
  };
59
58
  }
60
-
61
59
  //#endregion
62
60
  export { createVueConfig };
61
+
63
62
  //# sourceMappingURL=vue.js.map
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';\n// @ts-expect-error No declare file.\nimport kikiutilsTailwindcss from '@kikiutils/eslint-plugin-tailwindcss';\n// @ts-expect-error Ignore this error.\nimport kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';\n// @ts-expect-error No declare file.\nimport tailwindcss from 'eslint-plugin-tailwindcss';\n\nexport function createVueConfig(): TypedFlatConfigItem {\n return {\n files: ['**/*.vue'],\n plugins: {\n '@kikiutils/tailwindcss': kikiutilsTailwindcss,\n '@kikiutils/vue': kikiutilsEslintPluginVue,\n tailwindcss,\n },\n rules: {\n '@kikiutils/tailwindcss/classnames-order': 'error',\n '@kikiutils/vue/attributes-order': [\n 'error',\n { alphabetical: true },\n ],\n '@kikiutils/vue/no-extra-space-in-class': 'error',\n 'style/max-len': 'off',\n 'tailwindcss/classnames-order': 'off',\n 'tailwindcss/enforces-negative-arbitrary-values': 'error',\n 'tailwindcss/enforces-shorthand': 'error',\n 'tailwindcss/no-unnecessary-arbitrary-value': 'error',\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/prefer-separate-static-class': 'error',\n 'vue/require-explicit-emits': 'error',\n 'vue/require-typed-ref': 'error',\n },\n };\n}\n"],"mappings":";;;;;AAQA,SAAgB,kBAAuC;AACnD,QAAO;EACH,OAAO,CAAC,WAAW;EACnB,SAAS;GACL,0BAA0B;GAC1B,kBAAkB;GAClB;GACH;EACD,OAAO;GACH,2CAA2C;GAC3C,mCAAmC,CAC/B,SACA,EAAE,cAAc,MAAM,CACzB;GACD,0CAA0C;GAC1C,iBAAiB;GACjB,gCAAgC;GAChC,kDAAkD;GAClD,kCAAkC;GAClC,8CAA8C;GAC9C,6BAA6B;GAC7B,wBAAwB;GACxB,mBAAmB,CACf,SACA,EACI,OAAO;IACH;IACA;IACA;IACH,EACJ,CACJ;GACD,2BAA2B;GAC3B,gCAAgC;GAChC,gCAAgC;GAChC,+BAA+B;GAC/B,oCAAoC;GACpC,oCAAoC;GACpC,mBAAmB,CACf,SACA,EACH;GACD,+BAA+B,CAC3B,SACA;IACI,WAAW;IACX,YAAY;IACf,CACJ;GACD,eAAe,CACX,QACA;IACI,MAAM;IACN,UAAU;IACV,UAAU;IACb,CACJ;GACD,oBAAoB;GACpB,wBAAwB;GACxB,uBAAuB;GACvB,oCAAoC;GACpC,oBAAoB;GACpB,gCAAgC;GAChC,iBAAiB;GACjB,6BAA6B;GAC7B,oCAAoC;GACpC,8BAA8B;GAC9B,yBAAyB;GAC5B;EACJ"}
1
+ {"version":3,"file":"vue.js","names":[],"sources":["../src/vue.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport kikiutilsTailwindcss from '@kikiutils/eslint-plugin-tailwindcss';\n// @ts-expect-error Ignore this error.\nimport kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';\n// @ts-expect-error No declare file.\nimport tailwindcss from 'eslint-plugin-tailwindcss';\n\nexport function createVueConfig(): TypedFlatConfigItem {\n return {\n files: ['**/*.vue'],\n plugins: {\n '@kikiutils/tailwindcss': kikiutilsTailwindcss,\n '@kikiutils/vue': kikiutilsEslintPluginVue,\n tailwindcss,\n },\n rules: {\n '@kikiutils/tailwindcss/classnames-order': 'error',\n '@kikiutils/vue/attributes-order': [\n 'error',\n { alphabetical: true },\n ],\n '@kikiutils/vue/no-extra-space-in-class': 'error',\n 'style/max-len': 'off',\n 'tailwindcss/classnames-order': 'off',\n 'tailwindcss/enforces-negative-arbitrary-values': 'error',\n 'tailwindcss/enforces-shorthand': 'error',\n 'tailwindcss/no-unnecessary-arbitrary-value': 'error',\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/prefer-separate-static-class': 'error',\n 'vue/require-explicit-emits': 'error',\n 'vue/require-typed-ref': 'error',\n },\n };\n}\n"],"mappings":";;;;AAQA,SAAgB,kBAAuC;AACnD,QAAO;EACH,OAAO,CAAC,WAAW;EACnB,SAAS;GACL,0BAA0B;GAC1B,kBAAkB;GAClB;GACH;EACD,OAAO;GACH,2CAA2C;GAC3C,mCAAmC,CAC/B,SACA,EAAE,cAAc,MAAM,CACzB;GACD,0CAA0C;GAC1C,iBAAiB;GACjB,gCAAgC;GAChC,kDAAkD;GAClD,kCAAkC;GAClC,8CAA8C;GAC9C,6BAA6B;GAC7B,wBAAwB;GACxB,mBAAmB,CACf,SACA,EACI,OAAO;IACH;IACA;IACA;IACH,EACJ,CACJ;GACD,2BAA2B;GAC3B,gCAAgC;GAChC,gCAAgC;GAChC,+BAA+B;GAC/B,oCAAoC;GACpC,oCAAoC;GACpC,mBAAmB,CACf,SACA,EACH;GACD,+BAA+B,CAC3B,SACA;IACI,WAAW;IACX,YAAY;IACf,CACJ;GACD,eAAe,CACX,QACA;IACI,MAAM;IACN,UAAU;IACV,UAAU;IACb,CACJ;GACD,oBAAoB;GACpB,wBAAwB;GACxB,uBAAuB;GACvB,oCAAoC;GACpC,oBAAoB;GACpB,gCAAgC;GAChC,iBAAiB;GACjB,6BAA6B;GAC7B,oCAAoC;GACpC,8BAA8B;GAC9B,yBAAyB;GAC5B;EACJ"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kikiutils/eslint-config",
3
3
  "type": "module",
4
- "version": "5.0.4",
4
+ "version": "7.0.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,8 +12,8 @@
12
12
  "keywords": [],
13
13
  "sideEffects": false,
14
14
  "exports": {
15
- "./*": "./dist/*.js",
16
- "./package.json": "./package.json"
15
+ "./package.json": "./package.json",
16
+ "./*": "./dist/*.js"
17
17
  },
18
18
  "files": [
19
19
  "./dist",
@@ -25,22 +25,21 @@
25
25
  "scripts": {
26
26
  "build": "tsdown",
27
27
  "bumplog": "changelogen --bump --hideAuthorEmail",
28
- "depcheck": "depcheck",
28
+ "knip:deps": "knip --dependencies",
29
+ "knip:exports": "knip --exports",
29
30
  "lint": "eslint --max-warnings 0",
30
31
  "lint:fix": "eslint --fix --max-warnings 0",
31
32
  "prepack": "pnpm run build",
32
33
  "release": "pnpm run lint && pnpm run typecheck && pnpm run test && pnpm run build && changelogen --hideAuthorEmail --push --release && npm publish",
33
34
  "test": "vitest run --coverage",
34
35
  "test:watch": "vitest watch --coverage",
35
- "typecheck": "tsc -b --noEmit",
36
- "unused-exports": "ts-unused-exports ./tsconfig.json"
36
+ "typecheck": "tsc -b --noEmit"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@kikiutils/eslint-plugin-tailwindcss": "^3.19.0",
40
40
  "@kikiutils/eslint-plugin-vue": "^10.2.2",
41
- "eslint": "^9.35.0 || ^10.0.0",
42
- "eslint-flat-config-utils": "^2.1.1 || ^3.0.1",
43
- "eslint-plugin-format": "^1.4.0",
41
+ "eslint": ">= 9.0.0",
42
+ "eslint-plugin-format": ">= 1.0.0",
44
43
  "eslint-plugin-tailwindcss": "^3.18.2"
45
44
  },
46
45
  "peerDependenciesMeta": {
@@ -50,7 +49,7 @@
50
49
  "@kikiutils/eslint-plugin-vue": {
51
50
  "optional": true
52
51
  },
53
- "eslint-flat-config-utils": {
52
+ "eslint": {
54
53
  "optional": true
55
54
  },
56
55
  "eslint-plugin-format": {
@@ -61,23 +60,21 @@
61
60
  }
62
61
  },
63
62
  "dependencies": {
64
- "@antfu/eslint-config": "^7.4.3",
63
+ "@antfu/eslint-config": "^7.7.0",
65
64
  "eslint-plugin-promise": "^7.2.1"
66
65
  },
67
66
  "devDependencies": {
68
67
  "@kikiutils/eslint-plugin-tailwindcss": "^3.19.0",
69
68
  "@kikiutils/eslint-plugin-vue": "^10.2.2",
70
- "@kikiutils/tsconfigs": "^5.0.5",
71
- "@types/node": "^25.2.3",
69
+ "@kikiutils/tsconfigs": "^5.1.0",
70
+ "@types/node": "^25.3.5",
72
71
  "@vitest/coverage-v8": "^4.0.18",
73
72
  "changelogen": "^0.6.2",
74
- "depcheck": "^1.4.7",
75
- "eslint-flat-config-utils": "^3.0.1",
76
- "eslint-plugin-format": "^1.4.0",
73
+ "eslint-plugin-format": "^2.0.1",
77
74
  "eslint-plugin-tailwindcss": "^3.18.2",
78
- "publint": "^0.3.17",
79
- "ts-unused-exports": "^11.0.1",
80
- "tsdown": "^0.20.3",
75
+ "knip": "^5.86.0",
76
+ "publint": "^0.3.18",
77
+ "tsdown": "^0.21.0",
81
78
  "typescript": "^5.9.3",
82
79
  "unplugin-unused": "^0.5.7",
83
80
  "vitest": "^4.0.18"
package/src/base.ts CHANGED
@@ -1,4 +1,7 @@
1
- import type { TypedFlatConfigItem } from '@antfu/eslint-config';
1
+ import type {
2
+ Rules,
3
+ TypedFlatConfigItem,
4
+ } from '@antfu/eslint-config';
2
5
  // @ts-expect-error No declare file.
3
6
  import promise from 'eslint-plugin-promise';
4
7
 
@@ -9,278 +12,35 @@ const basePerfectionistSortOptions = {
9
12
 
10
13
  export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {
11
14
  return [
15
+ // All files
12
16
  {
13
- files: ['**/*.{cjs,js,mjs,ts,tsx}'],
14
17
  rules: {
15
- 'node/prefer-global/process': [
18
+ 'e18e/ban-dependencies': [
16
19
  'error',
17
- 'always',
20
+ { allowed: ['axios'] },
18
21
  ],
22
+ 'e18e/prefer-static-regex': ['off'],
19
23
  },
20
24
  },
25
+ // JavaScript
21
26
  {
22
- files: ['**/*.{cjs,js,mjs,ts,tsx,vue}'],
27
+ files: ['**/*.{cjs,js,mjs}'],
23
28
  plugins: { promise },
24
29
  rules: {
25
- 'antfu/consistent-list-newline': [
26
- 'error',
27
- {
28
- ArrayExpression: false,
29
- ArrayPattern: false,
30
- },
31
- ],
32
- 'antfu/curly': 'off',
33
- 'antfu/if-newline': 'off',
34
- 'antfu/no-top-level-await': 'off',
35
- 'curly': [
36
- 'error',
37
- 'multi-line',
38
- ],
39
- 'max-classes-per-file': [
40
- 'error',
41
- 1,
42
- ],
43
- 'no-promise-executor-return': [
44
- 'error',
45
- { allowVoid: true },
46
- ],
47
- 'perfectionist/sort-array-includes': [
48
- 'error',
49
- basePerfectionistSortOptions,
50
- ],
51
- 'perfectionist/sort-enums': [
52
- 'error',
53
- {
54
- ...basePerfectionistSortOptions,
55
- sortByValue: 'never',
56
- },
57
- ],
58
- 'perfectionist/sort-heritage-clauses': [
59
- 'error',
60
- {
61
- ignoreCase: false,
62
- type: 'natural',
63
- },
64
- ],
65
- 'perfectionist/sort-imports': [
66
- 'error',
67
- {
68
- environment,
69
- groups: [
70
- 'side-effect',
71
- 'side-effect-style',
72
- 'style',
73
- [
74
- 'value-builtin',
75
- 'type-builtin',
76
- ],
77
- [
78
- 'value-external',
79
- 'type-external',
80
- ],
81
- [
82
- 'value-internal',
83
- 'type-internal',
84
- ],
85
- [
86
- 'value-parent',
87
- 'type-parent',
88
- ],
89
- [
90
- 'value-sibling',
91
- 'type-sibling',
92
- ],
93
- [
94
- 'value-index',
95
- 'type-index',
96
- ],
97
- 'unknown',
98
- ],
99
- ignoreCase: false,
100
- internalPattern: [
101
- '^#.*',
102
- '^@/.*',
103
- '^~/.*',
104
- ],
105
- type: 'natural',
106
- },
107
- ],
108
- 'perfectionist/sort-interfaces': [
109
- 'error',
110
- basePerfectionistSortOptions,
111
- ],
112
- 'perfectionist/sort-intersection-types': [
113
- 'error',
114
- basePerfectionistSortOptions,
115
- ],
116
- 'perfectionist/sort-maps': [
117
- 'error',
118
- basePerfectionistSortOptions,
119
- ],
120
- 'perfectionist/sort-modules': [
121
- 'error',
122
- {
123
- ...basePerfectionistSortOptions,
124
- groups: [
125
- 'declare-type',
126
- [
127
- 'export-type',
128
- 'type',
129
- ],
130
- 'declare-interface',
131
- [
132
- 'export-interface',
133
- 'interface',
134
- ],
135
- 'declare-enum',
136
- [
137
- 'enum',
138
- 'export-enum',
139
- ],
140
- 'declare-class',
141
- [
142
- 'class',
143
- 'export-class',
144
- ],
145
- 'declare-function',
146
- [
147
- 'export-function',
148
- 'function',
149
- ],
150
- ],
151
- },
152
- ],
153
- 'perfectionist/sort-object-types': [
154
- 'error',
155
- basePerfectionistSortOptions,
156
- ],
157
- 'perfectionist/sort-objects': [
158
- 'error',
159
- basePerfectionistSortOptions,
160
- ],
161
- 'perfectionist/sort-sets': [
162
- 'error',
163
- basePerfectionistSortOptions,
164
- ],
165
- 'perfectionist/sort-switch-case': [
166
- 'error',
167
- {
168
- ignoreCase: false,
169
- type: 'natural',
170
- },
171
- ],
172
- 'perfectionist/sort-union-types': [
173
- 'error',
174
- basePerfectionistSortOptions,
175
- ],
176
- 'perfectionist/sort-variable-declarations': [
177
- 'error',
178
- basePerfectionistSortOptions,
179
- ],
180
- 'promise/no-multiple-resolved': 'error',
181
- 'promise/no-return-in-finally': 'error',
182
- 'promise/no-return-wrap': 'error',
183
- 'require-await': 'error',
184
- 'style/array-bracket-newline': [
185
- 'error',
186
- { multiline: true },
187
- ],
188
- 'style/array-element-newline': [
189
- 'error',
190
- {
191
- ArrayExpression: {
192
- consistent: true,
193
- minItems: 2,
194
- },
195
- ArrayPattern: { minItems: 3 },
196
- },
197
- ],
198
- 'style/arrow-parens': [
30
+ ...createBaseRules(environment),
31
+ 'node/prefer-global/process': [
199
32
  'error',
200
33
  'always',
201
34
  ],
202
- 'style/brace-style': [
203
- 'error',
204
- '1tbs',
205
- { allowSingleLine: false },
206
- ],
207
- 'style/function-call-spacing': [
208
- 'error',
209
- 'never',
210
- ],
211
- 'style/indent': [
212
- 'error',
213
- 4,
214
- ],
215
- 'style/max-len': [
216
- 'warn',
217
- {
218
- code: 120,
219
- comments: 120,
220
- },
221
- ],
222
- 'style/member-delimiter-style': [
223
- 'error',
224
- {
225
- multiline: {
226
- delimiter: 'semi',
227
- requireLast: true,
228
- },
229
- },
230
- ],
231
- 'style/no-extra-parens': [
232
- 'error',
233
- 'all',
234
- { nestedBinaryExpressions: false },
235
- ],
236
- 'style/no-extra-semi': 'error',
237
- 'style/object-curly-newline': [
238
- 'error',
239
- {
240
- ExportDeclaration: {
241
- minProperties: 2,
242
- multiline: true,
243
- },
244
- ImportDeclaration: {
245
- minProperties: 2,
246
- multiline: true,
247
- },
248
- ObjectExpression: {
249
- minProperties: 2,
250
- multiline: true,
251
- },
252
- ObjectPattern: {
253
- minProperties: 3,
254
- multiline: true,
255
- },
256
- },
257
- ],
258
- 'style/operator-linebreak': [
259
- 'error',
260
- 'before',
261
- { overrides: { '=': 'after' } },
262
- ],
263
- 'style/padding-line-between-statements': [
264
- 'error',
265
- {
266
- blankLine: 'always',
267
- next: [
268
- 'class',
269
- 'enum',
270
- 'function',
271
- ],
272
- prev: '*',
273
- },
274
- {
275
- blankLine: 'always',
276
- next: '*',
277
- prev: [
278
- 'class',
279
- 'function',
280
- ],
281
- },
282
- ],
283
- 'style/semi': [
35
+ },
36
+ },
37
+ // TypeScript
38
+ {
39
+ files: ['**/*.{ts,tsx}'],
40
+ plugins: { promise },
41
+ rules: {
42
+ ...createBaseRules(environment),
43
+ 'node/prefer-global/process': [
284
44
  'error',
285
45
  'always',
286
46
  ],
@@ -291,6 +51,7 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
291
51
  'ts/no-redeclare': 'off',
292
52
  },
293
53
  },
54
+ // VsCode jsonc
294
55
  {
295
56
  files: ['**/.vscode/*.json'],
296
57
  rules: {
@@ -314,5 +75,285 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
314
75
  ],
315
76
  },
316
77
  },
78
+ // Vue
79
+ {
80
+ files: ['**/*.{vue}'],
81
+ plugins: { promise },
82
+ rules: {
83
+ ...createBaseRules(environment),
84
+ 'ts/consistent-generic-constructors': [
85
+ 'error',
86
+ 'constructor',
87
+ ],
88
+ 'ts/no-redeclare': 'off',
89
+ },
90
+ },
317
91
  ];
318
92
  }
93
+
94
+ function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {
95
+ return {
96
+ 'antfu/consistent-list-newline': [
97
+ 'error',
98
+ {
99
+ ArrayExpression: false,
100
+ ArrayPattern: false,
101
+ },
102
+ ],
103
+ 'antfu/curly': 'off',
104
+ 'antfu/if-newline': 'off',
105
+ 'antfu/no-top-level-await': 'off',
106
+ 'curly': [
107
+ 'error',
108
+ 'multi-line',
109
+ ],
110
+ 'max-classes-per-file': [
111
+ 'error',
112
+ 1,
113
+ ],
114
+ 'no-promise-executor-return': [
115
+ 'error',
116
+ { allowVoid: true },
117
+ ],
118
+ 'perfectionist/sort-array-includes': [
119
+ 'error',
120
+ basePerfectionistSortOptions,
121
+ ],
122
+ 'perfectionist/sort-enums': [
123
+ 'error',
124
+ {
125
+ ...basePerfectionistSortOptions,
126
+ sortByValue: 'never',
127
+ },
128
+ ],
129
+ 'perfectionist/sort-heritage-clauses': [
130
+ 'error',
131
+ {
132
+ ignoreCase: false,
133
+ type: 'natural',
134
+ },
135
+ ],
136
+ 'perfectionist/sort-imports': [
137
+ 'error',
138
+ {
139
+ environment,
140
+ groups: [
141
+ 'side-effect',
142
+ 'side-effect-style',
143
+ 'style',
144
+ [
145
+ 'value-builtin',
146
+ 'type-builtin',
147
+ ],
148
+ [
149
+ 'value-external',
150
+ 'type-external',
151
+ ],
152
+ [
153
+ 'value-internal',
154
+ 'type-internal',
155
+ ],
156
+ [
157
+ 'value-parent',
158
+ 'type-parent',
159
+ ],
160
+ [
161
+ 'value-sibling',
162
+ 'type-sibling',
163
+ ],
164
+ [
165
+ 'value-index',
166
+ 'type-index',
167
+ ],
168
+ 'unknown',
169
+ ],
170
+ ignoreCase: false,
171
+ internalPattern: [
172
+ '^#.*',
173
+ '^@/.*',
174
+ '^~/.*',
175
+ ],
176
+ type: 'natural',
177
+ },
178
+ ],
179
+ 'perfectionist/sort-interfaces': [
180
+ 'error',
181
+ basePerfectionistSortOptions,
182
+ ],
183
+ 'perfectionist/sort-intersection-types': [
184
+ 'error',
185
+ basePerfectionistSortOptions,
186
+ ],
187
+ 'perfectionist/sort-maps': [
188
+ 'error',
189
+ basePerfectionistSortOptions,
190
+ ],
191
+ 'perfectionist/sort-modules': [
192
+ 'error',
193
+ {
194
+ ...basePerfectionistSortOptions,
195
+ groups: [
196
+ 'declare-type',
197
+ [
198
+ 'export-type',
199
+ 'type',
200
+ ],
201
+ 'declare-interface',
202
+ [
203
+ 'export-interface',
204
+ 'interface',
205
+ ],
206
+ 'declare-enum',
207
+ [
208
+ 'enum',
209
+ 'export-enum',
210
+ ],
211
+ 'declare-class',
212
+ [
213
+ 'class',
214
+ 'export-class',
215
+ ],
216
+ 'declare-function',
217
+ [
218
+ 'export-function',
219
+ 'function',
220
+ ],
221
+ ],
222
+ },
223
+ ],
224
+ 'perfectionist/sort-object-types': [
225
+ 'error',
226
+ basePerfectionistSortOptions,
227
+ ],
228
+ 'perfectionist/sort-objects': [
229
+ 'error',
230
+ basePerfectionistSortOptions,
231
+ ],
232
+ 'perfectionist/sort-sets': [
233
+ 'error',
234
+ basePerfectionistSortOptions,
235
+ ],
236
+ 'perfectionist/sort-switch-case': [
237
+ 'error',
238
+ {
239
+ ignoreCase: false,
240
+ type: 'natural',
241
+ },
242
+ ],
243
+ 'perfectionist/sort-union-types': [
244
+ 'error',
245
+ basePerfectionistSortOptions,
246
+ ],
247
+ 'perfectionist/sort-variable-declarations': [
248
+ 'error',
249
+ basePerfectionistSortOptions,
250
+ ],
251
+ 'promise/no-multiple-resolved': 'error',
252
+ 'promise/no-return-in-finally': 'error',
253
+ 'promise/no-return-wrap': 'error',
254
+ 'require-await': 'error',
255
+ 'style/array-bracket-newline': [
256
+ 'error',
257
+ { multiline: true },
258
+ ],
259
+ 'style/array-element-newline': [
260
+ 'error',
261
+ {
262
+ ArrayExpression: {
263
+ consistent: true,
264
+ minItems: 2,
265
+ },
266
+ ArrayPattern: { minItems: 3 },
267
+ },
268
+ ],
269
+ 'style/arrow-parens': [
270
+ 'error',
271
+ 'always',
272
+ ],
273
+ 'style/brace-style': [
274
+ 'error',
275
+ '1tbs',
276
+ { allowSingleLine: false },
277
+ ],
278
+ 'style/function-call-spacing': [
279
+ 'error',
280
+ 'never',
281
+ ],
282
+ 'style/indent': [
283
+ 'error',
284
+ 4,
285
+ ],
286
+ 'style/max-len': [
287
+ 'warn',
288
+ {
289
+ code: 120,
290
+ comments: 120,
291
+ },
292
+ ],
293
+ 'style/member-delimiter-style': [
294
+ 'error',
295
+ {
296
+ multiline: {
297
+ delimiter: 'semi',
298
+ requireLast: true,
299
+ },
300
+ },
301
+ ],
302
+ 'style/no-extra-parens': [
303
+ 'error',
304
+ 'all',
305
+ { nestedBinaryExpressions: false },
306
+ ],
307
+ 'style/no-extra-semi': 'error',
308
+ 'style/object-curly-newline': [
309
+ 'error',
310
+ {
311
+ ExportDeclaration: {
312
+ minProperties: 2,
313
+ multiline: true,
314
+ },
315
+ ImportDeclaration: {
316
+ minProperties: 2,
317
+ multiline: true,
318
+ },
319
+ ObjectExpression: {
320
+ minProperties: 2,
321
+ multiline: true,
322
+ },
323
+ ObjectPattern: {
324
+ minProperties: 3,
325
+ multiline: true,
326
+ },
327
+ },
328
+ ],
329
+ 'style/operator-linebreak': [
330
+ 'error',
331
+ 'before',
332
+ { overrides: { '=': 'after' } },
333
+ ],
334
+ 'style/padding-line-between-statements': [
335
+ 'error',
336
+ {
337
+ blankLine: 'always',
338
+ next: [
339
+ 'class',
340
+ 'enum',
341
+ 'function',
342
+ ],
343
+ prev: '*',
344
+ },
345
+ {
346
+ blankLine: 'always',
347
+ next: '*',
348
+ prev: [
349
+ 'class',
350
+ 'function',
351
+ ],
352
+ },
353
+ ],
354
+ 'style/semi': [
355
+ 'error',
356
+ 'always',
357
+ ],
358
+ };
359
+ }
package/src/style.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import type { TypedFlatConfigItem } from '@antfu/eslint-config';
2
- // @ts-expect-error Ignore this error.
3
2
  import format from 'eslint-plugin-format';
4
3
 
5
4
  function createPrettierCssConfig(parser: 'css' | 'sass' | 'scss'): TypedFlatConfigItem {