@kurateh/eslint-plugin 1.1.0 → 2.0.0-beta.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/dist/index.d.mts +3 -1163
- package/dist/index.d.ts +3 -1163
- package/dist/index.js +71 -98
- package/dist/index.mjs +70 -97
- package/package.json +20 -20
package/dist/index.js
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('eslint-plugin-react');
|
|
4
|
-
var
|
|
4
|
+
var reactHooks = require('eslint-plugin-react-hooks');
|
|
5
5
|
var globals = require('globals');
|
|
6
|
+
var js = require('@eslint/js');
|
|
6
7
|
var importPlugin = require('eslint-plugin-import');
|
|
8
|
+
var eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
|
|
9
|
+
var unusedImportsPlugin = require('eslint-plugin-unused-imports');
|
|
7
10
|
var tseslint = require('typescript-eslint');
|
|
8
11
|
var fs = require('fs');
|
|
9
12
|
var path = require('path');
|
|
10
13
|
var utils = require('@typescript-eslint/utils');
|
|
11
|
-
var js = require('@eslint/js');
|
|
12
|
-
var eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
|
|
13
|
-
var unusedImportsPlugin = require('eslint-plugin-unused-imports');
|
|
14
14
|
|
|
15
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
|
|
17
17
|
var react__default = /*#__PURE__*/_interopDefault(react);
|
|
18
|
-
var
|
|
18
|
+
var reactHooks__default = /*#__PURE__*/_interopDefault(reactHooks);
|
|
19
19
|
var globals__default = /*#__PURE__*/_interopDefault(globals);
|
|
20
|
-
var importPlugin__default = /*#__PURE__*/_interopDefault(importPlugin);
|
|
21
|
-
var tseslint__default = /*#__PURE__*/_interopDefault(tseslint);
|
|
22
20
|
var js__default = /*#__PURE__*/_interopDefault(js);
|
|
21
|
+
var importPlugin__default = /*#__PURE__*/_interopDefault(importPlugin);
|
|
23
22
|
var eslintPluginPrettierRecommended__default = /*#__PURE__*/_interopDefault(eslintPluginPrettierRecommended);
|
|
24
23
|
var unusedImportsPlugin__default = /*#__PURE__*/_interopDefault(unusedImportsPlugin);
|
|
24
|
+
var tseslint__default = /*#__PURE__*/_interopDefault(tseslint);
|
|
25
25
|
|
|
26
26
|
var __defProp = Object.defineProperty;
|
|
27
|
-
var __defProps = Object.defineProperties;
|
|
28
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
29
27
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
30
28
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
31
29
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -41,7 +39,6 @@ var __spreadValues = (a, b) => {
|
|
|
41
39
|
}
|
|
42
40
|
return a;
|
|
43
41
|
};
|
|
44
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
45
42
|
var createRule = utils.ESLintUtils.RuleCreator.withoutDocs;
|
|
46
43
|
|
|
47
44
|
// src/rules/import-path.ts
|
|
@@ -77,7 +74,10 @@ var getAbsolutePathInfo = (fileName) => {
|
|
|
77
74
|
const tsPathConfig = JSON.parse(
|
|
78
75
|
fs.readFileSync(filePath, {
|
|
79
76
|
encoding: "utf-8"
|
|
80
|
-
}).replace(
|
|
77
|
+
}).replace(/("(?:[^"\\]|\\.)*")|\/\/.*/g, (_, string) => string || "").replace(
|
|
78
|
+
/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,
|
|
79
|
+
(_, string) => string || ""
|
|
80
|
+
).replace(/,(?=\s*[\]}])/g, "")
|
|
81
81
|
);
|
|
82
82
|
const result = {
|
|
83
83
|
baseUrl: "",
|
|
@@ -190,22 +190,59 @@ var import_path_default = createRule({
|
|
|
190
190
|
var rules_default = {
|
|
191
191
|
"import-path": import_path_default
|
|
192
192
|
};
|
|
193
|
-
|
|
193
|
+
|
|
194
|
+
// src/configs/recommended.ts
|
|
195
|
+
var config = [
|
|
194
196
|
js__default.default.configs.recommended,
|
|
195
197
|
importPlugin__default.default.flatConfigs.recommended,
|
|
196
198
|
eslintPluginPrettierRecommended__default.default,
|
|
199
|
+
...tseslint__default.default.configs.recommended,
|
|
200
|
+
importPlugin__default.default.flatConfigs.typescript,
|
|
197
201
|
{
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
// ESLint config block에 file이 있으면 해당 파일을 검사할 차례가 와서야 plugin이 적용됨
|
|
203
|
+
// 따라서 이 Plugin을 끄려면 Config File에서 file: "~~"을 넣어야 됨
|
|
204
|
+
// 이 과정을 없애기 위해 plugin 적용을 앞서 진행
|
|
205
|
+
plugins: {
|
|
206
|
+
"@kurateh": { rules: rules_default, meta: { name: "@kurateh" } }
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
|
|
211
|
+
ignores: ["node_modules/", "dist/", "build/", "coverage/"],
|
|
212
|
+
settings: {
|
|
213
|
+
"import/resolver": {
|
|
214
|
+
typescript: {
|
|
215
|
+
alwaysTryTypes: true,
|
|
216
|
+
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
217
|
+
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
|
|
218
|
+
// use <root>/path/to/folder/tsconfig.json
|
|
219
|
+
project: "tsconfig.json"
|
|
220
|
+
// Multiple tsconfigs (Useful for monorepos)
|
|
221
|
+
// use a glob pattern
|
|
222
|
+
// project: "packages/*/tsconfig.json",
|
|
223
|
+
// use an array
|
|
224
|
+
// project: [
|
|
225
|
+
// "packages/module-a/tsconfig.json",
|
|
226
|
+
// "packages/module-b/tsconfig.json"
|
|
227
|
+
// ],
|
|
228
|
+
// use an array of glob patterns
|
|
229
|
+
// project: [
|
|
230
|
+
// "packages/*/tsconfig.json",
|
|
231
|
+
// "other-packages/*/
|
|
232
|
+
}
|
|
233
|
+
}
|
|
202
234
|
},
|
|
203
235
|
plugins: {
|
|
204
236
|
"unused-imports": unusedImportsPlugin__default.default
|
|
205
237
|
},
|
|
206
|
-
|
|
238
|
+
languageOptions: {
|
|
239
|
+
ecmaVersion: "latest",
|
|
240
|
+
sourceType: "module",
|
|
241
|
+
globals: __spreadValues(__spreadValues(__spreadValues({}, globals__default.default.es2017), globals__default.default.browser), globals__default.default.node)
|
|
242
|
+
},
|
|
207
243
|
rules: {
|
|
208
244
|
// eslint
|
|
245
|
+
"no-console": 1,
|
|
209
246
|
"object-shorthand": 1,
|
|
210
247
|
"no-unused-vars": [
|
|
211
248
|
1,
|
|
@@ -227,21 +264,9 @@ var recommended_default = [
|
|
|
227
264
|
camelcase: [1, { allow: ["^\\w*_[A-Z]*$"] }],
|
|
228
265
|
"no-var": 2,
|
|
229
266
|
// prettier
|
|
230
|
-
"prettier/prettier":
|
|
231
|
-
1,
|
|
232
|
-
{
|
|
233
|
-
trailingComma: "all",
|
|
234
|
-
tabWidth: 2,
|
|
235
|
-
semi: true,
|
|
236
|
-
singleQuote: false,
|
|
237
|
-
endOfLine: "auto"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
usePrettierrc: false
|
|
241
|
-
}
|
|
242
|
-
],
|
|
267
|
+
"prettier/prettier": 1,
|
|
243
268
|
// import
|
|
244
|
-
"import/no-
|
|
269
|
+
"import/no-named-as-default-member": 0,
|
|
245
270
|
"import/no-extraneous-dependencies": [
|
|
246
271
|
2,
|
|
247
272
|
{
|
|
@@ -280,55 +305,10 @@ var recommended_default = [
|
|
|
280
305
|
}
|
|
281
306
|
],
|
|
282
307
|
// unused-imports
|
|
283
|
-
"unused-imports/no-unused-imports": 2
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
];
|
|
287
|
-
|
|
288
|
-
// src/configs/typescript.ts
|
|
289
|
-
var typescript_default = [
|
|
290
|
-
...recommended_default,
|
|
291
|
-
// eslint-disable-next-line import/no-named-as-default-member
|
|
292
|
-
...tseslint__default.default.configs.recommended,
|
|
293
|
-
importPlugin__default.default.flatConfigs.typescript,
|
|
294
|
-
{
|
|
295
|
-
// ESLint config block에 file이 있으면 해당 파일을 검사할 차례가 와서야 plugin이 적용됨
|
|
296
|
-
// 따라서 이 Plugin을 끄려면 Config File에서 file: "~~"을 넣어야 됨
|
|
297
|
-
// 이 과정을 없애기 위해 plugin 적용을 앞서 진행
|
|
298
|
-
plugins: {
|
|
299
|
-
"@kurateh": { rules: rules_default, meta: { name: "@kurateh" } }
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
|
|
304
|
-
settings: {
|
|
305
|
-
"import/resolver": {
|
|
306
|
-
typescript: {
|
|
307
|
-
alwaysTryTypes: true,
|
|
308
|
-
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
309
|
-
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
|
|
310
|
-
// use <root>/path/to/folder/tsconfig.json
|
|
311
|
-
project: "tsconfig.json"
|
|
312
|
-
// Multiple tsconfigs (Useful for monorepos)
|
|
313
|
-
// use a glob pattern
|
|
314
|
-
// project: "packages/*/tsconfig.json",
|
|
315
|
-
// use an array
|
|
316
|
-
// project: [
|
|
317
|
-
// "packages/module-a/tsconfig.json",
|
|
318
|
-
// "packages/module-b/tsconfig.json"
|
|
319
|
-
// ],
|
|
320
|
-
// use an array of glob patterns
|
|
321
|
-
// project: [
|
|
322
|
-
// "packages/*/tsconfig.json",
|
|
323
|
-
// "other-packages/*/
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
rules: {
|
|
328
|
-
// eslint
|
|
308
|
+
"unused-imports/no-unused-imports": 2,
|
|
309
|
+
// kurateh
|
|
329
310
|
"@kurateh/import-path": 1,
|
|
330
|
-
|
|
331
|
-
"no-unused-vars": 0,
|
|
311
|
+
// typescript
|
|
332
312
|
"@typescript-eslint/no-unused-vars": [
|
|
333
313
|
1,
|
|
334
314
|
{
|
|
@@ -345,27 +325,18 @@ var typescript_default = [
|
|
|
345
325
|
fixStyle: "inline-type-imports"
|
|
346
326
|
}
|
|
347
327
|
],
|
|
348
|
-
"no-param-reassign": [
|
|
349
|
-
2,
|
|
350
|
-
{
|
|
351
|
-
props: true,
|
|
352
|
-
ignorePropertyModificationsForRegex: ["^draft$", "Draft$"]
|
|
353
|
-
}
|
|
354
|
-
],
|
|
355
|
-
camelcase: [1, { allow: ["^\\w*_[A-Z]*$"] }],
|
|
356
|
-
"no-var": 2,
|
|
357
328
|
"import-plugin/no-unresolved": 0
|
|
358
329
|
}
|
|
359
330
|
}
|
|
360
331
|
];
|
|
332
|
+
var recommended_default = config;
|
|
361
333
|
|
|
362
334
|
// src/configs/react.ts
|
|
363
|
-
var
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
335
|
+
var config2 = [
|
|
336
|
+
...recommended_default,
|
|
337
|
+
react__default.default.configs.flat.recommended,
|
|
338
|
+
reactHooks__default.default.configs.flat.recommended,
|
|
367
339
|
{
|
|
368
|
-
plugins: { "react-hooks": reactHook__default.default },
|
|
369
340
|
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
370
341
|
languageOptions: {
|
|
371
342
|
parserOptions: {
|
|
@@ -375,7 +346,7 @@ var react_default = [
|
|
|
375
346
|
},
|
|
376
347
|
globals: __spreadValues({}, globals__default.default.browser)
|
|
377
348
|
},
|
|
378
|
-
rules:
|
|
349
|
+
rules: {
|
|
379
350
|
"react/react-in-jsx-scope": 0,
|
|
380
351
|
"react/function-component-definition": [
|
|
381
352
|
2,
|
|
@@ -393,19 +364,21 @@ var react_default = [
|
|
|
393
364
|
],
|
|
394
365
|
"react/prop-types": 0,
|
|
395
366
|
"react/require-default-props": 0,
|
|
396
|
-
"react/display-name": 0
|
|
397
|
-
|
|
367
|
+
"react/display-name": 0,
|
|
368
|
+
"react/no-children-prop": [2, { allowFunctions: true }]
|
|
369
|
+
}
|
|
398
370
|
}
|
|
399
371
|
];
|
|
372
|
+
var react_default = config2;
|
|
400
373
|
|
|
401
374
|
// src/index.ts
|
|
402
|
-
var
|
|
375
|
+
var plugin = {
|
|
403
376
|
configs: {
|
|
404
377
|
recommended: recommended_default,
|
|
405
|
-
typescript: typescript_default,
|
|
406
378
|
react: react_default
|
|
407
379
|
},
|
|
408
380
|
rules: rules_default
|
|
409
381
|
};
|
|
382
|
+
var index_default = plugin;
|
|
410
383
|
|
|
411
384
|
module.exports = index_default;
|
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
2
|
import react from 'eslint-plugin-react';
|
|
3
|
-
import
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
4
|
import globals from 'globals';
|
|
5
|
-
import importPlugin from 'eslint-plugin-import';
|
|
6
|
-
import tseslint from 'typescript-eslint';
|
|
7
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
8
|
-
import { join, dirname, relative } from 'node:path';
|
|
9
|
-
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
10
5
|
import js from '@eslint/js';
|
|
6
|
+
import importPlugin from 'eslint-plugin-import';
|
|
11
7
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
12
8
|
import unusedImportsPlugin from 'eslint-plugin-unused-imports';
|
|
9
|
+
import tseslint from 'typescript-eslint';
|
|
10
|
+
import { readFileSync, existsSync } from 'fs';
|
|
11
|
+
import { join, dirname, relative } from 'path';
|
|
12
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
13
13
|
|
|
14
14
|
createRequire(import.meta.url);
|
|
15
15
|
var __defProp = Object.defineProperty;
|
|
16
|
-
var __defProps = Object.defineProperties;
|
|
17
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
18
16
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
19
17
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
20
18
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -30,7 +28,6 @@ var __spreadValues = (a, b) => {
|
|
|
30
28
|
}
|
|
31
29
|
return a;
|
|
32
30
|
};
|
|
33
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
34
31
|
var createRule = ESLintUtils.RuleCreator.withoutDocs;
|
|
35
32
|
|
|
36
33
|
// src/rules/import-path.ts
|
|
@@ -66,7 +63,10 @@ var getAbsolutePathInfo = (fileName) => {
|
|
|
66
63
|
const tsPathConfig = JSON.parse(
|
|
67
64
|
readFileSync(filePath, {
|
|
68
65
|
encoding: "utf-8"
|
|
69
|
-
}).replace(
|
|
66
|
+
}).replace(/("(?:[^"\\]|\\.)*")|\/\/.*/g, (_, string) => string || "").replace(
|
|
67
|
+
/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,
|
|
68
|
+
(_, string) => string || ""
|
|
69
|
+
).replace(/,(?=\s*[\]}])/g, "")
|
|
70
70
|
);
|
|
71
71
|
const result = {
|
|
72
72
|
baseUrl: "",
|
|
@@ -179,22 +179,59 @@ var import_path_default = createRule({
|
|
|
179
179
|
var rules_default = {
|
|
180
180
|
"import-path": import_path_default
|
|
181
181
|
};
|
|
182
|
-
|
|
182
|
+
|
|
183
|
+
// src/configs/recommended.ts
|
|
184
|
+
var config = [
|
|
183
185
|
js.configs.recommended,
|
|
184
186
|
importPlugin.flatConfigs.recommended,
|
|
185
187
|
eslintPluginPrettierRecommended,
|
|
188
|
+
...tseslint.configs.recommended,
|
|
189
|
+
importPlugin.flatConfigs.typescript,
|
|
186
190
|
{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
+
// ESLint config block에 file이 있으면 해당 파일을 검사할 차례가 와서야 plugin이 적용됨
|
|
192
|
+
// 따라서 이 Plugin을 끄려면 Config File에서 file: "~~"을 넣어야 됨
|
|
193
|
+
// 이 과정을 없애기 위해 plugin 적용을 앞서 진행
|
|
194
|
+
plugins: {
|
|
195
|
+
"@kurateh": { rules: rules_default, meta: { name: "@kurateh" } }
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
|
|
200
|
+
ignores: ["node_modules/", "dist/", "build/", "coverage/"],
|
|
201
|
+
settings: {
|
|
202
|
+
"import/resolver": {
|
|
203
|
+
typescript: {
|
|
204
|
+
alwaysTryTypes: true,
|
|
205
|
+
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
206
|
+
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
|
|
207
|
+
// use <root>/path/to/folder/tsconfig.json
|
|
208
|
+
project: "tsconfig.json"
|
|
209
|
+
// Multiple tsconfigs (Useful for monorepos)
|
|
210
|
+
// use a glob pattern
|
|
211
|
+
// project: "packages/*/tsconfig.json",
|
|
212
|
+
// use an array
|
|
213
|
+
// project: [
|
|
214
|
+
// "packages/module-a/tsconfig.json",
|
|
215
|
+
// "packages/module-b/tsconfig.json"
|
|
216
|
+
// ],
|
|
217
|
+
// use an array of glob patterns
|
|
218
|
+
// project: [
|
|
219
|
+
// "packages/*/tsconfig.json",
|
|
220
|
+
// "other-packages/*/
|
|
221
|
+
}
|
|
222
|
+
}
|
|
191
223
|
},
|
|
192
224
|
plugins: {
|
|
193
225
|
"unused-imports": unusedImportsPlugin
|
|
194
226
|
},
|
|
195
|
-
|
|
227
|
+
languageOptions: {
|
|
228
|
+
ecmaVersion: "latest",
|
|
229
|
+
sourceType: "module",
|
|
230
|
+
globals: __spreadValues(__spreadValues(__spreadValues({}, globals.es2017), globals.browser), globals.node)
|
|
231
|
+
},
|
|
196
232
|
rules: {
|
|
197
233
|
// eslint
|
|
234
|
+
"no-console": 1,
|
|
198
235
|
"object-shorthand": 1,
|
|
199
236
|
"no-unused-vars": [
|
|
200
237
|
1,
|
|
@@ -216,21 +253,9 @@ var recommended_default = [
|
|
|
216
253
|
camelcase: [1, { allow: ["^\\w*_[A-Z]*$"] }],
|
|
217
254
|
"no-var": 2,
|
|
218
255
|
// prettier
|
|
219
|
-
"prettier/prettier":
|
|
220
|
-
1,
|
|
221
|
-
{
|
|
222
|
-
trailingComma: "all",
|
|
223
|
-
tabWidth: 2,
|
|
224
|
-
semi: true,
|
|
225
|
-
singleQuote: false,
|
|
226
|
-
endOfLine: "auto"
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
usePrettierrc: false
|
|
230
|
-
}
|
|
231
|
-
],
|
|
256
|
+
"prettier/prettier": 1,
|
|
232
257
|
// import
|
|
233
|
-
"import/no-
|
|
258
|
+
"import/no-named-as-default-member": 0,
|
|
234
259
|
"import/no-extraneous-dependencies": [
|
|
235
260
|
2,
|
|
236
261
|
{
|
|
@@ -269,55 +294,10 @@ var recommended_default = [
|
|
|
269
294
|
}
|
|
270
295
|
],
|
|
271
296
|
// unused-imports
|
|
272
|
-
"unused-imports/no-unused-imports": 2
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
];
|
|
276
|
-
|
|
277
|
-
// src/configs/typescript.ts
|
|
278
|
-
var typescript_default = [
|
|
279
|
-
...recommended_default,
|
|
280
|
-
// eslint-disable-next-line import/no-named-as-default-member
|
|
281
|
-
...tseslint.configs.recommended,
|
|
282
|
-
importPlugin.flatConfigs.typescript,
|
|
283
|
-
{
|
|
284
|
-
// ESLint config block에 file이 있으면 해당 파일을 검사할 차례가 와서야 plugin이 적용됨
|
|
285
|
-
// 따라서 이 Plugin을 끄려면 Config File에서 file: "~~"을 넣어야 됨
|
|
286
|
-
// 이 과정을 없애기 위해 plugin 적용을 앞서 진행
|
|
287
|
-
plugins: {
|
|
288
|
-
"@kurateh": { rules: rules_default, meta: { name: "@kurateh" } }
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
|
|
293
|
-
settings: {
|
|
294
|
-
"import/resolver": {
|
|
295
|
-
typescript: {
|
|
296
|
-
alwaysTryTypes: true,
|
|
297
|
-
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
298
|
-
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
|
|
299
|
-
// use <root>/path/to/folder/tsconfig.json
|
|
300
|
-
project: "tsconfig.json"
|
|
301
|
-
// Multiple tsconfigs (Useful for monorepos)
|
|
302
|
-
// use a glob pattern
|
|
303
|
-
// project: "packages/*/tsconfig.json",
|
|
304
|
-
// use an array
|
|
305
|
-
// project: [
|
|
306
|
-
// "packages/module-a/tsconfig.json",
|
|
307
|
-
// "packages/module-b/tsconfig.json"
|
|
308
|
-
// ],
|
|
309
|
-
// use an array of glob patterns
|
|
310
|
-
// project: [
|
|
311
|
-
// "packages/*/tsconfig.json",
|
|
312
|
-
// "other-packages/*/
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
rules: {
|
|
317
|
-
// eslint
|
|
297
|
+
"unused-imports/no-unused-imports": 2,
|
|
298
|
+
// kurateh
|
|
318
299
|
"@kurateh/import-path": 1,
|
|
319
|
-
|
|
320
|
-
"no-unused-vars": 0,
|
|
300
|
+
// typescript
|
|
321
301
|
"@typescript-eslint/no-unused-vars": [
|
|
322
302
|
1,
|
|
323
303
|
{
|
|
@@ -334,27 +314,18 @@ var typescript_default = [
|
|
|
334
314
|
fixStyle: "inline-type-imports"
|
|
335
315
|
}
|
|
336
316
|
],
|
|
337
|
-
"no-param-reassign": [
|
|
338
|
-
2,
|
|
339
|
-
{
|
|
340
|
-
props: true,
|
|
341
|
-
ignorePropertyModificationsForRegex: ["^draft$", "Draft$"]
|
|
342
|
-
}
|
|
343
|
-
],
|
|
344
|
-
camelcase: [1, { allow: ["^\\w*_[A-Z]*$"] }],
|
|
345
|
-
"no-var": 2,
|
|
346
317
|
"import-plugin/no-unresolved": 0
|
|
347
318
|
}
|
|
348
319
|
}
|
|
349
320
|
];
|
|
321
|
+
var recommended_default = config;
|
|
350
322
|
|
|
351
323
|
// src/configs/react.ts
|
|
352
|
-
var
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
324
|
+
var config2 = [
|
|
325
|
+
...recommended_default,
|
|
326
|
+
react.configs.flat.recommended,
|
|
327
|
+
reactHooks.configs.flat.recommended,
|
|
356
328
|
{
|
|
357
|
-
plugins: { "react-hooks": reactHook },
|
|
358
329
|
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
359
330
|
languageOptions: {
|
|
360
331
|
parserOptions: {
|
|
@@ -364,7 +335,7 @@ var react_default = [
|
|
|
364
335
|
},
|
|
365
336
|
globals: __spreadValues({}, globals.browser)
|
|
366
337
|
},
|
|
367
|
-
rules:
|
|
338
|
+
rules: {
|
|
368
339
|
"react/react-in-jsx-scope": 0,
|
|
369
340
|
"react/function-component-definition": [
|
|
370
341
|
2,
|
|
@@ -382,19 +353,21 @@ var react_default = [
|
|
|
382
353
|
],
|
|
383
354
|
"react/prop-types": 0,
|
|
384
355
|
"react/require-default-props": 0,
|
|
385
|
-
"react/display-name": 0
|
|
386
|
-
|
|
356
|
+
"react/display-name": 0,
|
|
357
|
+
"react/no-children-prop": [2, { allowFunctions: true }]
|
|
358
|
+
}
|
|
387
359
|
}
|
|
388
360
|
];
|
|
361
|
+
var react_default = config2;
|
|
389
362
|
|
|
390
363
|
// src/index.ts
|
|
391
|
-
var
|
|
364
|
+
var plugin = {
|
|
392
365
|
configs: {
|
|
393
366
|
recommended: recommended_default,
|
|
394
|
-
typescript: typescript_default,
|
|
395
367
|
react: react_default
|
|
396
368
|
},
|
|
397
369
|
rules: rules_default
|
|
398
370
|
};
|
|
371
|
+
var index_default = plugin;
|
|
399
372
|
|
|
400
373
|
export { index_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurateh/eslint-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./dist/index.mjs",
|
|
@@ -21,27 +21,27 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@kurateh/eslint-plugin": "file:",
|
|
23
23
|
"@types/node": "^22.10.2",
|
|
24
|
-
"@types/react": "^19.
|
|
25
|
-
"eslint": "^9.
|
|
26
|
-
"prettier": "^3.4
|
|
27
|
-
"react": "^19.
|
|
28
|
-
"tsup": "^8.
|
|
29
|
-
"typescript": "^5.
|
|
24
|
+
"@types/react": "^19.2.7",
|
|
25
|
+
"eslint": "^9.39.2",
|
|
26
|
+
"prettier": "^3.7.4",
|
|
27
|
+
"react": "^19.2.3",
|
|
28
|
+
"tsup": "^8.5.1",
|
|
29
|
+
"typescript": "^5.9.3"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eslint/js": "^9.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
34
|
-
"@typescript-eslint/parser": "^8.
|
|
35
|
-
"@typescript-eslint/utils": "^8.
|
|
36
|
-
"eslint-config-prettier": "^
|
|
37
|
-
"eslint-import-resolver-typescript": "^
|
|
38
|
-
"eslint-plugin-import": "^2.
|
|
39
|
-
"eslint-plugin-prettier": "^5.
|
|
40
|
-
"eslint-plugin-react": "^7.37.
|
|
41
|
-
"eslint-plugin-react-hooks": "^
|
|
42
|
-
"eslint-plugin-unused-imports": "^4.
|
|
43
|
-
"globals": "^
|
|
44
|
-
"typescript-eslint": "^8.
|
|
32
|
+
"@eslint/js": "^9.39.2",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
34
|
+
"@typescript-eslint/parser": "^8.50.0",
|
|
35
|
+
"@typescript-eslint/utils": "^8.50.0",
|
|
36
|
+
"eslint-config-prettier": "^10.1.8",
|
|
37
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
38
|
+
"eslint-plugin-import": "^2.32.0",
|
|
39
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
40
|
+
"eslint-plugin-react": "^7.37.5",
|
|
41
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
42
|
+
"eslint-plugin-unused-imports": "^4.3.0",
|
|
43
|
+
"globals": "^16.5.0",
|
|
44
|
+
"typescript-eslint": "^8.50.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"eslint": ">=9"
|