2017-04-21 16:43:49 +02:00
|
|
|
root: true
|
|
|
|
|
2017-04-21 21:55:51 +02:00
|
|
|
plugins:
|
|
|
|
- markdown
|
|
|
|
|
2015-04-28 19:03:05 +02:00
|
|
|
env:
|
|
|
|
node: true
|
2016-02-13 22:57:34 +01:00
|
|
|
es6: true
|
2015-04-28 19:03:05 +02:00
|
|
|
|
2016-10-21 09:40:18 +02:00
|
|
|
parserOptions:
|
2017-02-07 10:41:49 +01:00
|
|
|
ecmaVersion: 2017
|
2016-10-21 09:40:18 +02:00
|
|
|
|
2015-04-28 19:03:05 +02:00
|
|
|
rules:
|
|
|
|
# Possible Errors
|
2016-03-03 22:45:08 +01:00
|
|
|
# http://eslint.org/docs/rules/#possible-errors
|
2017-07-03 18:51:45 +02:00
|
|
|
no-control-regex: error
|
|
|
|
no-debugger: error
|
|
|
|
no-dupe-args: error
|
|
|
|
no-dupe-keys: error
|
|
|
|
no-duplicate-case: error
|
|
|
|
no-empty-character-class: error
|
|
|
|
no-ex-assign: error
|
|
|
|
no-extra-boolean-cast: error
|
|
|
|
no-extra-parens: [error, functions]
|
|
|
|
no-extra-semi: error
|
|
|
|
no-func-assign: error
|
|
|
|
no-invalid-regexp: error
|
|
|
|
no-irregular-whitespace: error
|
|
|
|
no-obj-calls: error
|
|
|
|
no-template-curly-in-string: error
|
|
|
|
no-unexpected-multiline: error
|
|
|
|
no-unreachable: error
|
|
|
|
no-unsafe-negation: error
|
|
|
|
use-isnan: error
|
|
|
|
valid-typeof: error
|
2015-04-28 19:03:05 +02:00
|
|
|
|
|
|
|
# Best Practices
|
2016-03-03 22:45:08 +01:00
|
|
|
# http://eslint.org/docs/rules/#best-practices
|
2017-07-03 18:51:45 +02:00
|
|
|
dot-location: [error, property]
|
|
|
|
eqeqeq: [error, smart]
|
|
|
|
no-fallthrough: error
|
|
|
|
no-global-assign: error
|
|
|
|
no-multi-spaces: [error, {ignoreEOLComments: true}]
|
|
|
|
no-octal: error
|
|
|
|
no-proto: error
|
|
|
|
no-redeclare: error
|
2017-06-01 09:57:06 +02:00
|
|
|
no-restricted-properties:
|
2017-07-03 18:51:45 +02:00
|
|
|
- error
|
2017-06-01 09:57:06 +02:00
|
|
|
- object: assert
|
|
|
|
property: deepEqual
|
|
|
|
message: Use assert.deepStrictEqual().
|
|
|
|
- object: assert
|
|
|
|
property: equal
|
|
|
|
message: Use assert.strictEqual() rather than assert.equal().
|
|
|
|
- object: assert
|
|
|
|
property: notEqual
|
|
|
|
message: Use assert.notStrictEqual() rather than assert.notEqual().
|
|
|
|
- property: __defineGetter__
|
|
|
|
message: __defineGetter__ is deprecated.
|
|
|
|
- property: __defineSetter__
|
|
|
|
message: __defineSetter__ is deprecated.
|
2017-07-03 18:51:45 +02:00
|
|
|
no-self-assign: error
|
|
|
|
no-throw-literal: error
|
|
|
|
no-unused-labels: error
|
|
|
|
no-useless-call: error
|
|
|
|
no-useless-concat: error
|
|
|
|
no-useless-escape: error
|
|
|
|
no-useless-return: error
|
|
|
|
no-void: error
|
|
|
|
no-with: error
|
2015-04-28 19:03:05 +02:00
|
|
|
|
2016-03-03 22:45:08 +01:00
|
|
|
# Strict Mode
|
|
|
|
# http://eslint.org/docs/rules/#strict-mode
|
2017-07-03 18:51:45 +02:00
|
|
|
strict: [error, global]
|
2016-03-03 22:45:08 +01:00
|
|
|
|
2016-02-19 08:01:06 +01:00
|
|
|
# Variables
|
|
|
|
# http://eslint.org/docs/rules/#variables
|
2017-07-03 18:51:45 +02:00
|
|
|
no-delete-var: error
|
|
|
|
no-undef: error
|
|
|
|
no-unused-vars: [error, {args: none}]
|
|
|
|
no-use-before-define: [error, {classes: true,
|
|
|
|
functions: false,
|
|
|
|
variables: false}]
|
2016-02-19 08:01:06 +01:00
|
|
|
|
|
|
|
# Node.js and CommonJS
|
|
|
|
# http://eslint.org/docs/rules/#nodejs-and-commonjs
|
2017-07-03 18:51:45 +02:00
|
|
|
no-mixed-requires: error
|
|
|
|
no-new-require: error
|
|
|
|
no-path-concat: error
|
|
|
|
no-restricted-modules: [error, sys]
|
2016-02-19 08:01:06 +01:00
|
|
|
|
2015-04-28 19:03:05 +02:00
|
|
|
# Stylistic Issues
|
2016-03-03 22:45:08 +01:00
|
|
|
# http://eslint.org/docs/rules/#stylistic-issues
|
2017-07-03 18:51:45 +02:00
|
|
|
block-spacing: error
|
|
|
|
brace-style: [error, 1tbs, {allowSingleLine: true}]
|
|
|
|
comma-dangle: [error, only-multiline]
|
|
|
|
comma-spacing: error
|
|
|
|
comma-style: error
|
|
|
|
computed-property-spacing: error
|
|
|
|
eol-last: error
|
|
|
|
func-call-spacing: error
|
|
|
|
func-name-matching: error
|
|
|
|
func-style: [error, declaration, {allowArrowFunctions: true}]
|
2017-07-27 18:29:15 +02:00
|
|
|
indent: [error, 2, {ArrayExpression: first,
|
|
|
|
CallExpression: {arguments: first},
|
|
|
|
FunctionDeclaration: {parameters: first},
|
|
|
|
FunctionExpression: {parameters: first},
|
|
|
|
MemberExpression: off,
|
|
|
|
ObjectExpression: first,
|
|
|
|
SwitchCase: 1}]
|
2017-07-03 18:51:45 +02:00
|
|
|
key-spacing: [error, {mode: minimum}]
|
|
|
|
keyword-spacing: error
|
|
|
|
linebreak-style: [error, unix]
|
|
|
|
max-len: [error, {code: 80,
|
2017-05-03 07:01:57 +02:00
|
|
|
ignoreRegExpLiterals: true,
|
|
|
|
ignoreUrls: true,
|
|
|
|
tabWidth: 2}]
|
2017-07-03 18:51:45 +02:00
|
|
|
new-parens: error
|
|
|
|
no-mixed-spaces-and-tabs: error
|
|
|
|
no-multiple-empty-lines: [error, {max: 2, maxEOF: 0, maxBOF: 0}]
|
|
|
|
no-restricted-syntax: [error, {
|
2017-07-30 22:46:34 +02:00
|
|
|
selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])",
|
|
|
|
message: "use a regular expression for second argument of assert.throws()"
|
|
|
|
}, {
|
|
|
|
selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]",
|
|
|
|
message: "assert.throws() must be invoked with at least two arguments."
|
|
|
|
}, {
|
2017-04-02 08:06:31 +02:00
|
|
|
selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
|
|
|
|
message: "setTimeout() must be invoked with at least two arguments."
|
|
|
|
}, {
|
|
|
|
selector: "CallExpression[callee.name='setInterval'][arguments.length<2]",
|
2017-04-06 04:11:48 +02:00
|
|
|
message: "setInterval() must be invoked with at least 2 arguments."
|
|
|
|
}, {
|
|
|
|
selector: "ThrowStatement > CallExpression[callee.name=/Error$/]",
|
|
|
|
message: "Use new keyword when throwing an Error."
|
2017-06-13 05:46:27 +02:00
|
|
|
}]
|
2017-07-03 18:51:45 +02:00
|
|
|
no-tabs: error
|
|
|
|
no-trailing-spaces: error
|
2017-07-11 02:54:06 +02:00
|
|
|
object-curly-spacing: [error, always]
|
2017-07-03 18:51:45 +02:00
|
|
|
one-var-declaration-per-line: error
|
|
|
|
operator-linebreak: [error, after]
|
|
|
|
quotes: [error, single, avoid-escape]
|
|
|
|
semi: error
|
|
|
|
semi-spacing: error
|
|
|
|
space-before-blocks: [error, always]
|
|
|
|
space-before-function-paren: [error, {
|
2017-07-11 02:54:06 +02:00
|
|
|
anonymous: never,
|
|
|
|
named: never,
|
|
|
|
asyncArrow: always
|
2017-06-13 05:46:27 +02:00
|
|
|
}]
|
2017-07-03 18:51:45 +02:00
|
|
|
space-in-parens: [error, never]
|
|
|
|
space-infix-ops: error
|
|
|
|
space-unary-ops: error
|
|
|
|
unicode-bom: error
|
2015-04-28 19:03:05 +02:00
|
|
|
|
2015-10-08 19:40:10 +02:00
|
|
|
# ECMAScript 6
|
2016-02-09 05:23:42 +01:00
|
|
|
# http://eslint.org/docs/rules/#ecmascript-6
|
2017-07-03 18:51:45 +02:00
|
|
|
arrow-parens: [error, always]
|
|
|
|
arrow-spacing: [error, {before: true, after: true}]
|
|
|
|
constructor-super: error
|
|
|
|
no-class-assign: error
|
|
|
|
no-confusing-arrow: error
|
|
|
|
no-const-assign: error
|
|
|
|
no-dupe-class-members: error
|
|
|
|
no-new-symbol: error
|
|
|
|
no-this-before-super: error
|
|
|
|
prefer-const: [error, {ignoreReadBeforeAssign: true}]
|
|
|
|
rest-spread-spacing: error
|
|
|
|
template-curly-spacing: error
|
2015-10-08 19:40:10 +02:00
|
|
|
|
2015-06-11 19:08:25 +02:00
|
|
|
# Custom rules in tools/eslint-rules
|
2017-07-03 18:51:45 +02:00
|
|
|
no-unescaped-regexp-dot: error
|
2015-04-28 19:03:05 +02:00
|
|
|
|
|
|
|
# Global scoped method and vars
|
2015-05-11 14:24:38 +02:00
|
|
|
globals:
|
2016-07-13 00:09:41 +02:00
|
|
|
COUNTER_HTTP_CLIENT_REQUEST: false
|
|
|
|
COUNTER_HTTP_CLIENT_RESPONSE: false
|
|
|
|
COUNTER_HTTP_SERVER_REQUEST: false
|
|
|
|
COUNTER_HTTP_SERVER_RESPONSE: false
|
|
|
|
COUNTER_NET_SERVER_CONNECTION: false
|
|
|
|
COUNTER_NET_SERVER_CONNECTION_CLOSE: false
|
|
|
|
DTRACE_HTTP_CLIENT_REQUEST: false
|
|
|
|
DTRACE_HTTP_CLIENT_RESPONSE: false
|
|
|
|
DTRACE_HTTP_SERVER_REQUEST: false
|
|
|
|
DTRACE_HTTP_SERVER_RESPONSE: false
|
|
|
|
DTRACE_NET_SERVER_CONNECTION: false
|
|
|
|
DTRACE_NET_STREAM_END: false
|
|
|
|
LTTNG_HTTP_CLIENT_REQUEST: false
|
|
|
|
LTTNG_HTTP_CLIENT_RESPONSE: false
|
|
|
|
LTTNG_HTTP_SERVER_REQUEST: false
|
|
|
|
LTTNG_HTTP_SERVER_RESPONSE: false
|
|
|
|
LTTNG_NET_SERVER_CONNECTION: false
|
|
|
|
LTTNG_NET_STREAM_END: false
|