зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1158112 - Move the Loop modules into a sub-directory and prepare eslint for enabling more rules for Loop. r=dmose
--HG-- rename : browser/components/loop/CardDavImporter.jsm => browser/components/loop/modules/CardDavImporter.jsm rename : browser/components/loop/GoogleImporter.jsm => browser/components/loop/modules/GoogleImporter.jsm rename : browser/components/loop/LoopCalls.jsm => browser/components/loop/modules/LoopCalls.jsm rename : browser/components/loop/LoopContacts.jsm => browser/components/loop/modules/LoopContacts.jsm rename : browser/components/loop/LoopRooms.jsm => browser/components/loop/modules/LoopRooms.jsm rename : browser/components/loop/LoopStorage.jsm => browser/components/loop/modules/LoopStorage.jsm rename : browser/components/loop/MozLoopAPI.jsm => browser/components/loop/modules/MozLoopAPI.jsm rename : browser/components/loop/MozLoopPushHandler.jsm => browser/components/loop/modules/MozLoopPushHandler.jsm rename : browser/components/loop/MozLoopService.jsm => browser/components/loop/modules/MozLoopService.jsm rename : browser/components/loop/MozLoopWorker.js => browser/components/loop/modules/MozLoopWorker.js
This commit is contained in:
Родитель
8263d08189
Коммит
64f91f7342
|
@ -1,7 +1,9 @@
|
|||
# We still need to fix warnings in this file.
|
||||
MozLoopWorker.js
|
||||
# This file currently uses es7 features
|
||||
MozLoopAPI.jsm
|
||||
# This file currently uses a non-standard (and not on a standards track)
|
||||
# if statement within catch.
|
||||
modules/MozLoopWorker.js
|
||||
# This file currently uses es7 features eslint issue:
|
||||
# https://github.com/eslint/espree/issues/125
|
||||
modules/MozLoopAPI.jsm
|
||||
# Libs we don't need to check
|
||||
content/libs
|
||||
content/shared/libs
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: there are extra allowances for files used solely in Firefox desktop,
|
||||
// see content/js/.eslintrc and modules/.eslintrc
|
||||
{
|
||||
"plugins": [
|
||||
"react"
|
||||
|
@ -5,18 +7,6 @@
|
|||
"ecmaFeatures": {
|
||||
"forOf": true,
|
||||
"jsx": true,
|
||||
// These are on for this directory for .jsm and content/js files.
|
||||
// If adding more items here, consider turning them off for the following
|
||||
// files if they aren't supported by all browsers.
|
||||
// content/shared/.eslintrc
|
||||
// content/standalone/.eslintrc
|
||||
"blockBindings": true,
|
||||
"arrowFunctions": true,
|
||||
"destructuring": true,
|
||||
"generators": true,
|
||||
"spread": true,
|
||||
"restParams": true,
|
||||
"objectLiteralShorthandMethods": true
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
|
@ -43,49 +33,50 @@
|
|||
// problems they find, one at a time.
|
||||
|
||||
// Eslint built-in rules are documented at <http://eslint.org/docs/rules/>
|
||||
"camelcase": 0,
|
||||
"comma-dangle": 0,
|
||||
"comma-spacing": 0,
|
||||
"consistent-return": 0,
|
||||
"curly": 0,
|
||||
"dot-notation": 0,
|
||||
"eol-last": 0,
|
||||
"eqeqeq": 0,
|
||||
"global-strict": 0,
|
||||
"key-spacing": 0,
|
||||
"new-cap": 0,
|
||||
"no-catch-shadow": 0,
|
||||
"no-console": 0,
|
||||
"no-empty": 0,
|
||||
"no-extra-bind": 0,
|
||||
"no-extra-boolean-cast": 0,
|
||||
"no-extra-semi": 0,
|
||||
"no-multi-spaces": 0,
|
||||
"no-new": 0,
|
||||
"no-redeclare": 0,
|
||||
"no-return-assign": 0,
|
||||
"no-shadow": 0,
|
||||
"no-spaced-func": 0,
|
||||
"no-trailing-spaces": 0,
|
||||
"no-undef": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
"no-unused-expressions": 0,
|
||||
"no-unused-vars": 0,
|
||||
"no-use-before-define": 0,
|
||||
"no-wrap-func": 0,
|
||||
"quotes": 0,
|
||||
"semi": 0,
|
||||
"semi-spacing": 0,
|
||||
"space-infix-ops": 0,
|
||||
"space-return-throw-case": 0,
|
||||
"strict": 0,
|
||||
"yoda": 0,
|
||||
"camelcase": 0, // TODO: Remove (use default)
|
||||
"comma-dangle": 0, // TODO: Remove (use default)
|
||||
"comma-spacing": 0, // TODO: Remove (use default)
|
||||
"consistent-return": 0, // TODO: Remove (use default)
|
||||
"curly": 0, // TODO: Remove (use default)
|
||||
"dot-notation": 0, // TODO: Remove (use default)
|
||||
"eol-last": 0, // TODO: Remove (use default)
|
||||
"eqeqeq": 0, // TBD. Might need to be separate for content & chrome
|
||||
"global-strict": 0, // Leave as zero (this will be unsupported in eslint 1.0.0)
|
||||
"key-spacing": 0, // TODO: Remove (use default)
|
||||
"new-cap": 0, // TODO: Remove (use default)
|
||||
"no-catch-shadow": 0, // TODO: Remove (use default)
|
||||
"no-console": 0, // Leave as 0. We use console logging in content code.
|
||||
"no-empty": 0, // TODO: Remove (use default)
|
||||
"no-extra-bind": 0, // Leave as 0
|
||||
"no-extra-boolean-cast": 0, // TODO: Remove (use default)
|
||||
"no-extra-semi": 0, // TODO: Remove (use default)
|
||||
"no-multi-spaces": 0, // TBD.
|
||||
"no-new": 0, // TODO: Remove (use default)
|
||||
"no-redeclare": 0, // TODO: Remove (use default)
|
||||
"no-return-assign": 0, // TODO: Remove (use default)
|
||||
"no-shadow": 0, // TODO: Remove (use default)
|
||||
"no-spaced-func": 0, // TODO: Remove (use default)
|
||||
"no-trailing-spaces": 0, // TODO: Remove (use default)
|
||||
"no-undef": 0, // TODO: Remove (use default)
|
||||
"no-underscore-dangle": 0, // Leave as 0. Commonly used for private variables.
|
||||
"no-unused-expressions": 0, // TODO: Remove (use default)
|
||||
"no-unused-vars": 0, // TODO: Remove (use default)
|
||||
"no-use-before-define": 0, // TODO: Remove (use default)
|
||||
"no-wrap-func": 0, // TODO: Remove (use default)
|
||||
"quotes": 0, // [2, "double", "avoid-escape"],
|
||||
"semi": 0, // TODO: Remove (use default)
|
||||
"semi-spacing": 0, // TODO: Remove (use default)
|
||||
"space-infix-ops": 0, // TODO: Remove (use default)
|
||||
"space-return-throw-case": 0, // TODO: Remove (use default)
|
||||
"strict": 0, // [2, "function"],
|
||||
"yoda": 0, // [2, "never"],
|
||||
// eslint-plugin-react rules. These are documented at
|
||||
// <https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules>
|
||||
"react/jsx-quotes": [2, "double", "avoid-escape"],
|
||||
"react/jsx-no-undef": 2,
|
||||
// Need to fix instances where this is failing.
|
||||
"react/jsx-sort-props": 0,
|
||||
"react/jsx-sort-prop-types": 0,
|
||||
"react/jsx-uses-vars": 2,
|
||||
// Need to fix the couple of instances which don't
|
||||
// currently pass this rule.
|
||||
|
@ -101,6 +92,7 @@
|
|||
"react/react-in-jsx-scope": 0,
|
||||
// These ones we don't want to ever enable
|
||||
"react/display-name": 0,
|
||||
"react/jsx-boolean-value": 0,
|
||||
"react/no-multi-comp": 0
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"ecmaFeatures": {
|
||||
// These are on for this directory for .jsm and content/js files.
|
||||
"blockBindings": true,
|
||||
"arrowFunctions": true,
|
||||
"destructuring": true,
|
||||
"generators": true,
|
||||
"spread": true,
|
||||
"restParams": true,
|
||||
"objectLiteralShorthandMethods": true
|
||||
},
|
||||
"rules": {
|
||||
"generator-star-spacing": [2, "after"]
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"ecmaFeatures": {
|
||||
// Turn off top-level items needed for the jsm files, but not wanted
|
||||
// for shared code as we can't support them.
|
||||
"blockBindings": false,
|
||||
"arrowFunctions": false,
|
||||
"destructuring": false,
|
||||
"forOf": true,
|
||||
"generators": false,
|
||||
"spread": false,
|
||||
"restParams": false,
|
||||
"objectLiteralShorthandMethods": false
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"ecmaFeatures": {
|
||||
"arrowFunctions": true,
|
||||
"blockBindings": true,
|
||||
"destructuring": true,
|
||||
"generators": true,
|
||||
"restParams": true,
|
||||
"spread": true,
|
||||
"objectLiteralShorthandMethods": true,
|
||||
},
|
||||
"rules": {
|
||||
"generator-star-spacing": [2, "after"],
|
||||
// We should fix the errors and enable this (set to 2)
|
||||
"no-var": 0,
|
||||
"strict": [2, "global"]
|
||||
}
|
||||
}
|
|
@ -13,18 +13,18 @@ BROWSER_CHROME_MANIFESTS += [
|
|||
]
|
||||
|
||||
EXTRA_JS_MODULES.loop += [
|
||||
'CardDavImporter.jsm',
|
||||
'content/shared/js/crypto.js',
|
||||
'content/shared/js/utils.js',
|
||||
'GoogleImporter.jsm',
|
||||
'LoopCalls.jsm',
|
||||
'LoopContacts.jsm',
|
||||
'LoopRooms.jsm',
|
||||
'LoopStorage.jsm',
|
||||
'MozLoopAPI.jsm',
|
||||
'MozLoopPushHandler.jsm',
|
||||
'MozLoopService.jsm',
|
||||
'MozLoopWorker.js',
|
||||
'modules/CardDavImporter.jsm',
|
||||
'modules/GoogleImporter.jsm',
|
||||
'modules/LoopCalls.jsm',
|
||||
'modules/LoopContacts.jsm',
|
||||
'modules/LoopRooms.jsm',
|
||||
'modules/LoopStorage.jsm',
|
||||
'modules/MozLoopAPI.jsm',
|
||||
'modules/MozLoopPushHandler.jsm',
|
||||
'modules/MozLoopService.jsm',
|
||||
'modules/MozLoopWorker.js',
|
||||
]
|
||||
|
||||
with Files('**'):
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"ecmaFeatures": {
|
||||
// Turn off top-level items needed for the jsm files, but not wanted
|
||||
// for shared code as we can't support them.
|
||||
"blockBindings": false,
|
||||
"arrowFunctions": false,
|
||||
"destructuring": false,
|
||||
"forOf": true,
|
||||
"generators": false,
|
||||
"spread": false,
|
||||
"restParams": false,
|
||||
"objectLiteralShorthandMethods": false
|
||||
}
|
||||
}
|
|
@ -12,8 +12,8 @@
|
|||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"eslint": "0.18.x",
|
||||
"eslint-plugin-react": "2.0.x",
|
||||
"eslint": "0.20.x",
|
||||
"eslint-plugin-react": "2.2.x",
|
||||
"express": "3.x"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"rules": {
|
||||
// This is useful for some of the tests, e.g.
|
||||
// expect(new Foo()).to.Throw(/error/)
|
||||
"no-new": 0
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче