2020-03-19 13:47:51 +00: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 07:38:10 +00:00
|
|
|
"use strict";
|
|
|
|
|
2017-03-07 18:15:49 +00:00
|
|
|
module.exports = {
|
2016-01-24 10:35:36 +00:00
|
|
|
rules: {
|
2017-01-14 05:18:03 +00: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 17:59:03 +00:00
|
|
|
// Disallow use of alert(), confirm(), and prompt().
|
2016-11-08 20:14:19 +00:00
|
|
|
"no-alert": "error",
|
2016-07-05 17:59:03 +00:00
|
|
|
|
2017-01-14 05:18:03 +00:00
|
|
|
// Disallow likely erroneous `switch` scoped lexical declarations in
|
|
|
|
// case/default clauses.
|
|
|
|
"no-case-declarations": "error",
|
|
|
|
|
2016-07-05 17:59:03 +00:00
|
|
|
// Disallow use of the console API.
|
2016-11-08 20:14:19 +00:00
|
|
|
"no-console": "error",
|
2016-07-05 17:59:03 +00:00
|
|
|
|
2017-01-14 05:18:03 +00: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 16:43:05 +00:00
|
|
|
// No reassigning native JS objects or read only globals.
|
|
|
|
"no-global-assign": "error",
|
|
|
|
|
2016-07-05 17:59:03 +00:00
|
|
|
// Disallow use of assignment in return statement.
|
2016-11-08 20:14:19 +00:00
|
|
|
"no-return-assign": ["error", "always"],
|
2016-07-05 17:59:03 +00:00
|
|
|
|
2016-12-20 16:43:17 +00:00
|
|
|
// Disallow template literal placeholder syntax in regular strings.
|
|
|
|
"no-template-curly-in-string": "error",
|
|
|
|
|
2017-01-14 05:18:03 +00: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 10:35:36 +00:00
|
|
|
// No expressions where a statement is expected
|
2016-11-08 20:14:19 +00:00
|
|
|
"no-unused-expressions": "error",
|
2016-01-24 10:35:36 +00:00
|
|
|
|
2017-01-14 05:18:03 +00:00
|
|
|
// Disallow unnecessary escape usage in strings and regular expressions.
|
|
|
|
"no-useless-escape": "error",
|
|
|
|
|
2016-03-19 10:07:13 +00:00
|
|
|
// Require "use strict" to be defined globally in the script.
|
2016-11-08 20:14:19 +00:00
|
|
|
strict: ["error", "global"],
|
2016-03-19 10:07:13 +00:00
|
|
|
|
2017-01-14 05:18:03 +00:00
|
|
|
// Enforce valid JSDoc comments.
|
|
|
|
"valid-jsdoc": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
requireParamDescription: false,
|
|
|
|
requireReturn: false,
|
|
|
|
requireReturnDescription: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
// Disallow Yoda conditions.
|
|
|
|
yoda: ["error", "never"],
|
2016-01-24 10:35:36 +00:00
|
|
|
},
|
2016-10-18 07:38:10 +00:00
|
|
|
};
|