title: unexpected token import/export - typescript
body: <p>I'm trying out typescript for the first time and am confused about the import/export procedures that I am used to using with es6.</p>
  
  <p>this is an interface I am trying to export in a file called <code>transformedRowInterface.ts</code>: </p>
  
  <pre><code>export interface TransformedRow  {
    id: number;
    title: string;
    summary: string;
    body: string;
    synopsis: string;
    author: object;
    impressions: number;
    created: number;
    updated: number;
  }
  </code></pre>
  
  <p>and this is my attempt to import, in a file called <code>newsArticleModel.ts</code>:</p>
  
  <pre><code>const appRoot = require("app-root-path");
  
  import { TransformedRow } from "./transformedRowInterface";
  //throws the error below:
  // [Node] /newsArticleModel.ts:2
  // [Node] import { TransformedRow } from "./transformedRowInterface";
  //SyntaxError: Unexpected token import
  // also tried a require below, which also throws an error:
  // const transformedRow = require(appRoot + "/src/controllers/transformedRowInterface.ts");
  // throws this error: 
  // [Node] (function (exports, require, module, __filename, __dirname) { export interface TransformedRow  {
  //   [Node]                                                               ^^^^^^
  //   [Node]
  //   [Node] SyntaxError: Unexpected token export
  </code></pre>
  
  <p>this is my tsconfig:</p>
  
  <pre><code>    {
    "compilerOptions": {
      "module": "commonjs",
      "target": "es2017",
      "noImplicitAny": false,
      "moduleResolution": "node",
      "sourceMap": true,
      "outDir": "dist",
      "baseUrl": ".",
      "paths": {
        // "*": ["node_modules/*", "src/types/*"]
      }
    },
    "include": ["src/**/*"]
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>