bootstrap
bootstrap copied to clipboard
Use es6 on visual tests
Merge after #36914
Of course not mandatory for this PR: I just tried quickly but what would you think about adding some automation here with eslint-plugin-html
?
Configuration would look like something like this:
diff --git a/.eslintignore b/.eslintignore
index a18b03a5d..04bae1541 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -3,4 +3,6 @@
**/vendor/
/_site/
/js/coverage/
+/js/tests/integration/
/site/static/sw.js
+/site/layouts/
diff --git a/js/tests/unit/.eslintrc.json b/js/tests/unit/.eslintrc.json
index 6362a1acf..6508fc062 100644
--- a/js/tests/unit/.eslintrc.json
+++ b/js/tests/unit/.eslintrc.json
@@ -1,4 +1,7 @@
{
+ "plugins": [
+ "html"
+ ],
"extends": [
"../../../.eslintrc.json"
],
diff --git a/package.json b/package.json
index 50d4b35db..4db97cff1 100644
--- a/package.json
+++ b/package.json
@@ -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",
@@ -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": "^42.0.0",
And a new js/tests/visual/.eslintrc.json
:
{
"plugins": [
"html"
],
"extends": "../../../.eslintrc.json",
"parserOptions": {
"sourceType": "module"
},
"settings": {
"html/html-extensions": [".html"]
}
}
Of course not mandatory for this PR: I just tried quickly but what would you think about adding some automation here with eslint-plugin-html?
Linting is always a nice idea. Would you mind addressing it on a different PR?
Just for information, here is the report done by eslint-plugin-html without fine tuning it by removing useless rules. Maybe there are some things to you'd like to integrate right now in the modifications 🤷
Probably it will need an eslintrc.json
override like bootstrap\site\.eslintrc.json
We can fix any issues there 😉
Thank you for your help @julien-deramond