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

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,20 @@
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.32](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.31...v3.0.0-alpha.32) (2026-05-04)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **eslint:** add explicit sourcetype module for client js files ([c05d056](https://gitlab.coko.foundation/cokoapps/lint/commit/c05d0560a8fbfa2797eec257c1c06840b1f94641))
11
+
12
+ ## [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)
13
+
14
+
15
+ ### Features
16
+
17
+ * **eslint:** more nuanced root config ([d8f7fc2](https://gitlab.coko.foundation/cokoapps/lint/commit/d8f7fc2fb9926bdfc92e66712b468827936efd48))
18
+
5
19
  ## [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
20
 
7
21
 
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.32",
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,96 @@ 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
+ sourceType: 'module',
246
+ parserOptions: {
247
+ ecmaFeatures: {
248
+ jsx: true,
249
+ },
233
250
  },
234
251
  },
235
-
236
- {
237
- files: ['**/*.mjs'],
238
- rules: {
239
- ...nodePlugin.configs['flat/recommended-module'].rules,
252
+ settings: {
253
+ 'import/resolver': {
254
+ typescript: {
255
+ alwaysTryTypes: true,
256
+ },
240
257
  },
258
+ react: {
259
+ version: 'detect',
260
+ },
261
+ },
262
+ rules: {
263
+ ...commonRules,
264
+ 'no-console': ['error', { allow: ['warn', 'error'] }],
265
+ 'import/no-unresolved': 'error',
266
+ 'react/jsx-sort-props': [1, { ignoreCase: true }],
267
+ 'no-restricted-globals': ['error'].concat(confusingBrowserGlobals),
241
268
  },
269
+ }
270
+
271
+ const clientCommonjs = {
272
+ files: ['**/*.cjs'],
273
+ languageOptions: { sourceType: 'commonjs' },
274
+ }
275
+
276
+ const server = [
277
+ js.configs.recommended,
278
+ importPlugin.flatConfigs.recommended,
279
+ pluginPromise.configs['flat/recommended'],
280
+ workspacesConfig,
281
+
282
+ serverFiles,
283
+ serverCommonjs,
284
+ serverMjs,
242
285
 
243
286
  typescriptConfig,
244
287
  viteConfig,
@@ -250,48 +293,14 @@ const client = [
250
293
  importPlugin.flatConfigs.recommended,
251
294
  pluginPromise.configs['flat/recommended'],
252
295
  workspacesConfig,
296
+
253
297
  react.configs.flat.recommended,
254
298
  react.configs.flat['jsx-runtime'],
255
299
  reactHooks.configs.flat.recommended,
256
300
  jsxA11y.flatConfigs.recommended,
257
301
 
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
- },
302
+ clientFiles,
303
+ clientCommonjs,
295
304
 
296
305
  typescriptConfig,
297
306
  viteConfig,
@@ -299,12 +308,53 @@ const client = [
299
308
  ]
300
309
 
301
310
  const root = [
302
- ...server,
311
+ js.configs.recommended,
312
+ importPlugin.flatConfigs.recommended,
313
+ pluginPromise.configs['flat/recommended'],
314
+ workspacesConfig,
315
+
316
+ serverFiles,
317
+ serverCommonjs,
318
+ serverMjs,
303
319
 
304
320
  {
305
321
  files: ['cypress/**/*.{js,mjs,ts}'],
306
322
  extends: [pluginCypress.configs.recommended],
307
323
  },
324
+
325
+ {
326
+ ...react.configs.flat.recommended,
327
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
328
+ },
329
+
330
+ {
331
+ ...react.configs.flat['jsx-runtime'],
332
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
333
+ },
334
+
335
+ {
336
+ ...reactHooks.configs.flat.recommended,
337
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
338
+ },
339
+
340
+ {
341
+ ...jsxA11y.flatConfigs.recommended,
342
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
343
+ },
344
+
345
+ {
346
+ ...clientFiles,
347
+ files: ['packages/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
348
+ },
349
+
350
+ {
351
+ ...clientCommonjs,
352
+ files: ['packages/client/**/*.cjs'],
353
+ },
354
+
355
+ typescriptConfig,
356
+ viteConfig,
357
+ globalIgnores(globalIgnoreList),
308
358
  ]
309
359
 
310
360
  export {