Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
56 lines (55 loc) · 1.77 KB
/
Copy patheslint.config.js
File metadata and controls
56 lines (55 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Type-aware lint rules for every TypeScript and JavaScript file in the
// workspace. Formatting is Prettier's job, so conflicting style rules are off.
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import { defineConfig } from 'eslint/config';
import ts from 'typescript-eslint';
export default defineConfig(
{
ignores: [
'target/',
'test-results/',
'playwright-report/',
'.claude/',
'.dev/',
'packages/*/dist/',
// Generated by `just sdk-types`; tsc still checks it.
'packages/auth/src/protocol.ts'
]
},
js.configs.recommended,
ts.configs.strictTypeChecked,
ts.configs.stylisticTypeChecked,
prettier,
{
languageOptions: {
parserOptions: {
// Each file uses its nearest tsconfig.json.
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
// TypeScript already reports undefined identifiers, including browser and
// Node globals, so ESLint's environment-unaware check only adds noise.
'no-undef': 'off',
// The codebase consistently declares object shapes as type aliases.
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
// node:test reports the promises `test` and `describe` return itself.
'@typescript-eslint/no-floating-promises': [
'error',
{
allowForKnownSafeCalls: [
{ from: 'package', package: 'node:test', name: ['test', 'describe'] }
]
}
]
}
},
{
// The runtime smoke scripts import the built package, which does not exist yet
// when linting runs, so they get the rules that need no types.
files: ['packages/auth/test/smoke/*.js'],
extends: [ts.configs.disableTypeChecked]
}
);