Skip to content

Commit

Permalink
Merge pull request WrenSecurity#161 from karelmaxa/upgrade-ui
Browse files Browse the repository at this point in the history
Upgrade ESLint and Babel. Use Wren Security ESLint conventions.
  • Loading branch information
pavelhoral authored Nov 10, 2023
2 parents cb61f35 + 7f797c0 commit c84d0e5
Show file tree
Hide file tree
Showing 219 changed files with 18,200 additions and 13,242 deletions.
5 changes: 1 addition & 4 deletions openidm-ui/Gruntfile-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ module.exports = function(grunt, options) {
lint: {
src: [
mavenSrcPath + "/**/*.js"
],
options: {
format: options.eslintFormatter
}
]
}
},
less: {
Expand Down
5 changes: 0 additions & 5 deletions openidm-ui/openidm-ui-admin/.babelrc

This file was deleted.

10 changes: 10 additions & 0 deletions openidm-ui/openidm-ui-admin/.babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": "> 0.25%, not dead"
}
]
]
}
43 changes: 0 additions & 43 deletions openidm-ui/openidm-ui-admin/.eslintrc

This file was deleted.

35 changes: 35 additions & 0 deletions openidm-ui/openidm-ui-admin/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"root": true,
"extends": "@wrensecurity/eslint-config",
"parser": "@babel/eslint-parser",
"env": {
"amd": true,
"browser": true,
"qunit": true,
"es6": true
},
"rules": {
"arrow-parens": ["error", "always"],
"arrow-spacing": "error",
"indent": ["error", 4, {
"FunctionDeclaration": {
"parameters": 2
},
"FunctionExpression": {
"parameters": 2
},
"SwitchCase": 1,
"VariableDeclarator": 1
}],
"no-alert": "error",
"no-catch-shadow": "error",
"no-empty-character-class": "error",
"no-extend-native": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": "error",
"no-multi-str": "error",
"no-native-reassign": "error",
"no-unused-vars": "warn", // Temporarily changed to warning due to many inconsistencies
"no-void": "error"
}
}
6 changes: 3 additions & 3 deletions openidm-ui/openidm-ui-admin/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = function(grunt) {
forgeRockCommonsDirectory + "/src/main/resources"
],
deployDirectory: "admin/default",
eslintFormatter: require.resolve("eslint-formatter-warning-summary"),
lessPlugins: [new (require("less-plugin-clean-css"))({})],
copyLibs: [
// JS - npm
Expand Down Expand Up @@ -53,6 +52,7 @@ module.exports = function(grunt) {
{ src: "node_modules/backgrid-paginator/backgrid-paginator.min.css", dest: "target/www/css/backgrid-paginator-0.3.5-min.css" },
{ src: "node_modules/backgrid/lib/backgrid.min.css", dest: "target/www/css/backgrid-0.3.5-min.css" },
{ src: "node_modules/qunit/qunit/qunit.css", dest: "target/www/css/qunit-1.15.0.css" }, // Actually 2.15.0
{ src: "node_modules/dragula/dist/dragula.min.css", dest: "target/www/css/dragula-3.6.7-min.css" },

// CSS - custom
{ src: "libs/css/bootstrap-datetimepicker-4.14.30-min.css", dest: "target/www/css/bootstrap-datetimepicker-4.14.30-min.css" },
Expand All @@ -64,7 +64,7 @@ module.exports = function(grunt) {
{ src: "node_modules/codemirror/mode/groovy/groovy.js", dest: "target/www/libs/codemirror/mode/groovy/groovy.js" },
{ src: "node_modules/codemirror/mode/javascript/javascript.js", dest: "target/www/libs/codemirror/mode/javascript/javascript.js" },
{ src: "node_modules/codemirror/mode/xml/xml.js", dest: "target/www/libs/codemirror/mode/xml/xml.js" },
{ src: "node_modules/codemirror/lib/codemirror.css", dest: "target/www/css/codemirror/codemirror.css" },
],
{ src: "node_modules/codemirror/lib/codemirror.css", dest: "target/www/css/codemirror/codemirror.css" }
]
});
};
Loading

0 comments on commit c84d0e5

Please sign in to comment.