Location of version
property is inconsistent between core APIs
#9271
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
core
Relates to ESLint's core APIs and features
enhancement
This change enhances an existing feature of ESLint
In ESLint 4.6.1, we have a
version
property onCLIEngine
andLinter
indicating the version of ESLint being used. However, theversion
property appears in different places; it's placed onCLIEngine
directly, but it's placed on instances ofLinter
.This happened because the
version
property was added whenLinter
was a singleton rather than a constructor, so users were previously expected to accesseslint.linter.version
.This could be mildly annoying; for example, an integration that only has access to
Linter
(like https://eslint.org/demo) would need to create a throwaway instance ofLinter
to get the version.I propose that we add
version
as a static property ofLinter
. We could also copy it toLinter.prototype
to prevent integrations from breaking if they were checking for theversion
property on instances.The text was updated successfully, but these errors were encountered: