You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope).
6
4
7
-
### Example
5
+
## Usage
6
+
7
+
Install:
8
+
9
+
```
10
+
npm i eslint-scope --save
11
+
```
12
+
13
+
Example:
8
14
9
15
```js
10
-
varescope=require('escope');
16
+
vareslintScope=require('eslint-scope');
11
17
var esprima =require('esprima');
12
18
var estraverse =require('estraverse');
13
19
14
20
var ast =esprima.parse(code);
15
-
var scopeManager =escope.analyze(ast);
21
+
var scopeManager =eslintScope.analyze(ast);
16
22
17
23
var currentScope =scopeManager.acquire(ast); // global scope
18
24
@@ -34,46 +40,15 @@ estraverse.traverse(ast, {
34
40
});
35
41
```
36
42
37
-
### Document
38
-
39
-
Generated JSDoc is [here](http://estools.github.io/escope/).
40
-
41
-
### Demos and Tools
42
-
43
-
Demonstration is [here](http://mazurov.github.io/escope-demo/) by [Sasha Mazurov](https://github.com/mazurov) (twitter: [@mazurov](http://twitter.com/mazurov)). [issue](https://github.com/estools/escope/issues/14)
-[Esmangle](https://github.com/estools/esmangle) is a minifier / mangler / optimizer.
51
-
-[Eslevels](https://github.com/mazurov/eslevels) is a scope levels analyzer and [SublimeText plugin for scope context coloring](https://github.com/mazurov/sublime-levels) is constructed on it.
52
-
-[Esgoggles](https://github.com/keeyipchan/esgoggles) is JavaScript code browser.
(twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
45
+
Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-scope/issues).
59
46
60
-
Redistribution and use in source and binary forms, with or without
61
-
modification, are permitted provided that the following conditions are met:
47
+
## Build Commands
62
48
63
-
* Redistributions of source code must retain the above copyright
64
-
notice, this list of conditions and the following disclaimer.
49
+
*`npm test` - run all linting and tests
50
+
*`npm run lint` - run all linting
65
51
66
-
* Redistributions in binary form must reproduce the above copyright
67
-
notice, this list of conditions and the following disclaimer in the
68
-
documentation and/or other materials provided with the distribution.
52
+
## License
69
53
70
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
71
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
72
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
73
-
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHTHOLDER> BE LIABLE FOR ANY
74
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
75
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
76
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
77
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
78
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
79
-
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54
+
ESLint Scope is licensed under a permissive BSD 2-clause license.
0 commit comments