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

Commit

Permalink
[changed] updated flow ignore list and created interface files for al…
Browse files Browse the repository at this point in the history
…l of the project dependencies
  • Loading branch information
thealjey committed Dec 22, 2015
1 parent bcda000 commit 5097059
Show file tree
Hide file tree
Showing 19 changed files with 183 additions and 16 deletions.
16 changes: 7 additions & 9 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
[ignore]
.*/invalidPackageJson/*
.*/build/*
.*/node_modules/.*/test/*
.*/node_modules/.*/spec/*
config/*
coverage/*
docs/*
interfaces/*
.*/node_modules/*
.*/lib/*
.*/config/*
.*/coverage/*
.*/docs/*
.*/interfaces/*

[include]

[libs]
interfaces/

[options]
suppress_comment=.*@noflow.*
suppress_comment=.*@flowignore.*
1 change: 1 addition & 0 deletions interfaces/autoprefixer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'autoprefixer' {}
4 changes: 4 additions & 0 deletions interfaces/babel-core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module 'babel-core' {
declare function transformFile(file: string, options: Object,
callback: (error: ?string, result: {code: string, map: string}) => void): void;
}
8 changes: 8 additions & 0 deletions interfaces/clean-css.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type CleanCSSResult = {errors: Array<string>, warnings: Array<string>, styles: string, sourceMap: string};

declare module 'clean-css' {
declare class exports {
constructor(config: Object): void;
minify(code: string): CleanCSSResult;
}
}
10 changes: 10 additions & 0 deletions interfaces/eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type ESLintMessage = {message: string, ruleId?: string, line: number, column: number, filePath: string};
type ESLintResult = {filePath: string, messages: Array<ESLintMessage>};

declare module 'eslint' {
declare class CLIEngine {
options: {rules: Object};
constructor(config: Object): void;
executeOnFiles(files: Array<string>): {results: Array<ESLintResult>}
}
}
8 changes: 8 additions & 0 deletions interfaces/fb-watchman.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import EventEmitter from 'events';

declare module 'fb-watchman' {
declare class Client extends EventEmitter {
capabilityCheck(config: Object, callback: (error: ?string) => void): void;
command(cmd: Array<any>, callback: (error: ?string, result: Object) => void): void;
}
}
35 changes: 28 additions & 7 deletions interfaces/jasmine.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
declare function describe(title: string, callback: Function): any;
declare function beforeEach(callback: Function): any;
declare function afterEach(callback: Function): any;
declare function it(title: string, callback: Function): any;
declare function expect(obj: any): any;
declare function spyOn(obj: any, fn: string): any;
declare var jasmine: Object;
type Spy = {
and: {
callFake: (callback: (...args: Array<any>) => any) => Spy,
returnValue: (obj: any) => Spy,
callThrough: () => Spy
},
calls: {count: () => number}
};
type Match = {
not: Match,
toBe: (obj: any) => void,
toEqual: (obj: any) => void,
toBeTruthy: () => void,
toHaveBeenCalled: () => void,
toHaveBeenCalledWith: (...args: Array<any>) => void
};

declare function describe(title: string, callback: () => void): void;
declare function beforeEach(callback: () => void): void;
declare function afterEach(callback: () => void): void;
declare function it(title: string, callback: () => void): void;
declare function expect(obj: any): Match;
declare function spyOn(obj: any, fn: string): Spy;
declare var jasmine: {
createSpy: (name: string) => Spy,
any: (obj: any) => any,
objectContaining: (obj: Object) => void
};
3 changes: 3 additions & 0 deletions interfaces/js-yaml.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'js-yaml' {
declare function safeLoad(yaml: string, config: {filename: string}): Object;
}
5 changes: 5 additions & 0 deletions interfaces/memory-fs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'memory-fs' {
declare class exports {
readFileSync(path: string): {toString: () => string};
}
}
3 changes: 3 additions & 0 deletions interfaces/mkdirp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'mkdirp' {
declare var exports: (path: string, callback: (error: ?string) => void) => void;
}
1 change: 1 addition & 0 deletions interfaces/node-sass-import-once.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'node-sass-import-once' {}
6 changes: 6 additions & 0 deletions interfaces/node-sass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type NodeSassError = {message: string, file: string, line: number, column: number};
type NodeSassCallback = (error: ?NodeSassError, result: {css: string, map: string}) => void;

declare module 'node-sass' {
declare function render(options: Object, callback: NodeSassCallback): void;
}
6 changes: 6 additions & 0 deletions interfaces/postcss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type PostCSSResult = {css: string, map: Object, warnings: () => Array<string>};
type PostCSSPromise = {then: (callback: (result: PostCSSResult) => void) => void};

declare module 'postcss' {
declare var exports: (plugins: Array<any>) => {process: (code: string, config: Object) => PostCSSPromise};
}
3 changes: 3 additions & 0 deletions interfaces/proxyquire.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'proxyquire' {
declare var exports: (name: string, options: Object) => any;
}
3 changes: 3 additions & 0 deletions interfaces/tiny-lr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'tiny-lr' {
declare var exports: () => {changed: (config: Object) => void, listen: (port: number) => void};
}
3 changes: 3 additions & 0 deletions interfaces/uglify-js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'uglify-js' {
declare function minify(file: string, config: Object): {code: string, map: string};
}
71 changes: 71 additions & 0 deletions interfaces/webcompiler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
type NativeProcessCallback = (stderr: ?string, stdout: string) => void;
type DocumentationConfig = {inputDir?: string, outputDir?: string, readMe?: string, template?: string,
jsdocConfig: ?string};
type YAMLCallback = (error: ?string, data: Object) => void;
type JSLintError = {message: string, ruleId?: string, filePath: string, line: number, column: number};
type JSLintCallback = (errors: ?Array<JSLintError>) => void;
type ProgramData = {code: string, map: string};
type AutoprefixCallback = (data: ProgramData) => void;

declare module 'webcompiler' {

declare class NativeProcess {
constructor(task: string): void;
run(callback: ?NativeProcessCallback, args: ?Array<string>, opts: ?Object): void;
kill(): void;
}

declare class Documentation {
constructor(config: ?DocumentationConfig): void;
run(callback: () => void): void;
}

declare function watch(dir: string, type: string, callback: () => void): void;
declare function yaml(filename: string, callback: YAMLCallback): void;

declare class JS {
constructor(babelOptions: ?Object, lintRules: ?Object): void;
typecheck(callback: () => void): void;
lint(paths: Array<string>, callback: () => void): void;
be(inPath: string, outPath: string, lintPaths: ?Array<string>, callback: ?() => void): void;
fe(inPath: string, outPath: string, lintPaths: ?Array<string>, callback: ?() => void): void;
}

declare class SASS {
constructor(includePaths: ?Array<string>, excludeLinter: ?Array<string>, importOnceOptions: ?Object): void;
lint(paths: Array<string>, callback: () => void): void;
fe(inPath: string, outPath: string, lintPaths: ?Array<string>, callback: ?() => void): void;
}

declare class DevServer {
constructor(script: string, style: string, devDir: string, port: ?number, react: ?boolean): void;
watchSASS(watchDir: string): void;
watchJS(): void;
run(watchDir: string): void;
}

declare class JSLint {
constructor(rules: ?Object): void;
run(paths: Array<string>, callback: JSLintCallback): void;
}

declare class JSCompiler {
constructor(options: ?Object): void;
minify(path: string, data: ProgramData): ProgramData;
be(inPath: string, outPath: string, callback: ?() => void): void;
fe(inPath: string, outPath: string, callback: ?() => void): void;
}

declare class SASSLint {
constructor(...excludeLinter: Array<string>): void;
run(paths: Array<string>, callback: NativeProcessCallback): void;
}

declare class SASSCompiler {
constructor(includePaths: ?Array<string>, importOnceOptions: ?Object): void;
minify(path: string, data: ProgramData): ?ProgramData;
autoprefix(path: string, data: ProgramData, callback: AutoprefixCallback): void;
fe(inPath: string, outPath: string, callback: ?() => void): void;
}

}
7 changes: 7 additions & 0 deletions interfaces/webpack-dev-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module 'webpack-dev-server' {
declare class exports {
app: {get: (path: string, callback: (req: any, res: {send: (data: string) => void}) => void) => void};
constructor(webpack: Object): void;
listen(port: number, host: string, callback: (error: ?string) => void): void;
}
}
6 changes: 6 additions & 0 deletions interfaces/webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type WebPackStats = {toJson: () => {errors: Array<string>, warnings: Array<string>}};
type WebPackCallback = (error: ?string, stats: WebPackStats) => void;

declare module 'webpack' {
declare var exports: (config: Object, callback: ?WebPackCallback) => Object;
}

0 comments on commit 5097059

Please sign in to comment.