Skip to content

Instantly share code, notes, and snippets.

View moonseob's full-sized avatar

Moonseob Eum moonseob

View GitHub Profile
@moonseob
moonseob / noSrcImportRule.ts
Created September 18, 2020 07:10
A TSLint rule which detects and auto-fixes any imports starting with 'src'
import * as Lint from 'tslint';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
export class Rule extends Lint.Rules.AbstractRule {
public static FAILURE_STRING = 'SSR apps cannot import from src/';
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
return this.applyWithFunction(sourceFile, walk);
}

Keybase proof

I hereby claim:

  • I am pjms on github.
  • I am pjms (https://keybase.io/pjms) on keybase.
  • I have a public key ASA3rSWcXliHa-7myqL3USnZqpbPpgotkyB3Gjlv78LWfgo

To claim this, I am signing this object: