Commit Graph

32 Commits

Author SHA1 Message Date
Tim van der Meij
e7a3ea29aa
Firefox extension: remove unused preference cleanup from bootstrap.js
The comment for the removal has been added three years ago, so we can
safely remove this now.
2017-04-14 23:49:01 +02:00
Jonas Jenwald
a5d5b970af [Firefox addon] Enforce double quotes, using ESLint, to avoid linting errors in mozilla-central (issue 7957)
Given that this patch causes a lot of churn in the addon code, I wouldn't really mind if we ultimately decide against doing this and just add a rule exception in mozilla-central instead.[1]

---
[1] Note that I used the ESLint `--fix` option, hence writing this commit message actually took longer time than the creation of the patch :-)
2017-01-25 01:14:06 +01:00
Jonas Jenwald
2f3805efbc Switch to using ESLint, instead of JSHint, for linting
*Please note that most of the necessary code adjustments were made in PR 7890.*

ESLint has a number of advantageous properties, compared to JSHint. Among those are:
 - The ability to find subtle bugs, thanks to more rules (e.g. PR 7881).
 - Much more customizable in general, and many rules allow fine-tuned behaviour rather than the just the on/off rules in JSHint.
 - Many more rules that can help developers avoid bugs, and a lot of rules that can be used to enforce a consistent coding style. The latter should be particularily useful for new contributors (and reduce the amount of stylistic review comments necessary).
 - The ability to easily specify exactly what rules to use/not to use, as opposed to JSHint which has a default set. *Note:* in future JSHint version some of the rules we depend on will be removed, according to warnings in http://jshint.com/docs/options/, so we wouldn't be able to update without losing lint coverage.
 - More easily disable one, or more, rules temporarily. In JSHint this requires using a numeric code, which isn't very user friendly, whereas in ESLint the rule name is simply used instead.

By default there's no rules enabled in ESLint, but there are some default rule sets available. However, to prevent linting failures if we update ESLint in the future, it seemed easier to just explicitly specify what rules we want.
Obviously this makes the ESLint config file somewhat bigger than the old JSHint config file, but given how rarely that one has been updated over the years I don't think that matters too much.

I've tried, to the best of my ability, to ensure that we enable the same rules for ESLint that we had for JSHint. Furthermore, I've also enabled a number of rules that seemed to make sense, both to catch possible errors *and* various style guide violations.

Despite the ESLint README claiming that it's slower that JSHint, https://github.com/eslint/eslint#how-does-eslint-performance-compare-to-jshint, locally this patch actually reduces the runtime for `gulp` lint (by approximately 20-25%).

A couple of stylistic rules that would have been nice to enable, but where our code currently differs to much to make it feasible:
 - `comma-dangle`, controls trailing commas in Objects and Arrays (among others).
 - `object-curly-spacing`, controls spacing inside of Objects.
 - `spaced-comment`, used to enforce spaces after `//` and `/*. (This is made difficult by the fact that there's still some usage of the old preprocessor left.)

Rules that I indend to look into possibly enabling in follow-ups, if it seems to make sense: `no-else-return`, `no-lonely-if`, `brace-style` with the `allowSingleLine` parameter removed.

Useful links:
 - http://eslint.org/docs/user-guide/configuring
 - http://eslint.org/docs/rules/
2016-12-16 21:06:36 +01:00
Yury Delendik
df10513e10 Moves DEFAULT_PREFENCES into JSON format. 2016-05-11 17:58:17 -05:00
Manas
a2ba1b8189 Uses editorconfig to maintain consistent coding styles
Removes the following as they unnecessary
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
2015-11-14 07:32:18 +05:30
Yury Delendik
4f3f983a21 Removes PdfRedirector.js and PlayPreview support. 2015-08-06 10:38:45 -05:00
Yury Delendik
0b5330781c Bug 1179262 - Remove PlayPreview registration from PDF Viewer. 2015-07-02 12:59:17 -05:00
Collin Anderson
54e984c763 cleaned whitespace 2015-02-17 11:07:37 -05:00
Yury Delendik
1cda4c7a4b Loading PDF.js extension into e10s windows 2014-09-17 16:14:04 -05:00
Tim van der Meij
c29faaa22d Use strict equalities in make.js, external/* and extensions/* 2014-08-01 22:27:00 +02:00
Yury Delendik
b39f0c311c Refactors history and how the database is stored 2014-04-03 13:23:18 -05:00
Jonas Jenwald
f6cfab0061 [Firefox] Stop importing default_preferences.js as a module and include it instead 2014-03-26 00:37:32 +01:00
Jonas Jenwald
2b5fb59b67 Fix coding style in extensions/firefox/bootstrap.js 2014-03-22 21:48:00 +01:00
Jonas Jenwald
c158894d94 Improve handling of preferences in Firefox 2014-03-05 11:58:12 +01:00
Brendan Dahl
b8f7bcaf02 Use only one resource url for moz central build. 2014-02-27 14:11:39 -08:00
Yury Delendik
61a3b3d035 Handles embed tags via PlayPreview API 2013-03-12 10:16:03 -05:00
Yury Delendik
fcc169453b Adds the extensions/* files for jshint 2013-02-02 21:15:43 -06:00
Brendan Dahl
332ae4ce41 Change to the Apache v2 license. 2012-08-31 15:48:21 -07:00
Brendan Dahl
4f314fff39 Remove space at end of line. 2012-06-04 15:39:50 -07:00
Brendan Dahl
72e6dbebaa Update factory in bootstrap.js. 2012-06-04 09:45:09 -07:00
Gavin Sharp
117582b2ea fix review comments from bdahl 2012-05-10 10:05:24 -07:00
Gavin Sharp
b607147368 Issue 1682: don't use FUEL in pdf.js 2012-05-09 17:04:52 -07:00
Brendan Dahl
84568ee46d Address mc extension code review. 2012-03-20 09:39:33 -07:00
Brendan Dahl
7c902eb612 Skip unneeded steps on APP_SHUTDOWN. 2012-03-15 20:08:39 -07:00
Brendan Dahl
08d3710bfc Unload the pdfstreamconverter on shutdown. 2012-02-08 14:59:30 -08:00
Brendan Dahl
1af9a72011 Make the add-on truly restartless. 2012-02-07 16:39:07 -08:00
Brendan Dahl
e7a0a2e129 Better way to listen to events and verify them. 2012-01-27 10:53:07 -08:00
Brendan Dahl
0d839c1c59 Fix how we're storing settings and change how the save pdf works. 2012-01-25 17:40:08 -08:00
Brendan Dahl
178b89342a Switch to stream converter for extension. 2012-01-23 16:50:45 -08:00
Vivien Nicolas
0331847927 Add support for disabling the firefox extension on the fly 2011-10-31 13:18:30 +01:00
Kalervo Kujala
753bfcf7c7 Fix lint warnings. 2011-09-27 22:15:06 +03:00
Vivien Nicolas
e18ddc9c97 Initial import of the Firefox extension 2011-09-07 00:00:24 +02:00