forked from elastic/apm-agent-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
111 lines (108 loc) · 2.77 KB
/
.eslintrc.json
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// `npx eslint --print-config index.js` to print calculated config.
{
"root": true,
"parserOptions": {
"ecmaVersion": 2022, // Top-level await, etc.
"sourceType": "module",
"ecmaFeatures": {
}
},
"env": {
"node": true,
"es2022": true // Defines `Promise`, etc.
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"plugins": [
"import",
"license-header",
"prettier",
"promise",
"n"
],
"rules": {
"license-header/header": ["error", "./dev-utils/license-header.js"],
// Retoring some config from standardjs that we want to maintain at least
// for now -- to assist with transition to prettier.
"no-unused-vars": [ // See taav for possible better 'no-unused-vars' rule.
"error",
{
"args": "none",
"caughtErrors": "none",
"ignoreRestSiblings": true,
"vars": "all"
}
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"n/handle-callback-err": [
"error",
"^(err|error)$"
],
"n/no-callback-literal": [
"error"
],
"n/no-deprecated-api": [
"error"
],
"n/no-exports-assign": [
"error"
],
"n/no-new-require": [
"error"
],
"n/no-path-concat": [
"error"
],
"n/process-exit-as-throw": [
"error"
],
"promise/param-names": [
"error"
],
// Undo this config from eslint:recommended for now (standardjs didn't have it.)
"require-yield": [ "off" ],
"import/export": "error",
"import/first": "error",
"import/no-absolute-path": ["error", { "esmodule": true, "commonjs": true, "amd": false }],
"import/no-duplicates": "error",
"import/no-named-default": "error",
"import/no-webpack-loader-syntax": "error"
},
"ignorePatterns": [
"/*.example.js", // a pattern for uncommited local dev files to avoid linting
"/*.example.mjs", // a pattern for uncommited local dev files to avoid linting
"/.nyc_output",
"/build",
"node_modules",
"elastic-apm-node.js",
"/examples/esbuild/dist",
"/examples/typescript/dist",
"/examples/nextjs",
"/examples/an-azure-function-app",
"/lib/opentelemetry-bridge/opentelemetry-core-mini",
"/test/babel/out.js",
"/test/lambda/fixtures/esbuild-bundled-handler/hello.js",
"/test/instrumentation/modules/next/a-nextjs-app/pages",
"/test/instrumentation/modules/next/a-nextjs-app/components",
"/test/sourcemaps/fixtures/lib",
"/test/sourcemaps/fixtures/src",
"/test/stacktraces/fixtures/dist",
"/test/types/transpile/index.js",
"/test/types/transpile-default/index.js",
"/test_output",
"tmp"
]
}