diff --git a/change/just-scripts-2019-08-05-11-21-26-eslintOptions.json b/change/just-scripts-2019-08-05-11-21-26-eslintOptions.json new file mode 100644 index 00000000..0fd44497 --- /dev/null +++ b/change/just-scripts-2019-08-05-11-21-26-eslintOptions.json @@ -0,0 +1,8 @@ +{ + "comment": "add resolvePluginsPath option, make it possible to set maxWarnings to 0", + "type": "minor", + "packageName": "just-scripts", + "email": "andrewh@microsoft.com", + "commit": "986346455fe33c3ff1de70404d679cf18c60806c", + "date": "2019-08-05T18:21:26.706Z" +} \ No newline at end of file diff --git a/packages/just-scripts/src/tasks/eslintTask.ts b/packages/just-scripts/src/tasks/eslintTask.ts index 934745e4..e4104d1e 100644 --- a/packages/just-scripts/src/tasks/eslintTask.ts +++ b/packages/just-scripts/src/tasks/eslintTask.ts @@ -6,6 +6,7 @@ export interface EsLintTaskOptions { files?: string[]; configPath?: string; ignorePath?: string; + resolvePluginsPath?: string; fix?: boolean; extensions?: string; noEslintRc?: boolean; @@ -14,7 +15,7 @@ export interface EsLintTaskOptions { export function eslintTask(options: EsLintTaskOptions = {}): TaskFunction { return function eslint() { - const { files, configPath, ignorePath, fix, extensions, noEslintRc, maxWarnings } = options; + const { files, configPath, ignorePath, fix, extensions, noEslintRc, maxWarnings, resolvePluginsPath } = options; const eslintCmd = resolve('eslint/bin/eslint.js'); const eslintConfigPath = configPath || resolveCwd('.eslintrc'); if (eslintCmd && eslintConfigPath && fs.existsSync(eslintConfigPath)) { @@ -27,8 +28,9 @@ export function eslintTask(options: EsLintTaskOptions = {}): TaskFunction { ...(noEslintRc ? '--no-eslintrc' : []), ...(eslintConfigPath ? ['--config', eslintConfigPath] : []), ...(eslintIgnorePath ? ['--ignore-path', eslintIgnorePath] : []), + ...(resolvePluginsPath ? ['--resolve-plugins-relative-to', resolvePluginsPath] : []), ...(fix ? ['--fix'] : []), - ...(maxWarnings ? ['--max-warnings', `${maxWarnings}`] : []), + ...(maxWarnings !== undefined ? ['--max-warnings', `${maxWarnings}`] : []), '--color' ];