eslint-plugin-react-suspense-check 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/index.js +12 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const detectSuspenseHook = require('./rules/detect-suspense-hook');
2
2
 
3
+ // 1. 플러그인 객체 기본 정의
3
4
  const plugin = {
4
5
  meta: {
5
6
  name: 'eslint-plugin-react-suspense-check',
@@ -8,19 +9,20 @@ const plugin = {
8
9
  rules: {
9
10
  'detect-suspense-hook': detectSuspenseHook,
10
11
  },
11
- configs: {}, // 아래에서 채움
12
+ configs: {}, // 일단 비워둠
12
13
  };
13
14
 
14
- plugin.configs.recommended = {
15
+ // 2. Recommended 설정 정의 (Flat Config 호환)
16
+ // 핵심: 여기서 plugins에 'plugin' 변수(자기 자신)를 직접 넣어줍니다.
17
+ const recommendedConfig = {
18
+ name: 'react-suspense-check/recommended', // (선택) 디버깅용 이름
19
+ files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
15
20
  plugins: {
16
- 'react-suspense-check': plugin,
21
+ 'react-suspense-check': plugin, // ⭐ 여기가 핵심! 자기 자신을 참조
17
22
  },
18
23
  rules: {
19
24
  'react-suspense-check/detect-suspense-hook': 'warn',
20
25
  },
21
- // ③ (선택사항) 적용할 파일 확장자도 미리 지정해주면 사용자가 편함
22
- // 이걸 안 넣으면 모든 파일(.css, .json 등)을 다 찔러봐서 비효율적일 수 있음
23
- files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
24
26
  languageOptions: {
25
27
  parserOptions: {
26
28
  ecmaFeatures: {
@@ -30,4 +32,8 @@ plugin.configs.recommended = {
30
32
  },
31
33
  };
32
34
 
35
+ plugin.configs.recommended = recommendedConfig;
36
+
37
+ plugin.configs['flat/recommended'] = recommendedConfig;
38
+
33
39
  module.exports = plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-suspense-check",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "ESLint plugin to enforce naming conventions for React Suspense safety",
5
5
  "main": "index.js",
6
6
  "engines": {