Skip to content

Commit c91d001

Browse files
committed
fix: enforce MongoStore asserts and migrate to flat eslint config (plan#runtime)
1 parent 05f1920 commit c91d001

File tree

6 files changed

+77
-71
lines changed

6 files changed

+77
-71
lines changed

.eslintrc.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

docs/PLANS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- Refresh the tooling stack: virtually every dev dependency is from 2020 (TypeScript 4.0, Ava 3, ESLint 7, Husky 4, Prettier 2, commitlint 11, etc.), which misses hundreds of bug fixes and no longer understands Node 20/22 typings (package.json:67-107). Plan an across-the-board upgrade (TS ≥5.6, Ava 6, ESLint 9,
88
Prettier 3, Husky 9/Lint‑Staged 15, latest @types/*) and run yarn dedupe afterwards.
99
- [done 2025-11-15] Upgrade TS/AVA/ESLint/prettier/husky stacks while keeping Node 18 compatibility (agent: Codex)
10-
- TODO(agent): migrate from .eslintrc.yml to an eslint.config.js flat config so ESLINT_USE_FLAT_CONFIG shim can be removed.
10+
- [done 2025-11-19] Migrated to flat eslint.config.mjs + removed ESLINT_USE_FLAT_CONFIG shim (agent: Codex)
1111
- Examples and fixtures lag far behind: the sample app still consumes connect-mongo@^4.4.0, forces MongoDB 3.6 via Yarn resolutions, and docker-compose.yaml spins up Mongo 4.4 (example/package.json:12-23, docker-compose.yaml:1-11). Update those to your current major, exercise Mongo server 7+, and document SRV/TLS
1212
flows so contributors can reproduce issues without pinning to obsolete builds.
1313
- [done 2025-11-16] Refresh example deps/fixtures, add TLS profile + docs for SRV/TLS workflows (agent: Codex)

eslint.config.mjs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import path from 'node:path'
2+
import { fileURLToPath } from 'node:url'
3+
import { FlatCompat } from '@eslint/eslintrc'
4+
import js from '@eslint/js'
5+
6+
const __filename = fileURLToPath(import.meta.url)
7+
const __dirname = path.dirname(__filename)
8+
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all,
13+
})
14+
15+
export default [
16+
...compat.config({
17+
root: true,
18+
env: {
19+
node: true,
20+
es6: true,
21+
},
22+
ignorePatterns: [
23+
'node_modules/*',
24+
'build/*',
25+
'coverage/*',
26+
'example/*',
27+
'tsdown.config.ts',
28+
],
29+
parser: '@typescript-eslint/parser',
30+
parserOptions: {
31+
ecmaVersion: 2022,
32+
project: './tsconfig.json',
33+
tsconfigRootDir: __dirname,
34+
},
35+
extends: [
36+
'eslint:recommended',
37+
'plugin:@typescript-eslint/recommended',
38+
'plugin:@typescript-eslint/stylistic',
39+
'plugin:eslint-comments/recommended',
40+
'plugin:prettier/recommended',
41+
],
42+
plugins: ['eslint-comments', '@typescript-eslint'],
43+
rules: {
44+
camelcase: 'warn',
45+
'@typescript-eslint/no-unused-vars': [
46+
'warn',
47+
{
48+
args: 'none',
49+
varsIgnorePattern: '^_',
50+
argsIgnorePattern: '^_',
51+
},
52+
],
53+
'prefer-const': [
54+
'error',
55+
{
56+
destructuring: 'any',
57+
ignoreReadBeforeAssign: false,
58+
},
59+
],
60+
'@typescript-eslint/explicit-function-return-type': 'off',
61+
'@typescript-eslint/no-var-requires': 'off',
62+
'@typescript-eslint/ban-ts-comment': 'off',
63+
'@typescript-eslint/no-explicit-any': 'off',
64+
'@typescript-eslint/consistent-type-definitions': 'off',
65+
'@typescript-eslint/consistent-indexed-object-style': 'off',
66+
'@typescript-eslint/no-require-imports': 'off',
67+
},
68+
}),
69+
]

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
"build": "tsdown",
4040
"fix": "run-s fix:*",
4141
"fix:prettier": "prettier \"src/**/*.ts\" --write",
42-
"fix:lint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint --cache src --ext .ts --fix",
42+
"fix:lint": "eslint --cache src --ext .ts --fix",
4343
"test": "run-s test:*",
44-
"test:lint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint --cache src --ext .ts",
44+
"test:lint": "eslint --cache src --ext .ts",
4545
"test:prettier": "prettier \"src/**/*.ts\" --list-different",
4646
"test:unit": "c8 ava",
4747
"watch:test": "c8 ava --watch",
@@ -103,7 +103,8 @@
103103
"tsdown": "^0.16.4",
104104
"typedoc": "^0.28.14",
105105
"typescript": "^5.9.3",
106-
"cross-env": "^10.1.0"
106+
"@eslint/eslintrc": "^3.1.0",
107+
"@eslint/js": "^9.39.1"
107108
},
108109
"files": [
109110
"dist",
@@ -148,7 +149,7 @@
148149
},
149150
"lint-staged": {
150151
"**/*.{ts,js}": [
151-
"cross-env ESLINT_USE_FLAT_CONFIG=false eslint --cache --fix"
152+
"eslint --cache --fix"
152153
]
153154
},
154155
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"

src/test/testHelper.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// eslint-disable-next-line eslint-comments/disable-enable-pair
2-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
31
import util from 'util'
42
import ExpressSession from 'express-session'
53

yarn.lock

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,6 @@
282282
dependencies:
283283
tslib "^2.4.0"
284284

285-
"@epic-web/invariant@^1.0.0":
286-
version "1.0.0"
287-
resolved "https://registry.yarnpkg.com/@epic-web/invariant/-/invariant-1.0.0.tgz#1073e5dee6dd540410784990eb73e4acd25c9813"
288-
integrity sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==
289-
290285
"@eslint-community/eslint-utils@^4.7.0", "@eslint-community/eslint-utils@^4.8.0":
291286
version "4.9.0"
292287
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz#7308df158e064f0dd8b8fdb58aa14fa2a7f913b3"
@@ -322,7 +317,7 @@
322317
dependencies:
323318
"@types/json-schema" "^7.0.15"
324319

325-
"@eslint/eslintrc@^3.3.1":
320+
"@eslint/eslintrc@^3.1.0", "@eslint/eslintrc@^3.3.1":
326321
version "3.3.1"
327322
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.1.tgz#e55f7f1dd400600dd066dbba349c4c0bac916964"
328323
integrity sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==
@@ -337,7 +332,7 @@
337332
minimatch "^3.1.2"
338333
strip-json-comments "^3.1.1"
339334

340-
"@eslint/js@9.39.1":
335+
"@eslint/js@9.39.1", "@eslint/js@^9.39.1":
341336
version "9.39.1"
342337
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.39.1.tgz#0dd59c3a9f40e3f1882975c321470969243e0164"
343338
integrity sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==
@@ -2122,14 +2117,6 @@ cosmiconfig@^9.0.0:
21222117
js-yaml "^4.1.0"
21232118
parse-json "^5.2.0"
21242119

2125-
cross-env@^10.1.0:
2126-
version "10.1.0"
2127-
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-10.1.0.tgz#cfd2a6200df9ed75bfb9cb3d7ce609c13ea21783"
2128-
integrity sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==
2129-
dependencies:
2130-
"@epic-web/invariant" "^1.0.0"
2131-
cross-spawn "^7.0.6"
2132-
21332120
cross-spawn@^6.0.5:
21342121
version "6.0.5"
21352122
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"

0 commit comments

Comments
 (0)