{"id":18866261,"url":"https://github.com/nordcloud/eslint-config-pat","last_synced_at":"2026-03-09T19:02:55.589Z","repository":{"id":41292882,"uuid":"428627106","full_name":"nordcloud/eslint-config-pat","owner":"nordcloud","description":"Shareable ESLint config for PAT projects","archived":false,"fork":false,"pushed_at":"2025-03-12T19:59:00.000Z","size":1330,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T03:25:01.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nordcloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-16T11:24:21.000Z","updated_at":"2024-12-03T15:35:56.000Z","dependencies_parsed_at":"2023-12-18T22:27:23.510Z","dependency_job_id":"54ad8a45-3d3c-498c-8a83-5d801706bd45","html_url":"https://github.com/nordcloud/eslint-config-pat","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"97b44be71795cd68feb0bc1ae93b234b084a7493"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Feslint-config-pat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Feslint-config-pat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Feslint-config-pat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Feslint-config-pat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nordcloud","download_url":"https://codeload.github.com/nordcloud/eslint-config-pat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248897080,"owners_count":21179534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T05:06:05.024Z","updated_at":"2026-03-09T19:02:55.507Z","avatar_url":"https://github.com/nordcloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @nordcloud/eslint-config-pat\n\nA TypeScript ESLint ruleset designed for Nordcloud's Platform \u0026 Tools\n\n## Implementation\n\n- **Monorepo friendly:** The `@nordcloud/eslint-config-pat` package has direct dependencies on all the ESLint plugins\n  that it needs. This avoids encumbering each consuming project with the obligation to satisfy a peer dependencies.\n  It also ensures that the installed plugin versions were tested for compatibility together.\n\n- **Designed for Prettier:** The `@nordcloud/eslint-config-pat` ruleset is designed to be used together with\n  the [Prettier](https://prettier.io/) code formatter.\n  Prettier avoids frivolous debates: its defaults have already been debated\n  at length and adopted by a sizeable community.\n\n- **Minimal configuration:** To use this ruleset, your eslint configuration file (**.eslintrc.js** or **eslint.config.mjs**) will need to choose one **\"profile\"**\n  and possibly one or two **\"mixins\"** that cover special cases\n\n## Getting started\n\nApplying the ruleset to your project is quick and easy. You install the package, then create an eslint configuration file\nand select an appropriate project profile. Optionally you can also add some \"mixins\" to enable additional rules.\nLet's walk through those steps in more detail.\n\n### 1. Install the package\n\nTo install the package, do this:\n\n```sh\ncd your-project-folder\nnpm install -D eslint typescript prettier @nordcloud/eslint-config-pat\n```\n\n### 2. Choose one profile\n\nThe ruleset currently supports two different \"profile\" strings, which select lint rules applicable for\nyour project:\n\n- `@nordcloud/eslint-config-pat/profile/node` - This profile enables lint rules intended for a general Node.js project,\n  typically a web service.\n\n- `@nordcloud/eslint-config-pat/profile/web-app` - This profile enables lint rules intended for a web application, for\n  example security rules that are relevant to web browser APIs such as DOM.\n  _Also use this profile if you are creating a library that can be consumed by both Node.js and web applications._\n\nAfter choosing a profile, create an **.eslintrc.js** (eslint before v9) or **eslint.config.mjs** (eslint after v9) config file that provides the Node.js `__dirname` context\nfor TypeScript. Add your profile string in the `extends` field, as shown below:\n\n**.eslintrc.js**\n\n```ts\n// This is a workaround for https://github.com/eslint/eslint/issues/3458\nrequire(\"@nordcloud/eslint-config-pat/patch/modern-module-resolution\");\n\nmodule.exports = {\n  extends: [\"@nordcloud/eslint-config-pat/profile/node\"], // \u003c---- put your profile string here\n  parserOptions: { tsconfigRootDir: __dirname },\n};\n```\n\n**eslint.config.mjs**\n\n```ts\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport js from \"@eslint/js\";\nimport tsParser from \"@typescript-eslint/parser\";\nimport { FlatCompat } from \"@eslint/eslintrc\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\nconst compat = new FlatCompat({\n  baseDirectory: __dirname,\n  recommendedConfig: js.configs.recommended,\n  allConfig: js.configs.all,\n});\n\nexport default [\n  {\n    ignores: [\"**/*.js\"], // \u003c---- ignore files\n  },\n  ...compat.extends(\"@nordcloud/eslint-config-pat/profile/web-app\"), // \u003c---- put your profile\n  {\n    languageOptions: {\n      parser: tsParser,\n      ecmaVersion: 5,\n      sourceType: \"script\",\n\n      parserOptions: {\n        tsconfigRootDir: __dirname,\n      },\n    },\n\n    settings: {\n      react: {\n        version: \"18.13.0\", // \u003c---- Your React version\n      },\n    },\n\n    rules: {\n      \"unicorn/expiring-todo-comments\": \"off\", // \u003c---- overwrite rules\n    },\n  },\n];\n```\n\n### 3. Add any relevant mixins\n\nOptionally, you can add some \"mixins\" to your `extends` array to opt-in to some extra behaviors.\n\nImportant: Your **.eslintrc.js** `\"extends\"` field must load mixins after the profile entry.\n\n#### `@nordcloud/eslint-config-pat/mixins/react`\n\nFor projects using the [React](https://reactjs.org/) library, the `@nordcloud/eslint-config-pat/mixins/react` mixin\nenables some recommended additional rules. These rules are selected via a mixin because they require you to:\n\n- Add `\"jsx\": \"react\"` to your **tsconfig.json**\n- Configure your `settings.react.version` as shown below. This determines which React APIs will be considered\n  to be deprecated. (If you omit this, the React version will be detected automatically by\n  [loading the entire React library](https://github.com/yannickcr/eslint-plugin-react/blob/4da74518bd78f11c9c6875a159ffbae7d26be693/lib/util/version.js#L23)\n  into the linter's process, which is costly.)\n\nAdd the mixin to your `\"extends\"` field like this:\n\n**.eslintrc.js**\n\n```ts\n// This is a workaround for https://github.com/eslint/eslint/issues/3458\nrequire(\"@nordcloud/eslint-config-pat/patch/modern-module-resolution\");\n\nmodule.exports = {\n  extends: [\n    \"@nordcloud/eslint-config-pat/profile/web-app\",\n    \"@nordcloud/eslint-config-pat/mixins/react\", // \u003c----\n  ],\n  parserOptions: { tsconfigRootDir: __dirname },\n\n  settings: {\n    react: {\n      version: \"16.13.0\", // \u003c---- Your React version\n    },\n  },\n};\n```\n\n**eslint.config.mjs**\n\n```ts\nexport default [\n  // Other configurations\n  ...compat\n    .extends(\"@nordcloud/eslint-config-pat/mixins/react\") // \u003c----\n    .map((config) =\u003e ({\n      ...config,\n      files: [\"src/**/*.ts\", \"src/**/*.tsx\"],\n    })),\n];\n```\n\n#### `@nordcloud/eslint-config-pat/mixins/vitest`\n\nFor projects using [Vitest](https://vitest.dev/) testing framework, the `@nordcloud/eslint-config-pat/mixins/vitest` mixin enables some recommended rules. In order to apply it:\n\n- Configure your `settings.env` as shown below.\n\nAdd the mixin to your `\"extends\"` field like this:\n\n**.eslintrc.js**\n\n```ts\n// This is a workaround for https://github.com/eslint/eslint/issues/3458\nrequire(\"@nordcloud/eslint-config-pat/patch/modern-module-resolution\");\n\nmodule.exports = {\n  extends: [\"@nordcloud/eslint-config-pat/mixins/vitest\"], // \u003c----\n  parserOptions: { tsconfigRootDir: __dirname },\n};\n```\n\n**eslint.config.mjs**\n\n```ts\nexport default [\n  ...compat.extends(\"@nordcloud/eslint-config-pat/mixins/vitest\"),\n];\n```\n\n#### `@nordcloud/eslint-config-pat/mixins/cypress`\n\nIf you are using [Cypress](https://www.cypress.io/) testing framework, the `@nordcloud/eslint-config-pat/mixins/cypress` mixin\nenables some specific rules.\n\nAdd the mixin to your `\"extends\"` field like this:\n\n**.eslintrc.js**\n\n```ts\n// This is a workaround for https://github.com/eslint/eslint/issues/3458\nrequire(\"@nordcloud/eslint-config-pat/patch/modern-module-resolution\");\n\nmodule.exports = {\n  extends: [\n    \"@nordcloud/eslint-config-pat/mixins/cypress\", // \u003c----\n  ],\n  parserOptions: { tsconfigRootDir: __dirname },\n};\n```\n\n**eslint.config.mjs**\n\n```ts\nexport default [\n  ...compat.extends(\"@nordcloud/eslint-config-pat/mixins/cypress\"), // \u003c----\n];\n```\n\n#### `@nordcloud/eslint-config-pat/mixins/node`\n\nMixin dedicated for Node.js servers.\n\n#### `@nordcloud/eslint-config-pat/mixins/react-testing`\n\nEnables rules for [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/).\n\n#### `@nordcloud/eslint-config-pat/mixins/playwright`\n\nEnables rules from [Playwright ESLint plugin](https://github.com/playwright-community/eslint-plugin-playwright).\n\n#### `@nordcloud/eslint-config-pat/mixins/graphql`\n\nEnables rules for GraphQL schema and operation files.\n\n**server**\n\n**.eslintrc.js**\n\n```ts\nmodule.exports = {\n  extends: [\"@nordcloud/eslint-config-pat/mixins/graphql/schema\"], // \u003c----\n};\n```\n\n**eslint.config.mjs**\n\n```ts\nexport default [\n  ...compat.extends(\"@nordcloud/eslint-config-pat/mixins/graphql/schema\"), // \u003c----\n];\n```\n\n**client**\n\n**.eslintrc.js**\n\n```ts\nmodule.exports = {\n  extends: [\n    \"@nordcloud/eslint-config-pat/mixins/graphql/operations\", // \u003c----\n  ],\n};\n```\n\n**eslint.config.mjs**\n\n```ts\nexport default [\n  ...compat.extends(\"@nordcloud/eslint-config-pat/mixins/graphql/operations\"), // \u003c----\n];\n```\n\n### 4. Prettier\n\nThe `@nordcloud/eslint-config-pat` ruleset is intended to be used with the Prettier code formatter. For general\ninstructions on setting that up, please refer to the [Prettier docs](https://prettier.io/docs/en/index.html).\n\n```sh\ncd your-project-folder\nnpm install -D prettier\n```\n\nAdd the prettier config file in the root directory:\n\n**prettier.config.js**\n\n```ts\nmodule.exports = {\n  ...require(\"@nordcloud/eslint-config-pat/prettier.config.js\"), // \u003c----\n  // Your overrides\n};\n```\n\n### 5. Stylelint\n\nIt's possible to use common [Stylelint](https://stylelint.io/) config from this package, you must setup stylelint first:\n\n```sh\ncd your-project-folder\nnpm install -D stylelint stylelint-config-recommended stylelint-config-styled-components stylelint-processor-styled-components\n```\n\nAdd the stylelint config file in the root directory:\n\n**stylelint.config.js**\n\n```ts\nmodule.exports = {\n  extends: \"@nordcloud/eslint-config-pat/stylelint.config.js\", // \u003c----\n  rules: {\n    // Your overrides\n  },\n};\n```\n\n## Credits\n\n- Based on [@rushstack/eslint-config](https://github.dev/microsoft/rushstack/tree/master/stack/eslint-config)\n- Migration guide for Eslint configuration: [Migrate to ESLint 9.x](https://tduyng.com/blog/migrating-to-eslint9x/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Feslint-config-pat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnordcloud%2Feslint-config-pat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Feslint-config-pat/lists"}