Our recommended ESLint / prettier configurations.
npm install -D @akqa-denmark/eslint-config-akqa-dk
We offer a few constellations of ESLint rules and configs depending on the type of project you are working with:
The base ESLint configuration is for generic React projects (create-react-app
, and custom setups). It extends the following rule sets:
eslint:recommended
plugin:react/recommended
plugin:react-hooks/recommended
plugin:prettier/recommended
and adds the following plugins:
The Next.js ESLint configuration extends on the Base configuration and adds the eslint-plugin-next
core-web-vitals
ruleset.
The node.js ESLint configuration is for, well what the name implies - node.js projects, it extends the following rule sets:
After installing and choosing your flavour, all you need to do is configure ESLint.
Add an .eslintrc.js
file to the root of your project / monorepo workspace:
module.exports = {
root: true,
extends: ["@akqa-denmark/akqa-dk"],
// or
// extends: ["@akqa-denmark/akqa-dk/nextjs"],
// extends: ["@akqa-denmark/akqa-dk/node"],
}
Add an .prettierrc.js
file to the root of your project / monorepo workspace:
const prettierConfig = require("@akqa-denmark/eslint-config-akqa-dk/prettier");
module.exports = {
...prettierConfig
};