Skip to content

Commit

Permalink
Add basic linting of JSON files using eslint-plugin-json
Browse files Browse the repository at this point in the history
By adding basic linting of JSON files, we can ensure that they're actually valid and prevent e.g. test-failures caused by *accidental* errors when editing the `test/test_manifest.json` file (something that I've done *many* times myself).

For now this simply uses the `recommended` configuration, but we can obviously tweak this later if/when needed. Please find additional information at https://github.com/azeemba/eslint-plugin-json
  • Loading branch information
Snuffleupagus committed Jun 15, 2021
1 parent 246d565 commit 1cfaf07
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

"plugins": [
"import",
"json",
"mozilla",
"no-unsanitized",
"sort-exports",
"unicorn",
],

"extends": [
"plugin:json/recommended",
"plugin:prettier/recommended"
],

Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ gulp.task("lint", function (done) {
const esLintOptions = [
"node_modules/eslint/bin/eslint",
"--ext",
".js,.jsm",
".js,.jsm,.json",
".",
"--report-unused-disable-directives",
];
Expand Down
54 changes: 54 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"eslint-plugin-fetch-options": "^0.0.5",
"eslint-plugin-html": "^6.1.2",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-json": "^3.0.0",
"eslint-plugin-mozilla": "^2.10.0",
"eslint-plugin-no-unsanitized": "^3.1.5",
"eslint-plugin-prettier": "^3.4.0",
Expand Down
2 changes: 1 addition & 1 deletion test/types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
},
"files": [
"main.ts"
],
]
}

0 comments on commit 1cfaf07

Please sign in to comment.