-
Notifications
You must be signed in to change notification settings - Fork 12
Migration Guide
Matt Schuchard edited this page Jul 12, 2016
·
5 revisions
This is a guide to migrating old code to the newer APIs
-
execFilePath
replaced byexecNode
:static execNode(filePath: String, args: Array<string> = [], options: Object = {stream: 'stdout'})
-
findFile()
guaranteed available (added in v1.0.2)
-
exec()
now throws an error when data is encountered onstdout
, unless eitheroptions.throwOnStdErr
(added in v2.0.5) is set to false, or stream is not set tostdout
.
-
stream: 'both'
added toexec()
, allowing data to be gathered fromstdout
andstderr
(added in v3.1.2) - An optional third parameter
colStart
was added torangeFromLineNumber()
in v3.2.0, allowing a starting column for the range to be specified. - The
parse()
method gained an optional fourth parameterflags
, allowing modification of the RegEx flags used
-
rangeFromLineNumber()
guaranteed available (added in v3.1.0) -
tempFile()
guaranteed available (added in v3.1.3) -
findFileAsync()
guaranteed available (added in v3.4.0) -
findFile()
renamed tofind()
-
FindCache
exported, allowingFindCache.clear()
to be called if necessary (v4.1.1) - A 10 second execution timeout was added in v4.6.0
-
findCached()
andfindCachedAsync()
guaranteed available (added in v4.1.0) -
tempFiles()
guaranteed available (added in v4.3.0) - Handling of return codes implemented, potentially breaking providers of linters that don't follow common best practices.
- If the linter normally outputs on
stderr
, setting theallowEmptyStderr
option totrue
in*exec
methods will allow it to have no output on a run (eg. one with no issues to report) - If the linter exits with a non-zero exit code when issues are reported, setting the
ignoreExitCode
option totrue
in*exec
methods will allow it to report issues without throwing a fatal error tosb-exec
.
-
rangeFromLineNumber
updated to return a range that wraps a word not an entire line. (API breaking change)
-
createElement
was added in v3.3.5 and removed in v4.3.1, apparently due to a complete lack of use.