diff --git a/types/stylelint-webpack-plugin/index.d.ts b/types/stylelint-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..580fc4325f --- /dev/null +++ b/types/stylelint-webpack-plugin/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for https://github.com/JaKXz/stylelint-webpack-plugin 0.1 +// Project: https://github.com/JaKXz/stylelint-webpack-plugin +// Definitions by: Arne Bahlo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from "webpack"; + +export = StylelintWebpackPlugin; + +declare class StylelintWebpackPlugin extends Plugin { + constructor(options?: StylelintWebpackPlugin.Options); +} + +declare namespace StylelintWebpackPlugin { + interface Message { + line: number; + column: number; + severity: string; + text: string; + rule: string; + } + + type Formatter = (messages: Message[], source: string) => string; + + interface Options { + configFile?: string; + context?: string; + emitErrors?: boolean; + failOnError?: boolean; + files?: string[]; + formatter?: Formatter; + lintDirtyModulesOnly?: boolean; + syntax?: string; + quiet?: boolean; + } +} diff --git a/types/stylelint-webpack-plugin/stylelint-webpack-plugin-tests.ts b/types/stylelint-webpack-plugin/stylelint-webpack-plugin-tests.ts new file mode 100644 index 0000000000..924a41ee6d --- /dev/null +++ b/types/stylelint-webpack-plugin/stylelint-webpack-plugin-tests.ts @@ -0,0 +1,8 @@ +import * as webpack from "webpack"; +import * as StylelintWebpackPlugin from "stylelint-webpack-plugin"; + +const compiler = webpack({ + plugins: [ + new StylelintWebpackPlugin(), + ], +}); diff --git a/types/stylelint-webpack-plugin/tsconfig.json b/types/stylelint-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..c80333d6a9 --- /dev/null +++ b/types/stylelint-webpack-plugin/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "stylelint-webpack-plugin-tests.ts" + ] +} diff --git a/types/stylelint-webpack-plugin/tslint.json b/types/stylelint-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/stylelint-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }