1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["365"],{10799(e,n,t){t.r(n),t.d(n,{metadata:()=>s,default:()=>p,frontMatter:()=>l,contentTitle:()=>c,toc:()=>d,assets:()=>u});var s=JSON.parse('{"id":"troubleshooting/faqs/general","title":"General","description":"Frequently asked questions about configuring rules, checking versions, and linting performance.","source":"@site/../../docs/troubleshooting/faqs/General.mdx","sourceDirName":"troubleshooting/faqs","slug":"/troubleshooting/faqs/general","permalink":"/troubleshooting/faqs/general","draft":false,"unlisted":false,"editUrl":"https://github.com/typescript-eslint/typescript-eslint/edit/main/packages/website/../../docs/troubleshooting/faqs/General.mdx","tags":[],"version":"current","frontMatter":{"description":"Frequently asked questions about configuring rules, checking versions, and linting performance.","id":"general","title":"General","pagination_next":"troubleshooting/faqs/eslint","image":"/img/og/docs/troubleshooting/faqs/General.png"},"sidebar":"docs","previous":{"title":"Linting with Type Information","permalink":"/getting-started/typed-linting"},"next":{"title":"ESLint","permalink":"/troubleshooting/faqs/eslint"}}'),r=t(65723),i=t(7143),o=t(70503),a=t(46742);let l={description:"Frequently asked questions about configuring rules, checking versions, and linting performance.",id:"general",title:"General",pagination_next:"troubleshooting/faqs/eslint",image:"/img/og/docs/troubleshooting/faqs/General.png"},c,u={},d=[{value:"How do I turn on a <code>@typescript-eslint</code> rule?",id:"how-do-i-turn-on-a-typescript-eslint-rule",level:2},{value:"How do I configure JS/TS rules alongside non-JS/TS files such as JSON?",id:"how-do-i-configure-jsts-rules-alongside-non-jsts-files-such-as-json",level:2},{value:"How can I ban <code><specific language feature></code>?",id:"how-can-i-ban-specific-language-feature",level:2},{value:"How do I check to see what versions are installed?",id:"how-do-i-check-to-see-what-versions-are-installed",level:2},{value:"Changes to one file are not reflected when linting other files in my IDE",id:"changes-to-one-file-are-not-reflected-when-linting-other-files-in-my-ide",level:2},{value:"I get <code>no-unsafe-*</code> complaints for cross-file changes",id:"i-get-no-unsafe--complaints-for-cross-file-changes",level:3},{value:"How does typescript-eslint compare to native-speed linters?",id:"how-does-typescript-eslint-compare-to-native-speed-linters",level:2},{value:""The '<code><key></code>' property is deprecated on '<code><type></code>' nodes. Use '<code><key></code>' instead." warnings",id:"the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings",level:2},{value:"My linting feels really slow",id:"my-linting-feels-really-slow",level:2}];function h(e){let n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",meta:"meta",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components},{Details:t,Head:s}=n;return t||f("Details",!0),s||f("Head",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.h2,{id:"how-do-i-turn-on-a-typescript-eslint-rule",children:["How do I turn on a ",(0,r.jsx)(n.code,{children:"@typescript-eslint"})," rule?"]}),"\n",(0,r.jsx)(n.p,{children:"First make sure you've read the docs and understand ESLint configuration files:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/getting-started/",children:"Read our getting started guide"})," to ensure your config is properly setup to start configuring our rules."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://eslint.org/docs/latest/use/configure/rules",children:"Checkout ESLint's documentation on configuring rules"})," to ensure you understand how to configure rules."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Our ",(0,r.jsx)(n.a,{href:"/rules",children:"rule docs"}),' detail the options each rule supports under the "Options" heading.\nWe use TypeScript types to describe an ',(0,r.jsx)(n.code,{children:"Options"})," tuple type for the rule which you can use to configure the rule.\nIn your config file the keys of the ",(0,r.jsx)(n.code,{children:"rules"})," object are the names of the rules you wish to configure and the values follow the following form:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type Severity = 'off' | 'warn' | 'error';\ntype RuleConfig =\n | Severity\n | [Severity]\n | [\n Severity,\n // Options is the tuple type from the rule docs\n ...Options,\n ];\n"})}),"\n",(0,r.jsx)(n.p,{children:"Some examples"}),"\n",(0,r.jsxs)(o.A,{groupId:"eslint-config",children:[(0,r.jsx)(a.A,{value:"Flat Config",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="eslint.config.mjs"',children:"export default defineConfig({\n files: ['**/*.{js,ts}'],\n // ... the rest of your typescript config ...\n rules: {\n // turns a rule on with
1no configuration (i.e. uses the default configuration)\n '@typescript-eslint/array-type': 'error',\n // turns on a rule with configuration\n '@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }],\n },\n});\n"})})}),(0,r.jsx)(a.A,{value:"Legacy Config",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title=".eslintrc.cjs"',children:"module.exports = {\n // ... the rest of your config ...\n rules: {\n // turns a rule on with no configuration (i.e. uses the default configuration)\n '@typescript-eslint/array-type': 'error',\n // turns on a rule with configuration\n '@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }],\n },\n};\n"})})})]}),"\n",(0,r.jsx)(n.h2,{id:"how-do-i-configure-jsts-rules-alongside-non-jsts-files-such-as-json",children:"How do I configure JS/TS rules alongside non-JS/TS files such as JSON?"}),"\n",(0,r.jsxs)(n.p,{children:["When your project mixes JavaScript/TypeScript with files handled by other plugins (JSON, Markdown, etc.), it can be tempting to enable the JS/TS rules for ",(0,r.jsx)(n.em,{children:"all"})," files and then turn them off again for the non-JS/TS files.\nThat approach is error-prone: some rules - including ones that don't require type information, such as ",(0,r.jsx)(n.a,{href:"/rules/consistent-type-assertions",children:(0,r.jsx)(n.code,{children:"consistent-type-assertions"})})," - will still report on files they were never meant to lint."]}),"\n",(0,r.jsxs)(n.p,{children:["Instead, scope each set of rules to the files it applies to using ",(0,r.jsx)(n.a,{href:"https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores",children:(0,r.jsx)(n.code,{children:"files"})}),".\nThat way JS/TS rules only ever run on JS/TS files, and the other plugins only ever run on their own files.\nThis is also faster, since ESLint won't run rules against files they don't apply to:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="eslint.config.mjs"',children:"import js from '@eslint/js';\nimport packageJson from 'eslint-plugin-package-json';\nimport { defineConfig } from 'eslint/config';\nimport tseslint from 'typescript-eslint';\n\nexport default defineConfig(\n {\n files: ['package.json'],\n extends: [packageJson.configs.recommended],\n },\n {\n files: ['**/*.{js,ts}'],\n extends: [js.configs.recommended, tseslint.configs.recommended],\n },\n);\n"})}),"\n",(0,r.jsxs)(n.h2,{id:"how-can-i-ban-specific-language-feature",children:["How can I ban ",(0,r.jsx)(n.code,{children:"<specific language feature>"}),"?"]}),"\n",(0,r.jsxs)(n.p,{children:["ESLint core contains the rule ",(0,r.jsx)(n.a,{href:"https://eslint.org/docs/rules/no-restricted-syntax",children:(0,r.jsx)(n.code,{children:"no-restricted-syntax"})}),".\nThis generic rule allows you to specify a ",(0,r.jsx)(n.a,{href:"https://eslint.org/docs/developer-guide/selectors",children:"selector"})," for the code you want to ban, along with a custom error message."]}),"\n",(0,r.jsxs)(n.p,{children:["You can use an AST visualization tool such as ",(0,r.jsx)(n.a,{href:"/play#showAST=es",children:"typescript-eslint playground"})," > ",(0,r.jsx)(n.em,{children:"Options"})," > ",(0,r.jsx)(n.em,{children:"AST Explorer"})," on its left sidebar by selecting ",(0,r.jsx)(n.em,{children:"ESTree"})," to help in figuring out the structure of the AST that you want to ban."]}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Banning confusing property uses"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsonc",children:'{\n "rules": {\n "no-restricted-syntax": [\n "error",\n\n // Ban accessing `constructor.name`:\n {\n "selector": "MemberExpression[object.property.name=\'constructor\'][property.name=\'name\']",\n "message": "\'constructor.name\' is not reliable after code minifier usage.",\n },\n\n // Ban get and set accessors:\n {\n "selector": "Property:matches([kind = \\"get\\"], [kind = \\"set\\"]), MethodDefinition:matches([kind = \\"get\\"], [kind = \\"set\\"])",\n "message": "Don\'t use get and set accessors.",\n },\n ],\n },\n}\n'})})]}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Banning specific uses of class properties"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsonc",children:'{\n "rules": {\
1n "no-restricted-syntax": [\n "error",\n\n // Ban `private` members:\n {\n "selector": ":matches(PropertyDefinition, MethodDefinition)[accessibility=\\"private\\"]",\n "message": "Use `#private` members instead.",\n },\n\n // Ban `#private` members:\n {\n "selector": ":matches(PropertyDefinition, MethodDefinition) > PrivateIdentifier.key",\n "message": "Use the `private` modifier instead.",\n },\n\n // Ban static `this`:\n {\n "selector": "MethodDefinition[static = true] ThisExpression",\n "message": "Prefer using the class\'s name directly.",\n },\n ],\n },\n}\n'})})]}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Banning specific uses of TypeScript enums"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsonc",children:'{\n "rules": {\n "no-restricted-syntax": [\n "error",\n\n // Ban all enums:\n {\n "selector": "TSEnumDeclaration",\n "message": "My reason for not using any enums at all.",\n },\n\n // Ban just `const` enums:\n {\n "selector": "TSEnumDeclaration[const=true]",\n "message": "My reason for not using const enums.",\n },\n\n // Ban just non-`const` enums:\n {\n "selector": "TSEnumDeclaration:not([const=true])",\n "message": "My reason for not using non-const enums.",\n },\n ],\n },\n}\n'})})]}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Banning specific uses of TypeScript tuples"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsonc",children:'{\n "rules": {\n "no-restricted-syntax": [\n "error",\n // enforce tuple members have labels\n {\n "selector": "TSTupleType > :not(TSNamedTupleMember)",\n "message": "All tuples should have labels.",\n },\n ],\n },\n}\n'})})]}),"\n",(0,r.jsx)(n.h2,{id:"how-do-i-check-to-see-what-versions-are-installed",children:"How do I check to see what versions are installed?"}),"\n",(0,r.jsx)(n.p,{children:"If you have multiple versions of our tooling, it can cause various bugs for you.\nThis is because ESLint may load a different version each run depending on how you run it - leading to inconsistent lint results."}),"\n",(0,r.jsxs)(n.p,{children:["Installing our tooling in the root of your project does not mean that only one version is installed.\nOne or more of your dependencies may have its own dependency on our tooling, meaning ",(0,r.jsx)(n.code,{children:"npm"}),"/",(0,r.jsx)(n.code,{children:"yarn"})," will additionally install that version for use by that package.\nFor example, ",(0,r.jsx)(n.code,{children:"react-scripts"})," (part of ",(0,r.jsx)(n.code,{children:"create-react-app"}),") has a dependency on our tooling."]}),"\n",(0,r.jsx)(n.p,{children:"You can check what versions are installed in your project using the following commands:"}),"\n",(0,r.jsxs)(o.A,{groupId:"npm2yarn",children:[(0,r.jsx)(a.A,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm list @typescript-eslint/eslint-plugin @typescript-eslint/parser\n"})})}),(0,r.jsx)(a.A,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'yarn list --pattern "@typescript-eslint/eslint-plugin|@typescript-eslint/parser"\n'})})}),(0,r.jsx)(a.A,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm list @typescript-eslint/eslint-plugin @typescript-eslint/parser\n"})})}),(0,r.jsx)(a.A,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun pm ls @typescript-eslint/eslint-plugin @typescript-eslint/parser\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["If you see more than one version installed, then you will have to either use ",(0,r.jsx)(n.a,{href:"https://classic.yarnpkg.com/en/docs/selective-version-resolutions",children:"yarn resolutions"})," to force a single version, or you will have to downgrade your root versions to match the dependency versions."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"The best course of action in this case is to wait until your dependency releases a new version with support for our latest versions."})}),"\n",(0,r.jsx)(n.h2,{id:"changes-to-one-file-are-not-reflected-when-linting-other-files-in-my-ide",children:"Changes to one file are not reflected when linting other files in my IDE"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:"tl;dr: Restart your ESLint server to force an update."}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"ESLint currently does not have any way of telling parsers such as ours when an arbitrary file is changed on disk.\nThat means if you change file A that is imported by file B, it won't update lint caches for file B -- even if file B's text contents have changed.\nSometimes the only solution is to restart your ESLint editor extension altogether."}),"\n",(0,r.jsxs)(n.p,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/typescript-eslint/typescript-eslint/issues/5845#issuecomment-1283248238",title:"GitHub issue 5845, comment 1283248238: details on ESLint cross-file caching",children:"this issue comment"})," for more information."]}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",children:"VS Code's ESLint extension"})," provides an ",(0,r.jsx)(n.code,{children:"ESLint: Restart ESLint Server"})," action."]})}),"\n",(0,r.jsxs)(n.h3,{id:"i-get-no-unsafe--complaints-for-cross-file-changes",children:["I get ",(0,r.jsx)(n.code,{children:"no-unsafe-*"})," complaints for cross-file changes"]}),"\n",(0,r.jsxs)(n.p,{children:["See ",(0,r.jsx)(n.a,{href:"#changes-to-one-file-are-not-reflected-when-linting-other-files-in-my-ide",children:"Changes to one file are not reflected in linting other files in my IDE"}),".\nRules such as ",(0,r.jsx)(n.a,{href:"/rules/no-unsafe-argument",children:(0,r.jsx)(n.code,{children:"no-unsafe-argument"})}),", ",(0,r.jsx)(n.a,{href:"/rules/no-unsafe-assignment",children:(0,r.jsx)(n.code,{children:"no-unsafe-assignment"})}),", and ",(0,r.jsx)(n.a,{href:"/rules/no-unsafe-call",children:(0,r.jsx)(n.code,{children:"no-unsafe-call"})})," are often impacted."]}),"\n",(0,r.jsx)(n.h2,{id:"how-does-typescript-eslint-compare-to-native-speed-linters",children:"How does typescript-eslint compare to native-speed linters?"}),"\n",(0,r.jsxs)(n.p,{children:['"Native-speed" linters such as ',(0,r.jsx)(n.a,{href:"https://biomejs.dev/linter",children:"Biome linter"}),", ",(0,r.jsx)(n.a,{href:"https://docs.deno.com/runtime/manual/tools/linter",children:"Deno linter"}),", and ",(0,r.jsx)(n.a,{href:"https://oxc.rs/docs/guide/usage/linter.html",children:"oxlint"})," run in very fast languages such as Go or Rust, and so can generally run significantly faster than ESLint in non-type-aware-linting.\nThey can also be easier to configure because they don't need to support the full ecosystem and legacy trail of ESLint."]}),"\n",(0,r.jsxs)(n.p,{children:["However, until they support ",(0,r.jsx)(n.a,{href:"/getting-started/typed-linting",children:"typed linting"}),', they aren\'t a full replacement for typescript-eslint.\nIf you plan on using them, we recommend "dual linting": using those linters for what they support, then adding in ESLint for typed linting in a parallel or second step.\nOur ',(0,r.jsx)(n.code,{children:"*-type-checked-only"})," ",(0,r.jsx)(n.a,{href:"/users/configs",children:"Shared Configs"})," will enable only type-checked rules in your ESLint config."]}),"\n",(0,r.jsxs)(n.p,{children:["For example, the following config enables only the recommended config's type-checked rules with ",(0,r.jsx)(n.a,{href:"/users/configs#recommended-type-checked-only",children:(0,r.jsx)(n.code,{children:"recommendedTypeCheckedOnly"})}),":"]}),"\n",(0,r.jsxs)(o.A,{groupId:"eslint-config",children:[(0,r.jsx)(a.A,{value:"Flat Config",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="eslint.config.mjs"',children:"import js from '@eslint/js';\nimport { defineConfig } from 'eslint/config';\nimport tseslint from 'typescript-eslint';
1\n\nexport default defineConfig({\n files: ['**/*.{js,ts}'],\n extends: [\n tseslint.configs.recommendedTypeCheckedOnly,\n {\n languageOptions: {\n parserOptions: {\n projectService: true,\n },\n },\n },\n ],\n});\n"})})}),(0,r.jsx)(a.A,{value:"Legacy Config",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title=".eslintrc.cjs"',children:"module.exports = {\n extends: ['plugin:@typescript-eslint/recommended-type-checked-only'],\n parserOptions: {\n projectService: true,\n tsconfigRootDir: __dirname,\n },\n root: true,\n};\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["For example, ",(0,r.jsx)(n.a,{href:"https://oxc.rs/docs/guide/usage/linter#eslint",children:"oxlint's Integration > ESLint documentation"})," describes how to turn off ESLint rules that are already supported by oxlint."]}),"\n",(0,r.jsxs)(n.h2,{id:"the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings",children:["\"The '",(0,r.jsx)(n.code,{children:"<key>"}),"' property is deprecated on '",(0,r.jsx)(n.code,{children:"<type>"}),"' nodes. Use '",(0,r.jsx)(n.code,{children:"<key>"}),"' instead.\" warnings"]}),"\n",(0,r.jsx)(n.p,{children:"If you're seeing this warning, it's likely you're using an ESLint plugin (or other tooling) that hasn't been updated for typescript-eslint v6.\nMake sure you're using the latest versions of each of your ESLint plugins (and other tooling)."}),"\n",(0,r.jsx)(n.p,{children:"If you're using many ESLint plugins, have updated each to their latest version, and you're not sure which one this complaint is coming from, try either or both of:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Running with ",(0,r.jsx)(n.a,{href:"https://nodejs.org/api/cli.html#--trace-deprecation",children:(0,r.jsx)(n.code,{children:"--trace-deprecation"})})," (e.g. ",(0,r.jsx)(n.code,{children:"npx cross-env NODE_OPTIONS=--trace-deprecation npm run lint"}),")"]}),"\n",(0,r.jsx)(n.li,{children:"Disabling half of them at a time to narrow down which plugin it is"}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Then make sure each of those plugins has a GitHub issue asking that they release a version supporting typescript-eslint v6."}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["For developers updating ESLint rules in plugins that still need to support typescript-eslint v5: you may need to ",(0,r.jsx)(n.code,{children:"||"})," fall back to the old property key if the new one doesn't exist:"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-diff",children:"- node.typeParameters\n+ node.typeArguments || node.typeParameters\n"})})]}),"\n",(0,r.jsxs)(n.p,{children:["For more context, see the ",(0,r.jsx)(n.a,{href:"https://github.com/typescript-eslint/typescript-eslint/issues/146",children:"Some properties named typeParameters instead of typeArguments"})," issue, and the implementing ",(0,r.jsx)(n.a,{href:"https://github.com/typescript-eslint/typescript-eslint/pull/5384",children:"fix: rename typeParameters to typeArguments where needed"})," pull request."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.a,{href:"/blog/announcing-typescript-eslint-v6-beta",children:"typescript-eslint v6 release post"})," has more information on typescript-eslint v6."]}),"\n",(0,r.jsx)(n.h2,{id:"my-linting-feels-really-slow",children:"My linting feels really slow"}),"\n",(0,r.jsxs)(n.p,{children:["If you think you're having issues with performance, see our ",(0,r.jsx)(n.a,{href:"/troubleshooting/typed-linting/performance",children:"Performance Troubleshooting documentation"}),"."]}),"\n",(0,r.jsx)(s,{children:(0,r.jsx)("script",{type:"application/ld+json",children:'{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","acceptedAnswer":{"@type":"Answer","name":"How do I turn on a @typescript-eslint rule?","text":"First make sure you\'ve read the docs and understand ESLint configuration files: Read more on our website!"}},{"@type":"Question","acceptedAnswer":{"@type":"Answer","name":"How do I configure JS/TS rules alongside non-JS/TS files such as JSON?","text":"When your project mixes JavaScript/TypeScript with files handled by other plugins (JSON, Markdown, etc.), it can be tempting to enable the JS/TS rules for all files and then turn them off again for the non-JS/TS files.\\nThat approach is error-prone: some rules - including ones that don\'t require type information, such as consistent-type-assertions - will still report on files they were never meant to lint. Read more on our website!"}}
1,{"@type":"Question","acceptedAnswer":{"@type":"Answer","name":"How can I ban <specific language feature>?","text":"ESLint core contains the rule no-restricted-syntax.\\nThis generic rule allows you to specify a selector for the code you want to ban, along with a custom error message. Read more on our website!"}},{"@type":"Question","acceptedAnswer":{"@type":"Answer","name":"How do I check to see what versions are installed?","text":"If you have multiple versions of our tooling, it can cause various bugs for you.\\nThis is because ESLint may load a different version each run depending on how you run it - leading to inconsistent lint results. Read more on our website!"}},{"@type":"Question","acceptedAnswer":{"@type":"Answer","name":"I get no-unsafe-* complaints for cross-file changes","text":"See Changes to one file are not reflected in linting other files in my IDE.\\nRules such as no-unsafe-argument, no-unsafe-assignment, and no-unsafe-call are often impacted. Read more on our website!"}},{"@type":"Question","acceptedAnswer":{"@type":"Answer","name":"How does typescript-eslint compare to native-speed linters?","text":"\\"Native-speed\\" linters such as Biome linter, Deno linter, and oxlint run in very fast languages such as Go or Rust, and so can generally run significantly faster than ESLint in non-type-aware-linting.\\nThey can also be easier to configure because they don\'t need to support the full ecosystem and legacy trail of ESLint. Read more on our website!"}},{"@type":"Question","acceptedAnswer":{"@type":"Answer","name":"\\"The \'<key>\' property is deprecated on \'<type>\' nodes. Use \'<key>\' instead.\\" warnings","text":"If you\'re seeing this warning, it\'s likely you\'re using an ESLint plugin (or other tooling) that hasn\'t been updated for typescript-eslint v6.\\nMake sure you\'re using the latest versions of each of your ESLint plugins (and other tooling). Read more on our website!"}},{"@type":"Question","acceptedAnswer":{"@type":"Answer","name":"My linting feels really slow","text":"If you think you\'re having issues with performance, see our Performance Troubleshooting documentation. Read more on our website!"}}]}'})}),"\n",(0,r.jsx)(s,{children:(0,r.jsx)(n.meta,{content:"General: Frequently asked questions about configuring rules, checking versions, and linting performance.",name:"twitter:image:alt"})})]})}function p(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}function f(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},46742(e,n,t){t.d(n,{A:()=>a});var s=t(65723);t(22155);var r=t(70851),i=t(28226);function o({children:e,className:n,hidden:t}){return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)("tabItem_eQ9s",n),hidden:t,children:e})}function a({children:e,className:n,value:t}){let{selectedValue:r,lazy:l}=(0,i.uc)(),c=t===r;return!c&&l?null:(0,s.jsx)(o,{className:n,hidden:!c,children:e})}},70503(e,n,t){t.d(n,{A:()=>h});var s=t(65723);t(22155);var r=t(70851),i=t(98838),o=t(28226),a=t(26309),l=t(29021);function c({className:e}){let{selectedValue:n,selectValue:t,tabValues:i,block:l}=(0,o.uc)(),u=[],{blockElementScrollPositionUntilNextRender:d}=(0,a.a_)(),h=e=>{let s=e.currentTarget,r=i[u.indexOf(s)].value;r!==n&&(d(s),t(r))},p=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let t=u.indexOf(e.currentTarget)+1;n=u[t]??u[0];break}case"ArrowLeft":{let t=u.indexOf(e.currentTarget)-1;n=u[t]??u[u.length-1]}}n?.focus()};return(0,s.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":l},e),children:i.map(({value:e,label:t,attributes:i})=>(0,s.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{u.push(e)},onKeyDown:p,onClick:h,...i,className:(0,r.A)("tabs__item","tabItem_e1w9",i?.className,{"tabs__item--active":n===e}),children:t??e},e))})}function u({children:e}){return(0,s.jsx)("div",{className:"margin-top--md",children:e})}function d({className:e,children:n}){return(0,s.jsxs)("div",{className:(0,r.A)(i.G.tabs.container,"tabs-container","tabList_mVW_"),children:[(0,s.jsx)(c,{className:e}),(0,s.jsx)(u,{children:n})]})}function h(e){let n=(0,l.A)(),t=(0,o.OC)(e);return(0,s.jsx)(o.O_,{value:t,children:(0,s.jsx)(d,{className:e.className,children:(0,o.vT)(e.children)})},String(n))}},28226(e,n,t){t.d(n,{OC:()=>h,O_:()=>g,uc:()=>f,vT:()=>u});var s=t(65723),r=t(22155),i=t(62934),o=t(24127),a=t(12910),l=t(22399),c=t(6660);function u(e){return r.Children.toArray(e).filter(e=>"\n"!==e)}function d({value:e,tabValues:n}){return n.some(n=>n.value===e)}function h(e){let n,{defaultValue:t,queryString:s=!1,groupId:u}=e,h=function(e){let{values:n,children:t}=e;return(0,r.useMemo)(()=>{let e=n??r.Children.toArray(t).flatMap(e=>{if(!e)return[];if((0,r.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return[e];
1let n="string"==typeof e.type?e.type:e.type.name;throw Error(`Docusaurus error: Bad <Tabs> child <${n}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop. 2If you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.`)}).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s})),s=(0,l.XI)(e,(e,n)=>e.value===n.value);if(s.length>0)throw Error(`Docusaurus error: Duplicate values "${s.map(e=>`'${e.value}'`).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[n,t])}(e),[p,f]=(0,r.useState)(()=>(function({defaultValue:e,tabValues:n}){if(0===n.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!d({value:e,tabValues:n}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}let t=n.find(e=>e.default)??n[0];if(!t)throw Error("Unexpected error: 0 tabValues");return t.value})({defaultValue:t,tabValues:h})),[g,m]=function({queryString:e=!1,groupId:n}){let t=(0,i.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,a.aZ)(s),(0,r.useCallback)(e=>{if(!s)return;let n=new URLSearchParams(t.location.search);n.set(s,e),t.replace({...t.location,search:n.toString()})},[s,t])]}({queryString:s,groupId:u}),[y,x]=function({groupId:e}){let n=e?`docusaurus.tab.${e}`:null,[t,s]=(0,c.Dv)(n);return[t,(0,r.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:u}),j=d({value:n=g??y,tabValues:h})?n:null;return(0,o.A)(()=>{j&&f(j)},[j]),{selectedValue:p,selectValue:(0,r.useCallback)(e=>{if(!d({value:e,tabValues:h}))throw Error(`Can't select invalid tab value=${e}`);f(e),m(e),x(e)},[m,x,h]),tabValues:h,lazy:e.lazy??!1,block:e.block??!1}}let p=(0,r.createContext)(null);function f(){let e=r.useContext(p);if(!e)throw Error("useTabsContext() must be used within a Tabs component");return e}function g(e){return(0,s.jsx)(p.Provider,{value:e.value,children:e.children})}},7143(e,n,t){t.d(n,{R:()=>o,x:()=>a});var s=t(22155);let r={},i=s.createContext(r);function o(e){let n=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.