From cbf0fb9b209dd2d3efe69510925805da5fa8e29f Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Sun, 24 Dec 2017 02:43:47 -0500 Subject: [PATCH] Docs: describe how to feature-detect scopeManager/visitorKeys support (#9764) --- docs/developer-guide/working-with-plugins.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/developer-guide/working-with-plugins.md b/docs/developer-guide/working-with-plugins.md index 0fa9ef66555..e0b20bedef5 100644 --- a/docs/developer-guide/working-with-plugins.md +++ b/docs/developer-guide/working-with-plugins.md @@ -173,7 +173,9 @@ If you want to use your own parser and provide additional capabilities for your * `ast` should contain the AST. * `services` can contain any parser-dependent services (such as type checkers for nodes). The value of the `services` property is available to rules as `context.parserServices`. Default is an empty object. * `scopeManager` can be a [ScopeManager](./scope-manager-interface.md) object. Custom parsers can use customized scope analysis for experimental/enhancement syntaxes. Default is the `ScopeManager` object which is created by [eslint-scope](https://github.com/eslint/eslint-scope). + * Support for `scopeManager` was added in ESLint v4.14.0. ESLint versions which support `scopeManager` will provide an `eslintScopeManager: true` property in `parserOptions`, which can be used for feature detection. * `visitorKeys` can be an object to customize AST traversal. The keys of the object are the type of AST nodes. Each value is an array of the property names which should be traversed. Default is [KEYS of `eslint-visitor-keys`](https://github.com/eslint/eslint-visitor-keys#evkkeys). + * Support for `visitorKeys` was added in ESLint v4.14.0. ESLint versions which support `visitorKeys` will provide an `eslintVisitorKeys: true` property in `parserOptions`, which can be used for feature detection. You can find an ESLint parser project [here](https://github.com/eslint/typescript-eslint-parser).