Skip to content

Commit c5b7b98

Browse files
committed
feat(lint): adopt @constructive-io/eslint-config flat config
ESLint 9 only reads flat config, so pnpm lint has been failing repo-wide since the eslint 8 -> 9 bump. Replaces .eslintrc.json with an eslint.config.mjs on top of the shared package, plus repo-local ignores for codegen output and a few rule relaxations for idioms this repo relies on.
1 parent 117303b commit c5b7b98

4 files changed

Lines changed: 123 additions & 67 deletions

File tree

.eslintrc.json

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

eslint.config.mjs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import base from '@constructive-io/eslint-config';
2+
3+
export default [
4+
...base,
5+
{
6+
// several rules this repo turns off still have inline disable comments;
7+
// leave them in place rather than have --fix strip them
8+
linterOptions: {
9+
reportUnusedDisableDirectives: 'off'
10+
}
11+
},
12+
{
13+
ignores: [
14+
// codegen output, regenerated by `pnpm generate`
15+
'sdk/*/src/**',
16+
'**/__generated__/**',
17+
'**/*.generated.ts',
18+
'postgres/pg-ast/src/asts.ts',
19+
'postgres/pg-ast/src/wrapped.ts',
20+
// legacy fixture build script
21+
'__fixtures__/kitchen-sink/**'
22+
]
23+
},
24+
{
25+
rules: {
26+
// `declare global { namespace Grafast { ... } }` augmentations
27+
'@typescript-eslint/no-namespace': 'off',
28+
// `Function` in plugin/callback signatures
29+
'@typescript-eslint/no-unsafe-function-type': 'off',
30+
// `{}` as a type-level marker (StrictSelect) and placeholder option bags
31+
'@typescript-eslint/no-empty-object-type': 'off'
32+
}
33+
},
34+
{
35+
// ANSI escapes are matched on purpose
36+
files: ['pgpm/logger/**'],
37+
rules: {
38+
'no-control-regex': 'off'
39+
}
40+
},
41+
{
42+
// type-level assertions are expressions by construction
43+
files: ['**/*.type-test.ts'],
44+
rules: {
45+
'@typescript-eslint/no-unused-expressions': 'off'
46+
}
47+
}
48+
];

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"fixtures:install:force": "node pgpm/cli/dist/index.js install -W --force"
2626
},
2727
"devDependencies": {
28+
"@constructive-io/eslint-config": "^0.2.0",
2829
"@jest/test-sequencer": "^30.4.1",
2930
"@types/jest": "^30.0.0",
3031
"@types/jest-in-case": "^1.0.9",

0 commit comments

Comments
 (0)