Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/braces-3.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
TanyaStere42 authored Sep 23, 2024
2 parents cd83050 + e066923 commit 2042e3a
Show file tree
Hide file tree
Showing 13 changed files with 438 additions and 851 deletions.
27 changes: 26 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default [
react: {
version: "detect"
}
},
},

rules: {
"semi": 2,
"react/prop-types": 0,
Expand Down Expand Up @@ -56,4 +57,28 @@ export default [

},
},
{
files: ['frontend/babel.config.js', 'frontend/jest.config.js', 'babel.config.js'], // Specify the config files
languageOptions: {
globals: {
require: "readonly",
module: "readonly",
__dirname: "readonly",
process: "readonly",
},
},
},
{
files: ["**/__tests__/**/*.{js,jsx}", "**/*.test.{js,jsx}"],
languageOptions: {
globals: {
jest: "readonly", // Define Jest-specific globals
test: "readonly",
expect: "readonly",
},
},
rules: {
"react/react-in-jsx-scope": 0, // Disable React in scope for JSX cuz we are using React 17+
}
}
];
3 changes: 3 additions & 0 deletions frontend/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["@babel/preset-env", "@babel/preset-react"],
};
14 changes: 14 additions & 0 deletions frontend/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
testMatch: [
"**/__tests__/**/*.[jt]s?(x)", // Looks inside __tests__ folders
"**/?(*.)+(spec|test).[tj]s?(x)", // Looks for .spec.js/.test.js files
],
transform: {
"^.+\\.[t|j]sx?$": "babel-jest",
},
transformIgnorePatterns: ["/node_modules/(?!(axios)).+\\.js$"],
testEnvironment: "jsdom", // Set the environment for testing React components
moduleNameMapper: {
"^axios$": require.resolve("axios"),
},
};
5 changes: 5 additions & 0 deletions frontend/maven-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ export SITE_NAME="Test Site Name"
npm install react-app-rewired

cd frontend

# Use `npm ci` for consistent and faster installs in production, as it installs exact versions
# from `package-lock.json` without modifying it, ensuring stability across environments.
npm ci

npm run build

rsync -a build/ ../src/main/webapp/react
Expand Down
Loading

0 comments on commit 2042e3a

Please sign in to comment.