Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Compile with TypeScript 1.8.10 #1575

Merged
merged 3 commits into from
Sep 26, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ Creating a new release
----------------------
<sup>[back to ToC &uarr;](#table-of-contents)</sup>

1. Bump the version number in `package.json`, `src/tslint.ts`, and `src/tslintMutli.ts`
1. Bump the version number in `package.json` and `src/tslintMutli.ts`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling

2. Add release notes in `CHANGELOG.md`
3. Run `grunt` to build the latest sources
4. Commit with message `Prepare release <version>`
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
"mocha": "^2.2.5",
"tslint": "latest",
"tslint-test-config-non-relative": "file:test/external/tslint-test-config-non-relative",
"typescript": "latest"
"typescript": "1.8.10"
},
"peerDependencies": {
"typescript": ">=2.0.0"
"typescript": ">=1.7.3"
},
"license": "Apache-2.0",
"typescript": {
Expand Down
3 changes: 2 additions & 1 deletion src/language/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export function getSourceFile(fileName: string, source: string): ts.SourceFile {
getCanonicalFileName: (filename: string) => filename,
getCurrentDirectory: () => "",
getDefaultLibFileName: () => "lib.d.ts",
getDirectories: (path: string) => [],
// TODO: include this field when compiling with TS 2.0
// getDirectories: (path: string) => [],
getNewLine: () => "\n",
getSourceFile: (filenameToGet: string) => {
if (filenameToGet === normalizedName) {
Expand Down
3 changes: 2 additions & 1 deletion src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export function runTest(testDirectory: string, rulesDirectory?: string | string[
getCanonicalFileName: (filename: string) => filename,
getCurrentDirectory: () => "",
getDefaultLibFileName: () => ts.getDefaultLibFileName(compilerOptions),
getDirectories: (path: string) => [],
// TODO: include this field when compiling with TS 2.0
// getDirectories: (path: string) => [],
getNewLine: () => "\n",
getSourceFile(filenameToGet: string) {
if (filenameToGet === this.getDefaultLibFileName()) {
Expand Down
14 changes: 8 additions & 6 deletions src/tslintMulti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* limitations under the License.
*/

import { existsSync } from "fs";
import * as ts from "typescript";

import {
Expand All @@ -39,7 +40,7 @@ import { arrayify } from "./utils";
* Linter that can lint multiple files in consecutive runs.
*/
class MultiLinter {
public static VERSION = "3.15.1";
public static VERSION = "4.0.0-dev";

public static findConfiguration = findConfiguration;
public static findConfigurationPath = findConfigurationPath;
Expand All @@ -61,12 +62,13 @@ class MultiLinter {
}
}

const {config} = ts.readConfigFile(configFile, ts.sys.readFile);
const parsed = ts.parseJsonConfigFileContent(config, {
fileExists: (path: string) => true,
const { config } = ts.readConfigFile(configFile, ts.sys.readFile);
const parseConfigHost = {
fileExists: existsSync,
readDirectory: ts.sys.readDirectory,
useCaseSensitiveFileNames: false,
}, projectDirectory);
useCaseSensitiveFileNames: true,
};
const parsed = ts.parseJsonConfigFileContent(config, parseConfigHost, projectDirectory);
const host = ts.createCompilerHost(parsed.options, true);
const program = ts.createProgram(parsed.fileNames, parsed.options, host);

Expand Down