{"name":"typescript-estree","description":"A parser that converts TypeScript source code into an ESTree compatible form","homepage":"https://github.com/JamesHenry/typescript-estree","main":"dist/parser.js","version":"13.5.0","engines":{"node":">=6.14.0"},"repository":{"type":"git","url":"git+https://github.com/JamesHenry/typescript-estree.git"},"bugs":{"url":"https://github.com/JamesHenry/typescript-estree/issues"},"license":"BSD-2-Clause","devDependencies":{"@babel/code-frame":"7.0.0","@babel/parser":"7.2.3","@commitlint/cli":"^7.1.2","@commitlint/config-conventional":"^7.1.2","@commitlint/travis-cli":"^7.1.2","@types/babel-code-frame":"^6.20.1","@types/jest":"^23.3.9","@types/lodash.isplainobject":"^4.0.4","@types/lodash.unescape":"^4.0.4","@types/node":"^10.12.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","cz-conventional-changelog":"2.1.0","glob":"7.1.2","husky":"0.14.3","jest":"23.6.0","lint-staged":"7.3.0","lodash.isplainobject":"4.0.6","prettier":"^1.14.3","semantic-release":"^15.9.16","shelljs":"0.8.2","travis-deploy-once":"^5.0.8","ts-jest":"^23.10.4","typescript":"~3.2.1"},"keywords":["ast","estree","ecmascript","javascript","typescript","parser","syntax"],"scripts":{"build":"tsc","test":"jest","unit-tests":"jest \"./tests/lib/.*\"","ast-alignment-tests":"jest spec.ts","precommit":"npm test && lint-staged","cz":"git-cz","commitmsg":"commitlint -E GIT_PARAMS","check-format":"prettier --list-different \"./**/*.{ts,js,json,md}\"","semantic-release":"semantic-release","travis-deploy-once":"travis-deploy-once"},"dependencies":{"lodash.unescape":"4.0.1","semver":"5.5.0"},"peerDependencies":{"typescript":"*"},"lint-staged":{"*.{ts,js,json,md}":["prettier --write","git add"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"c8dd0d99f78d60735d80b5267affbf98bd3e5d04","_id":"typescript-estree@13.5.0","_npmVersion":"6.5.0","_nodeVersion":"11.6.0","_npmUser":{"name":"jameshenry","email":"james@henry.sc"},"dist":{"integrity":"sha512-EZKKvEaXIKl5nqqnYzQS/kd9ZG8UvSpWVuNw8EsRzKpf4ETZF35Bav8X4rLqTM2uyAQNxm8fGLCe+vRa0o91WQ==","shasum":"10d65a9370ea74462f1ebca21336d22298144366","tarball":"http://registry-npm.ywwl.com/typescript-estree/download/typescript-estree-13.5.0.tgz","fileCount":29,"unpackedSize":227208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMigqCRA9TVsSAnZWagAA5nkQAJsPV95omI5ri1y2oONy\nncjqEG8IMz/08ROyF21WAYRX8F6qlF8Iil5K9sqIdSlV0ibtBSMeFliINbZs\nygVKMR3OPVrZlxB8AZJs+XnwG6NGynoOxvFbFxSyxonFUZj4sxJZojssXl/3\n5Sghl8aiXvLYnJ+VET1YjeotxuLb5QXTauq75VkWvh4Q6HqrWx25art+qu09\nRHYWwEgMWhIR/VXIZhpFWq3INcf6J8fUx1R1eCVJLBgiReulM4YH5hxsvE6G\nGw3JKNnJHcnpX5k1pNwT1xSGXvpNwvtvXE4YWAmLj8K13zRkN/VRhKnGda1q\n58uirBZjSYfM3gNuDE76FEwFvE2urPBXZBpoX66l+rEp4mJGZe4Q7m/cID3z\n+MMmTABWmZgVzYf05dODNvJVFQ7Tnmv7kC8xGXwFP/PeF476Vc1JpW70wUTn\nxPvl4d10pil2F+AbJziUoDQhmk9DeEtT/Tr4WE+gTVxxdI/1wzY3bMwMNlWV\nMD6NOqyPMG20I20+I13f338ZpkvCF8OPYnj3t+4rodoGtZv3HuOvv0iA33oF\ncdlTtQh9eb1KVeCosK/4CEjShbtr3JXoABD/Fdubb8o4eXpccq258Egp+1/F\nuqcHuQn+AbXAoOuDCapGsx/g/EIdVrQkTYceko4IDmPa+6XPYmvbbwcvzIEL\nKZUA\r\n=HSFr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNL4DOjW/zHoqyQA00WPtCaTCxgM9Vc5l/uN9qNhcKNAIgO2Z1BBWkU5jTuyCEHDvA0yQlH24Te4+sz+uCLubpzRE="}],"size":41455,"noattachment":false,"key":"/typescript-estree/-/typescript-estree-13.5.0.tgz"},"maintainers":[{"name":"jameshenry","email":"james@henry.sc"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typescript-estree_13.5.0_1546790954189_0.9065235730502668"},"_hasShrinkwrap":false,"deprecated":"This package was moved to @typescript-eslint/typescript-estree, please install the latest version from there instead","readme":"<h1 align=\"center\">TypeScript ESTree</h1>\n\n<p align=\"center\">A parser that converts TypeScript source code into an <a href=\"https://github.com/estree/estree\">ESTree</a>-compatible form</p>\n\n<p align=\"center\">\n    <a href=\"https://travis-ci.org/JamesHenry/typescript-estree\"><img src=\"https://img.shields.io/travis/JamesHenry/typescript-estree.svg?style=flat-square\" alt=\"Travis\"/></a>\n    <a href=\"https://github.com/JamesHenry/typescript-estree/blob/master/LICENSE\"><img src=\"https://img.shields.io/npm/l/typescript-estree.svg?style=flat-square\" alt=\"GitHub license\" /></a>\n    <a href=\"https://www.npmjs.com/package/typescript-estree\"><img src=\"https://img.shields.io/npm/v/typescript-estree.svg?style=flat-square\" alt=\"NPM Version\" /></a>\n    <a href=\"https://www.npmjs.com/package/typescript-estree\"><img src=\"https://img.shields.io/npm/dt/typescript-estree.svg?style=flat-square\" alt=\"NPM Downloads\" /></a>\n    <a href=\"http://commitizen.github.io/cz-cli/\"><img src=\"https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\" alt=\"Commitizen friendly\" /></a>\n    <a href=\"https://github.com/semantic-release/semantic-release\"><img src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square\" alt=\"semantic-release\" /></a>\n</p>\n\n<br>\n\n## About\n\nThis parser is somewhat generic and robust, and could be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatible AST.\n\nIn fact, it is already used within these hyper-popular open-source projects to power their TypeScript support:\n\n- [ESLint](https://eslint.org), the pluggable linting utility for JavaScript and JSX\n  - See [typescript-eslint-parser](https://github.com/eslint/typescript-eslint-parser) for more details\n- [Prettier](https://prettier.io), an opinionated code formatter\n\n## Installation\n\n```\nnpm install --save typescript-estree\n```\n\n## API\n\n### parse(code, options)\n\nParses the given string of code with the options provided and returns an ESTree-compatible AST. The options object has the following properties:\n\n```javascript\n{\n    // attach range information to each node\n    range: false,\n\n    // attach line/column location information to each node\n    loc: false,\n\n    // create a top-level tokens array containing all tokens\n    tokens: false,\n\n    // create a top-level comments array containing all comments\n    comment: false,\n\n    // enable parsing JSX. For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html\n    jsx: false,\n\n    /*\n     * The JSX AST changed the node type for string literals\n     * inside a JSX Element from `Literal` to `JSXText`.\n     * When value is `true`, these nodes will be parsed as type `JSXText`.\n     * When value is `false`, these nodes will be parsed as type `Literal`.\n     */\n    useJSXTextNode: false,\n\n    // Cause the parser to error if it encounters an unknown AST node type (useful for testing)\n    errorOnUnknownASTType: false,\n\n    /*\n     * Allows overriding of function used for logging.\n     * When value is `false`, no logging will occur.\n     * When value is not provided, `console.log()` will be used.\n     */\n    loggerFn: undefined\n}\n```\n\nExample usage:\n\n```javascript\nconst parser = require('typescript-estree');\nconst code = `const hello: string = 'world';`;\nconst ast = parser.parse(code, {\n  range: true,\n  loc: true\n});\n```\n\n### version\n\nExposes the current version of typescript-estree as specified in package.json.\n\nExample usage:\n\n```javascript\nconst parser = require('typescript-estree');\nconst version = parser.version;\n```\n\n### AST_NODE_TYPES\n\nExposes an object that contains the AST node types produced by the parser.\n\nExample usage:\n\n```javascript\nconst parser = require('typescript-estree');\nconst astNodeTypes = parser.AST_NODE_TYPES;\n```\n\n## Supported TypeScript Version\n\nWe will always endeavor to support the latest stable version of TypeScript.\n\nThe version of TypeScript currently supported by this parser is `~3.2.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.\n\nIf you use a non-supported version of TypeScript, the parser will log a warning to the console.\n\n**Please ensure that you are using a supported version before submitting any issues/bug reports.**\n\n## Reporting Issues\n\nPlease check the current list of open and known issues and ensure the issue has not been reported before. When creating a new issue provide as much information about your environment as possible. This includes:\n\n- TypeScript version\n- The `typescript-estree` version\n\n## AST Alignment Tests\n\nA couple of years after work on this parser began, the TypeScript Team at Microsoft began [officially supporting TypeScript parsing via Babel](https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/).\n\nI work closely with TypeScript Team and we are gradually aliging the AST of this project with the one produced by Babel's parser. To that end, I have created a full test harness to compare the ASTs of the two projects which runs on every PR, please see the code for more details.\n\n## Build/Test Commands\n\n- `npm test` - run all tests\n- `npm run unit-tests` - run only unit tests\n- `npm run ast-alignment-tests` - run only Babylon AST alignment tests\n\n## License\n\nTypeScript ESTree inherits from the the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license.\n","publish_time":1546790954381,"_cnpm_publish_time":1546790954381,"dist-tags":{"latest":"18.1.0","next":"6.0.0-rc.1"}}