8000 typescript-eslint/packages/parser at master · tyv/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"path":"packages/parser","repo":{"id":215794425,"defaultBranch":"master","name":"typescript-eslint","ownerLogin":"tyv","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2019-10-17T13:05:42.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/122360?v=4","public":true,"private":false,"isOrgOwned":false},"currentUser":null,"refInfo":{"name":"master","listCacheKey":"v0:1617252280.250331","canEdit":false,"refType":"branch","currentOid":"0c85ac3dadf59e475317bbbe422447c08689b36b"},"tree":{"items":[{"name":"src","path":"packages/parser/src","contentType":"directory"},{"name":"tests","path":"packages/parser/tests","contentType":"directory"},{"name":"CHANGELOG.md","path":"packages/parser/CHANGELOG.md","contentType":"file"},{"name":"LICENSE","path":"packages/parser/LICENSE","contentType":"file"},{"name":"README.md","path":"packages/parser/README.md","contentType":"file"},{"name":"jest.config.js","path":"packages/parser/jest.config.js","contentType":"file"},{"name":"package.json","path":"packages/parser/package.json","contentType":"file"},{"name":"tsconfig.build.json","path":"packages/parser/tsconfig.build.json","contentType":"file"},{"name":"tsconfig.json","path":"packages/parser/tsconfig.json","contentType":"file"}],"templateDirectorySuggestionUrl":null,"readme":{"displayName":"README.md","richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 align=\"center\" tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTypeScript ESLint Parser\u003c/h1\u003e\u003ca id=\"user-content-typescript-eslint-parser\" class=\"anchor\" aria-label=\"Permalink: TypeScript ESLint Parser\" href=\"#typescript-eslint-parser\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp align=\"center\" dir=\"auto\"\u003eAn ESLint custom parser which leverages \u003ca href=\"https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/typescript-estree\"\u003eTypeScript ESTree\u003c/a\u003e to allow for ESLint to lint TypeScript source code.\u003c/p\u003e\n\u003cp align=\"center\" dir=\"auto\"\u003e\n \u003ca href=\"https://dev.azure.com/typescript-eslint/TypeScript%20ESLint/_build/latest?definitionId=1\u0026amp;branchName=master\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/8a0f1385180f7f200cc799b895c5d1efd8a1268d4c56c032a6057f944bd71990/68747470733a2f2f696d672e736869656c64732e696f2f617a7572652d6465766f70732f6275696c642f747970657363726970742d65736c696e742f5479706553637269707425323045534c696e742f312f6d61737465722e7376673f6c6162656c3d254630253946253941253830253230417a757265253230506970656c696e6573267374796c653d666c61742d737175617265\" alt=\"Azure Pipelines\" data-canonical-src=\"https://img.shields.io/azure-devops/build/typescript-eslint/TypeScript%20ESLint/1/master.svg?label=%F0%9F%9A%80%20Azure%20Pipelines\u0026amp;style=flat-square\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n \u003ca href=\"https://github.com/typescript-eslint/typescript-eslint/blob/master/LICENSE\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/aec1a4187c2341e4f364ddddc63225415d9aff7fc1d430ee791177033fbd0ab7/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f747970657363726970742d6573747265652e7376673f7374796c653d666c61742d737175617265\" alt=\"GitHub license\" data-canonical-src=\"https://img.shields.io/npm/l/typescript-estree.svg?style=flat-square\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n \u003ca href=\"https://www.npmjs.com/package/@typescript-eslint/parser\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/a8ff4ddbf1c8509fe0d018a3b71fd58a405da879b1011c66a232ec72109ce551/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f40747970657363726970742d65736c696e742f7061727365722e7376673f7374796c653d666c61742d737175617265\" alt=\"NPM Version\" data-canonical-src=\"https://img.shields.io/npm/v/@typescript-eslint/parser.svg?style=flat-square\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n \u003ca href=\"https://www.npmjs.com/package/@typescript-eslint/parser\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/e85dadb82d41b4893deec6d97c132fd07036c7844058ea27ad5daa33224375ae/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f40747970657363726970742d65736c696e742f7061727365722e7376673f7374796c653d666c61742d737175617265\" alt=\"NPM Downloads\" data-canonical-src=\"https://img.shields.io/npm/dm/@typescript-eslint/parser.svg?style=flat-square\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n \u003ca href=\"http://commitizen.github.io/cz-cli/\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/b44890358b62ed506ee63de3ac148c8bd0e52f67d932864455d67ada837638c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d6d6974697a656e2d667269656e646c792d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265\" alt=\"Commitizen friendly\" data-canonical-src=\"https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eInstallation:\u003c/h2\u003e\u003ca id=\"user-content-installation\" class=\"anchor\" aria-label=\"Permalink: Installation:\" href=\"#installation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"npm install @typescript-eslint/parser --save-dev\"\u003e\u003cpre\u003enpm install @typescript-eslint/parser --save-dev\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUsage\u003c/h2\u003e\u003ca id=\"user-content-usage\" class=\"anchor\" aria-label=\"Permalink: Usage\" href=\"#usage\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIn your ESLint configuration file, set the \u003ccode\u003eparser\u003c/code\u003e property:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-json notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"{\n \u0026quot;parser\u0026quot;: \u0026quot;@typescript-eslint/parser\u0026quot;\n}\"\u003e\u003cpre\u003e{\n \u003cspan class=\"pl-ent\"\u003e\"parser\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e@typescript-eslint/parser\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere is sometimes an incorrect assumption that the parser itself is what does everything necessary to facilitate the use of ESLint with TypeScript. In actuality, it is the combination of the parser \u003cem\u003eand\u003c/em\u003e one or more plugins which allow you to maximize your usage of ESLint with TypeScript.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFor example, once this parser successfully produces an AST for the TypeScript source code, it might well contain some information which simply does not exist in a standard JavaScript context, such as the data for a TypeScript-specific construct, like an \u003ccode\u003einterface\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe core rules built into ESLint, such as \u003ccode\u003eindent\u003c/code\u003e have no knowledge of such constructs, so it is impossible to expect them to work out of the box with them.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eInstead, you also need to make use of one more plugins which will add or extend rules with TypeScript-specific features.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eBy far the most common case will be installing the \u003ca href=\"https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin\"\u003e@typescript-eslint/eslint-plugin\u003c/a\u003e plugin, but there are also other relevant options available such a \u003ca href=\"https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin-tslint\"\u003e@typescript-eslint/eslint-plugin-tslint\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eConfiguration\u003c/h2\u003e\u003ca id=\"user-content-configuration\" class=\"anchor\" aria-label=\"Permalink: Configuration\" href=\"#configuration\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe following additional configuration options are available by specifying them in \u003ca href=\"https://eslint.org/docs/user-guide/configuring#specifying-parser-options\" rel=\"nofollow\"\u003e\u003ccode\u003eparserOptions\u003c/code\u003e\u003c/a\u003e in your ESLint configuration file.\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003e\u003ccode\u003eecmaFeatures.jsx\u003c/code\u003e\u003c/strong\u003e - default \u003ccode\u003efalse\u003c/code\u003e. Enable parsing JSX when \u003ccode\u003etrue\u003c/code\u003e. More details can be found \u003ca href=\"https://www.typescriptlang.org/docs/handbook/jsx.html\" rel=\"nofollow\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eIt's \u003ccode\u003efalse\u003c/code\u003e on \u003ccode\u003e*.ts\u003c/code\u003e files regardless of this option.\u003c/li\u003e\n\u003cli\u003eIt's \u003ccode\u003etrue\u003c/code\u003e on \u003ccode\u003e*.tsx\u003c/code\u003e files regardless of this option.\u003c/li\u003e\n\u003cli\u003eOtherwise, it respects this option.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003e\u003ccode\u003euseJSXTextNode\u003c/code\u003e\u003c/strong\u003e - default \u003ccode\u003etrue\u003c/code\u003e. Please set \u003ccode\u003efalse\u003c/code\u003e if you use this parser on ESLint v4. If this is \u003ccode\u003efalse\u003c/code\u003e, the parser creates the AST of JSX texts as the legacy style.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003e\u003ccode\u003eproject\u003c/code\u003e\u003c/strong\u003e - default \u003ccode\u003eundefined\u003c/code\u003e. This option allows you to provide a path to your project's \u003ccode\u003etsconfig.json\u003c/code\u003e. \u003cstrong\u003eThis setting is required if you want to use rules which require type information\u003c/strong\u003e. You may want to use this setting in tandem with the \u003ccode\u003etsconfigRootDir\u003c/code\u003e option below.\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eAccepted values:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-js notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// path\nproject: './tsconfig.json';\n\n// glob pattern\nproject: './packages/**/tsconfig.json';\n\n// array of paths and/or glob patterns\nproject: [\n './packages/**/tsconfig.json',\n './separate-package/tsconfig.json',\n];\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e// path\u003c/span\u003e\nproject: \u003cspan class=\"pl-s\"\u003e'./tsconfig.json'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// glob pattern\u003c/span\u003e\nproject: \u003cspan class=\"pl-s\"\u003e'./packages/**/tsconfig.json'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// array of paths and/or glob patterns\u003c/span\u003e\nproject: \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\n \u003cspan class=\"pl-s\"\u003e'./packages/**/tsconfig.json'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-s\"\u003e'./separate-package/tsconfig.json'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eIf you use project references, TypeScript will not automatically use project references to resolve files. This means that you will have to add each referenced tsconfig to the \u003ccode\u003eproject\u003c/code\u003e field either separately, or via a glob.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eTypeScript will ignore files with duplicate filenames in the same folder (for example, \u003ccode\u003esrc/file.ts\u003c/code\u003e and \u003ccode\u003esrc/file.js\u003c/code\u003e). TypeScript purposely ignore all but one of the files, only keeping the one file with the highest priority extension (the extension priority order (from highest to lowest) is \u003ccode\u003e.ts\u003c/code\u003e, \u003ccode\u003e.tsx\u003c/code\u003e, \u003ccode\u003e.d.ts\u003c/code\u003e, \u003ccode\u003e.js\u003c/code\u003e, \u003ccode\u003e.jsx\u003c/code\u003e). For more info see #955.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eNote that if this setting is specified and \u003ccode\u003ecreateDefaultProgram\u003c/code\u003e is not, you must only lint files that are included in the projects as defined by the provided \u003ccode\u003etsconfig.json\u003c/code\u003e files. If your existing configuration does not include all of the files you would like to lint, you can create a separate \u003ccode\u003etsconfig.eslint.json\u003c/code\u003e as follows:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-json-comments notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"{\n // extend your base config so you don't have to redefine your compilerOptions\n \u0026quot;extends\u0026quot;: \u0026quot;./tsconfig.json\u0026quot;,\n \u0026quot;include\u0026quot;: [\n \u0026quot;src/**/*.ts\u0026quot;,\n \u0026quot;test/**/*.ts\u0026quot;,\n \u0026quot;typings/**/*.ts\u0026quot;,\n // etc\n\n // if you have a mixed JS/TS codebase, don't forget to include your JS files\n \u0026quot;src/**/*.js\u0026quot;\n ]\n}\"\u003e\u003cpre\u003e{\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e extend your base config so you don't have to redefine your compilerOptions\u003c/span\u003e\n \u003cspan class=\"pl-s\"\u003e\"extends\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e./tsconfig.json\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-s\"\u003e\"include\"\u003c/span\u003e: [\n \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003esrc/**/*.ts\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etest/**/*.ts\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etypings/**/*.ts\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e etc\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e if you have a mixed JS/TS codebase, don't forget to include your JS files\u003c/span\u003e\n \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003esrc/**/*.js\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\n ]\n}\u003c/pre\u003e\u003c/div\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003e\u003ccode\u003etsconfigRootDir\u003c/code\u003e\u003c/strong\u003e - default \u003ccode\u003eundefined\u003c/code\u003e. This option allows you to provide the root directory for relative tsconfig paths specified in the \u003ccode\u003eproject\u003c/code\u003e option above.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003e\u003ccode\u003eextraFileExtensions\u003c/code\u003e\u003c/strong\u003e - default \u003ccode\u003eundefined\u003c/code\u003e. This option allows you to provide one or more additional file extensions which should be considered in the TypeScript Program compilation. E.g. a \u003ccode\u003e.vue\u003c/code\u003e file\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003e\u003ccode\u003ewarnOnUnsupportedTypeScriptVersion\u003c/code\u003e\u003c/strong\u003e - default \u003ccode\u003etrue\u003c/code\u003e. This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003e\u003ccode\u003ecreateDefaultProgram\u003c/code\u003e\u003c/strong\u003e - default \u003ccode\u003efalse\u003c/code\u003e. This option allows you to request that when the \u003ccode\u003eproject\u003c/code\u003e setting is specified, files will be allowed when not included in the projects defined by the provided \u003ccode\u003etsconfig.json\u003c/code\u003e files. \u003cstrong\u003eUsing this option will incur significant performance costs. This option is primarily included for backwards-compatibility.\u003c/strong\u003e See the \u003cstrong\u003e\u003ccode\u003eproject\u003c/code\u003e\u003c/strong\u003e section above for more information.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e.eslintrc.json\u003c/h3\u003e\u003ca id=\"user-content-eslintrcjson\" class=\"anchor\" aria-label=\"Permalink: .eslintrc.json\" href=\"#eslintrcjson\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-json notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"{\n \u0026quot;parser\u0026quot;: \u0026quot;@typescript-eslint/parser\u0026quot;,\n \u0026quot;parserOptions\u0026quot;: {\n \u0026quot;ecmaFeatures\u0026quot;: {\n \u0026quot;jsx\u0026quot;: true\n },\n \u0026quot;useJSXTextNode\u0026quot;: true,\n \u0026quot;project\u0026quot;: \u0026quot;./tsconfig.json\u0026quot;,\n \u0026quot;tsconfigRootDir\u0026quot;: \u0026quot;../../\u0026quot;,\n \u0026quot;extraFileExtensions\u0026quot;: [\u0026quot;.vue\u0026quot;]\n }\n}\"\u003e\u003cpre\u003e{\n \u003cspan class=\"pl-ent\"\u003e\"parser\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e@typescript-eslint/parser\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"parserOptions\"\u003c/span\u003e: {\n \u003cspan class=\"pl-ent\"\u003e\"ecmaFeatures\"\u003c/span\u003e: {\n \u003cspan class=\"pl-ent\"\u003e\"jsx\"\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e\n },\n \u003cspan class=\"pl-ent\"\u003e\"useJSXTextNode\"\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"project\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e./tsconfig.json\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"tsconfigRootDir\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e../../\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"extraFileExtensions\"\u003c/span\u003e: [\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e.vue\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e]\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSupported TypeScript Version\u003c/h2\u003e\u003ca id=\"user-content-supported-typescript-version\" class=\"anchor\" aria-label=\"Permalink: Supported TypeScript Version\" href=\"#supported-typescript-version\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ePlease see \u003ca href=\"https://github.com/typescript-eslint/typescript-eslint\"\u003ehttps://github.com/typescript-eslint/typescript-eslint\u003c/a\u003e for the supported TypeScript version.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003ePlease ensure that you are using a supported version before submitting any issues/bug reports.\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eReporting Issues\u003c/h2\u003e\u003ca id=\"user-content-reporting-issues\" class=\"anchor\" aria-label=\"Permalink: Reporting Issues\" href=\"#reporting-issues\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ePlease use the @typescript-eslint/parser issue template when creating your issue and fill out the information requested as best you can. This will really help us when looking into your issue.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLicense\u003c/h2\u003e\u003ca id=\"user-content-license\" class=\"anchor\" aria-label=\"Permalink: License\" href=\"#license\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTypeScript ESLint Parser is licensed under a permissive BSD 2-clause license.\u003c/p\u003e\n\u003c/article\u003e","errorMessage":null,"headerInfo":{"toc":[{"level":1,"text":"TypeScript ESLint Parser","anchor":"typescript-eslint-parser","htmlText":"TypeScript ESLint Parser"},{"level":2,"text":"Installation:","anchor":"installation","htmlText":"Installation:"},{"level":2,"text":"Usage","anchor":"usage","htmlText":"Usage"},{"level":2,"text":"Configuration","anchor":"configuration","htmlText":"Configuration"},{"level":3,"text":".eslintrc.json","anchor":"eslintrcjson","htmlText":".eslintrc.json"},{"level":2,"text":"Supported TypeScript Version","anchor":"supported-typescript-version","htmlText":"Supported TypeScript Version"},{"level":2,"text":"Reporting Issues","anchor":"reporting-issues","htmlText":"Reporting Issues"},{"level":2,"text":"License","anchor":"license","htmlText":"License"}],"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Ftyv%2Ftypescript-eslint%2Ftree%2Fmaster%2Fpackages%2Fparser"}},"totalCount":9,"showBranchInfobar":true},"fileTree":{"packages":{"items":[{"name":"eslint-plugin-tslint","path":"packages/eslint-plugin-tslint","contentType":"directory"},{"name":"eslint-plugin","path":"packages/eslint-plugin","contentType":"directory"},{"name":"experimental-utils","path":"packages/experimental-utils","contentType":"directory"},{"name":"parser","path":"packages/parser","contentType":"directory"},{"name":"shared-fixtures","path":"packages/shared-fixtures","contentType":"directory"},{"name":"typescript-estree","path":"packages/typescript-estree","contentType":"directory"}],"totalCount":6},"":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":".vscode","path":".vscode","contentType":"directory"},{"name":"packages","path":"packages","contentType":"directory"},{"name":"tests","path":"tests","contentType":"directory"},{"name":"tools","path":"tools","contentType":"directory"},{"name":".all-contributorsrc","path":".all-contributorsrc","contentType":"file"},{"name":".codecov.yml","path":".codecov.yml","contentType":"file"},{"name":".editorconfig","path":".editorconfig","contentType":"file"},{"name":".eslintignore","path":".eslintignore","contentType":"file"},{"name":".eslintrc.js","path":".eslintrc.js","contentType":"file"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".huskyrc","path":".huskyrc","contentType":"file"},{"name":".lintstagedrc","path":".lintstagedrc","contentType":"file"},{"name":".npmrc","path":".npmrc","contentType":"file"},{"name":".prettierignore","path":".prettierignore","contentType":"file"},{"name":".prettierrc.json","path":".prettierrc.json","contentType":"file"},{"name":"CHANGELOG.md","path":"CHANGELOG.md","contentType":"file"},{"name":"CONTRIBUTORS.md","path":"CONTRIBUTORS.md","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"azure-pipelines.yml","path":"azure-pipelines.yml","contentType":"file"},{"name":"lerna.json","path":"lerna.json","contentType":"file"},{"name":"package.json","path":"package.json","contentType":"file"},{"name":"tsconfig.base.json","path":"tsconfig.base.json","contentType":"file"},{"name":"tsconfig.eslint.json","path":"tsconfig.eslint.json","contentType":"file"},{"name":"yarn.lock","path":"yarn.lock","contentType":"file"}],"totalCount":27}},"fileTreeProcessingTime":22.335371,"foldersToFetch":[],"treeExpanded":true,"symbolsExpanded":false,"csrf_tokens":{"/tyv/typescript-eslint/branches":{"post":"sOASbsJUGW1HuAnoTN5IZ61lh5gnYZ0iUeNgaReBZapMLL90IjYV880woB2o-XWb-Mz45oKuGswE-zcPNgYiSQ"},"/tyv/typescript-eslint/branches/fetch_and_merge/master":{"post":"IrVZSwyUOuSbgo7o7YGmVi5sHSI9sO_aM2SUN1uuCSsPar7N3PoVxaHbGomdVA2KwM_lkWP3TyDkmHxTZsHXjw"},"/tyv/typescript-eslint/branches/fetch_and_merge/master?discard_changes=true":{"post":"bMZ1GbHKc5E9XClDi70NJgEIOgs98LjHXbPwf7KYCyhBGZKfYaRcsAcFvSL7aKb676vCuGO3GD2KTxgbj_fVjA"}}},"title":"typescript-eslint/packages/parser at master · tyv/typescript-eslint","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1b17b3e7786a.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0