diff --git a/apps/climatemappedafrica/.eslintrc.js b/apps/climatemappedafrica/.eslintrc.js index c867daf1b..468a5ff74 100644 --- a/apps/climatemappedafrica/.eslintrc.js +++ b/apps/climatemappedafrica/.eslintrc.js @@ -1,4 +1,11 @@ module.exports = { root: true, extends: ["eslint-config-commons-ui/next"], + settings: { + "import/resolver": { + webpack: { + config: "./eslint.webpack.config.js", + }, + }, + }, }; diff --git a/apps/climatemappedafrica/eslint.webpack.config.js b/apps/climatemappedafrica/eslint.webpack.config.js new file mode 100644 index 000000000..4242830fc --- /dev/null +++ b/apps/climatemappedafrica/eslint.webpack.config.js @@ -0,0 +1,26 @@ +const path = require("path"); + +module.exports = { + module: { + rules: [ + { + test: /\.svg$/i, + type: "asset", + resourceQuery: /url/, // *.svg?url + }, + { + test: /\.svg$/i, + issuer: /\.[jt]sx?$/, + resourceQuery: { not: [/url/] }, // exclude react component if *.svg?url + use: ["@svgr/webpack"], + }, + ], + }, + resolve: { + alias: { + "@/climatemappedafrica": path.resolve(__dirname, "src/"), + content: path.resolve(__dirname, "content/"), + }, + extensions: [".js"], + }, +}; diff --git a/apps/climatemappedafrica/package.json b/apps/climatemappedafrica/package.json index 0cd6ee70c..e8306b32e 100644 --- a/apps/climatemappedafrica/package.json +++ b/apps/climatemappedafrica/package.json @@ -30,7 +30,7 @@ "lint": "TIMING=1 eslint --fix './'", "jest": "jest", "playwright": "npx playwright test", - "clean": "rm -rf .next .turbo node_modules" + "clean": "rm -rf .next .turbo build dist node_modules" }, "dependencies": { "@apollo/client": "catalog:",