diff --git a/src/eslint.config.mjs b/src/eslint.config.mjs new file mode 100644 index 0000000000..d119ae6868 --- /dev/null +++ b/src/eslint.config.mjs @@ -0,0 +1,9 @@ +import globals from 'globals'; +import pluginJs from '@eslint/js'; + +export default [ + { + languageOptions: { globals: globals.browser }, + }, + pluginJs.configs.recommended, +]; diff --git a/src/package.json b/src/package.json index 85df21e8ec..a5a95f575c 100644 --- a/src/package.json +++ b/src/package.json @@ -11,10 +11,14 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "webpack serve --open --config webpack.config.dev.js", - "build": "webpack --config webpack.config.prod.js" + "lint": "eslint ./js --fix", + "build": "npm run lint && webpack --config webpack.config.prod.js" }, "devDependencies": { + "@eslint/js": "^9.9.0", "copy-webpack-plugin": "^11.0.0", + "eslint": "^8.57.0", + "globals": "^15.9.0", "html-webpack-plugin": "^5.6.0", "webpack": "^5.92.1", "webpack-cli": "^5.1.4", diff --git a/test/file_existence.mjs b/test/file_existence.mjs index d45bd56655..851184c4b4 100644 --- a/test/file_existence.mjs +++ b/test/file_existence.mjs @@ -34,6 +34,7 @@ const expectedFilesInDistDir = [ 'index.html', + 'eslint.config.mjs', 'js/', 'js/app.js', 'js/vendor/',