-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.cjs
51 lines (49 loc) · 1.35 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
env: {
// allow document, window, etc (these are expected as a frontend-library)
browser: true,
},
plugins: ['jest', '@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
rules: {
// some of the dependencies do not support module imports... yet
'@typescript-eslint/no-var-requires': 'off',
// as a framework, we have to sometimes just expect anything
'@typescript-eslint/no-explicit-any': 'off',
// we shouldn't have console logs in our project
'no-console': 'error',
},
overrides: [
// allow module.exports for config, testing, and docs
{
files: [
'**/*.cjs', // any file with the cjs extension
'./*.js', // top level config
'./docs/runkit_example.js', // runkit example
'./integration-tests/broken-app/**.js', // tests that still need runtime import/export
],
env: {
commonjs: true,
},
},
// configure test files to be in the jest environment
{
files: ['integration-tests/**/*', 'performance-tests/**/*'],
env: {
jest: true,
},
rules: {
'@typescript-eslint/no-empty-function': 'off',
},
},
// local scripts are expected to run on local machines with node
{
files: ['dev-scripts/**/*.js'],
env: {
node: true,
},
},
],
};