@lqbach/eslint-config 0.6.1 โ 0.8.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/CHANGELOG.md +33 -0
- package/README.md +19 -0
- package/dist/index.cjs +78 -305
- package/dist/index.d.cts +26 -11
- package/dist/index.d.ts +26 -11
- package/dist/index.js +111 -361
- package/package.json +12 -9
- package/src/index.ts +98 -9
- package/src/libs.ts +3 -3
- package/src/types.ts +30 -11
- package/test/astro.spec.ts +120 -0
- package/test/ignore.spec.ts +39 -0
- package/test/next.spec.ts +56 -0
- package/test/utils.ts +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.0](https://github.com/lqbach/eslint-prettier-config/compare/eslint-config-v0.7.0...eslint-config-v0.8.0) (2025-10-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features ๐
|
|
7
|
+
|
|
8
|
+
* add astro ([eabb4b0](https://github.com/lqbach/eslint-prettier-config/commit/eabb4b0923608c5c3964cf149e40f0a88d08dc0e))
|
|
9
|
+
* add mise file ([#19](https://github.com/lqbach/eslint-prettier-config/issues/19)) ([fbd6061](https://github.com/lqbach/eslint-prettier-config/commit/fbd60615fb30c310d6b38d1cdc875ba9f21f6684))
|
|
10
|
+
|
|
11
|
+
## [0.7.0](https://github.com/lqbach/eslint-prettier-config/compare/eslint-config-v0.6.1...eslint-config-v0.7.0) (2024-12-22)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features ๐
|
|
15
|
+
|
|
16
|
+
* add nextjs config ([#18](https://github.com/lqbach/eslint-prettier-config/issues/18)) ([423b1b2](https://github.com/lqbach/eslint-prettier-config/commit/423b1b28dc519ff24d5824e7e1c0d3f60db083df))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes ๐
|
|
20
|
+
|
|
21
|
+
* add `composite=true` to tsconfig files ([#15](https://github.com/lqbach/eslint-prettier-config/issues/15)) ([965d40e](https://github.com/lqbach/eslint-prettier-config/commit/965d40eac4ac5c1071c421aadd5e54c6c2e634be))
|
|
22
|
+
* remove `remove` package ([5655b9b](https://github.com/lqbach/eslint-prettier-config/commit/5655b9bf822c8fc8ff27b66e13c7170ccfca534b))
|
|
23
|
+
* remove composite true setting ([e604a78](https://github.com/lqbach/eslint-prettier-config/commit/e604a78fe24f417fcc4c82d678ebc4be7fd8e1d5))
|
|
24
|
+
* update types in eslint-config ([0f3afd4](https://github.com/lqbach/eslint-prettier-config/commit/0f3afd405bd1b930c74ad3272d113de0639e073e))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Chores ๐งน
|
|
28
|
+
|
|
29
|
+
* upgrade prettier in subpackages ([3e60af5](https://github.com/lqbach/eslint-prettier-config/commit/3e60af54a2d7e79cfc1b9c6ee3901db88d9161b3))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Tests ๐งช
|
|
33
|
+
|
|
34
|
+
* add ignore tests ([#17](https://github.com/lqbach/eslint-prettier-config/issues/17)) ([503837b](https://github.com/lqbach/eslint-prettier-config/commit/503837b49572bb8a5108f8f4316907ebdca7e83b))
|
|
35
|
+
|
|
3
36
|
## [0.6.1](https://github.com/lqbach/eslint-prettier-config/compare/eslint-config-v0.6.0...eslint-config-v0.6.1) (2024-10-02)
|
|
4
37
|
|
|
5
38
|
|
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
- [Features](#features)
|
|
22
22
|
- [Ignoring Files](#ignoring-files)
|
|
23
23
|
- [React and Vue](#react-and-vue)
|
|
24
|
+
- [NextJS](#nextjs)
|
|
24
25
|
|
|
25
26
|
## Usage
|
|
26
27
|
|
|
@@ -110,3 +111,21 @@ export default eslintConfig({
|
|
|
110
111
|
// react: true,
|
|
111
112
|
})
|
|
112
113
|
```
|
|
114
|
+
|
|
115
|
+
### NextJS
|
|
116
|
+
|
|
117
|
+
NextJS has options for parameters. The following parameters are supported:
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
// eslint.config.js
|
|
121
|
+
import eslintConfig from "@lqbach/eslint-config"
|
|
122
|
+
|
|
123
|
+
export default eslintConfig({
|
|
124
|
+
next: {
|
|
125
|
+
rootDir: "packages/example", //set the root directory of next project, useful for monorepo
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
// can also use boolean for default configuration
|
|
129
|
+
// next: true,
|
|
130
|
+
})
|
|
131
|
+
```
|
package/dist/index.cjs
CHANGED
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
8
|
var __export = (target, all) => {
|
|
12
9
|
for (var name in all)
|
|
13
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -30,315 +27,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
27
|
));
|
|
31
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
29
|
|
|
33
|
-
// ../../node_modules/.pnpm/@eslint+js@9.11.1/node_modules/@eslint/js/src/configs/eslint-all.js
|
|
34
|
-
var require_eslint_all = __commonJS({
|
|
35
|
-
"../../node_modules/.pnpm/@eslint+js@9.11.1/node_modules/@eslint/js/src/configs/eslint-all.js"(exports, module2) {
|
|
36
|
-
"use strict";
|
|
37
|
-
module2.exports = Object.freeze({
|
|
38
|
-
"rules": {
|
|
39
|
-
"accessor-pairs": "error",
|
|
40
|
-
"array-callback-return": "error",
|
|
41
|
-
"arrow-body-style": "error",
|
|
42
|
-
"block-scoped-var": "error",
|
|
43
|
-
"camelcase": "error",
|
|
44
|
-
"capitalized-comments": "error",
|
|
45
|
-
"class-methods-use-this": "error",
|
|
46
|
-
"complexity": "error",
|
|
47
|
-
"consistent-return": "error",
|
|
48
|
-
"consistent-this": "error",
|
|
49
|
-
"constructor-super": "error",
|
|
50
|
-
"curly": "error",
|
|
51
|
-
"default-case": "error",
|
|
52
|
-
"default-case-last": "error",
|
|
53
|
-
"default-param-last": "error",
|
|
54
|
-
"dot-notation": "error",
|
|
55
|
-
"eqeqeq": "error",
|
|
56
|
-
"for-direction": "error",
|
|
57
|
-
"func-name-matching": "error",
|
|
58
|
-
"func-names": "error",
|
|
59
|
-
"func-style": "error",
|
|
60
|
-
"getter-return": "error",
|
|
61
|
-
"grouped-accessor-pairs": "error",
|
|
62
|
-
"guard-for-in": "error",
|
|
63
|
-
"id-denylist": "error",
|
|
64
|
-
"id-length": "error",
|
|
65
|
-
"id-match": "error",
|
|
66
|
-
"init-declarations": "error",
|
|
67
|
-
"logical-assignment-operators": "error",
|
|
68
|
-
"max-classes-per-file": "error",
|
|
69
|
-
"max-depth": "error",
|
|
70
|
-
"max-lines": "error",
|
|
71
|
-
"max-lines-per-function": "error",
|
|
72
|
-
"max-nested-callbacks": "error",
|
|
73
|
-
"max-params": "error",
|
|
74
|
-
"max-statements": "error",
|
|
75
|
-
"new-cap": "error",
|
|
76
|
-
"no-alert": "error",
|
|
77
|
-
"no-array-constructor": "error",
|
|
78
|
-
"no-async-promise-executor": "error",
|
|
79
|
-
"no-await-in-loop": "error",
|
|
80
|
-
"no-bitwise": "error",
|
|
81
|
-
"no-caller": "error",
|
|
82
|
-
"no-case-declarations": "error",
|
|
83
|
-
"no-class-assign": "error",
|
|
84
|
-
"no-compare-neg-zero": "error",
|
|
85
|
-
"no-cond-assign": "error",
|
|
86
|
-
"no-console": "error",
|
|
87
|
-
"no-const-assign": "error",
|
|
88
|
-
"no-constant-binary-expression": "error",
|
|
89
|
-
"no-constant-condition": "error",
|
|
90
|
-
"no-constructor-return": "error",
|
|
91
|
-
"no-continue": "error",
|
|
92
|
-
"no-control-regex": "error",
|
|
93
|
-
"no-debugger": "error",
|
|
94
|
-
"no-delete-var": "error",
|
|
95
|
-
"no-div-regex": "error",
|
|
96
|
-
"no-dupe-args": "error",
|
|
97
|
-
"no-dupe-class-members": "error",
|
|
98
|
-
"no-dupe-else-if": "error",
|
|
99
|
-
"no-dupe-keys": "error",
|
|
100
|
-
"no-duplicate-case": "error",
|
|
101
|
-
"no-duplicate-imports": "error",
|
|
102
|
-
"no-else-return": "error",
|
|
103
|
-
"no-empty": "error",
|
|
104
|
-
"no-empty-character-class": "error",
|
|
105
|
-
"no-empty-function": "error",
|
|
106
|
-
"no-empty-pattern": "error",
|
|
107
|
-
"no-empty-static-block": "error",
|
|
108
|
-
"no-eq-null": "error",
|
|
109
|
-
"no-eval": "error",
|
|
110
|
-
"no-ex-assign": "error",
|
|
111
|
-
"no-extend-native": "error",
|
|
112
|
-
"no-extra-bind": "error",
|
|
113
|
-
"no-extra-boolean-cast": "error",
|
|
114
|
-
"no-extra-label": "error",
|
|
115
|
-
"no-fallthrough": "error",
|
|
116
|
-
"no-func-assign": "error",
|
|
117
|
-
"no-global-assign": "error",
|
|
118
|
-
"no-implicit-coercion": "error",
|
|
119
|
-
"no-implicit-globals": "error",
|
|
120
|
-
"no-implied-eval": "error",
|
|
121
|
-
"no-import-assign": "error",
|
|
122
|
-
"no-inline-comments": "error",
|
|
123
|
-
"no-inner-declarations": "error",
|
|
124
|
-
"no-invalid-regexp": "error",
|
|
125
|
-
"no-invalid-this": "error",
|
|
126
|
-
"no-irregular-whitespace": "error",
|
|
127
|
-
"no-iterator": "error",
|
|
128
|
-
"no-label-var": "error",
|
|
129
|
-
"no-labels": "error",
|
|
130
|
-
"no-lone-blocks": "error",
|
|
131
|
-
"no-lonely-if": "error",
|
|
132
|
-
"no-loop-func": "error",
|
|
133
|
-
"no-loss-of-precision": "error",
|
|
134
|
-
"no-magic-numbers": "error",
|
|
135
|
-
"no-misleading-character-class": "error",
|
|
136
|
-
"no-multi-assign": "error",
|
|
137
|
-
"no-multi-str": "error",
|
|
138
|
-
"no-negated-condition": "error",
|
|
139
|
-
"no-nested-ternary": "error",
|
|
140
|
-
"no-new": "error",
|
|
141
|
-
"no-new-func": "error",
|
|
142
|
-
"no-new-native-nonconstructor": "error",
|
|
143
|
-
"no-new-wrappers": "error",
|
|
144
|
-
"no-nonoctal-decimal-escape": "error",
|
|
145
|
-
"no-obj-calls": "error",
|
|
146
|
-
"no-object-constructor": "error",
|
|
147
|
-
"no-octal": "error",
|
|
148
|
-
"no-octal-escape": "error",
|
|
149
|
-
"no-param-reassign": "error",
|
|
150
|
-
"no-plusplus": "error",
|
|
151
|
-
"no-promise-executor-return": "error",
|
|
152
|
-
"no-proto": "error",
|
|
153
|
-
"no-prototype-builtins": "error",
|
|
154
|
-
"no-redeclare": "error",
|
|
155
|
-
"no-regex-spaces": "error",
|
|
156
|
-
"no-restricted-exports": "error",
|
|
157
|
-
"no-restricted-globals": "error",
|
|
158
|
-
"no-restricted-imports": "error",
|
|
159
|
-
"no-restricted-properties": "error",
|
|
160
|
-
"no-restricted-syntax": "error",
|
|
161
|
-
"no-return-assign": "error",
|
|
162
|
-
"no-script-url": "error",
|
|
163
|
-
"no-self-assign": "error",
|
|
164
|
-
"no-self-compare": "error",
|
|
165
|
-
"no-sequences": "error",
|
|
166
|
-
"no-setter-return": "error",
|
|
167
|
-
"no-shadow": "error",
|
|
168
|
-
"no-shadow-restricted-names": "error",
|
|
169
|
-
"no-sparse-arrays": "error",
|
|
170
|
-
"no-template-curly-in-string": "error",
|
|
171
|
-
"no-ternary": "error",
|
|
172
|
-
"no-this-before-super": "error",
|
|
173
|
-
"no-throw-literal": "error",
|
|
174
|
-
"no-undef": "error",
|
|
175
|
-
"no-undef-init": "error",
|
|
176
|
-
"no-undefined": "error",
|
|
177
|
-
"no-underscore-dangle": "error",
|
|
178
|
-
"no-unexpected-multiline": "error",
|
|
179
|
-
"no-unmodified-loop-condition": "error",
|
|
180
|
-
"no-unneeded-ternary": "error",
|
|
181
|
-
"no-unreachable": "error",
|
|
182
|
-
"no-unreachable-loop": "error",
|
|
183
|
-
"no-unsafe-finally": "error",
|
|
184
|
-
"no-unsafe-negation": "error",
|
|
185
|
-
"no-unsafe-optional-chaining": "error",
|
|
186
|
-
"no-unused-expressions": "error",
|
|
187
|
-
"no-unused-labels": "error",
|
|
188
|
-
"no-unused-private-class-members": "error",
|
|
189
|
-
"no-unused-vars": "error",
|
|
190
|
-
"no-use-before-define": "error",
|
|
191
|
-
"no-useless-assignment": "error",
|
|
192
|
-
"no-useless-backreference": "error",
|
|
193
|
-
"no-useless-call": "error",
|
|
194
|
-
"no-useless-catch": "error",
|
|
195
|
-
"no-useless-computed-key": "error",
|
|
196
|
-
"no-useless-concat": "error",
|
|
197
|
-
"no-useless-constructor": "error",
|
|
198
|
-
"no-useless-escape": "error",
|
|
199
|
-
"no-useless-rename": "error",
|
|
200
|
-
"no-useless-return": "error",
|
|
201
|
-
"no-var": "error",
|
|
202
|
-
"no-void": "error",
|
|
203
|
-
"no-warning-comments": "error",
|
|
204
|
-
"no-with": "error",
|
|
205
|
-
"object-shorthand": "error",
|
|
206
|
-
"one-var": "error",
|
|
207
|
-
"operator-assignment": "error",
|
|
208
|
-
"prefer-arrow-callback": "error",
|
|
209
|
-
"prefer-const": "error",
|
|
210
|
-
"prefer-destructuring": "error",
|
|
211
|
-
"prefer-exponentiation-operator": "error",
|
|
212
|
-
"prefer-named-capture-group": "error",
|
|
213
|
-
"prefer-numeric-literals": "error",
|
|
214
|
-
"prefer-object-has-own": "error",
|
|
215
|
-
"prefer-object-spread": "error",
|
|
216
|
-
"prefer-promise-reject-errors": "error",
|
|
217
|
-
"prefer-regex-literals": "error",
|
|
218
|
-
"prefer-rest-params": "error",
|
|
219
|
-
"prefer-spread": "error",
|
|
220
|
-
"prefer-template": "error",
|
|
221
|
-
"radix": "error",
|
|
222
|
-
"require-atomic-updates": "error",
|
|
223
|
-
"require-await": "error",
|
|
224
|
-
"require-unicode-regexp": "error",
|
|
225
|
-
"require-yield": "error",
|
|
226
|
-
"sort-imports": "error",
|
|
227
|
-
"sort-keys": "error",
|
|
228
|
-
"sort-vars": "error",
|
|
229
|
-
"strict": "error",
|
|
230
|
-
"symbol-description": "error",
|
|
231
|
-
"unicode-bom": "error",
|
|
232
|
-
"use-isnan": "error",
|
|
233
|
-
"valid-typeof": "error",
|
|
234
|
-
"vars-on-top": "error",
|
|
235
|
-
"yoda": "error"
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
// ../../node_modules/.pnpm/@eslint+js@9.11.1/node_modules/@eslint/js/src/configs/eslint-recommended.js
|
|
242
|
-
var require_eslint_recommended = __commonJS({
|
|
243
|
-
"../../node_modules/.pnpm/@eslint+js@9.11.1/node_modules/@eslint/js/src/configs/eslint-recommended.js"(exports, module2) {
|
|
244
|
-
"use strict";
|
|
245
|
-
module2.exports = Object.freeze({
|
|
246
|
-
rules: Object.freeze({
|
|
247
|
-
"constructor-super": "error",
|
|
248
|
-
"for-direction": "error",
|
|
249
|
-
"getter-return": "error",
|
|
250
|
-
"no-async-promise-executor": "error",
|
|
251
|
-
"no-case-declarations": "error",
|
|
252
|
-
"no-class-assign": "error",
|
|
253
|
-
"no-compare-neg-zero": "error",
|
|
254
|
-
"no-cond-assign": "error",
|
|
255
|
-
"no-const-assign": "error",
|
|
256
|
-
"no-constant-binary-expression": "error",
|
|
257
|
-
"no-constant-condition": "error",
|
|
258
|
-
"no-control-regex": "error",
|
|
259
|
-
"no-debugger": "error",
|
|
260
|
-
"no-delete-var": "error",
|
|
261
|
-
"no-dupe-args": "error",
|
|
262
|
-
"no-dupe-class-members": "error",
|
|
263
|
-
"no-dupe-else-if": "error",
|
|
264
|
-
"no-dupe-keys": "error",
|
|
265
|
-
"no-duplicate-case": "error",
|
|
266
|
-
"no-empty": "error",
|
|
267
|
-
"no-empty-character-class": "error",
|
|
268
|
-
"no-empty-pattern": "error",
|
|
269
|
-
"no-empty-static-block": "error",
|
|
270
|
-
"no-ex-assign": "error",
|
|
271
|
-
"no-extra-boolean-cast": "error",
|
|
272
|
-
"no-fallthrough": "error",
|
|
273
|
-
"no-func-assign": "error",
|
|
274
|
-
"no-global-assign": "error",
|
|
275
|
-
"no-import-assign": "error",
|
|
276
|
-
"no-invalid-regexp": "error",
|
|
277
|
-
"no-irregular-whitespace": "error",
|
|
278
|
-
"no-loss-of-precision": "error",
|
|
279
|
-
"no-misleading-character-class": "error",
|
|
280
|
-
"no-new-native-nonconstructor": "error",
|
|
281
|
-
"no-nonoctal-decimal-escape": "error",
|
|
282
|
-
"no-obj-calls": "error",
|
|
283
|
-
"no-octal": "error",
|
|
284
|
-
"no-prototype-builtins": "error",
|
|
285
|
-
"no-redeclare": "error",
|
|
286
|
-
"no-regex-spaces": "error",
|
|
287
|
-
"no-self-assign": "error",
|
|
288
|
-
"no-setter-return": "error",
|
|
289
|
-
"no-shadow-restricted-names": "error",
|
|
290
|
-
"no-sparse-arrays": "error",
|
|
291
|
-
"no-this-before-super": "error",
|
|
292
|
-
"no-undef": "error",
|
|
293
|
-
"no-unexpected-multiline": "error",
|
|
294
|
-
"no-unreachable": "error",
|
|
295
|
-
"no-unsafe-finally": "error",
|
|
296
|
-
"no-unsafe-negation": "error",
|
|
297
|
-
"no-unsafe-optional-chaining": "error",
|
|
298
|
-
"no-unused-labels": "error",
|
|
299
|
-
"no-unused-private-class-members": "error",
|
|
300
|
-
"no-unused-vars": "error",
|
|
301
|
-
"no-useless-backreference": "error",
|
|
302
|
-
"no-useless-catch": "error",
|
|
303
|
-
"no-useless-escape": "error",
|
|
304
|
-
"no-with": "error",
|
|
305
|
-
"require-yield": "error",
|
|
306
|
-
"use-isnan": "error",
|
|
307
|
-
"valid-typeof": "error"
|
|
308
|
-
})
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
// ../../node_modules/.pnpm/@eslint+js@9.11.1/node_modules/@eslint/js/src/index.js
|
|
314
|
-
var require_src = __commonJS({
|
|
315
|
-
"../../node_modules/.pnpm/@eslint+js@9.11.1/node_modules/@eslint/js/src/index.js"(exports, module2) {
|
|
316
|
-
"use strict";
|
|
317
|
-
module2.exports = {
|
|
318
|
-
configs: {
|
|
319
|
-
all: require_eslint_all(),
|
|
320
|
-
recommended: require_eslint_recommended()
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
|
|
326
30
|
// src/index.ts
|
|
327
|
-
var
|
|
328
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
329
33
|
default: () => config
|
|
330
34
|
});
|
|
331
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
332
36
|
var import_globals = __toESM(require("globals"), 1);
|
|
333
37
|
|
|
334
38
|
// src/libs.ts
|
|
335
|
-
var import_js = __toESM(
|
|
39
|
+
var import_js = __toESM(require("@eslint/js"), 1);
|
|
40
|
+
var import_eslint_plugin_next = __toESM(require("@next/eslint-plugin-next"), 1);
|
|
336
41
|
var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
337
42
|
var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
|
|
338
43
|
var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
|
|
44
|
+
var import_eslint_plugin_astro = __toESM(require("eslint-plugin-astro"), 1);
|
|
339
45
|
var import_eslint_plugin_jsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
340
46
|
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
341
47
|
var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
|
|
48
|
+
var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
|
|
342
49
|
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
343
50
|
var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
|
|
344
51
|
var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
|
|
@@ -371,8 +78,10 @@ function config(params = {}) {
|
|
|
371
78
|
"**/web/public",
|
|
372
79
|
"**/studio/build",
|
|
373
80
|
"**/studio/.sanity",
|
|
81
|
+
...params.next ? ["**/.next"] : [],
|
|
374
82
|
...params.ignores ? params.ignores : []
|
|
375
|
-
]
|
|
83
|
+
],
|
|
84
|
+
name: "lqbach/ignores"
|
|
376
85
|
};
|
|
377
86
|
const javascriptConfig = [
|
|
378
87
|
// Default
|
|
@@ -390,6 +99,7 @@ function config(params = {}) {
|
|
|
390
99
|
sourceType: "module"
|
|
391
100
|
}
|
|
392
101
|
},
|
|
102
|
+
name: "lqbach/javascript",
|
|
393
103
|
plugins: {
|
|
394
104
|
"unused-imports": import_eslint_plugin_unused_imports.default
|
|
395
105
|
},
|
|
@@ -415,6 +125,7 @@ function config(params = {}) {
|
|
|
415
125
|
sourceType: "module"
|
|
416
126
|
}
|
|
417
127
|
},
|
|
128
|
+
name: "lqbach/typescript",
|
|
418
129
|
plugins: {
|
|
419
130
|
"@typescript-eslint": import_eslint_plugin.default
|
|
420
131
|
},
|
|
@@ -422,7 +133,7 @@ function config(params = {}) {
|
|
|
422
133
|
...import_eslint_plugin.default.configs.recommended.rules
|
|
423
134
|
}
|
|
424
135
|
} : {};
|
|
425
|
-
const reactConfig = params.react ?? false ? {
|
|
136
|
+
const reactConfig = (params.next || params.react) ?? false ? {
|
|
426
137
|
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
427
138
|
languageOptions: {
|
|
428
139
|
globals: {
|
|
@@ -435,15 +146,27 @@ function config(params = {}) {
|
|
|
435
146
|
}
|
|
436
147
|
}
|
|
437
148
|
},
|
|
149
|
+
name: "lqbach/react",
|
|
438
150
|
plugins: {
|
|
439
151
|
react: import_eslint_plugin_react.default
|
|
440
152
|
},
|
|
441
153
|
rules: {
|
|
442
|
-
...import_eslint_plugin_react.default.configs.flat
|
|
154
|
+
...import_eslint_plugin_react.default.configs.flat?.recommended.rules,
|
|
443
155
|
// ignore `css` for emotion usage
|
|
444
156
|
"react/no-unknown-property": ["error", { ignore: ["css"] }]
|
|
445
157
|
}
|
|
446
158
|
} : {};
|
|
159
|
+
const reactHooksConfig = (params.next || typeof params.react !== "boolean" && params.react?.hooks === true) ?? false ? {
|
|
160
|
+
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
161
|
+
name: "lqbach/react-hooks",
|
|
162
|
+
plugins: {
|
|
163
|
+
"react-hooks": import_eslint_plugin_react_hooks.default
|
|
164
|
+
},
|
|
165
|
+
rules: {
|
|
166
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
167
|
+
"react-hooks/rules-of-hooks": "error"
|
|
168
|
+
}
|
|
169
|
+
} : {};
|
|
447
170
|
const vueConfig = params.vue ?? false ? {
|
|
448
171
|
files: ["**/*.vue"],
|
|
449
172
|
languageOptions: {
|
|
@@ -453,14 +176,33 @@ function config(params = {}) {
|
|
|
453
176
|
sourceType: "module"
|
|
454
177
|
}
|
|
455
178
|
},
|
|
179
|
+
name: "lqbach/vue",
|
|
456
180
|
plugins: {
|
|
457
181
|
vue: import_eslint_plugin_vue.default
|
|
458
182
|
},
|
|
459
183
|
processor: import_eslint_plugin_vue.default.processors[".vue"],
|
|
460
184
|
rules: {
|
|
461
185
|
...import_eslint_plugin_vue.default.configs["base"].rules,
|
|
462
|
-
...import_eslint_plugin_vue.default.configs["
|
|
463
|
-
...import_eslint_plugin_vue.default.configs["
|
|
186
|
+
...import_eslint_plugin_vue.default.configs["essential"].rules,
|
|
187
|
+
...import_eslint_plugin_vue.default.configs["strongly-recommended"].rules
|
|
188
|
+
}
|
|
189
|
+
} : {};
|
|
190
|
+
const nextConfig = params.next ?? false ? {
|
|
191
|
+
files: ["**/*.{js,jsx,ts,tsx}"],
|
|
192
|
+
name: "lqbach/next",
|
|
193
|
+
plugins: {
|
|
194
|
+
"@next/next": import_eslint_plugin_next.default
|
|
195
|
+
},
|
|
196
|
+
rules: {
|
|
197
|
+
...import_eslint_plugin_next.default.configs.recommended.rules,
|
|
198
|
+
...import_eslint_plugin_next.default.configs["core-web-vitals"].rules
|
|
199
|
+
},
|
|
200
|
+
...typeof params.next !== "boolean" && params.next?.rootDir && {
|
|
201
|
+
settings: {
|
|
202
|
+
nextjs: {
|
|
203
|
+
rootDir: params.next.rootDir
|
|
204
|
+
}
|
|
205
|
+
}
|
|
464
206
|
}
|
|
465
207
|
} : {};
|
|
466
208
|
const yamlConfig = params.yaml ?? true ? {
|
|
@@ -468,6 +210,7 @@ function config(params = {}) {
|
|
|
468
210
|
languageOptions: {
|
|
469
211
|
parser: import_yaml_eslint_parser.default
|
|
470
212
|
},
|
|
213
|
+
name: "lqbach/yaml",
|
|
471
214
|
plugins: {
|
|
472
215
|
yml: import_eslint_plugin_yml.default
|
|
473
216
|
},
|
|
@@ -478,6 +221,7 @@ function config(params = {}) {
|
|
|
478
221
|
} : {};
|
|
479
222
|
const jsoncConfig = params.json ?? true ? [
|
|
480
223
|
{
|
|
224
|
+
name: "lqbach/jsonc-plugin",
|
|
481
225
|
plugins: {
|
|
482
226
|
jsonc: import_eslint_plugin_jsonc.default
|
|
483
227
|
}
|
|
@@ -487,6 +231,7 @@ function config(params = {}) {
|
|
|
487
231
|
languageOptions: {
|
|
488
232
|
parser: import_jsonc_eslint_parser.default
|
|
489
233
|
},
|
|
234
|
+
name: "lqbach/json",
|
|
490
235
|
rules: {
|
|
491
236
|
...import_eslint_plugin_jsonc.default.configs["recommended-with-json"].rules,
|
|
492
237
|
...import_eslint_plugin_jsonc.default.configs["recommended-with-jsonc"].rules,
|
|
@@ -497,6 +242,7 @@ function config(params = {}) {
|
|
|
497
242
|
}
|
|
498
243
|
] : [];
|
|
499
244
|
const perfectionistConfig = params.perfectionist ?? true ? {
|
|
245
|
+
name: "lqbach/perfectionist",
|
|
500
246
|
plugins: {
|
|
501
247
|
perfectionist: import_eslint_plugin_perfectionist.default
|
|
502
248
|
},
|
|
@@ -504,13 +250,40 @@ function config(params = {}) {
|
|
|
504
250
|
...import_eslint_plugin_perfectionist.default.configs["recommended-natural"].rules
|
|
505
251
|
}
|
|
506
252
|
} : {};
|
|
253
|
+
const astroConfig = params.astro ?? false ? {
|
|
254
|
+
files: ["**/*.astro"],
|
|
255
|
+
languageOptions: {
|
|
256
|
+
parserOptions: params.typescript ? {
|
|
257
|
+
extraFileExtensions: [".astro"],
|
|
258
|
+
parser: import_parser.default,
|
|
259
|
+
sourceType: "module"
|
|
260
|
+
} : {}
|
|
261
|
+
},
|
|
262
|
+
name: "lqbach/astro",
|
|
263
|
+
plugins: {
|
|
264
|
+
astro: import_eslint_plugin_astro.default
|
|
265
|
+
},
|
|
266
|
+
rules: {
|
|
267
|
+
"astro/missing-client-only-directive-value": "error",
|
|
268
|
+
"astro/no-conflict-set-directives": "error",
|
|
269
|
+
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
270
|
+
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
271
|
+
"astro/no-deprecated-astro-resolve": "error",
|
|
272
|
+
"astro/no-deprecated-getentrybyslug": "error",
|
|
273
|
+
"astro/no-unused-define-vars-in-style": "error",
|
|
274
|
+
"astro/valid-compile": "error"
|
|
275
|
+
}
|
|
276
|
+
} : {};
|
|
507
277
|
const prettierConfig = import_eslint_config_prettier.default;
|
|
508
278
|
let config2 = [];
|
|
509
279
|
config2.push(ignoresConfig);
|
|
510
280
|
config2.push(...javascriptConfig);
|
|
511
281
|
config2.push(typescriptConfig);
|
|
512
282
|
config2.push(reactConfig);
|
|
283
|
+
config2.push(reactHooksConfig);
|
|
513
284
|
config2.push(vueConfig);
|
|
285
|
+
config2.push(nextConfig);
|
|
286
|
+
config2.push(astroConfig);
|
|
514
287
|
config2.push(yamlConfig);
|
|
515
288
|
config2.push(...jsoncConfig);
|
|
516
289
|
config2.push(perfectionistConfig);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
|
+
interface AstroConfigParams {
|
|
2
|
+
typescript?: boolean;
|
|
3
|
+
}
|
|
4
|
+
interface ConfigObject {
|
|
5
|
+
files?: Array<string>;
|
|
6
|
+
ignores?: Array<string>;
|
|
7
|
+
languageOptions?: LanguageOptions;
|
|
8
|
+
linterOptions?: LinterOptions;
|
|
9
|
+
name?: string;
|
|
10
|
+
plugins?: object;
|
|
11
|
+
processor?: object;
|
|
12
|
+
rules?: object;
|
|
13
|
+
settings?: any;
|
|
14
|
+
}
|
|
1
15
|
interface ConfigParams {
|
|
16
|
+
astro?: AstroConfigParams | boolean;
|
|
2
17
|
ignores?: Array<string>;
|
|
3
18
|
json?: boolean;
|
|
4
19
|
markdown?: boolean;
|
|
20
|
+
next?: boolean | NextJSConfigParams;
|
|
5
21
|
perfectionist?: boolean;
|
|
6
|
-
react?: boolean;
|
|
22
|
+
react?: boolean | ReactJSConfigParams;
|
|
7
23
|
typescript?: boolean;
|
|
8
24
|
vue?: boolean;
|
|
9
25
|
yaml?: boolean;
|
|
10
26
|
}
|
|
11
27
|
interface LanguageOptions {
|
|
12
|
-
ecmaVersion?: string;
|
|
28
|
+
ecmaVersion?: number | string;
|
|
13
29
|
globals?: object;
|
|
14
30
|
parser?: object;
|
|
15
31
|
parserOptions?: object;
|
|
@@ -19,15 +35,14 @@ interface LinterOptions {
|
|
|
19
35
|
noInlineConfig?: boolean;
|
|
20
36
|
reportUnusedDisableDirectives?: boolean;
|
|
21
37
|
}
|
|
22
|
-
interface
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
settings?: object;
|
|
38
|
+
interface NextJSConfigParams {
|
|
39
|
+
rootDir?: string;
|
|
40
|
+
}
|
|
41
|
+
interface ReactJSConfigParams {
|
|
42
|
+
/**
|
|
43
|
+
* use react hooks
|
|
44
|
+
*/
|
|
45
|
+
hooks?: boolean;
|
|
31
46
|
}
|
|
32
47
|
|
|
33
48
|
declare function config(params?: ConfigParams): Array<ConfigObject>;
|