agama/web/babel.config.js
David Díaz ef05fe848e
chore: format web base code consistently (#1460)
## Problem

For whatever reason, the code web frontend code does not have a
consistent format.

## Solution

_Prettify_ the code by running `npx prettier . -w` after adapting the
configuration we had in `.prettierrc` and updating the list of
directories/files it should ignore via `.prettierignore` file.

What we have decided it to use as much defaults as possible, ending up
with just one override: `printWidth`. Having lines up to 100 characters
length looks a good compromise for us in terms of code readability.

To make the change possible, conflicts between ESLint and Prettier has
been solved by making use of
https://github.com/prettier/eslint-config-prettier. Something similar
with Stylelint, for which https://github.com/prettier/stylelint-prettier
has been used.
2024-07-12 13:00:46 +01:00

13 lines
290 B
JavaScript

const { NODE_ENV } = process.env;
const presets = ["@babel/preset-react", ["@babel/preset-env", { targets: { node: "current" } }]];
const plugins = [];
if (!["production", "test"].includes(NODE_ENV)) {
plugins.push("react-refresh/babel");
}
module.exports = {
presets,
plugins,
};