Add linting.
This commit is contained in:
Родитель
13ae70492b
Коммит
ea87348404
|
@ -0,0 +1,24 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
extends: [
|
||||||
|
"plugin:mozilla/recommended",
|
||||||
|
],
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
"mozilla",
|
||||||
|
],
|
||||||
|
|
||||||
|
parserOptions: {
|
||||||
|
sourceType: "module"
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
"no-return-await": ["off"],
|
||||||
|
"valid-jsdoc": ["error", {
|
||||||
|
requireReturn: false,
|
||||||
|
requireParamDescription: false,
|
||||||
|
requireReturnDescription: false,
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,2 +1,3 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/shield-study-js-errors.xpi
|
/shield-study-js-errors.xpi
|
||||||
|
node_modules
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -13,6 +13,9 @@ build: shield-study-js-errors.xpi
|
||||||
clean:
|
clean:
|
||||||
rm -f shield-study-js-errors.xpi
|
rm -f shield-study-js-errors.xpi
|
||||||
|
|
||||||
|
lint:
|
||||||
|
npm run lint
|
||||||
|
|
||||||
shield-study-js-errors.xpi: $(EXTENSION_FILES)
|
shield-study-js-errors.xpi: $(EXTENSION_FILES)
|
||||||
pushd extension; \
|
pushd extension; \
|
||||||
zip -r shield-study-js-errors.xpi ./*; \
|
zip -r shield-study-js-errors.xpi ./*; \
|
||||||
|
|
|
@ -50,6 +50,13 @@ Nightly:
|
||||||
- `xpinstall.signatures.required`
|
- `xpinstall.signatures.required`
|
||||||
- `extensions.allow-non-mpc-extensions`
|
- `extensions.allow-non-mpc-extensions`
|
||||||
|
|
||||||
|
Linting can be run on the add-on using `make lint`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install # If they haven't been installed yet
|
||||||
|
$ make lint
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
Shield Study: JavaScript Errors is licensed under the MPLv2. See the `LICENSE`
|
Shield Study: JavaScript Errors is licensed under the MPLv2. See the `LICENSE`
|
||||||
file for details.
|
file for details.
|
||||||
|
|
|
@ -28,12 +28,12 @@ function generateFingerprint(error) {
|
||||||
this.install = function() {};
|
this.install = function() {};
|
||||||
|
|
||||||
this.startup = function() {
|
this.startup = function() {
|
||||||
logger = Log.repository.getLogger('shield-study-js-errors');
|
logger = Log.repository.getLogger("shield-study-js-errors");
|
||||||
logger.addAppender(new Log.ConsoleAppender(new Log.BasicFormatter()));
|
logger.addAppender(new Log.ConsoleAppender(new Log.BasicFormatter()));
|
||||||
logger.level = Services.prefs.getIntPref(
|
logger.level = Services.prefs.getIntPref(
|
||||||
"extensions.shield-study-js-errors@shield.mozilla.org.logLevel",
|
"extensions.shield-study-js-errors@shield.mozilla.org.logLevel",
|
||||||
Log.Level.Warn,
|
Log.Level.Warn,
|
||||||
);;
|
);
|
||||||
|
|
||||||
ErrorReporting.startup();
|
ErrorReporting.startup();
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ this.startup = function() {
|
||||||
addClientId: true,
|
addClientId: true,
|
||||||
addEnvironment: true,
|
addEnvironment: true,
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.shutdown = function() {
|
this.shutdown = function() {
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"title": "Shield Study: JavaScript Errors",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "A Shield study to test collecting JavaScript errors thrown by Firefox chrome code",
|
||||||
|
"private": true,
|
||||||
|
"author": "Michael Kelly <mkelly@mozilla.com>",
|
||||||
|
"repository": "https://github.com/mozilla/shield-study-js-errors",
|
||||||
|
"license": "MPL-2.0",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint extension || true"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^4.12.1",
|
||||||
|
"eslint-plugin-mozilla": "^0.4.9",
|
||||||
|
"eslint-plugin-no-unsanitized": "^2.0.2"
|
||||||
|
}
|
||||||
|
}
|
Загрузка…
Ссылка в новой задаче