2020-03-19 16:47:51 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2016-10-18 10:38:10 +03:00
|
|
|
"use strict";
|
|
|
|
|
2017-03-07 21:15:49 +03:00
|
|
|
module.exports = {
|
2016-01-24 13:35:36 +03:00
|
|
|
rules: {
|
2017-01-14 08:18:03 +03:00
|
|
|
// Enforce return statements in callbacks of array methods.
|
|
|
|
"array-callback-return": "error",
|
|
|
|
|
|
|
|
// Verify calls of super() in constructors.
|
|
|
|
"constructor-super": "error",
|
|
|
|
|
|
|
|
// Require default case in switch statements.
|
|
|
|
"default-case": "error",
|
|
|
|
|
2016-07-05 20:59:03 +03:00
|
|
|
// Disallow use of alert(), confirm(), and prompt().
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-alert": "error",
|
2016-07-05 20:59:03 +03:00
|
|
|
|
2017-01-14 08:18:03 +03:00
|
|
|
// Disallow likely erroneous `switch` scoped lexical declarations in
|
|
|
|
// case/default clauses.
|
|
|
|
"no-case-declarations": "error",
|
|
|
|
|
2016-07-05 20:59:03 +03:00
|
|
|
// Disallow use of the console API.
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-console": "error",
|
2016-07-05 20:59:03 +03:00
|
|
|
|
2017-01-14 08:18:03 +03:00
|
|
|
// Disallow constant expressions in conditions (except for loops).
|
|
|
|
"no-constant-condition": ["error", { checkLoops: false }],
|
|
|
|
|
|
|
|
// Disallow extending of native objects.
|
|
|
|
"no-extend-native": "error",
|
|
|
|
|
|
|
|
// Disallow case statement fallthrough without explicit `// falls through`
|
|
|
|
// annotation.
|
|
|
|
"no-fallthrough": "error",
|
|
|
|
|
2016-12-20 19:43:05 +03:00
|
|
|
// No reassigning native JS objects or read only globals.
|
|
|
|
"no-global-assign": "error",
|
|
|
|
|
2016-07-05 20:59:03 +03:00
|
|
|
// Disallow use of assignment in return statement.
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-return-assign": ["error", "always"],
|
2016-07-05 20:59:03 +03:00
|
|
|
|
2016-12-20 19:43:17 +03:00
|
|
|
// Disallow template literal placeholder syntax in regular strings.
|
|
|
|
"no-template-curly-in-string": "error",
|
|
|
|
|
2017-01-14 08:18:03 +03:00
|
|
|
// Disallow use of this/super before calling super() in constructors.
|
|
|
|
"no-this-before-super": "error",
|
|
|
|
|
|
|
|
// Disallow unmodified loop conditions.
|
|
|
|
"no-unmodified-loop-condition": "error",
|
|
|
|
|
2016-01-24 13:35:36 +03:00
|
|
|
// No expressions where a statement is expected
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-unused-expressions": "error",
|
2016-01-24 13:35:36 +03:00
|
|
|
|
2017-01-14 08:18:03 +03:00
|
|
|
// Disallow unnecessary escape usage in strings and regular expressions.
|
|
|
|
"no-useless-escape": "error",
|
|
|
|
|
2016-03-19 13:07:13 +03:00
|
|
|
// Require "use strict" to be defined globally in the script.
|
2016-11-08 23:14:19 +03:00
|
|
|
strict: ["error", "global"],
|
2016-03-19 13:07:13 +03:00
|
|
|
|
2017-01-14 08:18:03 +03:00
|
|
|
// Enforce valid JSDoc comments.
|
|
|
|
"valid-jsdoc": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
requireParamDescription: false,
|
|
|
|
requireReturn: false,
|
|
|
|
requireReturnDescription: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
// Disallow Yoda conditions.
|
|
|
|
yoda: ["error", "never"],
|
2016-01-24 13:35:36 +03:00
|
|
|
},
|
2016-10-18 10:38:10 +03:00
|
|
|
};
|