{"id":15415839,"url":"https://github.com/davidje13/typescript-eslint-converter","last_synced_at":"2026-04-12T21:35:18.627Z","repository":{"id":57383802,"uuid":"291269337","full_name":"davidje13/typescript-eslint-converter","owner":"davidje13","description":"Automatic ESLint rule conversions for TypeScript","archived":false,"fork":false,"pushed_at":"2022-01-07T18:39:01.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-08T14:02:52.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/davidje13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-29T12:42:45.000Z","updated_at":"2022-01-07T18:39:06.000Z","dependencies_parsed_at":"2022-09-14T00:52:33.361Z","dependency_job_id":null,"html_url":"https://github.com/davidje13/typescript-eslint-converter","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidje13%2Ftypescript-eslint-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidje13%2Ftypescript-eslint-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidje13%2Ftypescript-eslint-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidje13%2Ftypescript-eslint-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidje13","download_url":"https://codeload.github.com/davidje13/typescript-eslint-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244618448,"owners_count":20482319,"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-10-01T17:09:56.571Z","updated_at":"2026-04-12T21:35:13.599Z","avatar_url":"https://github.com/davidje13.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript ESLint Converter\n\nAutomatic ESLint rule conversions for TypeScript.\n\nESLint [replaces TSLint](https://eslint.org/blog/2019/01/future-typescript-eslint) for linting TypeScript.\n\nExisting JavaScript rules will be converted to support TypeScript, so you can combine this with base\nconfigurations such as airbnb easily. See below for full details.\n\n## Installation\n\nThis assumes you have already installed and configured ESLint.\n\n```bash\nnpm install --save-dev typescript-eslint-converter\n```\n\nChange your `.eslintrc.js`:\n\n```javascript\nconst typescriptEslintConverter = require('typescript-eslint-converter');\n\nmodule.exports = typescriptEslintConverter({\n  // existing configuration here; for example airbnb:\n  extends: ['airbnb'],\n});\n```\n\nThis project is not limited to airbnb! You can use any ESLint configuration, and it will be converted\nto be TypeScript-compatible (see below for full details).\n\nNote that by default, `indent` is _not_ converted to `@typescript-eslint/indent` (due to\n[typescript-eslint#1824](https://github.com/typescript-eslint/typescript-eslint/issues/1824)).\nIf you want to enable indentation linting despite the known issues, you can:\n\n```javascript\nconst typescriptEslintConverter = require('typescript-eslint-converter');\n\nmodule.exports = typescriptEslintConverter({\n  // existing configuration here\n}, {\n  indent: true, // enable indent -\u003e @typescript-eslint/indent conversion\n});\n```\n\n## Customisation\n\n### Adding or customising TypeScript-specific rules\n\nThe recommended way to add or customise TypeScript rules is with an `override`. This prevents\nESLint attempting to apply the rules to Javascript files:\n\n```javascript\nconst typescriptEslintConverter = require('typescript-eslint-converter');\n\nmodule.exports = typescriptEslintConverter({\n  extends: ['airbnb'], /* or whatever you are using */\n\n  overrides: [\n    {\n      files: ['*.ts', '*.tsx'],\n      rules: {\n        // examples:\n\n        // use airbnb quote rules for JS, but backticks for TS:\n        '@typescript-eslint/quotes': ['error', 'backtick'],\n\n        // TS-specific rule: enforce Array\u003cT\u003e rather than T[]\n        '@typescript-eslint/array-type': ['error', 'generic'],\n      },\n    }\n  ],\n});\n```\n\n### Options\n\nBy default, `ts` and `tsx` files will be handled as TypeScript. You can customise this if needed:\n\n```javascript\nconst typescriptEslintConverter = require('typescript-eslint-converter');\n\nmodule.exports = typescriptEslintConverter({\n  /* existing configuration here */\n}, {\n  // default values are shown:\n  typescriptFiles: ['*.ts', '*.tsx'],\n  resolveExtensions: ['js', 'mjs', 'jsx', 'mjsx', 'ts', 'tsx'],\n  autoParseResolvableExtensions: true,\n  useLoaderStyle: null,\n  recommended: true,\n  indent: false,\n});\n```\n\n- `typescriptFiles` controls the pattern used to identify a file as TypeScript when overriding rules.\n- `resolveExtensions` lists all file extensions which should be recognised by `import/resolver`.\n- `autoParseResolvableExtensions` enables empty `overrides` for all entries in `resolveExtensions`; this\n  means matching files will be linted without needing to specify `--ext` on the CLI. If you do not want\n  this behaviour, you can set it to `false` (all entries in `typescriptFiles` will continue to be linted\n  automatically). Note that this feature only works with ESLint 7+.\n- `useLoaderStyle` if `true`, forces `baseConfig`-style configuration (used by the `CLIEngine` API and\n  `eslint-loader`). If `false`, forces flat behaviour (matching `.eslintrc` files). By default, this\n  will automatically detect the presence of `baseConfig` in the input configuration. When using inside\n  a `.eslintrc` file, you should not need to change this. If using in a wrapper project (such as\n  `neutrino`), you may need to set this to `true` to guarantee correct behaviour.\n- `recommended` adds `'plugin:@typescript-eslint/recommended'` to the `extends` option.\n  If you do not want this, set it to `false`.\n- `indent` converts any existing `indent` rule to `@typescript-eslint/indent`. This is disabled by\n  default due to known issues with `@typescript-eslint/indent`.\n\n## Automatic rule conversion\n\nSeveral rules are automatically converted. If you believe another rule should be automatically converted, please\n[raise an issue](https://github.com/davidje13/typescript-eslint-converter/issues).\n\n### Global rule changes\n\n* `react/jsx-filename-extension`\n  - `extensions` will have `ts` and `tsx` added to mirror `js` and `jsx`.\n\n* `import/no-extraneous-dependencies`\n  - Any `devDependencies` glob patterns will be extended to include `.ts*` if they contain `.js*`.\n\n* `import/extensions`\n  - `.ts*` equivalents for all `.js*` extensions will be added.\n\n### TypeScript file rule changes\n\nThese rule changes only apply to `.ts` and `.tsx` source files:\n\n* Disable all rules [which are checked by the TypeScript compiler](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/eslint-recommended.ts):\n  - `getter-return`\n  - `no-dupe-args`\n  - `no-dupe-keys`\n  - `no-unreachable`\n  - `valid-typeof` \u0026amp; `babel/valid-typeof`\n  - `no-const-assign`\n  - `no-new-symbol`\n  - `no-this-before-super`\n  - `no-undef`\n  - `no-dupe-class-members`\n  - `no-redeclare`\n\n* Convert native ESLint and babel rules which [do not support TypeScript](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#extension-rules):\n  (any configuration is copied over; the TypeScript rules are config-compatible)\n\n  - `brace-style` \u0026rarr; `@typescript-eslint/brace-style`\n  - `comma-spacing` \u0026rarr; `@typescript-eslint/comma-spacing`\n  - `default-param-last` \u0026rarr; `@typescript-eslint/default-param-last`\n  - `dot-notation` \u0026rarr; `@typescript-eslint/dot-notation`\n    - The TypeScript rule offers [additional configuration options](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md)\n  - `func-call-spacing` \u0026rarr; `@typescript-eslint/func-call-spacing`\n  - `init-declarations` \u0026rarr; `@typescript-eslint/init-declarations`\n  - `keyword-spacing` \u0026rarr; `@typescript-eslint/keyword-spacing`\n  - `lines-between-class-members` \u0026rarr; `@typescript-eslint/lines-between-class-members`\n    - The TypeScript rule offers [additional configuration options](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md)\n  - `no-array-constructor` \u0026rarr; `@typescript-eslint/no-array-constructor`\n  - `no-dupe-class-members` \u0026rarr; `@typescript-eslint/no-dupe-class-members`\n  - `no-empty-function` \u0026rarr; `@typescript-eslint/no-empty-function`\n  - `no-extra-parens` \u0026rarr; `@typescript-eslint/no-extra-parens`\n  - `no-extra-semi` \u0026rarr; `@typescript-eslint/no-extra-semi`\n  - `no-invalid-this` \u0026amp; `babel/no-invalid-this` \u0026rarr; `@typescript-eslint/no-invalid-this`\n  - `no-loop-func` \u0026rarr; `@typescript-eslint/no-loop-func`\n  - `no-loss-of-precision` \u0026rarr; `@typescript-eslint/no-loss-of-precision`\n  - `no-magic-numbers` \u0026rarr; `@typescript-eslint/no-magic-numbers`\n    - The TypeScript rule offers [additional configuration options](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md)\n  - `no-redeclare` \u0026rarr; `@typescript-eslint/no-redeclare`\n    - The TypeScript rule offers [additional configuration options](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md)\n  - `no-shadow` \u0026rarr; `@typescript-eslint/no-shadow`\n    - The TypeScript rule offers [additional configuration options](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md)\n  - `no-unused-expressions` \u0026amp; `babel/no-unused-expressions` \u0026rarr; `@typescript-eslint/no-unused-expressions`\n  - `no-unused-vars` \u0026rarr; `@typescript-eslint/no-unused-vars`\n  - `no-use-before-define` \u0026rarr; `@typescript-eslint/no-use-before-define`\n    - The TypeScript rule offers [additional configuration options](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md)\n  - `no-useless-constructor` \u0026rarr; `@typescript-eslint/no-useless-constructor`\n  - `quotes` \u0026amp; `babel/quotes` \u0026rarr; `@typescript-eslint/quotes`\n  - `require-await` \u0026rarr; `@typescript-eslint/require-await`\n  - `no-return-await` \u0026rarr; `@typescript-eslint/return-await`\n    - The TypeScript rule offers [additional configuration options](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md)\n    - The default `in-try-catch` matches `no-return-await`'s behaviour\n  - `semi` \u0026amp; `babel/semi` \u0026rarr; `@typescript-eslint/semi`\n  - `space-before-function-paren` \u0026rarr; `@typescript-eslint/space-before-function-paren`\n\n* `indent`\n  - This rule is disabled by default due to [typescript-eslint#1824](https://github.com/typescript-eslint/typescript-eslint/issues/1824).\n  - If you want to enable indentation linting, use the `indent` option (described above).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidje13%2Ftypescript-eslint-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidje13%2Ftypescript-eslint-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidje13%2Ftypescript-eslint-converter/lists"}