-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
42 lines (41 loc) · 1.25 KB
/
.eslintrc.js
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
/** @type {import('eslint').Linter.ParserOptions} */
const parserOptions = {
tsconfigRootDir: __dirname,
ecmaVersion: 'latest',
project: ['./tsconfig.json'],
}
/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['@detachhead/eslint-config'],
parserOptions,
rules: {
// typescript-eslint enables this for typescript files only, but the js config files can benefit from it too because we aren't targeting an ancient node version
'no-var': 'error',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'playwright.config.ts',
'.eslintrc.cjs',
'src/browser/**/*.ts',
'tests/**/*.ts',
],
},
],
},
overrides: [
{
files: ['src/browser/**/*.ts'],
parserOptions: { ...parserOptions, project: ['./src/browser/tsconfig.json'] },
},
{
files: ['.eslintrc.cjs'],
parserOptions,
rules: {
// commonjs cant use esm imports, duh
'@typescript-eslint/no-var-requires': 'off',
},
},
],
}
module.exports = config