Skip to content

Commit

Permalink
Add eslint-plugin-html to lint JS in HTML files
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond committed Sep 22, 2022
1 parent 2b46842 commit f86269a
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .eslintignore
Expand Up @@ -3,4 +3,6 @@
**/vendor/
/_site/
/js/coverage/
/js/tests/integration/
/site/static/sw.js
/site/layouts/
3 changes: 3 additions & 0 deletions js/tests/unit/.eslintrc.json
@@ -1,4 +1,7 @@
{
"plugins": [
"html"
],
"extends": [
"../../../.eslintrc.json"
],
Expand Down
12 changes: 12 additions & 0 deletions js/tests/visual/.eslintrc.json
@@ -0,0 +1,12 @@
{
"plugins": [
"html"
],
"extends": "../../../.eslintrc.json",
"parserOptions": {
"sourceType": "module"
},
"settings": {
"html/html-extensions": [".html"]
}
}
160 changes: 160 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -63,7 +63,7 @@
"js-compile-standalone-esm": "rollup --environment ESM:true,BUNDLE:false --config build/rollup.config.js --sourcemap",
"js-compile-bundle": "rollup --environment BUNDLE:true --config build/rollup.config.js --sourcemap",
"js-compile-plugins": "node build/build-plugins.js",
"js-lint": "eslint --cache --cache-location .cache/.eslintcache --report-unused-disable-directives .",
"js-lint": "eslint --cache --cache-location .cache/.eslintcache --report-unused-disable-directives --ext .html,.js .",
"js-minify": "npm-run-all --aggregate-output --parallel js-minify-*",
"js-minify-standalone": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.js.map,includeSources,url=bootstrap.min.js.map\" --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
"js-minify-standalone-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.esm.js.map,includeSources,url=bootstrap.esm.min.js.map\" --output dist/js/bootstrap.esm.min.js dist/js/bootstrap.esm.js",
Expand Down Expand Up @@ -118,6 +118,7 @@
"cross-env": "^7.0.3",
"eslint": "^8.23.1",
"eslint-config-xo": "^0.42.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-unicorn": "^43.0.2",
Expand Down

0 comments on commit f86269a

Please sign in to comment.