Skip to content

Write the TSLint configuration file to the temp directory during build.#129

Merged
nickpape merged 7 commits intomicrosoft:masterfrom
lijunle:write-config
Mar 16, 2017
Merged

Write the TSLint configuration file to the temp directory during build.#129
nickpape merged 7 commits intomicrosoft:masterfrom
lijunle:write-config

Conversation

@lijunle
Copy link
Copy Markdown
Member

@lijunle lijunle commented Mar 12, 2017

https://marketplace.visualstudio.com/items?itemName=eg2.tslint

  


This change is Reviewable

lijunle added 2 commits March 12, 2017 22:44
- The TSLint configuration file can be used for VSCode TSLint plugin.
const activeLintRules: any = taskScope._loadLintRules(); // tslint:disable-line:no-any

// @todo This stream is not piped to returned value. Find a way to block the execute flow.
this._writeLintRules(activeLintRules);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should be able to do this with Gulp.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can do it as gulp-like pattern like this. Do you think it is OK?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I could leverage the fs.writeFileSync API for simplicity.

}

private _writeLintRules(lintRules: any): fs.WriteStream { // tslint:disable-line:no-any
const tslintFilePath: string = path.resolve(this.buildConfig.rootPath, this.buildConfig.tempFolder, 'tslint.json');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the tslint.json file location configurable in the TSLint plugin?

Copy link
Copy Markdown
Member Author

@lijunle lijunle Mar 13, 2017

Choose a reason for hiding this comment

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

Yes. There is an option - tslint.configFile to config the tslint.config file.

https://marketplace.visualstudio.com/items?itemName=eg2.tslint

@iclanton iclanton changed the title Write the TSLint configuration file when execute. Write the TSLint configuration file to the temp directory during build. Mar 13, 2017
@nickpape nickpape merged commit ddbde2f into microsoft:master Mar 16, 2017
@lijunle lijunle deleted the write-config branch March 16, 2017 18:30
christiango pushed a commit to christiango/web-build-tools that referenced this pull request Aug 22, 2017
…d. (microsoft#129)

* Write the TSLint configuration file when execute.

- The TSLint configuration file can be used for VSCode TSLint plugin.

* Run rush change.

* Replace with fs.writeFileSync

* Leverage the writeFileSync.

- Leave a TODO to improve the performance.

* Update the change set comment.

* Fix some problems

* Merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants