Bug 1563927 - Add JSON linting via ESLint. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D186882
This commit is contained in:
Mark Banner 2023-09-05 12:59:31 +00:00
parent db70ee3220
commit 640bcbbba0
9 changed files with 1932 additions and 1536 deletions

View file

@ -12,9 +12,8 @@
# Include all js dot files. # Include all js dot files.
!.*.js !.*.js
# For now, skip all json files for ESLint, these will still be run through # Ignore VSCode files
# Prettier. .vscode/
**/*.json
# Always ignore node_modules. # Always ignore node_modules.
**/node_modules/ **/node_modules/
@ -125,6 +124,7 @@ dom/svg/test/test_SVG_namespace_ids.html
# Strange encodings # Strange encodings
dom/base/test/file_bug687859-16.js dom/base/test/file_bug687859-16.js
dom/base/test/file_bug707142_bom.json
dom/base/test/file_bug707142_utf-16.json dom/base/test/file_bug707142_utf-16.json
dom/encoding/test/test_utf16_files.html dom/encoding/test/test_utf16_files.html
dom/encoding/test/file_utf16_be_bom.js dom/encoding/test/file_utf16_be_bom.js

View file

@ -72,7 +72,7 @@ module.exports = {
// tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js to // tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js to
// allow external repositories that use the plugin to pick them up as well. // allow external repositories that use the plugin to pick them up as well.
extends: ["plugin:mozilla/recommended"], extends: ["plugin:mozilla/recommended"],
plugins: ["mozilla", "import"], plugins: ["mozilla", "import", "json"],
overrides: [ overrides: [
{ {
// All .eslintrc.js files are in the node environment, so turn that // All .eslintrc.js files are in the node environment, so turn that

1967
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -18,6 +18,7 @@
"eslint-plugin-import": "2.27.5", "eslint-plugin-import": "2.27.5",
"eslint-plugin-jest": "23.20.0", "eslint-plugin-jest": "23.20.0",
"eslint-plugin-jsdoc": "39.9.1", "eslint-plugin-jsdoc": "39.9.1",
"eslint-plugin-json": "3.1.0",
"eslint-plugin-jsx-a11y": "6.7.1", "eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-mozilla": "file:tools/lint/eslint/eslint-plugin-mozilla", "eslint-plugin-mozilla": "file:tools/lint/eslint/eslint-plugin-mozilla",
"eslint-plugin-no-unsanitized": "4.0.2", "eslint-plugin-no-unsanitized": "4.0.2",
@ -26,8 +27,8 @@
"eslint-plugin-spidermonkey-js": "file:tools/lint/eslint/eslint-plugin-spidermonkey-js", "eslint-plugin-spidermonkey-js": "file:tools/lint/eslint/eslint-plugin-spidermonkey-js",
"jsdoc": "4.0.2", "jsdoc": "4.0.2",
"prettier": "2.8.8", "prettier": "2.8.8",
"stylelint": "^15.6.0", "stylelint": "15.6.2",
"stylelint-config-recommended": "^12.0.0", "stylelint-config-recommended": "12.0.0",
"stylelint-config-standard-scss": "7.0.1", "stylelint-config-standard-scss": "7.0.1",
"yarn": "1.22.19" "yarn": "1.22.19"
}, },

View file

@ -21,7 +21,11 @@ module.exports = {
// The prettier configuration here comes from eslint-config-prettier and // The prettier configuration here comes from eslint-config-prettier and
// turns off all of ESLint's rules related to formatting. // turns off all of ESLint's rules related to formatting.
extends: ["eslint:recommended", "prettier"], extends: [
"eslint:recommended",
"prettier",
"plugin:json/recommended-with-comments",
],
overrides: [ overrides: [
{ {
@ -120,7 +124,7 @@ module.exports = {
}, },
// When adding items to this file please check for effects on sub-directories. // When adding items to this file please check for effects on sub-directories.
plugins: ["html", "fetch-options", "no-unsanitized"], plugins: ["fetch-options", "html", "json", "no-unsanitized"],
// When adding items to this file please check for effects on all of toolkit // When adding items to this file please check for effects on all of toolkit
// and browser // and browser

View file

@ -1,9 +1,9 @@
[ [
{ {
"filename": "eslint-plugin-mozilla.tar.gz", "filename": "eslint-plugin-mozilla.tar.gz",
"size": 9278498, "size": 9725424,
"algorithm": "sha512", "algorithm": "sha512",
"digest": "01615c6a29c0027fabe528d9a6e2133b80467e0e0c420bab3a282dea3c8de1fd59c44dab0fcdb19c09e72c7d0d7e81347029336e77b4463a8c09272876da10a8", "digest": "321617401a3e4c375b66e493939e08b3b67bff52794ca7d4e0c41a41c853af75e9275e851e2523690bd03b0ccc86b2b4f76058374d2eb0b612ed0b7da8ef29e1",
"unpack": true, "unpack": true,
"visibility": "public" "visibility": "public"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "eslint-plugin-mozilla", "name": "eslint-plugin-mozilla",
"version": "3.1.0", "version": "3.2.0",
"description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.", "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
"keywords": [ "keywords": [
"eslint", "eslint",
@ -38,6 +38,7 @@
"eslint-config-prettier": "^8.0.0", "eslint-config-prettier": "^8.0.0",
"eslint-plugin-fetch-options": "^0.0.5", "eslint-plugin-fetch-options": "^0.0.5",
"eslint-plugin-html": "^7.0.0", "eslint-plugin-html": "^7.0.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-no-unsanitized": "^4.0.0" "eslint-plugin-no-unsanitized": "^4.0.0"
}, },
"engines": { "engines": {

View file

@ -1,9 +1,9 @@
[ [
{ {
"filename": "eslint.tar.gz", "filename": "eslint.tar.gz",
"size": 26456449, "size": 26663760,
"algorithm": "sha512", "algorithm": "sha512",
"digest": "8c266196d7d694df67ee7f654b2d905d00c7c40d989462c6e78a82a69a83160e5f34da3d353f95309c42ad057251e5888c814a3d8d9d97db1827909e393cbb58", "digest": "b6a6831d32d512ad479c5d724c4dc39ff7790fa929aa7417481772720132251ef0513ee3c9ea75f393cbe807b8caed0e960dcb82d2c6da0fba32db4716569ae6",
"unpack": true, "unpack": true,
"visibility": "public" "visibility": "public"
} }