Browse Source

Merge pull request #8417 from Standard8/eslint-cleanup-globals

Use eslint-plugin-mozilla and the webextensions environment to avoid defining globals in each file.
Jonas Jenwald 8 years ago committed by GitHub
parent
commit
ca3cf6e744
  1. 9
      extensions/chromium/.eslintrc
  2. 1
      extensions/chromium/contentscript.js
  3. 1
      extensions/chromium/extension-router.js
  4. 1
      extensions/chromium/feature-detect.js
  5. 1
      extensions/chromium/options/migration.js
  6. 1
      extensions/chromium/options/options.js
  7. 1
      extensions/chromium/pageAction/background.js
  8. 2
      extensions/chromium/pdfHandler-vcros.js
  9. 3
      extensions/chromium/pdfHandler.js
  10. 3
      extensions/chromium/preserve-referer.js
  11. 1
      extensions/chromium/suppress-update.js
  12. 1
      extensions/chromium/telemetry.js
  13. 11
      extensions/firefox/.eslintrc
  14. 4
      extensions/firefox/bootstrap.js
  15. 3
      extensions/firefox/chrome/content.js
  16. 2
      extensions/firefox/content/PdfJs.jsm
  17. 1
      extensions/firefox/content/PdfJsNetwork.jsm
  18. 1
      extensions/firefox/content/PdfJsTelemetry.jsm
  19. 2
      extensions/firefox/content/PdfStreamConverter.jsm
  20. 1
      extensions/firefox/content/PdfjsChromeUtils.jsm
  21. 1
      extensions/firefox/content/PdfjsContentUtils.jsm
  22. 1
      extensions/firefox/content/pdfjschildbootstrap-enabled.js
  23. 1
      extensions/firefox/content/pdfjschildbootstrap.js
  24. 1
      package.json

9
extensions/chromium/.eslintrc

@ -3,11 +3,20 @@
../../.eslintrc ../../.eslintrc
], ],
"env": {
"webextensions": true
},
"plugins": [
"mozilla"
],
"parserOptions": { "parserOptions": {
"sourceType": "script" "sourceType": "script"
}, },
"rules": { "rules": {
"mozilla/import-globals": "error",
"object-shorthand": "off", "object-shorthand": "off",
}, },
} }

1
extensions/chromium/contentscript.js

@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome, CSS */
'use strict'; 'use strict';

1
extensions/chromium/extension-router.js

@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome */
'use strict'; 'use strict';

1
extensions/chromium/feature-detect.js

@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome */
'use strict'; 'use strict';

1
extensions/chromium/options/migration.js

@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* eslint strict: ["error", "function"] */ /* eslint strict: ["error", "function"] */
/* globals chrome */
(function() { (function() {
'use strict'; 'use strict';

1
extensions/chromium/options/options.js

@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome */
'use strict'; 'use strict';
var storageAreaName = chrome.storage.sync ? 'sync' : 'local'; var storageAreaName = chrome.storage.sync ? 'sync' : 'local';

1
extensions/chromium/pageAction/background.js

@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome */
'use strict'; 'use strict';

2
extensions/chromium/pdfHandler-vcros.js

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* eslint strict: ["error", "function"] */ /* eslint strict: ["error", "function"] */
/* globals chrome, getViewerURL */ /* import-globals-from pdfHandler.js */
(function() { (function() {
'use strict'; 'use strict';

3
extensions/chromium/pdfHandler.js

@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome, Features, saveReferer */ /* import-globals-from feature-detect.js */
/* import-globals-from preserve-referer.js */
'use strict'; 'use strict';

3
extensions/chromium/preserve-referer.js

@ -13,8 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome, getHeaderFromHeaders */ /* import-globals-from pdfHandler.js */
/* exported saveReferer */
'use strict'; 'use strict';
/** /**

1
extensions/chromium/suppress-update.js

@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome */
'use strict'; 'use strict';

1
extensions/chromium/telemetry.js

@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* eslint strict: ["error", "function"] */ /* eslint strict: ["error", "function"] */
/* globals chrome, crypto, Headers, Request */
(function() { (function() {
'use strict'; 'use strict';

11
extensions/firefox/.eslintrc

@ -8,7 +8,18 @@
"sourceType": "script" "sourceType": "script"
}, },
"plugins": [
"mozilla"
],
"globals": {
"Components": false,
"dump": false
},
"rules": { "rules": {
"mozilla/import-globals": "error",
// Best Practices // Best Practices
"consistent-return": "error", "consistent-return": "error",

4
extensions/firefox/bootstrap.js vendored

@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Components, Services, dump, XPCOMUtils, PdfStreamConverter, /* globals PdfStreamConverter, APP_SHUTDOWN, PdfjsChromeUtils,
APP_SHUTDOWN, PdfjsChromeUtils, PdfjsContentUtils */ PdfjsContentUtils */
"use strict"; "use strict";

3
extensions/firefox/chrome/content.js

@ -12,8 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Components, Services, XPCOMUtils, PdfjsContentUtils, /* eslint-env mozilla/frame-script */
PdfjsContentUtils, PdfStreamConverter, addMessageListener */
"use strict"; "use strict";

2
extensions/firefox/content/PdfJs.jsm

@ -12,8 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Components, Services, XPCOMUtils, PdfjsChromeUtils,
PdfjsContentUtils, PdfStreamConverter */
"use strict"; "use strict";

1
extensions/firefox/content/PdfJsNetwork.jsm

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Components, Services */
"use strict"; "use strict";

1
extensions/firefox/content/PdfJsTelemetry.jsm

@ -13,7 +13,6 @@
* limitations under the License. * limitations under the License.
*/ */
/* eslint max-len: ["error", 100] */ /* eslint max-len: ["error", 100] */
/* globals Components, Services */
"use strict"; "use strict";

2
extensions/firefox/content/PdfStreamConverter.jsm

@ -12,8 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Components, Services, XPCOMUtils, NetUtil, PrivateBrowsingUtils,
dump, NetworkManager, PdfJsTelemetry, PdfjsContentUtils */
"use strict"; "use strict";

1
extensions/firefox/content/PdfjsChromeUtils.jsm

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Components, Services, XPCOMUtils */
"use strict"; "use strict";

1
extensions/firefox/content/PdfjsContentUtils.jsm

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Components, Services, XPCOMUtils */
"use strict"; "use strict";

1
extensions/firefox/content/pdfjschildbootstrap-enabled.js vendored

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Components, PdfJs, Services */
"use strict"; "use strict";

1
extensions/firefox/content/pdfjschildbootstrap.js vendored

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Components, PdfjsContentUtils */
"use strict"; "use strict";

1
package.json

@ -9,6 +9,7 @@
"babel-preset-es2015": "^6.24.1", "babel-preset-es2015": "^6.24.1",
"escodegen": "^1.8.0", "escodegen": "^1.8.0",
"eslint": "^3.11.1", "eslint": "^3.11.1",
"eslint-plugin-mozilla": "^0.2.47",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-rename": "^1.2.2", "gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4", "gulp-replace": "^0.5.4",

Loading…
Cancel
Save