Add linting to webpack-sources.

This commit is contained in:
Chris Eppstein
2017-07-03 09:29:47 -07:00
parent ae6459f44a
commit 6811cc74cb
3 changed files with 12 additions and 13 deletions

View File

@@ -1,15 +1,14 @@
// Type definitions for webpack-sources v0.1.2
// Type definitions for webpack-sources 0.1
// Project: https://github.com/webpack/webpack-sources
// Definitions by: e-cloud <http://github.com/e-cloud>
// Chris Eppstein <http://github.com/chriseppstein>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="source-map" />
/// <reference types="source-list-map" />
/// <reference types="node" />
import { Hash } from 'crypto'
import { SourceNode, RawSourceMap, SourceMapGenerator } from 'source-map'
import { SourceListMap } from 'source-list-map'
import { Hash } from 'crypto';
import { SourceNode, RawSourceMap, SourceMapGenerator } from 'source-map';
import { SourceListMap } from 'source-list-map';
export abstract class Source {
size(): number;
@@ -32,7 +31,7 @@ export abstract class Source {
listMap(options?: any): any;
}
interface SourceAndMapMixin {
export interface SourceAndMapMixin {
map(options: { columns?: boolean }): RawSourceMap;
sourceAndMap(options: { columns?: boolean }): {
source: string;
@@ -67,9 +66,9 @@ export class CachedSource {
}
export class ConcatSource extends Source implements SourceAndMapMixin {
children: (string | Source)[];
children: Array<(string | Source)>;
constructor(...args: (string | Source)[]);
constructor(...args: Array<(string | Source)>);
add(item: string | Source): void;

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@@ -7,9 +7,8 @@ import {
ReplaceSource,
OriginalSource,
SourceMapSource,
} from 'webpack-sources';
import { RawSourceMap } from 'source-map'
import { RawSourceMap } from 'source-map';
const s1 = new OriginalSource('a', 'b');
@@ -19,8 +18,8 @@ const s3 = new ConcatSource('a', 'b', s1);
const s4 = new RawSource('hey');
const a = {} as RawSourceMap
const b = {} as RawSourceMap
const a = {} as RawSourceMap;
const b = {} as RawSourceMap;
const s5 = new LineToLineMappedSource('a', 'v', 'c');
const s6 = new PrefixSource(s4, s5);