зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1246594 - Enable ESLint rule no-throw-literal by default. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D24088 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
244c79d92a
Коммит
167f623a3e
55
.eslintrc.js
55
.eslintrc.js
|
@ -52,5 +52,60 @@ module.exports = {
|
|||
"rules": {
|
||||
"no-undef": "off",
|
||||
}
|
||||
}, {
|
||||
// TODO: Bug 1246594. Empty this list once the rule has landed for all dirs
|
||||
"files": [
|
||||
"accessible/tests/mochitest/events.js",
|
||||
"browser/actors/ContextMenuChild.jsm",
|
||||
"browser/base/content/**",
|
||||
"browser/components/customizableui/**",
|
||||
"browser/components/enterprisepolicies/Policies.jsm",
|
||||
"browser/components/places/content/**",
|
||||
"browser/components/preferences/**",
|
||||
"browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js",
|
||||
"browser/components/urlbar/tests/browser/head-common.js",
|
||||
"browser/extensions/fxmonitor/privileged/FirefoxMonitor.jsm",
|
||||
"browser/modules/**",
|
||||
"browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm",
|
||||
"docshell/test/chrome/docshell_helpers.js",
|
||||
"docshell/test/navigation/NavigationUtils.js",
|
||||
"dom/asmjscache/test/**",
|
||||
"dom/cache/test/mochitest/test_cache_tons_of_fd.html",
|
||||
"dom/crypto/test/**",
|
||||
"dom/indexedDB/test/**",
|
||||
"dom/localstorage/test/unit/test_migration.js",
|
||||
"dom/plugins/test/mochitest/head.js",
|
||||
"gfx/layers/apz/test/mochitest/**",
|
||||
"mobile/android/components/**",
|
||||
"mobile/android/modules/**",
|
||||
"modules/libmar/tests/unit/head_libmar.js",
|
||||
"netwerk/protocol/http/WellKnownOpportunisticUtils.jsm",
|
||||
"netwerk/test/httpserver/httpd.js",
|
||||
"netwerk/test/httpserver/test/**",
|
||||
"parser/htmlparser/tests/mochitest/parser_datreader.js",
|
||||
"testing/marionette/event.js",
|
||||
"testing/mochitest/**",
|
||||
"testing/modules/tests/xpcshell/test_assert.js",
|
||||
"testing/specialpowers/content/specialpowersAPI.js",
|
||||
"testing/talos/talos/**",
|
||||
"toolkit/components/aboutmemory/content/aboutMemory.js",
|
||||
"toolkit/components/captivedetect/test/unit/test_multiple_requests.js",
|
||||
"toolkit/components/cleardata/ServiceWorkerCleanUp.jsm",
|
||||
"toolkit/components/ctypes/**",
|
||||
"toolkit/components/downloads/**",
|
||||
"toolkit/components/places/tests/**",
|
||||
"toolkit/components/processsingleton/MainProcessSingleton.jsm",
|
||||
"toolkit/components/prompts/**",
|
||||
"toolkit/components/search/SearchService.jsm",
|
||||
"toolkit/components/telemetry/app/TelemetryEnvironment.jsm",
|
||||
"toolkit/content/**",
|
||||
"toolkit/modules/**",
|
||||
"toolkit/mozapps/**",
|
||||
"tools/leak-gauge/leak-gauge.html",
|
||||
"xpcom/tests/unit/test_iniParser.js",
|
||||
],
|
||||
"rules": {
|
||||
"no-throw-literal": "off",
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
|
|
@ -57,7 +57,6 @@ module.exports = {
|
|||
"no-shadow": "error",
|
||||
"no-sync": "off",
|
||||
"no-ternary": "off",
|
||||
"no-throw-literal": "error",
|
||||
"no-underscore-dangle": "off",
|
||||
"no-undefined": "off",
|
||||
"no-unused-vars": ["error", {"vars": "all", "args": "none"}],
|
||||
|
|
|
@ -12,7 +12,6 @@ module.exports = {
|
|||
"no-multi-str": "error",
|
||||
"no-return-assign": "error",
|
||||
"no-shadow": "error",
|
||||
"no-throw-literal": "error",
|
||||
"no-unused-vars": ["error", { "args": "after-used", "vars": "all" }],
|
||||
"semi-spacing": ["error", {"before": false, "after": true}],
|
||||
"space-in-parens": ["error", "never"],
|
||||
|
|
|
@ -185,7 +185,6 @@ module.exports = {
|
|||
"no-sync": 0,
|
||||
"no-template-curly-in-string": 2,
|
||||
"no-ternary": 0,
|
||||
"no-throw-literal": 2,
|
||||
"no-undef-init": 2,
|
||||
"no-undefined": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
|
|
|
@ -51,7 +51,6 @@ module.exports = {
|
|||
max: 2,
|
||||
}],
|
||||
"no-proto": "error",
|
||||
"no-throw-literal": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-unused-vars": ["error", {
|
||||
args: "none",
|
||||
|
|
|
@ -88,10 +88,6 @@ module.exports = {
|
|||
// single line of code to have only one easily predictable effect.
|
||||
"no-return-assign": "error",
|
||||
|
||||
// Disallow throwing literals (eg. throw "error" instead of
|
||||
// throw new Error("error")).
|
||||
"no-throw-literal": "error",
|
||||
|
||||
// Require use of the second argument for parseInt().
|
||||
"radix": "error",
|
||||
|
||||
|
|
|
@ -83,10 +83,6 @@ module.exports = {
|
|||
// single line of code to have only one easily predictable effect.
|
||||
"no-return-assign": "error",
|
||||
|
||||
// Disallow throwing literals (eg. throw "error" instead of
|
||||
// throw new Error("error")).
|
||||
"no-throw-literal": "error",
|
||||
|
||||
// Require use of the second argument for parseInt().
|
||||
"radix": "error",
|
||||
|
||||
|
|
|
@ -330,9 +330,6 @@ module.exports = {
|
|||
"no-sync": "off",
|
||||
// Allow the use of ternary operators.
|
||||
"no-ternary": "off",
|
||||
// Disallow throwing literals (eg. throw "error" instead of
|
||||
// throw new Error("error")).
|
||||
"no-throw-literal": "error",
|
||||
// Allow dangling underscores in identifiers (for privates).
|
||||
"no-underscore-dangle": "off",
|
||||
// Allow use of undefined variable.
|
||||
|
|
|
@ -83,10 +83,6 @@ module.exports = {
|
|||
// single line of code to have only one easily predictable effect.
|
||||
"no-return-assign": "error",
|
||||
|
||||
// Disallow throwing literals (eg. throw "error" instead of
|
||||
// throw new Error("error")).
|
||||
"no-throw-literal": "error",
|
||||
|
||||
// Require use of the second argument for parseInt().
|
||||
"radix": "error",
|
||||
|
||||
|
|
|
@ -52,10 +52,6 @@ module.exports = {
|
|||
// Disallow use of this/super before calling super() in constructors.
|
||||
"no-this-before-super": "error",
|
||||
|
||||
// Disallow throwing literals (eg. |throw "error"| instead of
|
||||
// |throw new Error("error")|)
|
||||
"no-throw-literal": "error",
|
||||
|
||||
// Disallow unmodified loop conditions.
|
||||
"no-unmodified-loop-condition": "error",
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
"mozilla"
|
||||
],
|
||||
"rules": {
|
||||
"no-throw-literal": 2,
|
||||
},
|
||||
}
|
|
@ -57,10 +57,6 @@ module.exports = {
|
|||
// Disallow use of this/super before calling super() in constructors.
|
||||
"no-this-before-super": "error",
|
||||
|
||||
// Disallow throwing literals (eg. |throw "error"| instead of
|
||||
// |throw new Error("error")|)
|
||||
"no-throw-literal": "error",
|
||||
|
||||
// Disallow unmodified loop conditions.
|
||||
"no-unmodified-loop-condition": "error",
|
||||
|
||||
|
|
|
@ -229,10 +229,6 @@ module.exports = {
|
|||
// Allow the use of ternary operators.
|
||||
"no-ternary": "off",
|
||||
|
||||
// Disallow throwing literals (eg. throw "error" instead of
|
||||
// throw new Error("error")).
|
||||
"no-throw-literal": "error",
|
||||
|
||||
// Allow dangling underscores in identifiers (for privates).
|
||||
"no-underscore-dangle": "off",
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ module.exports = {
|
|||
"no-multiple-empty-lines": ["error", {"max": 1}],
|
||||
"no-return-assign": "error",
|
||||
"no-shadow": "error",
|
||||
"no-throw-literal": "error",
|
||||
"quotes": ["error", "double", "avoid-escape"],
|
||||
"semi-spacing": ["error", {"before": false, "after": true}],
|
||||
"space-in-parens": ["error", "never"],
|
||||
|
|
|
@ -37,7 +37,6 @@ module.exports = {
|
|||
max: 2,
|
||||
}],
|
||||
"no-proto": "error",
|
||||
"no-throw-literal": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-unused-vars": ["error", {
|
||||
args: "none",
|
||||
|
|
|
@ -286,6 +286,10 @@ module.exports = {
|
|||
// Disallow tabs.
|
||||
"no-tabs": "error",
|
||||
|
||||
// Disallow throwing literals (eg. throw "error" instead of
|
||||
// throw new Error("error")).
|
||||
"no-throw-literal": "error",
|
||||
|
||||
// No trailing whitespace
|
||||
"no-trailing-spaces": "error",
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "eslint-plugin-mozilla",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "eslint-plugin-mozilla",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
|
|
Загрузка…
Ссылка в новой задаче