@coko/lint 3.0.0-alpha.30 → 3.0.0-alpha.31

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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [3.0.0-alpha.31](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.30...v3.0.0-alpha.31) (2026-05-04)
6
+
7
+
8
+ ### Features
9
+
10
+ * **eslint:** more nuanced root config ([d8f7fc2](https://gitlab.coko.foundation/cokoapps/lint/commit/d8f7fc2fb9926bdfc92e66712b468827936efd48))
11
+
5
12
  ## [3.0.0-alpha.30](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.29...v3.0.0-alpha.30) (2026-05-04)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coko/lint",
3
- "version": "3.0.0-alpha.30",
3
+ "version": "3.0.0-alpha.31",
4
4
  "description": "Linter configurations and dependencies for coko's projects",
5
5
  "keywords": [
6
6
  "lint",
package/src/eslint.mjs CHANGED
@@ -192,53 +192,95 @@ const globalIgnoreList = [
192
192
  '**/node_modules',
193
193
  ]
194
194
 
195
- const server = [
196
- js.configs.recommended,
197
- importPlugin.flatConfigs.recommended,
198
- pluginPromise.configs['flat/recommended'],
199
- workspacesConfig,
200
-
201
- {
202
- files: ['**/*.{js,mjs,ts}'],
203
- languageOptions: {
204
- globals: { ...globals.node },
205
- ecmaVersion: 'latest',
206
- },
207
- plugins: {
208
- n: nodePlugin,
209
- },
210
- settings: {
211
- 'import/resolver': {
212
- typescript: {
213
- alwaysTryTypes: true,
214
- },
195
+ const serverFiles = {
196
+ files: ['**/*.{js,mjs,ts}'],
197
+ languageOptions: {
198
+ globals: { ...globals.node },
199
+ ecmaVersion: 'latest',
200
+ },
201
+ plugins: {
202
+ n: nodePlugin,
203
+ },
204
+ settings: {
205
+ 'import/resolver': {
206
+ typescript: {
207
+ alwaysTryTypes: true,
215
208
  },
216
- n: { tryExtensions: ['.js', '.ts'] },
217
- },
218
- rules: {
219
- ...commonRules,
220
- 'no-console': 'error',
221
- // 'n/no-process-exit': 'off',
222
- 'import/no-unresolved': ['error', { commonjs: true }],
223
209
  },
210
+ n: { tryExtensions: ['.js', '.ts'] },
224
211
  },
212
+ rules: {
213
+ ...commonRules,
214
+ 'no-console': 'error',
215
+ // 'n/no-process-exit': 'off',
216
+ 'import/no-unresolved': ['error', { commonjs: true }],
217
+ },
218
+ }
225
219
 
226
- {
227
- files: ['**/*.js'],
228
- languageOptions: {
229
- sourceType: 'commonjs',
220
+ const serverCommonjs = {
221
+ files: ['**/*.js'],
222
+ languageOptions: {
223
+ sourceType: 'commonjs',
224
+ },
225
+ rules: {
226
+ ...nodePlugin.configs['flat/recommended-script'].rules,
227
+ },
228
+ }
229
+
230
+ const serverMjs = {
231
+ files: ['**/*.mjs'],
232
+ rules: {
233
+ ...nodePlugin.configs['flat/recommended-module'].rules,
234
+ },
235
+ }
236
+
237
+ const clientFiles = {
238
+ files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
239
+ languageOptions: {
240
+ globals: {
241
+ ...globals.browser,
242
+ process: 'readonly',
230
243
  },
231
- rules: {
232
- ...nodePlugin.configs['flat/recommended-script'].rules,
244
+ ecmaVersion: 'latest',
245
+ parserOptions: {
246
+ ecmaFeatures: {
247
+ jsx: true,
248
+ },
233
249
  },
234
250
  },
235
-
236
- {
237
- files: ['**/*.mjs'],
238
- rules: {
239
- ...nodePlugin.configs['flat/recommended-module'].rules,
251
+ settings: {
252
+ 'import/resolver': {
253
+ typescript: {
254
+ alwaysTryTypes: true,
255
+ },
240
256
  },
257
+ react: {
258
+ version: 'detect',
259
+ },
260
+ },
261
+ rules: {
262
+ ...commonRules,
263
+ 'no-console': ['error', { allow: ['warn', 'error'] }],
264
+ 'import/no-unresolved': 'error',
265
+ 'react/jsx-sort-props': [1, { ignoreCase: true }],
266
+ 'no-restricted-globals': ['error'].concat(confusingBrowserGlobals),
241
267
  },
268
+ }
269
+
270
+ const clientCommonjs = {
271
+ files: ['**/*.cjs'],
272
+ languageOptions: { sourceType: 'commonjs' },
273
+ }
274
+
275
+ const server = [
276
+ js.configs.recommended,
277
+ importPlugin.flatConfigs.recommended,
278
+ pluginPromise.configs['flat/recommended'],
279
+ workspacesConfig,
280
+
281
+ serverFiles,
282
+ serverCommonjs,
283
+ serverMjs,
242
284
 
243
285
  typescriptConfig,
244
286
  viteConfig,
@@ -250,48 +292,14 @@ const client = [
250
292
  importPlugin.flatConfigs.recommended,
251
293
  pluginPromise.configs['flat/recommended'],
252
294
  workspacesConfig,
295
+
253
296
  react.configs.flat.recommended,
254
297
  react.configs.flat['jsx-runtime'],
255
298
  reactHooks.configs.flat.recommended,
256
299
  jsxA11y.flatConfigs.recommended,
257
300
 
258
- {
259
- files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
260
- languageOptions: {
261
- globals: {
262
- ...globals.browser,
263
- process: 'readonly',
264
- },
265
- ecmaVersion: 'latest',
266
- parserOptions: {
267
- ecmaFeatures: {
268
- jsx: true,
269
- },
270
- },
271
- },
272
- settings: {
273
- 'import/resolver': {
274
- typescript: {
275
- alwaysTryTypes: true,
276
- },
277
- },
278
- react: {
279
- version: 'detect',
280
- },
281
- },
282
- rules: {
283
- ...commonRules,
284
- 'no-console': ['error', { allow: ['warn', 'error'] }],
285
- 'import/no-unresolved': 'error',
286
- 'react/jsx-sort-props': [1, { ignoreCase: true }],
287
- 'no-restricted-globals': ['error'].concat(confusingBrowserGlobals),
288
- },
289
- },
290
-
291
- {
292
- files: ['**/*.cjs'],
293
- languageOptions: { sourceType: 'commonjs' },
294
- },
301
+ clientFiles,
302
+ clientCommonjs,
295
303
 
296
304
  typescriptConfig,
297
305
  viteConfig,
@@ -299,12 +307,53 @@ const client = [
299
307
  ]
300
308
 
301
309
  const root = [
302
- ...server,
310
+ js.configs.recommended,
311
+ importPlugin.flatConfigs.recommended,
312
+ pluginPromise.configs['flat/recommended'],
313
+ workspacesConfig,
314
+
315
+ serverFiles,
316
+ serverCommonjs,
317
+ serverMjs,
303
318
 
304
319
  {
305
320
  files: ['cypress/**/*.{js,mjs,ts}'],
306
321
  extends: [pluginCypress.configs.recommended],
307
322
  },
323
+
324
+ {
325
+ ...react.configs.flat.recommended,
326
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
327
+ },
328
+
329
+ {
330
+ ...react.configs.flat['jsx-runtime'],
331
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
332
+ },
333
+
334
+ {
335
+ ...reactHooks.configs.flat.recommended,
336
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
337
+ },
338
+
339
+ {
340
+ ...jsxA11y.flatConfigs.recommended,
341
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
342
+ },
343
+
344
+ {
345
+ ...clientFiles,
346
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
347
+ },
348
+
349
+ {
350
+ ...clientCommonjs,
351
+ files: ['packages/client/**/*.cjs'],
352
+ },
353
+
354
+ typescriptConfig,
355
+ viteConfig,
356
+ globalIgnores(globalIgnoreList),
308
357
  ]
309
358
 
310
359
  export {