Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location of version property is inconsistent between core APIs #9271

Closed
not-an-aardvark opened this issue Sep 9, 2017 · 1 comment
Closed
Assignees
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

Comments

@not-an-aardvark
Copy link
Member

In ESLint 4.6.1, we have a version property on CLIEngine and Linter indicating the version of ESLint being used. However, the version property appears in different places; it's placed on CLIEngine directly, but it's placed on instances of Linter.

const eslint = require("eslint");

eslint.CLIEngine.version // 4.6.1
eslint.Linter.version // undefined

new eslint.CLIEngine().version // undefined
new eslint.Linter().version // 4.6.1

This happened because the version property was added when Linter was a singleton rather than a constructor, so users were previously expected to access eslint.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 of Linter to get the version.

I propose that we add version as a static property of Linter. We could also copy it to Linter.prototype to prevent integrations from breaking if they were checking for the version property on instances.

@not-an-aardvark not-an-aardvark added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 9, 2017
@nzakas
Copy link
Member

nzakas commented Oct 23, 2018

Looks like everyone thought this was a good idea and it just fell through the cracks. I'll tackle this.

@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Oct 23, 2018
@nzakas nzakas self-assigned this Oct 23, 2018
@nzakas nzakas closed this as completed in 3943635 Oct 24, 2018
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Apr 23, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

2 participants