Closed
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
Repro
mkdir typescript-eslint-bug-no-createprogram
yarn init -y
yarn add eslint @typescript-eslint/parser
- Check
node_modules/@typescript-eslint/parser
exports contents.
Attached screenshots at the bottom.
Expected Result
Should be exported.
Actual Result
I tried to use inside eslintrc.js
and it threw saying that parser.createProgram
is not defined.
Additional Info
I tried to import from @typescript-eslint/typescript-estree
as well and got the same result.
Versions
package | version |
---|---|
@typescript-eslint/parser |
4.26.1 |
TypeScript |
4.3.2 |
ESLint |
7.28.0 |
node |
14.17.0 |
Notice on this file above how it's missing a third import but still has a trailing comma, for some reason createProgram
is getting stripped from there.
export { parse, parseForESLint, ParserOptions } from './parser';
export { ParserServices, clearCaches, } from '@typescript-eslint/typescript-estree';
export declare const version: string;
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = exports.clearCaches = exports.parseForESLint = exports.parse = void 0;
var parser_1 = require("./parser");
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_1.parse; } });
Object.defineProperty(exports, "parseForESLint", { enumerable: true, get: function () { return parser_1.parseForESLint; } });
var typescript_estree_1 = require("@typescript-eslint/typescript-estree");
Object.defineProperty(exports, "clearCaches", { enumerable: true, get: function () { return typescript_estree_1.clearCaches; } });
// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
exports.version = require('../package.json').version;
//# sourceMappingURL=index.js.map