Skip to content

Commit 6f57767

Browse files
Katletosroblarsen
andauthored
Add ESLint (#3152)
* add eslint to src project * fix test --------- Co-authored-by: Rob Larsen <[email protected]>
1 parent ac08a17 commit 6f57767

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

src/eslint.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import globals from 'globals';
2+
import pluginJs from '@eslint/js';
3+
4+
export default [
5+
{
6+
languageOptions: { globals: globals.browser },
7+
},
8+
pluginJs.configs.recommended,
9+
];

src/package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@
1111
"scripts": {
1212
"test": "echo \"Error: no test specified\" && exit 1",
1313
"start": "webpack serve --open --config webpack.config.dev.js",
14-
"build": "webpack --config webpack.config.prod.js"
14+
"lint": "eslint ./js --fix",
15+
"build": "npm run lint && webpack --config webpack.config.prod.js"
1516
},
1617
"devDependencies": {
17-
"copy-webpack-plugin": "^13.0.0",
18-
"html-webpack-plugin": "^5.6.3",
19-
"webpack": "^5.99.9",
20-
"webpack-cli": "^6.0.1",
21-
"webpack-dev-server": "^5.2.1",
22-
"webpack-merge": "^6.0.1"
18+
"@eslint/js": "^9.9.0",
19+
"copy-webpack-plugin": "^11.0.0",
20+
"eslint": "^8.57.0",
21+
"globals": "^15.9.0",
22+
"html-webpack-plugin": "^5.6.0",
23+
"webpack": "^5.92.1",
24+
"webpack-cli": "^5.1.4",
25+
"webpack-dev-server": "^5.0.4",
26+
"webpack-merge": "^5.10.0"
2327
}
2428
}

test/file_existence.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const expectedFilesInDistDir = [
3434

3535
'index.html',
3636

37+
'eslint.config.mjs',
3738
'js/',
3839
'js/app.js',
3940
'js/vendor/',

0 commit comments

Comments
 (0)