@devapoo-dev/eslint-config 1.1.23 → 1.1.24

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.mjs +56 -50
  2. package/package.json +2 -2
package/index.mjs CHANGED
@@ -122,67 +122,73 @@ export function createConfig(options, ...userConfigs) {
122
122
  ],
123
123
 
124
124
  // react
125
- ...(options?.react && {
126
- 'perfectionist/sort-jsx-props': 'error',
127
- 'react/no-array-index-key': 'off', // Off to enable composable keys
125
+ ...(options?.react
126
+ ? {
127
+ 'perfectionist/sort-jsx-props': 'error',
128
+ 'react/no-array-index-key': 'off', // Off to enable composable keys
128
129
 
129
- // check-file
130
- 'check-file/filename-naming-convention': [
131
- 'error',
132
- { [JS_GLOB]: 'KEBAB_CASE', [TS_GLOB]: 'KEBAB_CASE' },
133
- { ignoreMiddleExtensions: true },
134
- ],
135
- 'check-file/folder-naming-convention': [
136
- 'error',
137
- { [JS_GLOB]: 'KEBAB_CASE', [TS_GLOB]: 'KEBAB_CASE' },
138
- { ignoreMiddleExtensions: true },
139
- ],
140
- }),
130
+ // check-file
131
+ 'check-file/filename-naming-convention': [
132
+ 'error',
133
+ { [JS_GLOB]: 'KEBAB_CASE', [TS_GLOB]: 'KEBAB_CASE' },
134
+ { ignoreMiddleExtensions: true },
135
+ ],
136
+ 'check-file/folder-naming-convention': [
137
+ 'error',
138
+ { [JS_GLOB]: 'KEBAB_CASE', [TS_GLOB]: 'KEBAB_CASE' },
139
+ { ignoreMiddleExtensions: true },
140
+ ],
141
+ }
142
+ : {}),
141
143
 
142
- ...options?.rules,
144
+ ...(options?.rules || {}),
143
145
  },
144
146
  },
145
147
  /**
146
148
  * React Routter 7 | Remix.run rules
147
149
  */
148
150
  {
149
- ...(options?.remix && {
150
- plugins: {
151
- 'react-refresh': reactRefresh,
152
- },
153
- rules: {
154
- // preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
155
- 'react-refresh/only-export-components': [
156
- 'error',
157
- {
158
- allowExportNames: [
159
- 'meta',
160
- 'links',
161
- 'headers',
162
- 'loader',
163
- 'action',
164
- 'clientLoader',
165
- 'clientAction',
166
- 'handle',
167
- 'middleware',
168
- 'shouldRevalidate',
151
+ ...(options?.remix
152
+ ? {
153
+ plugins: {
154
+ 'react-refresh': reactRefresh,
155
+ },
156
+ rules: {
157
+ // preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
158
+ 'react-refresh/only-export-components': [
159
+ 'error',
160
+ {
161
+ allowExportNames: [
162
+ 'meta',
163
+ 'links',
164
+ 'headers',
165
+ 'loader',
166
+ 'action',
167
+ 'clientLoader',
168
+ 'clientAction',
169
+ 'handle',
170
+ 'middleware',
171
+ 'shouldRevalidate',
172
+ ],
173
+ },
169
174
  ],
170
175
  },
171
- ],
172
- },
173
- }),
176
+ }
177
+ : {}),
174
178
  },
175
179
  {
176
- ...(options?.remix && {
177
- files: [
178
- '**/root.tsx',
179
- '**/routes/**/*.{ts,tsx}',
180
- '**/middlewares/**/*.{ts,tsx}',
181
- ],
182
- rules: {
183
- 'react-naming-convention/context-name': 'off',
184
- },
185
- }),
180
+ ...(options?.remix
181
+ ? {
182
+ files: [
183
+ '**/root.tsx',
184
+ '**/routes/**/*.{ts,tsx}',
185
+ '**/middlewares/**/*.{ts,tsx}',
186
+ ],
187
+ rules: {
188
+ 'react-naming-convention/context-name': 'off',
189
+ },
190
+ }
191
+ : {}),
186
192
  },
187
193
  /**
188
194
  * Tailwind CSS
@@ -253,6 +259,6 @@ export function createConfig(options, ...userConfigs) {
253
259
  '@typescript-eslint/no-unused-vars': 'off',
254
260
  },
255
261
  },
256
- ...userConfigs,
262
+ ...(userConfigs || []),
257
263
  );
258
264
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devapoo-dev/eslint-config",
3
3
  "type": "module",
4
- "version": "1.1.23",
4
+ "version": "1.1.24",
5
5
  "main": "index.mjs",
6
6
  "types": "index.d.ts",
7
7
  "peerDependencies": {
@@ -21,7 +21,7 @@
21
21
  "eslint": "^9",
22
22
  "typescript": "^5",
23
23
  "@devapoo-dev/prettier-config": "0.0.15",
24
- "@devapoo-dev/tsconfig": "0.0.18"
24
+ "@devapoo-dev/tsconfig": "0.0.20"
25
25
  },
26
26
  "scripts": {
27
27
  "lint": "eslint .",