{"_id":"@akqa-denmark/eslint","_rev":"5-86324dc3fb04e891245292ee96dd4de1","name":"@akqa-denmark/eslint","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@akqa-denmark/eslint","version":"1.0.0","_id":"@akqa-denmark/eslint@1.0.0","maintainers":[{"name":"dni","email":"dennis.nielsen@akqa.com"},{"name":"bjarniolsen","email":"bjarni.olsen@akqa.com"},{"name":"cbrostrom","email":"christian.brostrom@akqa.com"},{"name":"simonlarsson-akqa","email":"simon.larsson@akqa.com"}],"dist":{"shasum":"9254390c00360c2949addc912b51a38d0a5fbc05","tarball":"https://registry.npmjs.org/@akqa-denmark/eslint/-/eslint-1.0.0.tgz","fileCount":9,"integrity":"sha512-ScBw8Aahsit6is4cE8I17C5XZxBpRltp4WWQebQ3uwA/uOj4NpK0A0x0Uz16q+nxr5wsCH+59jplLquIyQS6tQ==","signatures":[{"sig":"MEQCIGC0wBii6dILGIvs6UNrAF1l/HCZ1y3jBMVe1lyrfMRuAiAdrDXQu3XV+uOMZZazuF3difG9bmccCdJKx/VnJcmp9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14853},"main":"index.js","type":"module","exports":{".":"./index.js","./node":"./node.js","./test":"./test.js","./react":"./react.js","./eslint":"./eslint.js","./nextjs":"./nextjs.js"},"gitHead":"3e7c22dc7ed03b7bd6c086a704b16d92ff7fcee4","imports":{"#/*":"./*"},"scripts":{"lint":"eslint --fix","format":"prettier --write .","precommit":"npx lint-staged","compare-configs":"node utils/compare-configs.js"},"_npmUser":{"name":"dni","email":"dennis.nielsen@akqa.com"},"_npmVersion":"8.19.4","description":"AKQA dendach's ESLint configs","directories":{},"_nodeVersion":"16.20.2","dependencies":{"globals":"^15.13.0","@eslint/js":"^9.16.0","eslint-plugin-n":"^17.14.0","@eslint/eslintrc":"^3.2.0","typescript-eslint":"^8.17.0","eslint-plugin-react":"^7.37.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-react-hooks":"^5.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.16.0","prettier":"^3","eslint-config-next":"^15.0.0","@akqa-denmark/prettier":"*"},"peerDependencies":{"eslint":"^9","typescript":"^5","eslint-config-next":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint_1.0.0_1734010122675_0.4089575451506158","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@akqa-denmark/eslint","version":"1.1.0","_id":"@akqa-denmark/eslint@1.1.0","maintainers":[{"name":"dni","email":"dennis.nielsen@akqa.com"},{"name":"bjarniolsen","email":"bjarni.olsen@akqa.com"},{"name":"cbrostrom","email":"christian.brostrom@akqa.com"},{"name":"simonlarsson-akqa","email":"simon.larsson@akqa.com"}],"dist":{"shasum":"a3cfb53dc27439c14130c1b6c3aa09aece3330cf","tarball":"https://registry.npmjs.org/@akqa-denmark/eslint/-/eslint-1.1.0.tgz","fileCount":10,"integrity":"sha512-Xc7cVLTMcCNW9N/TVCfHh57NQ9OArNAF2GXodtgHKjUbgGYJt59bdWBzxAA4HmZXWgFS5eHhEZf9UtjOZPyBoQ==","signatures":[{"sig":"MEUCIQDToSOuLF76xSIGcWBBbndkECe9HWNMOmDmxKqi6jx8JAIgCnf8FBI38IfISWZghUVrnE3CDhzUj4kCiqXqFbdEvUk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19913},"main":"index.js","type":"module","exports":{".":"./index.js","./node":"./node.js","./test":"./test.js","./react":"./react.js","./eslint":"./eslint.js","./nextjs":"./nextjs.js"},"gitHead":"b5cda7684d185c8bee401a03f8fe7a33ae5b17e7","imports":{"#/*":"./*"},"scripts":{"lint":"eslint --fix","format":"prettier --write .","precommit":"npx lint-staged","compare-configs":"node utils/compare-configs.js"},"_npmUser":{"name":"dni","email":"dennis.nielsen@akqa.com"},"_npmVersion":"8.19.4","description":"AKQA dendach's ESLint configs","directories":{},"_nodeVersion":"16.20.2","dependencies":{"globals":"^15.13.0","@eslint/js":"^9.16.0","eslint-plugin-n":"^17.14.0","@eslint/eslintrc":"^3.2.0","typescript-eslint":"^8.17.0","eslint-plugin-react":"^7.37.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-react-hooks":"^5.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.16.0","prettier":"^3","eslint-config-next":"^15.5.0","@akqa-denmark/prettier":"*"},"peerDependencies":{"eslint":"^9","typescript":"^5"},"peerDependenciesMeta":{"eslint-config-next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/eslint_1.1.0_1755687014572_0.7461288755447744","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@akqa-denmark/eslint","version":"1.1.1","_id":"@akqa-denmark/eslint@1.1.1","maintainers":[{"name":"dni","email":"dennis.nielsen@akqa.com"},{"name":"bjarniolsen","email":"bjarni.olsen@akqa.com"},{"name":"cbrostrom","email":"christian.brostrom@akqa.com"},{"name":"simonlarsson-akqa","email":"simon.larsson@akqa.com"}],"dist":{"shasum":"ac73f1e8ba379ec38f92c72922e8c02588389461","tarball":"https://registry.npmjs.org/@akqa-denmark/eslint/-/eslint-1.1.1.tgz","fileCount":10,"integrity":"sha512-7FFDoKJtpRFBxUOJio0y5cb5c5xrcab4O6a1L5k/E0QnshXOpeDrlUTcXoK/dLVotc0529iXrgvw2EN1rGLsCA==","signatures":[{"sig":"MEUCIQDS81zZM6tn467opGkR0Od0Nqeo5G0Gu9G/Vm1Gu6xGQwIgbh5boqFTCQhg4A8VJ97H/z26egzI2EgomMsXTr5jG8w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20354},"main":"index.js","type":"module","exports":{".":"./index.js","./node":"./node.js","./test":"./test.js","./react":"./react.js","./eslint":"./eslint.js","./nextjs":"./nextjs.js"},"gitHead":"303285bb322381950b4f2e04de4c18472688dd6d","imports":{"#/*":"./*"},"scripts":{"lint":"eslint --fix","format":"prettier --write .","precommit":"npx lint-staged","compare-configs":"node utils/compare-configs.js"},"_npmUser":{"name":"dni","email":"dennis.nielsen@akqa.com"},"_npmVersion":"8.19.4","description":"AKQA dendach's ESLint configs","directories":{},"_nodeVersion":"16.20.2","dependencies":{"globals":"^15.13.0","@eslint/js":"^9.16.0","eslint-plugin-n":"^17.14.0","@eslint/eslintrc":"^3.2.0","typescript-eslint":"^8.17.0","eslint-plugin-react":"^7.37.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-react-hooks":"^5.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.16.0","prettier":"^3","eslint-config-next":"^15.5.0","@akqa-denmark/prettier":"*"},"peerDependencies":{"eslint":"^9","typescript":"^5"},"peerDependenciesMeta":{"eslint-config-next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/eslint_1.1.1_1755687914335_0.869475297366948","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@akqa-denmark/eslint","version":"1.1.2","_id":"@akqa-denmark/eslint@1.1.2","maintainers":[{"name":"dni","email":"dennis.nielsen@akqa.com"},{"name":"bjarniolsen","email":"bjarni.olsen@akqa.com"},{"name":"cbrostrom","email":"christian.brostrom@akqa.com"},{"name":"simonlarsson-akqa","email":"simon.larsson@akqa.com"}],"dist":{"shasum":"0948e48bcd04656686bb88a27e21b6d20072bd1d","tarball":"https://registry.npmjs.org/@akqa-denmark/eslint/-/eslint-1.1.2.tgz","fileCount":10,"integrity":"sha512-YDAgk0mYiIaMJHunqQsmovw8sLq4qObebnZ8qjf5m4gEC3U4/IhV7oUwqCrBwkvAXsUDFzSLJ7E7jhE/DvRqeQ==","signatures":[{"sig":"MEYCIQC8guQVlR6pYr4VKDYxwV7w0p6GB1tsXKY/bNnJJ0q54QIhAIMrlpztfOwElfxHew9X4NjsU/2xE631WZmaLnG7662c","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20450},"main":"index.js","type":"module","exports":{".":"./index.js","./node":"./node.js","./test":"./test.js","./react":"./react.js","./eslint":"./eslint.js","./nextjs":"./nextjs.js"},"gitHead":"9eee42d7a13ee57bb6c4c89991b492fba20a1da9","imports":{"#/*":"./*"},"scripts":{"lint":"eslint --fix","format":"prettier --write .","precommit":"npx lint-staged","compare-configs":"node utils/compare-configs.js"},"_npmUser":{"name":"dni","email":"dennis.nielsen@akqa.com"},"_npmVersion":"8.19.4","description":"AKQA dendach's ESLint configs","directories":{},"_nodeVersion":"16.20.2","dependencies":{"globals":"^15.13.0","@eslint/js":"^9.16.0","eslint-plugin-n":"^17.14.0","@eslint/eslintrc":"^3.2.0","typescript-eslint":"^8.17.0","eslint-plugin-react":"^7.37.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-react-hooks":"^5.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.16.0","prettier":"^3","eslint-config-next":"^15.5.0","@akqa-denmark/prettier":"*"},"peerDependencies":{"eslint":"^9","typescript":"^5"},"peerDependenciesMeta":{"eslint-config-next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/eslint_1.1.2_1755691677810_0.4711413854563524","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@akqa-denmark/eslint","version":"1.2.0","type":"module","description":"AKQA dendach's ESLint configs","main":"index.js","imports":{"#/*":"./*"},"exports":{".":"./index.js","./eslint":"./eslint.js","./nextjs":"./nextjs.js","./node":"./node.js","./react":"./react.js","./test":"./test.js"},"scripts":{"format":"prettier --write .","lint":"eslint --fix","precommit":"npx lint-staged","compare-configs":"node utils/compare-configs.js"},"peerDependencies":{"eslint":"^9","typescript":"^5"},"dependencies":{"@eslint/eslintrc":"^3.2.0","@eslint/js":"^9.16.0","eslint-config-next":"^16.0.0","eslint-plugin-import":"^2.31.0","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^17.14.0","eslint-plugin-react":"^7.37.2","eslint-plugin-react-hooks":"^5.1.0","globals":"^15.13.0","typescript-eslint":"^8.17.0"},"devDependencies":{"@akqa-denmark/prettier":"*","eslint":"^9.38.0","prettier":"^3"},"publishConfig":{"access":"public"},"_id":"@akqa-denmark/eslint@1.2.0","gitHead":"a81a1537ddae192ab1a905517080519228ef7bbc","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-3zHPHJS+wbbBHyN3z6xOl7/nYWJVe8IwkyVmGnBQ1J1HaAhOI7XcT5mH94M6BrpSMdodr+dkcSQo7x2fPD8cZg==","shasum":"3a780229ffc35306b5789e524db2520f1d89dd66","tarball":"https://registry.npmjs.org/@akqa-denmark/eslint/-/eslint-1.2.0.tgz","fileCount":10,"unpackedSize":22914,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDtc/xBzRZSHiHsltm6dpBdq8ydSiJGv9S1ihH2sSCTXAIhANX+wUHZ2clrxHTls3mzQG1kGj7dDr9cPTR4BD+Tco9H"}]},"_npmUser":{"name":"dni","email":"dennis.nielsen@akqa.com"},"directories":{},"maintainers":[{"name":"dni","email":"dennis.nielsen@akqa.com"},{"name":"bjarniolsen","email":"bjarni.olsen@akqa.com"},{"name":"cbrostrom","email":"christian.brostrom@akqa.com"},{"name":"simonlarsson-akqa","email":"simon.larsson@akqa.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint_1.2.0_1761920762100_0.05779096581740628"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-12T13:28:42.591Z","modified":"2025-10-31T14:26:02.570Z","1.0.0":"2024-12-12T13:28:42.846Z","1.1.0":"2025-08-20T10:50:14.759Z","1.1.1":"2025-08-20T11:05:14.723Z","1.1.2":"2025-08-20T12:07:57.989Z","1.2.0":"2025-10-31T14:26:02.295Z"},"description":"AKQA dendach's ESLint configs","maintainers":[{"name":"dni","email":"dennis.nielsen@akqa.com"},{"name":"bjarniolsen","email":"bjarni.olsen@akqa.com"},{"name":"cbrostrom","email":"christian.brostrom@akqa.com"},{"name":"simonlarsson-akqa","email":"simon.larsson@akqa.com"}],"readme":"# `@akqa-denmark/eslint`\n\nAKQA Denmark's shared ESLint configurations for TypeScript projects.\n\n## Installation\n\n```bash\nnpm install --save-dev @akqa-denmark/eslint eslint typescript\n```\n\n## Custom Rules\n\nCurrently, we only define three custom rules that is important to you:\n\n- `\"no-console\": \"warn\"`\n\nWe will not break your precommit hooks, or your CI pipeline <3\n\n- `\"@typescript-eslint/consistent-type-imports\": \"error\"`\n\nThis rule will enforce that you always use `import type` for type imports.\nThis helps bundlers and can prevent you from accidentally shipping unnecessary code:\n\n```typescript\n// 🚫\nimport { useEffect, ReactNode } from \"react\";\n\n// 🚫\nimport { useEffect, type ReactNode } from \"react\";\n\n// ✅\nimport { useEffect } from \"react\";\nimport type { ReactNode } from \"react\";\n```\n\nYour bundler should be able to auto-fix this for you on save.\n\n- `no-restricted-imports`\n\nThis rule forbids importing the default React export which can prevent you from accidentally shipping unecessary code:\n\n```typescript\n// 🚫\nimport React from \"react\";\n\ntype MyComponentProps = {\n    children: React.ReactNode;\n}\n\nconst MyComponent = (props: MyComponentProps) => {\n    const [theBoolean, setTheBoolean] = React.useEffect(false);\n\n    return ...\n}\n\n// ✅\nimport { useEffect } from \"react\";\nimport type { ReactNode } from \"react\";\n\ntype MyComponentProps = {\n    children: ReactNode;\n}\n\nconst MyComponent = (props: MyComponentProps) => {\n    const [theBoolean, setTheBoolean] = useEffect(false);\n\n    return ...\n}\n```\n\n_We also configure a few more rules which are not relevant to your daily work, but are set to offer a better development experience._\n\n## Usage\n\nCreate a ESLint configuration file in your project root, or workspace root.\nIf your project is configured as a CommonJS project (no `\"type\": \"module\"` in `package.json`), you'll need to use the `.mjs` file extension.\n\nIf your project is configured as an ESM project (with `\"type\": \"module\"` in `package.json`), you'll need to use the `.js` file extension.\n\n### Available Configurations\n\nWe provide several specialized configurations that you can import directly:\n\n#### Base Configuration\n\n```js\nimport { config } from \"@akqa-denmark/eslint/eslint\";\n\nexport default config;\n```\n\nThe base configuration includes:\n\n- [eslint:recommended](https://eslint.org/docs/latest/rules/)\n- [typescript-eslint](https://typescript-eslint.io/rules/)\n- [@eslint-plugin-import](https://github.com/import-js/eslint-plugin-import#rules)\n\n#### React Configuration\n\n```js\nimport { config } from \"@akqa-denmark/eslint/react\";\n\nexport default config;\n```\n\nExtends the base configuration and adds:\n\n- [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react#list-of-supported-rules)\n- [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)\n- [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y#supported-rules)\n\n> [!IMPORTANT]\n> Note: Our React rules have been carefully aligned with Next.js rules to provide a consistent experience across React and Next.js projects.\n\n#### Next.js Configuration\n\n```js\nimport { config } from \"@akqa-denmark/eslint/nextjs\";\n\nexport default config;\n```\n\nFor Next.js projects, you'll need to install the Next.js ESLint configuration:\n\n```bash\nnpm install --save-dev eslint-config-next\n```\n\nExtends the React configuration and adds:\n\n- [@next/eslint-plugin-next](https://nextjs.org/docs/basic-features/eslint#eslint-plugin#rules) (using the stricter `core-web-vitals` ruleset)\n\n#### Node.js Configuration\n\n```js\nimport { config } from \"@akqa-denmark/eslint/node\";\n\nexport default config;\n```\n\nOptimized for TypeScript-based Node.js projects, includes:\n\n- [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n#-rules)\n- TypeScript-aware import resolution\n\n### Test Configuration\n\nWe provide a specialized configuration for test files that can be composed with any of the above configurations:\n\n```js\nimport { config as baseConfig } from \"@akqa-denmark/eslint/react\";\nimport { config as testConfig } from \"@akqa-denmark/eslint/test\";\n\nexport default [...baseConfig, ...testConfig];\n```\n\nThe test configuration:\n\n- Automatically detects common test file patterns (`.test.`, `.spec.`, `__tests__/`, etc.)\n- Provides globals for Jest and Mocha, etc. (`it()`, `describe()`, `test()`, etc.)\n- Can be composed with any other configuration\n\n## Running ESLint\n\n### Via NPM Scripts\n\nAdd these scripts to your package.json:\n\n```json\n{\n    \"scripts\": {\n        \"lint\": \"eslint . --fix\"\n    }\n}\n```\n\n### With lint-staged\n\nIn your lint-staged config you need to add the following to specify usage of the `--file` flag:\n\n#### Not using Next.js\n\n```js\nimport path from \"path\";\n\nconst buildEslintCommand = (filenames) =>\n    `eslint --fix --file ${filenames\n        .map((f) => path.relative(process.cwd(), f))\n        .join(\" --file \")}`;\n\nconst config = {\n    \"**/*.{js,jsx,ts,tsx}\": [buildEslintCommand],\n};\n\nexport default config;\n```\n\n#### Using Next.js\n\n```js\nimport path from \"path\";\n\nconst buildEslintCommand = (filenames) =>\n    `next lint --fix --file ${filenames\n        .map((f) => path.relative(process.cwd(), f))\n        .join(\" --file \")}`;\n\nconst config = {\n    \"**/*.{js,jsx,ts,tsx}\": [buildEslintCommand],\n};\n```\n\n## Editor Integration\n\n### VS Code / Cursor\n\n1. Install the ESLint extension\n2. Add to settings.json:\n\n```json\n{\n    \"editor.codeActionsOnSave\": {\n        \"source.fixAll.eslint\": true\n    }\n}\n```\n\n### JetBrains IDEs\n\n1. Open Settings\n2. Search for \"ESLint\"\n3. Enable \"Run eslint --fix on save\"\n\n## Testing Package Updates Locally\n\n1. From the repository root, build or compile anything the package needs so the published artifacts are up to date.\n2. `cd packages/eslint-config-akqa-denmark` and run `npm pack`. This produces a tarball such as `akqa-denmark-eslint-0.0.0.tgz`, matching what will reach npm.\n3. In a throwaway or sandbox project, install the tarball with `npm install --save-dev /absolute/path/to/akqa-denmark-eslint-0.0.0.tgz` and verify the lint configuration behaves correctly.\n4. For faster iteration you can also rely on npm’s file system resolution: `npm install --save-dev file:/absolute/path/to/akqa-dk-frontend-configs/packages/eslint-config-akqa-denmark`. npm applies the same pack rules, letting you mimic a publish without pushing to the registry.\n5. After testing, revert the local dependency override in the test project and delete any generated `.tgz` archives.\n","readmeFilename":"README.md"}