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

Add 'encoding' rule #2368

Merged
merged 3 commits into from
May 6, 2017
Merged

Add 'encoding' rule #2368

merged 3 commits into from
May 6, 2017

Conversation

andy-hanson
Copy link
Contributor

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Overview of change:

Added the encoding rule, which checks each file's encoding.

Is there anything you'd like reviewers to focus on?

This is a tricky one as it performs additional I/O, synchronously. It only reads 3 bytes but there may be lag.
The test runner had to be tweaked so that we would be reading the right file. I tested this rule out (using npm link) in both regular and non-type-checked scenarios and it worked, but it's possible that something like gulp-tslint could break with this.

src/test.ts Outdated
@@ -25,6 +25,7 @@ import * as ts from "typescript";

import {Fix} from "./language/rule/rule";
import * as Linter from "./linter";
import {readBufferWithDetectedEncoding} from "./rules/encodingRule";
Copy link
Contributor

Choose a reason for hiding this comment

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

should go in utils

@nchen63 nchen63 merged commit d88f06d into palantir:master May 6, 2017
@andy-hanson andy-hanson deleted the encoding branch May 6, 2017 04:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants