Add ESLint (#3152)

* add eslint to src project

* fix test

---------

Co-authored-by: Rob Larsen <rob@htmlcssjavascript.com>
This commit is contained in:
Mikita
2025-09-09 22:40:10 +03:00
committed by GitHub
parent ac08a17cb6
commit 6f57767218
3 changed files with 21 additions and 7 deletions

9
src/eslint.config.mjs Normal file
View File

@@ -0,0 +1,9 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
export default [
{
languageOptions: { globals: globals.browser },
},
pluginJs.configs.recommended,
];

View File

@@ -11,14 +11,18 @@
"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": {
"copy-webpack-plugin": "^13.0.0",
"html-webpack-plugin": "^5.6.3",
"webpack": "^5.99.9",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.1",
"webpack-merge": "^6.0.1"
"@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",
"webpack-dev-server": "^5.0.4",
"webpack-merge": "^5.10.0"
}
}

View File

@@ -34,6 +34,7 @@ const expectedFilesInDistDir = [
'index.html',
'eslint.config.mjs',
'js/',
'js/app.js',
'js/vendor/',