Skip to content
Snippets Groups Projects
Commit ed6bde2b authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

Integrate `eslint` into the `webpack` build process.

Closes #963

Merge request studip/studip!557
parent 40876d75
No related branches found
No related tags found
No related merge requests found
{
"parser": "@babel/eslint-parser",
"parserOptions": {
"sourceType": "module"
},
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"STUDIP": "writable",
"CKEDITOR": "writable",
"$": "writable",
"_": "writable",
"jQuery": "writable"
},
"rules": {
"no-unused-vars": "off",
"no-async-promise-executor": "error",
"no-await-in-loop": "error",
"no-promise-executor-return": "error",
"require-atomic-updates": "error",
"max-nested-callbacks": ["error", 3],
"no-return-await": "error",
"prefer-promise-reject-errors": "error"
}
}
This diff is collapsed.
......@@ -4,6 +4,7 @@
"description": "Stud.IP",
"private": true,
"scripts": {
"lint": "eslint resources/assets/javascripts resources/vue",
"wds": "webpack serve --progress --config webpack.dev-server.js",
"webpack-dev": "webpack --config webpack.dev.js --mode development",
"webpack-prod": "webpack --config webpack.prod.js --mode production",
......@@ -19,7 +20,8 @@
"node": ">=12"
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/core": "^7.17.9",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
......@@ -45,8 +47,9 @@
"css-minimizer-webpack-plugin": "^1.1.5",
"easygettext": "^2.17.0",
"es6-promise": "4.2.8",
"eslint": "7.21.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "7.7.0",
"eslint-webpack-plugin": "^3.1.1",
"expose-loader": "1.0.1",
"favico.js": "0.3.10",
"file-saver": "^2.0.5",
......@@ -113,15 +116,6 @@
"last 2 versions",
"not IE <= 11"
],
"eslintConfig": {
"env": {
"browser": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
}
},
"prettier": {
"printWidth": 120,
"singleQuote": true,
......
......@@ -2,6 +2,7 @@ const webpack = require("webpack");
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const ESLintPlugin = require('eslint-webpack-plugin');
const assetsPath = path.resolve(__dirname, "resources/assets/javascripts");
......@@ -106,6 +107,14 @@ module.exports = {
filename: "stylesheets/[name].css",
chunkFilename: "stylesheets/[name].css?h=[chunkhash]"
}),
new ESLintPlugin({
exclude: [
'node_modules',
'public/assets/javascripts/ckeditor/ckeditor.js',
'resources/assets/javascripts/vendor',
'resources/assets/javascripts/jquery/jstree/jquery.jstree.js',
]
}),
],
resolve: {
alias: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment