{"_id":"@kesills/eslint-config-airbnb-typescript","_rev":"1-383a8c4f9d376db91ca6bc988037378c","name":"@kesills/eslint-config-airbnb-typescript","dist-tags":{"latest":"20.0.0"},"versions":{"19.0.0":{"name":"@kesills/eslint-config-airbnb-typescript","version":"19.0.0","keywords":["airbnb","config","eslint","eslintconfig","typescript"],"author":{"name":"Kenneth Sills","email":"ksills.dev@gmail.com"},"license":"MIT","_id":"@kesills/eslint-config-airbnb-typescript@19.0.0","maintainers":[{"name":"kesills","email":"ksills.dev+npm@gmail.com"}],"homepage":"https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript","bugs":{"url":"https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript/issues"},"dist":{"shasum":"3919f347bf29555bbaee148bec9aa9096b254632","tarball":"https://registry.npmjs.org/@kesills/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-19.0.0.tgz","fileCount":7,"integrity":"sha512-ZwZI44xFUBk/+nPv95abpf4KPrpoTWkEfDeUXjc+msL5RtVjAnL6Al2pLPquEea0GhFDk07H4zxpIemLrwnI8w==","signatures":[{"sig":"MEUCIGqY9QulPn6xf9g1awICM2dLBX+OH3urZEY6QP1grczEAiEAvhHi9q9gBd42IztHJOG5+89dXBtWZr0PjVsdlFDtSqs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22317},"main":"index.js","gitHead":"b5f651f6f61704a33997546f8ac308b5bb703c53","release":{"preset":"conventionalcommits","branches":["main"],"parserOpts":{"issuePrefixes":["Closes #","Close #"],"referenceActions":["R4ND0M"]}},"scripts":{"lint":"run-s lint:style lint:source lint:types","prepare":"husky","lint:fix":"run-s lint:style:fix lint:source:fix","lint:style":"prettier --check .","lint:types":"tsc","lint:source":"eslint .","lint:style:fix":"prettier --write .","lint:source:fix":"eslint --fix ."},"_npmUser":{"name":"kesills","email":"ksills.dev+npm@gmail.com"},"commitlint":{"extends":"@commitlint/config-conventional"},"repository":{"url":"git+https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript.git","type":"git"},"_npmVersion":"10.8.2","description":"Airbnb's ESLint config with TypeScript support","directories":{},"_nodeVersion":"20.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"9.1.5","prettier":"3.2.5","typescript":"5.3.3","npm-run-all2":"6.1.2","@commitlint/cli":"^19.4.0","semantic-release":"^24.1.0","eslint-plugin-import":"2.29.1","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^12.0.1","eslint-config-prettier":"9.1.0","@semantic-release/github":"^10.1.7","prettier-plugin-packagejson":"^2.5.2","@commitlint/config-conventional":"^19.2.2","@semantic-release/commit-analyzer":"^13.0.0","@semantic-release/release-notes-generator":"^14.0.1","conventional-changelog-conventionalcommits":"^8.0.0"},"peerDependencies":{"eslint":"^8.57.0","typescript":"*","eslint-config-airbnb":"^15.0.0","@stylistic/eslint-plugin":"^2.6.1","@typescript-eslint/parser":"^8.0.0","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"peerDependenciesMeta":{"typescript":{"optional":true},"eslint-config-airbnb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/eslint-config-airbnb-typescript_19.0.0_1724795301949_0.7455617729461801","host":"s3://npm-registry-packages"}},"20.0.0":{"name":"@kesills/eslint-config-airbnb-typescript","version":"20.0.0","description":"Airbnb's ESLint config with TypeScript support","keywords":["airbnb","config","eslint","eslintconfig","typescript"],"homepage":"https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript","bugs":{"url":"https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript/issues"},"repository":{"type":"git","url":"git+https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript.git"},"license":"MIT","author":{"name":"Kenneth Sills","email":"ksills.dev@gmail.com"},"main":"index.js","scripts":{"lint":"run-s lint:style lint:source lint:types","lint:fix":"run-s lint:style:fix lint:source:fix","lint:source":"eslint .","lint:source:fix":"eslint --fix .","lint:style":"prettier --check .","lint:style:fix":"prettier --write .","lint:types":"tsc","prepare":"husky"},"commitlint":{"extends":"@commitlint/config-conventional"},"release":{"branches":["main"],"parserOpts":{"referenceActions":["R4ND0M"],"issuePrefixes":["Closes #","Close #"]},"preset":"conventionalcommits"},"devDependencies":{"@commitlint/cli":"^19.4.0","@commitlint/config-conventional":"^19.2.2","@semantic-release/commit-analyzer":"^13.0.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^10.1.7","@semantic-release/npm":"^12.0.1","@semantic-release/release-notes-generator":"^14.0.1","conventional-changelog-conventionalcommits":"^8.0.0","eslint-config-prettier":"9.1.0","eslint-plugin-import":"2.29.1","husky":"9.1.5","npm-run-all2":"6.1.2","prettier":"3.2.5","prettier-plugin-packagejson":"^2.5.2","semantic-release":"^24.1.0","typescript":"5.3.3"},"peerDependencies":{"@stylistic/eslint-plugin":"^2.6.1","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","eslint":"^8.57.0","eslint-config-airbnb":"^19.0.0","eslint-config-airbnb-base":"^15.0.0","typescript":"*"},"peerDependenciesMeta":{"eslint-config-airbnb":{"optional":true},"typescript":{"optional":true}},"publishConfig":{"access":"public"},"_id":"@kesills/eslint-config-airbnb-typescript@20.0.0","gitHead":"b22bb83b057370c169cb975bca9b69b674f99940","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-P3DBcIs5eQsEMz4mgwG9ZsOqwE42EGFJ+fI49IFp8ai8D2dHhByr7oUoTW6aDzGe4tVjFOfCjEjcAA1b8sVWTg==","shasum":"a4f8cc37104de289e2717812d60960b7c52da916","tarball":"https://registry.npmjs.org/@kesills/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-20.0.0.tgz","fileCount":7,"unpackedSize":22276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDP6YO1toPt00gIKxdUmTbhS3TE9Ar0EX6OkJr6PoKmEQIgOY1ox4HBisF1A9xyttjtKliiqUWBd7SkEE2kYh2/Ss8="}]},"_npmUser":{"name":"kesills","email":"ksills.dev+npm@gmail.com"},"directories":{},"maintainers":[{"name":"kesills","email":"ksills.dev+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-config-airbnb-typescript_20.0.0_1726525414712_0.7627742055672289"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-27T21:48:21.837Z","modified":"2024-09-16T22:23:35.090Z","19.0.0":"2024-08-27T21:48:22.091Z","20.0.0":"2024-09-16T22:23:34.902Z"},"bugs":{"url":"https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript/issues"},"author":{"name":"Kenneth Sills","email":"ksills.dev@gmail.com"},"license":"MIT","homepage":"https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript","keywords":["airbnb","config","eslint","eslintconfig","typescript"],"repository":{"type":"git","url":"git+https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript.git"},"description":"Airbnb's ESLint config with TypeScript support","maintainers":[{"name":"kesills","email":"ksills.dev+npm@gmail.com"}],"readme":"# Typescript Compatible Airbnb Rules for ESLint\n\n[![semantic-release: conventional](https://img.shields.io/badge/semantic--release-conventional-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) [![Version](https://img.shields.io/npm/v/@kesills/eslint-config-airbnb-typescript.svg?style=flat-square)](https://www.npmjs.com/package/@kesills/eslint-config-airbnb-typescript?activeTab=versions) [![Downloads](https://img.shields.io/npm/dm/@kesills/eslint-config-airbnb-typescript.svg?style=flat-square)](https://www.npmjs.com/package/@kesills/eslint-config-airbnb-typescript)\n\nEnhances [Airbnb's ESLint config](https://www.npmjs.com/package/eslint-config-airbnb) with TypeScript support.\nForked from the generous work of [Matt Turnbull](https://github.com/iamturns/eslint-config-airbnb-typescript)!\n\n> [!WARNING]\n> We currently **do not** support ESLint v9 or above. Please see issue #15 to track progress.\n\n## Setup\n\n### Installation\n\nStart by installing both ESLint and Typescript in your project. Afterwards, you can install this config through your favorite package manager normally:\n\n```sh\nnpm install -D @kesills/eslint-config-airbnb-typescript\n```\n\nIf you're using React, you'll also need to install the appropriate Airbnb rules separately:\n\n```sh\nnpm install -D eslint-config-airbnb\n```\n\n> [!NOTE]\n> While current versions of NPM will automatically install peer dependencies, if you're using a version of NPM prior to v7, you will need to install them manually instead:\n>\n> ```sh\n> npm install -D \\\n>   eslint@^8.56 \\\n>   eslint-config-airbnb-base \\\n>   @stylistic/eslint-plugin \\\n>   @typescript-eslint/eslint-plugin@^8 \\\n>   @typescript-eslint/parser@^8\n> ```\n\n### Configuration\n\nNext, tell ESLint to extend from this configuration. And since we need to access type information, a `tsconfig.json` and some setup for [`@typescript-eslint/parser`](https://typescript-eslint.io/packages/parser/) to recognize it are required.\n\n> [!IMPORTANT]\n> These instructions assume you are on the current LTS version of Node. If you are using a Node version older than v20, you will need to update any references to `import.meta.dirname` to use [a `__dirname` workaround](https://github.com/iamturns/eslint-config-airbnb-typescript/issues/307#issuecomment-2153373493) instead.\n\n#### Recommended - Flat Config\n\nSince we don't yet have first-class support for the new flat configuration format (see #14 for progress), [ESLint's compatability utility](https://www.npmjs.com/package/@eslint/eslintrc) is needed:\n\n```sh\nnpm install -D @eslint/eslintrc\n```\n\nThen you'll want to set up your `eslint.config.js` something like this:\n\n```js\nimport { FlatCompat } from '@eslint/eslintrc';\n\nconst compat = new FlatCompat({\n  baseDirectory: import.meta.dirname,\n});\n\nexport default [\n  // Without React\n  ...compat.extends('airbnb-base'),\n  ...compat.extends('@kesills/airbnb-typescript/base'),\n\n  // With React\n  ...compat.extends('airbnb'),\n  ...compat.extends('@kesills/airbnb-typescript'),\n\n  // Either way\n  {\n    languageOptions: {\n      parserOptions: {\n        projectService: true,\n        tsconfigRootDir: import.meta.dirname,\n      },\n    },\n  },\n];\n```\n\n#### Legacy Config\n\nIf you're stuck on the legacy `.eslintrc` format, you'll want to set up your `.eslintrc.js` similar to this:\n\n```js\nmodule.exports = {\n  extends: [\n    // Without React\n    'airbnb-base',\n    '@kesills/airbnb-typescript/base'\n\n    // With React\n    'airbnb',\n    '@kesills/airbnb-typescript'\n  ],\n  parserOptions: {\n    projectService: true,\n    tsconfigRootDir: import.meta.dirname,\n  },\n};\n```\n\n### Running ESLint\n\nOnce set up, you can use ESLint as you would normally. In the root directory of your project, run:\n\n```sh\nnpx eslint . --ext .js,.jsx,.ts,.tsx\n```\n\nESLint will lint all .js, .jsx, .ts, and .tsx files within the current folder, and output results to your terminal.\n\nYou can also get results in realtime inside most IDEs via a plugin. See [ESLint's integration documentation](https://eslint.org/docs/latest/use/integrations) for more details.\n\n## FAQ\n\n### I get this error when running ESLint: \"The file must be included in at least one of the projects provided\"\n\nThis means you are attempting to lint a file that `tsconfig.json` doesn't include.\nPlease refer to the [`typescript-eslint`](https://typescript-eslint.io/troubleshooting/typed-linting#traditional-project-issues) FAQ on how best to resolve this.\n\n### I wish this config would support [...]\n\nThis config simply enhances the Airbnb with TypeScript support. It's not a single config to cater for all TypeScript linting requirements. For additional functionality, alter your ESLint config file. For example:\n\n```js\nimport typescriptPlugin from 'typescript-eslint';\n\n// ...\n\nexport default [\n  ...compat.extends('airbnb-base'),\n  ...compat.extends('airbnb/hooks'),\n  ...compat.extends('@kesills/airbnb-typescript/base'),\n  ...typescriptPlugin.configs.recommendedTypeChecked,\n  ...typescriptPlugin.configs.stylisticTypeChecked,\n  {\n    languageOptions: {\n      parserOptions: {\n        projectService: true,\n        tsconfigRootDir: import.meta.dirname,\n      },\n    },\n  },\n];\n```\n\n### I use Prettier / StandardJS, how do I remove formatting rules?\n\nThere are a couple of approaches to achieve this.\n\n#### Configuration\n\nSince the base Airbnb configs still use ESLint's legacy formatting rules, you can extend [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier) to disable them. However, with ESLint [deprecating all formatting rules](https://eslint.org/blog/2023/10/deprecating-formatting-rules/) and [`typescript-eslint` outright removing them](https://typescript-eslint.io/users/what-about-formatting/), all our styling rules now originate from [ESLint Stylistic](https://eslint.style), which is not supported by the Prettier config (see upstream issue [#283](https://github.com/prettier/eslint-config-prettier/issues/283) to track progress).\n\nTherefore, you'll need to disable all these rules manually. Luckily, this is pretty easy with flat configurations:\n\n```js\nimport stylistic from '@stylistic/eslint-plugin';\n\nexport default [\n  // ...\n\n  {\n    rules: Object.fromEntries(\n      Object.keys(stylisticPlugin.configs['all-flat'].rules ?? {}).map((key) => [key, 'off']),\n    ),\n  },\n];\n```\n\n#### Combined Tooling\n\nAnother approach is to use [`prettier-eslint`](https://github.com/prettier/prettier-eslint), which keeps the styling rules enabled and just combines the execution of ESLint and Prettier so the conflicts aren't user-facing. The CLI tool itself can be found under [`prettier-eslint-cli`](https://github.com/prettier/prettier-eslint-cli).\n\n### Why is `import/no-unresolved` disabled?\n\nTwo reasons:\n\n1. It requires additional configuration, which may be different for monorepo's, webpack usage, etc\n2. The rule offers little value in a TypeScript world, as the TypeScript compiler will catch these errors\n\nIf you would like to enable this rule, then:\n\n- Enable the rule within your config: `'import/no-unresolved': 'error'`\n- Install and configure the TypeScript import resolver: [eslint-import-resolver-typescript](https://www.npmjs.com/package/eslint-import-resolver-typescript)\n\n## Credits\n\nOriginally authored by Matt Turnbull. Forked and maintained by Kenneth Sills.\n\nA big thank you to all [contributors](https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript/graphs/contributors)!\n","readmeFilename":"README.md"}