@kurateh/eslint-plugin 10.0.0 → 11.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.
- package/dist/index.cjs +1 -208
- package/dist/index.js +1 -200
- package/package.json +18 -43
- package/README.ko.md +0 -77
- package/README.md +0 -77
package/dist/index.cjs
CHANGED
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var fs = require('fs');
|
|
4
|
-
var react = require('eslint-plugin-react');
|
|
5
|
-
var reactHooks = require('eslint-plugin-react-hooks');
|
|
6
|
-
var globals = require('globals');
|
|
7
|
-
var js = require('@eslint/js');
|
|
8
|
-
var importPlugin = require('eslint-plugin-import');
|
|
9
|
-
var eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
|
|
10
|
-
var unusedImportsPlugin = require('eslint-plugin-unused-imports');
|
|
11
|
-
var tseslint = require('typescript-eslint');
|
|
12
4
|
var path = require('path');
|
|
13
5
|
var utils = require('@typescript-eslint/utils');
|
|
14
6
|
|
|
15
7
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
16
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
9
|
|
|
18
|
-
var react__default = /*#__PURE__*/_interopDefault(react);
|
|
19
|
-
var reactHooks__default = /*#__PURE__*/_interopDefault(reactHooks);
|
|
20
|
-
var globals__default = /*#__PURE__*/_interopDefault(globals);
|
|
21
|
-
var js__default = /*#__PURE__*/_interopDefault(js);
|
|
22
|
-
var importPlugin__default = /*#__PURE__*/_interopDefault(importPlugin);
|
|
23
|
-
var eslintPluginPrettierRecommended__default = /*#__PURE__*/_interopDefault(eslintPluginPrettierRecommended);
|
|
24
|
-
var unusedImportsPlugin__default = /*#__PURE__*/_interopDefault(unusedImportsPlugin);
|
|
25
|
-
var tseslint__default = /*#__PURE__*/_interopDefault(tseslint);
|
|
26
10
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
27
11
|
|
|
28
12
|
// src/index.ts
|
|
@@ -193,206 +177,15 @@ var rules_default = {
|
|
|
193
177
|
"import-path": import_path_default
|
|
194
178
|
};
|
|
195
179
|
|
|
196
|
-
// src/configs/recommended.ts
|
|
197
|
-
var config = [
|
|
198
|
-
js__default.default.configs.recommended,
|
|
199
|
-
importPlugin__default.default.flatConfigs.recommended,
|
|
200
|
-
eslintPluginPrettierRecommended__default.default,
|
|
201
|
-
...tseslint__default.default.configs.recommended,
|
|
202
|
-
importPlugin__default.default.flatConfigs.typescript,
|
|
203
|
-
{
|
|
204
|
-
// ESLint config block에 file이 있으면 해당 파일을 검사할 차례가 와서야 plugin이 적용됨
|
|
205
|
-
// 따라서 이 Plugin을 끄려면 Config File에서 file: "~~"을 넣어야 됨
|
|
206
|
-
// 이 과정을 없애기 위해 plugin 적용을 앞서 진행
|
|
207
|
-
plugins: {
|
|
208
|
-
"@kurateh": { rules: rules_default, meta: { name: "@kurateh" } }
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
|
|
213
|
-
ignores: ["node_modules/", "dist/", "build/", "coverage/"],
|
|
214
|
-
settings: {
|
|
215
|
-
"import/resolver": {
|
|
216
|
-
typescript: {
|
|
217
|
-
alwaysTryTypes: true,
|
|
218
|
-
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
219
|
-
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
|
|
220
|
-
// use <root>/path/to/folder/tsconfig.json
|
|
221
|
-
project: "tsconfig.json"
|
|
222
|
-
// Multiple tsconfigs (Useful for monorepos)
|
|
223
|
-
// use a glob pattern
|
|
224
|
-
// project: "packages/*/tsconfig.json",
|
|
225
|
-
// use an array
|
|
226
|
-
// project: [
|
|
227
|
-
// "packages/module-a/tsconfig.json",
|
|
228
|
-
// "packages/module-b/tsconfig.json"
|
|
229
|
-
// ],
|
|
230
|
-
// use an array of glob patterns
|
|
231
|
-
// project: [
|
|
232
|
-
// "packages/*/tsconfig.json",
|
|
233
|
-
// "other-packages/*/
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
plugins: {
|
|
238
|
-
"unused-imports": unusedImportsPlugin__default.default
|
|
239
|
-
},
|
|
240
|
-
languageOptions: {
|
|
241
|
-
ecmaVersion: "latest",
|
|
242
|
-
sourceType: "module",
|
|
243
|
-
globals: {
|
|
244
|
-
...globals__default.default.es2017,
|
|
245
|
-
...globals__default.default.browser,
|
|
246
|
-
...globals__default.default.node
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
rules: {
|
|
250
|
-
// eslint
|
|
251
|
-
"no-console": 1,
|
|
252
|
-
"object-shorthand": 1,
|
|
253
|
-
"no-unused-vars": [
|
|
254
|
-
1,
|
|
255
|
-
{
|
|
256
|
-
ignoreRestSiblings: true,
|
|
257
|
-
vars: "all",
|
|
258
|
-
args: "after-used",
|
|
259
|
-
argsIgnorePattern: "^_",
|
|
260
|
-
varsIgnorePattern: "^_"
|
|
261
|
-
}
|
|
262
|
-
],
|
|
263
|
-
"no-param-reassign": [
|
|
264
|
-
2,
|
|
265
|
-
{
|
|
266
|
-
props: true,
|
|
267
|
-
ignorePropertyModificationsForRegex: ["^draft$", "Draft$"]
|
|
268
|
-
}
|
|
269
|
-
],
|
|
270
|
-
camelcase: [1, { allow: ["^\\w*_[A-Z]*$"] }],
|
|
271
|
-
"no-var": 2,
|
|
272
|
-
// prettier
|
|
273
|
-
"prettier/prettier": 1,
|
|
274
|
-
// import
|
|
275
|
-
"import/no-named-as-default-member": 0,
|
|
276
|
-
"import/no-extraneous-dependencies": [
|
|
277
|
-
2,
|
|
278
|
-
{
|
|
279
|
-
devDependencies: [
|
|
280
|
-
"**/*.test.*",
|
|
281
|
-
"**/*.stories.*",
|
|
282
|
-
"**/*.config.*",
|
|
283
|
-
"**/*.spec.*"
|
|
284
|
-
]
|
|
285
|
-
}
|
|
286
|
-
],
|
|
287
|
-
"import/order": [
|
|
288
|
-
1,
|
|
289
|
-
{
|
|
290
|
-
alphabetize: {
|
|
291
|
-
order: "asc",
|
|
292
|
-
caseInsensitive: true
|
|
293
|
-
},
|
|
294
|
-
"newlines-between": "always",
|
|
295
|
-
groups: [
|
|
296
|
-
"builtin",
|
|
297
|
-
"external",
|
|
298
|
-
"internal",
|
|
299
|
-
["parent", "sibling", "index"]
|
|
300
|
-
],
|
|
301
|
-
pathGroups: [
|
|
302
|
-
{
|
|
303
|
-
pattern: "~*/**",
|
|
304
|
-
group: "internal"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
pattern: "@*/**",
|
|
308
|
-
group: "internal"
|
|
309
|
-
}
|
|
310
|
-
]
|
|
311
|
-
}
|
|
312
|
-
],
|
|
313
|
-
// unused-imports
|
|
314
|
-
"unused-imports/no-unused-imports": 2,
|
|
315
|
-
// kurateh
|
|
316
|
-
"@kurateh/import-path": 1,
|
|
317
|
-
// typescript
|
|
318
|
-
"@typescript-eslint/no-unused-vars": [
|
|
319
|
-
1,
|
|
320
|
-
{
|
|
321
|
-
ignoreRestSiblings: true,
|
|
322
|
-
vars: "all",
|
|
323
|
-
args: "after-used",
|
|
324
|
-
argsIgnorePattern: "^_",
|
|
325
|
-
varsIgnorePattern: "^_"
|
|
326
|
-
}
|
|
327
|
-
],
|
|
328
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
329
|
-
1,
|
|
330
|
-
{
|
|
331
|
-
fixStyle: "inline-type-imports"
|
|
332
|
-
}
|
|
333
|
-
],
|
|
334
|
-
"import-plugin/no-unresolved": 0
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
];
|
|
338
|
-
var recommended_default = config;
|
|
339
|
-
|
|
340
|
-
// src/configs/react.ts
|
|
341
|
-
var config2 = [
|
|
342
|
-
...recommended_default,
|
|
343
|
-
react__default.default.configs.flat.recommended,
|
|
344
|
-
reactHooks__default.default.configs.flat.recommended,
|
|
345
|
-
{
|
|
346
|
-
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
347
|
-
languageOptions: {
|
|
348
|
-
parserOptions: {
|
|
349
|
-
ecmaFeatures: {
|
|
350
|
-
jsx: true
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
globals: {
|
|
354
|
-
...globals__default.default.browser
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
|
-
rules: {
|
|
358
|
-
"react/react-in-jsx-scope": 0,
|
|
359
|
-
"react/function-component-definition": [
|
|
360
|
-
2,
|
|
361
|
-
{
|
|
362
|
-
namedComponents: "arrow-function",
|
|
363
|
-
unnamedComponents: "arrow-function"
|
|
364
|
-
}
|
|
365
|
-
],
|
|
366
|
-
"react/jsx-curly-brace-presence": [
|
|
367
|
-
1,
|
|
368
|
-
{
|
|
369
|
-
props: "never",
|
|
370
|
-
children: "never"
|
|
371
|
-
}
|
|
372
|
-
],
|
|
373
|
-
"react/prop-types": 0,
|
|
374
|
-
"react/require-default-props": 0,
|
|
375
|
-
"react/display-name": 0,
|
|
376
|
-
"react/no-children-prop": [2, { allowFunctions: true }]
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
];
|
|
380
|
-
var react_default = config2;
|
|
381
|
-
|
|
382
180
|
// src/index.ts
|
|
383
181
|
var pkg = JSON.parse(
|
|
384
182
|
fs.readFileSync(new URL("../package.json", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))), "utf-8")
|
|
385
183
|
);
|
|
386
184
|
var plugin = {
|
|
387
185
|
meta: {
|
|
388
|
-
name: "eslint-plugin",
|
|
389
|
-
namespace: "@kurateh",
|
|
186
|
+
name: "@kurateh/eslint-plugin",
|
|
390
187
|
version: pkg.version
|
|
391
188
|
},
|
|
392
|
-
configs: {
|
|
393
|
-
recommended: recommended_default,
|
|
394
|
-
react: react_default
|
|
395
|
-
},
|
|
396
189
|
rules: rules_default
|
|
397
190
|
};
|
|
398
191
|
var index_default = plugin;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
2
|
import { readFileSync, existsSync } from 'fs';
|
|
3
|
-
import react from 'eslint-plugin-react';
|
|
4
|
-
import reactHooks from 'eslint-plugin-react-hooks';
|
|
5
|
-
import globals from 'globals';
|
|
6
|
-
import js from '@eslint/js';
|
|
7
|
-
import importPlugin from 'eslint-plugin-import';
|
|
8
|
-
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
9
|
-
import unusedImportsPlugin from 'eslint-plugin-unused-imports';
|
|
10
|
-
import tseslint from 'typescript-eslint';
|
|
11
3
|
import path, { join } from 'path';
|
|
12
4
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
13
5
|
|
|
@@ -179,206 +171,15 @@ var rules_default = {
|
|
|
179
171
|
"import-path": import_path_default
|
|
180
172
|
};
|
|
181
173
|
|
|
182
|
-
// src/configs/recommended.ts
|
|
183
|
-
var config = [
|
|
184
|
-
js.configs.recommended,
|
|
185
|
-
importPlugin.flatConfigs.recommended,
|
|
186
|
-
eslintPluginPrettierRecommended,
|
|
187
|
-
...tseslint.configs.recommended,
|
|
188
|
-
importPlugin.flatConfigs.typescript,
|
|
189
|
-
{
|
|
190
|
-
// ESLint config block에 file이 있으면 해당 파일을 검사할 차례가 와서야 plugin이 적용됨
|
|
191
|
-
// 따라서 이 Plugin을 끄려면 Config File에서 file: "~~"을 넣어야 됨
|
|
192
|
-
// 이 과정을 없애기 위해 plugin 적용을 앞서 진행
|
|
193
|
-
plugins: {
|
|
194
|
-
"@kurateh": { rules: rules_default, meta: { name: "@kurateh" } }
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
|
|
199
|
-
ignores: ["node_modules/", "dist/", "build/", "coverage/"],
|
|
200
|
-
settings: {
|
|
201
|
-
"import/resolver": {
|
|
202
|
-
typescript: {
|
|
203
|
-
alwaysTryTypes: true,
|
|
204
|
-
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
205
|
-
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
|
|
206
|
-
// use <root>/path/to/folder/tsconfig.json
|
|
207
|
-
project: "tsconfig.json"
|
|
208
|
-
// Multiple tsconfigs (Useful for monorepos)
|
|
209
|
-
// use a glob pattern
|
|
210
|
-
// project: "packages/*/tsconfig.json",
|
|
211
|
-
// use an array
|
|
212
|
-
// project: [
|
|
213
|
-
// "packages/module-a/tsconfig.json",
|
|
214
|
-
// "packages/module-b/tsconfig.json"
|
|
215
|
-
// ],
|
|
216
|
-
// use an array of glob patterns
|
|
217
|
-
// project: [
|
|
218
|
-
// "packages/*/tsconfig.json",
|
|
219
|
-
// "other-packages/*/
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
plugins: {
|
|
224
|
-
"unused-imports": unusedImportsPlugin
|
|
225
|
-
},
|
|
226
|
-
languageOptions: {
|
|
227
|
-
ecmaVersion: "latest",
|
|
228
|
-
sourceType: "module",
|
|
229
|
-
globals: {
|
|
230
|
-
...globals.es2017,
|
|
231
|
-
...globals.browser,
|
|
232
|
-
...globals.node
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
rules: {
|
|
236
|
-
// eslint
|
|
237
|
-
"no-console": 1,
|
|
238
|
-
"object-shorthand": 1,
|
|
239
|
-
"no-unused-vars": [
|
|
240
|
-
1,
|
|
241
|
-
{
|
|
242
|
-
ignoreRestSiblings: true,
|
|
243
|
-
vars: "all",
|
|
244
|
-
args: "after-used",
|
|
245
|
-
argsIgnorePattern: "^_",
|
|
246
|
-
varsIgnorePattern: "^_"
|
|
247
|
-
}
|
|
248
|
-
],
|
|
249
|
-
"no-param-reassign": [
|
|
250
|
-
2,
|
|
251
|
-
{
|
|
252
|
-
props: true,
|
|
253
|
-
ignorePropertyModificationsForRegex: ["^draft$", "Draft$"]
|
|
254
|
-
}
|
|
255
|
-
],
|
|
256
|
-
camelcase: [1, { allow: ["^\\w*_[A-Z]*$"] }],
|
|
257
|
-
"no-var": 2,
|
|
258
|
-
// prettier
|
|
259
|
-
"prettier/prettier": 1,
|
|
260
|
-
// import
|
|
261
|
-
"import/no-named-as-default-member": 0,
|
|
262
|
-
"import/no-extraneous-dependencies": [
|
|
263
|
-
2,
|
|
264
|
-
{
|
|
265
|
-
devDependencies: [
|
|
266
|
-
"**/*.test.*",
|
|
267
|
-
"**/*.stories.*",
|
|
268
|
-
"**/*.config.*",
|
|
269
|
-
"**/*.spec.*"
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
],
|
|
273
|
-
"import/order": [
|
|
274
|
-
1,
|
|
275
|
-
{
|
|
276
|
-
alphabetize: {
|
|
277
|
-
order: "asc",
|
|
278
|
-
caseInsensitive: true
|
|
279
|
-
},
|
|
280
|
-
"newlines-between": "always",
|
|
281
|
-
groups: [
|
|
282
|
-
"builtin",
|
|
283
|
-
"external",
|
|
284
|
-
"internal",
|
|
285
|
-
["parent", "sibling", "index"]
|
|
286
|
-
],
|
|
287
|
-
pathGroups: [
|
|
288
|
-
{
|
|
289
|
-
pattern: "~*/**",
|
|
290
|
-
group: "internal"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
pattern: "@*/**",
|
|
294
|
-
group: "internal"
|
|
295
|
-
}
|
|
296
|
-
]
|
|
297
|
-
}
|
|
298
|
-
],
|
|
299
|
-
// unused-imports
|
|
300
|
-
"unused-imports/no-unused-imports": 2,
|
|
301
|
-
// kurateh
|
|
302
|
-
"@kurateh/import-path": 1,
|
|
303
|
-
// typescript
|
|
304
|
-
"@typescript-eslint/no-unused-vars": [
|
|
305
|
-
1,
|
|
306
|
-
{
|
|
307
|
-
ignoreRestSiblings: true,
|
|
308
|
-
vars: "all",
|
|
309
|
-
args: "after-used",
|
|
310
|
-
argsIgnorePattern: "^_",
|
|
311
|
-
varsIgnorePattern: "^_"
|
|
312
|
-
}
|
|
313
|
-
],
|
|
314
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
315
|
-
1,
|
|
316
|
-
{
|
|
317
|
-
fixStyle: "inline-type-imports"
|
|
318
|
-
}
|
|
319
|
-
],
|
|
320
|
-
"import-plugin/no-unresolved": 0
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
];
|
|
324
|
-
var recommended_default = config;
|
|
325
|
-
|
|
326
|
-
// src/configs/react.ts
|
|
327
|
-
var config2 = [
|
|
328
|
-
...recommended_default,
|
|
329
|
-
react.configs.flat.recommended,
|
|
330
|
-
reactHooks.configs.flat.recommended,
|
|
331
|
-
{
|
|
332
|
-
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
333
|
-
languageOptions: {
|
|
334
|
-
parserOptions: {
|
|
335
|
-
ecmaFeatures: {
|
|
336
|
-
jsx: true
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
|
-
globals: {
|
|
340
|
-
...globals.browser
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
rules: {
|
|
344
|
-
"react/react-in-jsx-scope": 0,
|
|
345
|
-
"react/function-component-definition": [
|
|
346
|
-
2,
|
|
347
|
-
{
|
|
348
|
-
namedComponents: "arrow-function",
|
|
349
|
-
unnamedComponents: "arrow-function"
|
|
350
|
-
}
|
|
351
|
-
],
|
|
352
|
-
"react/jsx-curly-brace-presence": [
|
|
353
|
-
1,
|
|
354
|
-
{
|
|
355
|
-
props: "never",
|
|
356
|
-
children: "never"
|
|
357
|
-
}
|
|
358
|
-
],
|
|
359
|
-
"react/prop-types": 0,
|
|
360
|
-
"react/require-default-props": 0,
|
|
361
|
-
"react/display-name": 0,
|
|
362
|
-
"react/no-children-prop": [2, { allowFunctions: true }]
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
];
|
|
366
|
-
var react_default = config2;
|
|
367
|
-
|
|
368
174
|
// src/index.ts
|
|
369
175
|
var pkg = JSON.parse(
|
|
370
176
|
readFileSync(new URL("../package.json", import.meta.url), "utf-8")
|
|
371
177
|
);
|
|
372
178
|
var plugin = {
|
|
373
179
|
meta: {
|
|
374
|
-
name: "eslint-plugin",
|
|
375
|
-
namespace: "@kurateh",
|
|
180
|
+
name: "@kurateh/eslint-plugin",
|
|
376
181
|
version: pkg.version
|
|
377
182
|
},
|
|
378
|
-
configs: {
|
|
379
|
-
recommended: recommended_default,
|
|
380
|
-
react: react_default
|
|
381
|
-
},
|
|
382
183
|
rules: rules_default
|
|
383
184
|
};
|
|
384
185
|
var index_default = plugin;
|
package/package.json
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurateh/eslint-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
|
+
"description": "",
|
|
4
5
|
"type": "module",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "kurateh",
|
|
7
|
-
"email": "me@kurateh.com"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"url": "https://github.com/kurateh/eslint-plugin"
|
|
11
|
-
},
|
|
12
6
|
"exports": {
|
|
13
7
|
".": {
|
|
14
8
|
"import": "./dist/index.js",
|
|
@@ -18,50 +12,31 @@
|
|
|
18
12
|
"files": [
|
|
19
13
|
"dist"
|
|
20
14
|
],
|
|
21
|
-
"keywords": [
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
"license": "ISC",
|
|
26
|
-
"engines": {
|
|
27
|
-
"node": ">=22"
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "kurateh",
|
|
18
|
+
"email": "me@kurateh.com"
|
|
28
19
|
},
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"@types/node": "~24",
|
|
32
|
-
"@types/react": "^19.2.14",
|
|
33
|
-
"@typescript-eslint/rule-tester": "^8.59.0",
|
|
34
|
-
"eslint": "~10.2.1",
|
|
35
|
-
"prettier": "^3.8.3",
|
|
36
|
-
"react": "^19.2.5",
|
|
37
|
-
"tsup": "^8.5.1",
|
|
38
|
-
"typescript": "^6.0.3",
|
|
39
|
-
"vitest": "^4.1.5"
|
|
20
|
+
"repository": {
|
|
21
|
+
"url": "https://github.com/kurateh/eslint-plugin"
|
|
40
22
|
},
|
|
23
|
+
"license": "ISC",
|
|
41
24
|
"dependencies": {
|
|
42
|
-
"@eslint/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"@
|
|
46
|
-
"eslint
|
|
47
|
-
"eslint-
|
|
48
|
-
"
|
|
49
|
-
"eslint-plugin-prettier": "^5.5.5",
|
|
50
|
-
"eslint-plugin-react": "^7.37.5",
|
|
51
|
-
"eslint-plugin-react-hooks": "^7.1.1",
|
|
52
|
-
"eslint-plugin-unused-imports": "^4.4.1",
|
|
53
|
-
"globals": "^17.5.0",
|
|
54
|
-
"typescript-eslint": "^8.59.0"
|
|
25
|
+
"@typescript-eslint/utils": "^8.59.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^24.13.3",
|
|
29
|
+
"@typescript-eslint/parser": "8.59.0",
|
|
30
|
+
"@typescript-eslint/rule-tester": "8.59.0",
|
|
31
|
+
"vitest": "^4.1.10"
|
|
55
32
|
},
|
|
56
33
|
"peerDependencies": {
|
|
57
34
|
"eslint": ">=9"
|
|
58
35
|
},
|
|
59
36
|
"scripts": {
|
|
60
37
|
"build": "tsup",
|
|
61
|
-
"lint": "eslint .",
|
|
62
38
|
"format": "prettier --write .",
|
|
63
|
-
"
|
|
64
|
-
"test": "vitest run"
|
|
65
|
-
"version": "npm version"
|
|
39
|
+
"format:check": "prettier --check .",
|
|
40
|
+
"test": "vitest run"
|
|
66
41
|
}
|
|
67
42
|
}
|
package/README.ko.md
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# @kurateh/eslint-plugin
|
|
2
|
-
|
|
3
|
-
[English](./README.md) | 한국어
|
|
4
|
-
|
|
5
|
-
개인적인 ESLint 규칙과 권장 설정을 포함하는 플러그인입니다.
|
|
6
|
-
|
|
7
|
-
## 환경 요구 사항
|
|
8
|
-
- **NodeJS**: >=22
|
|
9
|
-
- **ESLint**: >= 9 (Flat Config 전용)
|
|
10
|
-
- **TypeScript**: >= 5.7.2
|
|
11
|
-
|
|
12
|
-
## 1. 사용법
|
|
13
|
-
|
|
14
|
-
### 설치
|
|
15
|
-
```bash
|
|
16
|
-
pnpm add -D @kurateh/eslint-plugin
|
|
17
|
-
# 또는
|
|
18
|
-
npm install --save-dev @kurateh/eslint-plugin
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### ESLint 설정 (`eslint.config.mjs`)
|
|
22
|
-
이 플러그인은 ESLint Flat Config를 지원합니다. 다음과 같이 설정을 추가할 수 있습니다.
|
|
23
|
-
|
|
24
|
-
```javascript
|
|
25
|
-
import kuratehPlugin from "@kurateh/eslint-plugin";
|
|
26
|
-
|
|
27
|
-
export default [
|
|
28
|
-
// 권장 설정 적용
|
|
29
|
-
kuratehPlugin.configs.recommended,
|
|
30
|
-
|
|
31
|
-
// React 환경인 경우 추가 설정 적용
|
|
32
|
-
kuratehPlugin.configs.react,
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
plugins: {
|
|
36
|
-
"@kurateh": kuratehPlugin,
|
|
37
|
-
},
|
|
38
|
-
rules: {
|
|
39
|
-
// 특정 규칙을 커스텀하고 싶은 경우
|
|
40
|
-
"@kurateh/import-path": "error",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
];
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### 제공되는 설정
|
|
47
|
-
- `configs.recommended`: 일반적인 TypeScript 프로젝트를 위한 권장 설정 (Prettier 포함).
|
|
48
|
-
- `configs.react`: React 프로젝트를 위한 추가 설정 (Hooks 규칙 포함).
|
|
49
|
-
|
|
50
|
-
## 2. GitHub Actions를 통한 배포 방법
|
|
51
|
-
|
|
52
|
-
이 프로젝트는 GitHub Actions를 통해 NPM 저장소에 자동으로 배포됩니다.
|
|
53
|
-
|
|
54
|
-
### 배포 절차
|
|
55
|
-
1. **CHANGELOG.md 작성**: 배포 전에 `CHANGELOG.md`의 `## [Unreleased]` 섹션 아래에 이번 버전에 포함된 변경 사항을 기록합니다.
|
|
56
|
-
* **작성 예시**:
|
|
57
|
-
```markdown
|
|
58
|
-
## [Unreleased]
|
|
59
|
-
### Added
|
|
60
|
-
- 새로운 규칙 `@kurateh/new-rule` 추가
|
|
61
|
-
### Fixed
|
|
62
|
-
- `import-path` 규칙의 오탐 문제 수정
|
|
63
|
-
```
|
|
64
|
-
2. GitHub 저장소의 **Actions** 탭으로 이동합니다.
|
|
65
|
-
3. 왼쪽 워크플로우 목록에서 **Release package**를 선택합니다.
|
|
66
|
-
4. **Run workflow** 버튼을 클릭합니다.
|
|
67
|
-
5. 다음 옵션 중 하나를 선택하거나 입력합니다:
|
|
68
|
-
- **Release type**: `patch`, `minor`, `major` 중 하나를 선택하여 버전을 올립니다.
|
|
69
|
-
- **Custom version (선택 사항)**: 특정 버전으로 바로 배포하고 싶을 때 입력합니다 (예: `10.0.0`). 이 값을 입력하면 `Release type`은 무시됩니다.
|
|
70
|
-
6. **Run workflow**를 클릭하면 다음 과정이 자동으로 진행됩니다:
|
|
71
|
-
- 빌드 및 테스트 수행
|
|
72
|
-
- `CHANGELOG.md`의 `[Unreleased]` 섹션이 새 버전 번호로 업데이트됨
|
|
73
|
-
- `package.json` 버전 업데이트 및 변경 사항 커밋/태그 생성
|
|
74
|
-
- NPM 배포 및 GitHub Release 생성 (Changelog 내용이 Release 노트로 포함됨)
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
**주의**: 배포를 위해서는 `NPMJS_ACCESS_TOKEN`이 GitHub Secrets에 등록되어 있어야 합니다.
|
package/README.md
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# @kurateh/eslint-plugin
|
|
2
|
-
|
|
3
|
-
English | [한국어](./README.ko.md)
|
|
4
|
-
|
|
5
|
-
An ESLint plugin containing personal ESLint rules and recommended configurations.
|
|
6
|
-
|
|
7
|
-
## Requirements
|
|
8
|
-
- **NodeJS**: >=22
|
|
9
|
-
- **ESLint**: >= 9 (Flat Config only)
|
|
10
|
-
- **TypeScript**: >= 5.7.2
|
|
11
|
-
|
|
12
|
-
## 1. Usage
|
|
13
|
-
|
|
14
|
-
### Installation
|
|
15
|
-
```bash
|
|
16
|
-
pnpm add -D @kurateh/eslint-plugin
|
|
17
|
-
# or
|
|
18
|
-
npm install --save-dev @kurateh/eslint-plugin
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### ESLint Configuration (`eslint.config.mjs`)
|
|
22
|
-
This plugin supports ESLint Flat Config. You can add configurations as follows:
|
|
23
|
-
|
|
24
|
-
```javascript
|
|
25
|
-
import kuratehPlugin from "@kurateh/eslint-plugin";
|
|
26
|
-
|
|
27
|
-
export default [
|
|
28
|
-
// Apply recommended configuration
|
|
29
|
-
kuratehPlugin.configs.recommended,
|
|
30
|
-
|
|
31
|
-
// Apply additional configuration for React environments
|
|
32
|
-
kuratehPlugin.configs.react,
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
plugins: {
|
|
36
|
-
"@kurateh": kuratehPlugin,
|
|
37
|
-
},
|
|
38
|
-
rules: {
|
|
39
|
-
// Customize specific rules if needed
|
|
40
|
-
"@kurateh/import-path": "error",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
];
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Provided Configurations
|
|
47
|
-
- `configs.recommended`: Recommended configuration for general TypeScript projects (includes Prettier).
|
|
48
|
-
- `configs.react`: Additional configuration for React projects (includes React Hooks rules).
|
|
49
|
-
|
|
50
|
-
## 2. Deployment via GitHub Actions
|
|
51
|
-
|
|
52
|
-
This project is automatically deployed to the NPM registry via GitHub Actions.
|
|
53
|
-
|
|
54
|
-
### Deployment Process
|
|
55
|
-
1. **Update CHANGELOG.md**: Before deployment, record the changes for the new version under the `## [Unreleased]` section in `CHANGELOG.md`.
|
|
56
|
-
* **Writing Example**:
|
|
57
|
-
```markdown
|
|
58
|
-
## [Unreleased]
|
|
59
|
-
### Added
|
|
60
|
-
- New rule `@kurateh/new-rule`
|
|
61
|
-
### Fixed
|
|
62
|
-
- Fixed false positive in `import-path` rule
|
|
63
|
-
```
|
|
64
|
-
2. Go to the **Actions** tab of the GitHub repository.
|
|
65
|
-
3. Select **Release package** from the workflow list on the left.
|
|
66
|
-
4. Click the **Run workflow** button.
|
|
67
|
-
5. Select or enter one of the following options:
|
|
68
|
-
- **Release type**: Select one of `patch`, `minor`, `major` to bump the version.
|
|
69
|
-
- **Custom version (Optional)**: Enter a specific version to deploy immediately (e.g., `10.0.0`). If provided, `Release type` is ignored.
|
|
70
|
-
6. Click **Run workflow** to trigger the following automated steps:
|
|
71
|
-
- Run build and tests.
|
|
72
|
-
- Update the `[Unreleased]` section in `CHANGELOG.md` to the new version number.
|
|
73
|
-
- Update the version in `package.json`, commit changes, and create a tag.
|
|
74
|
-
- Publish to NPM and create a GitHub Release (Changelog content will be used as Release notes).
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
**Note**: `NPMJS_ACCESS_TOKEN` must be registered in GitHub Secrets for successful deployment.
|