|
| 1 | +root: true |
| 2 | + |
| 3 | +plugins: |
| 4 | + - markdown |
| 5 | + |
| 6 | +env: |
| 7 | + node: true |
| 8 | + es6: true |
| 9 | + |
| 10 | +parser: babel-eslint |
| 11 | + |
| 12 | +parserOptions: |
| 13 | + sourceType: script |
| 14 | + |
| 15 | +overrides: |
| 16 | + - files: ["doc/api/esm.md", "*.mjs", "test/es-module/test-esm-example-loader.js"] |
| 17 | + parserOptions: |
| 18 | + sourceType: module |
| 19 | + |
| 20 | +rules: |
| 21 | + # Possible Errors |
| 22 | + # http://eslint.org/docs/rules/#possible-errors |
| 23 | + for-direction: error |
| 24 | + no-control-regex: error |
| 25 | + no-debugger: error |
| 26 | + no-dupe-args: error |
| 27 | + no-dupe-keys: error |
| 28 | + no-duplicate-case: error |
| 29 | + no-empty-character-class: error |
| 30 | + no-ex-assign: error |
| 31 | + no-extra-boolean-cast: error |
| 32 | + no-extra-parens: [error, functions] |
| 33 | + no-extra-semi: error |
| 34 | + no-func-assign: error |
| 35 | + no-invalid-regexp: error |
| 36 | + no-irregular-whitespace: error |
| 37 | + no-obj-calls: error |
| 38 | + no-template-curly-in-string: error |
| 39 | + no-unexpected-multiline: error |
| 40 | + no-unreachable: error |
| 41 | + no-unsafe-negation: error |
| 42 | + use-isnan: error |
| 43 | + valid-typeof: error |
| 44 | + |
| 45 | + # Best Practices |
| 46 | + # http://eslint.org/docs/rules/#best-practices |
| 47 | + accessor-pairs: error |
| 48 | + array-callback-return: error |
| 49 | + dot-location: [error, property] |
| 50 | + eqeqeq: [error, smart] |
| 51 | + no-fallthrough: error |
| 52 | + no-global-assign: error |
| 53 | + no-multi-spaces: [error, {ignoreEOLComments: true}] |
| 54 | + no-octal: error |
| 55 | + no-proto: error |
| 56 | + no-redeclare: error |
| 57 | + no-restricted-properties: |
| 58 | + - error |
| 59 | + - object: assert |
| 60 | + property: deepEqual |
| 61 | + message: Use assert.deepStrictEqual(). |
| 62 | + - object: assert |
| 63 | + property: notDeepEqual |
| 64 | + message: Use assert.notDeepStrictEqual(). |
| 65 | + - object: assert |
| 66 | + property: equal |
| 67 | + message: Use assert.strictEqual() rather than assert.equal(). |
| 68 | + - object: assert |
| 69 | + property: notEqual |
| 70 | + message: Use assert.notStrictEqual() rather than assert.notEqual(). |
| 71 | + - property: __defineGetter__ |
| 72 | + message: __defineGetter__ is deprecated. |
| 73 | + - property: __defineSetter__ |
| 74 | + message: __defineSetter__ is deprecated. |
| 75 | + no-return-await: error |
| 76 | + no-self-assign: error |
| 77 | + no-throw-literal: error |
| 78 | + no-unused-labels: error |
| 79 | + no-useless-call: error |
| 80 | + no-useless-concat: error |
| 81 | + no-useless-escape: error |
| 82 | + no-useless-return: error |
| 83 | + no-void: error |
| 84 | + no-with: error |
| 85 | + |
| 86 | + # Strict Mode |
| 87 | + # http://eslint.org/docs/rules/#strict-mode |
| 88 | + strict: [error, global] |
| 89 | + |
| 90 | + # Variables |
| 91 | + # http://eslint.org/docs/rules/#variables |
| 92 | + no-delete-var: error |
| 93 | + no-undef: error |
| 94 | + no-unused-vars: [error, {args: none}] |
| 95 | + no-use-before-define: [error, {classes: true, |
| 96 | + functions: false, |
| 97 | + variables: false}] |
| 98 | + |
| 99 | + # Node.js and CommonJS |
| 100 | + # http://eslint.org/docs/rules/#nodejs-and-commonjs |
| 101 | + no-mixed-requires: error |
| 102 | + no-new-require: error |
| 103 | + no-path-concat: error |
| 104 | + no-restricted-modules: [error, sys] |
| 105 | + |
| 106 | + # Stylistic Issues |
| 107 | + # http://eslint.org/docs/rules/#stylistic-issues |
| 108 | + block-spacing: error |
| 109 | + brace-style: [error, 1tbs, {allowSingleLine: true}] |
| 110 | + comma-dangle: [error, only-multiline] |
| 111 | + comma-spacing: error |
| 112 | + comma-style: error |
| 113 | + computed-property-spacing: error |
| 114 | + eol-last: error |
| 115 | + func-call-spacing: error |
| 116 | + func-name-matching: error |
| 117 | + func-style: [error, declaration, {allowArrowFunctions: true}] |
| 118 | + indent: [error, 2, {ArrayExpression: first, |
| 119 | + CallExpression: {arguments: first}, |
| 120 | + FunctionDeclaration: {parameters: first}, |
| 121 | + FunctionExpression: {parameters: first}, |
| 122 | + MemberExpression: off, |
| 123 | + ObjectExpression: first, |
| 124 | + SwitchCase: 1}] |
| 125 | + key-spacing: [error, {mode: minimum}] |
| 126 | + keyword-spacing: error |
| 127 | + linebreak-style: [error, unix] |
| 128 | + max-len: [error, {code: 80, |
| 129 | + ignorePattern: "^\/\/ Flags:", |
| 130 | + ignoreRegExpLiterals: true, |
| 131 | + ignoreUrls: true, |
| 132 | + tabWidth: 2}] |
| 133 | + new-parens: error |
| 134 | + no-lonely-if: error |
| 135 | + no-mixed-spaces-and-tabs: error |
| 136 | + no-multiple-empty-lines: [error, {max: 2, maxEOF: 0, maxBOF: 0}] |
| 137 | + no-restricted-syntax: [error, { |
| 138 | + selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])", |
| 139 | + message: "use a regular expression for second argument of assert.throws()" |
| 140 | + }, { |
| 141 | + selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]", |
| 142 | + message: "assert.throws() must be invoked with at least two arguments." |
| 143 | + }, { |
| 144 | + selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]", |
| 145 | + message: "setTimeout() must be invoked with at least two arguments." |
| 146 | + }, { |
| 147 | + selector: "CallExpression[callee.name='setInterval'][arguments.length<2]", |
| 148 | + message: "setInterval() must be invoked with at least 2 arguments." |
| 149 | + }, { |
| 150 | + selector: "ThrowStatement > CallExpression[callee.name=/Error$/]", |
| 151 | + message: "Use new keyword when throwing an Error." |
| 152 | + }] |
| 153 | + no-tabs: error |
| 154 | + no-trailing-spaces: error |
| 155 | + object-curly-spacing: [error, always] |
| 156 | + one-var-declaration-per-line: error |
| 157 | + operator-linebreak: [error, after] |
| 158 | + quotes: [error, single, avoid-escape] |
| 159 | + semi: error |
| 160 | + semi-spacing: error |
| 161 | + space-before-blocks: [error, always] |
| 162 | + space-before-function-paren: [error, { |
| 163 | + anonymous: never, |
| 164 | + named: never, |
| 165 | + asyncArrow: always |
| 166 | + }] |
| 167 | + space-in-parens: [error, never] |
| 168 | + space-infix-ops: error |
| 169 | + space-unary-ops: error |
| 170 | + unicode-bom: error |
| 171 | + |
| 172 | + # ECMAScript 6 |
| 173 | + # http://eslint.org/docs/rules/#ecmascript-6 |
| 174 | + arrow-parens: [error, always] |
| 175 | + arrow-spacing: [error, {before: true, after: true}] |
| 176 | + constructor-super: error |
| 177 | + no-class-assign: error |
| 178 | + no-confusing-arrow: error |
| 179 | + no-const-assign: error |
| 180 | + no-dupe-class-members: error |
| 181 | + no-new-symbol: error |
| 182 | + no-this-before-super: error |
| 183 | + prefer-const: [error, {ignoreReadBeforeAssign: true}] |
| 184 | + rest-spread-spacing: error |
| 185 | + symbol-description: error |
| 186 | + template-curly-spacing: error |
| 187 | + |
| 188 | + # Custom rules in tools/eslint-rules |
| 189 | + no-unescaped-regexp-dot: error |
| 190 | + |
| 191 | +# Global scoped method and vars |
| 192 | +globals: |
| 193 | + COUNTER_HTTP_CLIENT_REQUEST: false |
| 194 | + COUNTER_HTTP_CLIENT_RESPONSE: false |
| 195 | + COUNTER_HTTP_SERVER_REQUEST: false |
| 196 | + COUNTER_HTTP_SERVER_RESPONSE: false |
| 197 | + COUNTER_NET_SERVER_CONNECTION: false |
| 198 | + COUNTER_NET_SERVER_CONNECTION_CLOSE: false |
| 199 | + DTRACE_HTTP_CLIENT_REQUEST: false |
| 200 | + DTRACE_HTTP_CLIENT_RESPONSE: false |
| 201 | + DTRACE_HTTP_SERVER_REQUEST: false |
| 202 | + DTRACE_HTTP_SERVER_RESPONSE: false |
| 203 | + DTRACE_NET_SERVER_CONNECTION: false |
| 204 | + DTRACE_NET_STREAM_END: false |
| 205 | + LTTNG_HTTP_CLIENT_REQUEST: false |
| 206 | + LTTNG_HTTP_CLIENT_RESPONSE: false |
| 207 | + LTTNG_HTTP_SERVER_REQUEST: false |
| 208 | + LTTNG_HTTP_SERVER_RESPONSE: false |
| 209 | + LTTNG_NET_SERVER_CONNECTION: false |
| 210 | + LTTNG_NET_STREAM_END: false |
| 211 | + internalBinding: false |
0 commit comments