Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4694918
- Linting: Move ESLint to npm script; remove jshintrc
brettz9 Apr 26, 2020
80f4484
- Linting: Apply automated fixes (e.g., prefer-const)
brettz9 Apr 26, 2020
86632c0
- Linting: Manual fixes per config (e.g., destructuring) and moving `…
brettz9 Apr 26, 2020
3ec159d
- Move Mocha and Babel building/watch to npm
brettz9 Apr 26, 2020
a1deffe
- package.json: Add keywords
brettz9 Apr 26, 2020
aa7fd52
- Breaking change: Remove deprecated bower
brettz9 Apr 26, 2020
b23352d
- Lint espree wrapper file
brettz9 Apr 26, 2020
77fa91e
- Switch from local copy to npm package for esprima
brettz9 Apr 26, 2020
aa35e20
- npm: use author/contributors
brettz9 Apr 26, 2020
f56266a
- Travis: Drop pre Node 10 versions
brettz9 Apr 26, 2020
3e57002
- Set coverage for now to pass as is
brettz9 Apr 26, 2020
d014710
- npm: Provide tentative `browserify` script
brettz9 Apr 26, 2020
65b0697
- Linting: Remove old jslint directive
brettz9 Apr 26, 2020
99d1502
- Babel: Target Node 4+ for Babel (to avoid needing to polyfill featu…
brettz9 Apr 26, 2020
41d1d78
- Linting: Ignore jsdoc folder
brettz9 Apr 26, 2020
c5a48bc
- Linting: Remove formerly disabled rules
brettz9 Apr 26, 2020
724377e
- Testing: Use ESM fully in `third_party` and `test`
brettz9 Apr 26, 2020
54c6f41
- Build: Replace browserify with Rollup
brettz9 Apr 26, 2020
c0b1de3
- Testing: Minor coverage improvement
brettz9 Apr 26, 2020
d9b24f2
- Use file extensions
brettz9 Apr 30, 2020
c4f8cfa
- Refactoring: Prefer for-of
brettz9 Apr 30, 2020
bd191fb
- Add `Object.entries` polyfill
brettz9 Apr 30, 2020
0858bdf
- npm: Update devDeps.
brettz9 May 10, 2020
99ffe18
- npm: Update devDeps.
brettz9 Jun 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

12 changes: 12 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
["@babel/preset-env", {
"targets": {
"node": "4.0.0"
}
}]
],
"plugins": [
["transform-es2017-object-entries"]
]
}
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.json]
indent_size = 2

[*.yml]
indent_size = 2
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
lib

!.eslintrc.js
coverage

# jsdoc
out
46 changes: 46 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use strict';
module.exports = {
extends: 'eslint:recommended',
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
overrides: [{
files: '.eslintrc.js',
parserOptions: {
sourceType: 'script'
},
rules: {
strict: 'error'
}
}, {
files: 'test/**',
globals: {
expect: true
},
env: {
mocha: true
}
}],
rules: {
semi: ['error'],
indent: ['error', 4, { SwitchCase: 1 }],
'prefer-const': ['error'],
'no-var': ['error'],
'prefer-destructuring': ['error'],
'object-shorthand': ['error'],
'object-curly-spacing': ['error', 'always'],
quotes: ['error', 'single'],
'quote-props': ['error', 'as-needed'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'prefer-template': ['error']
},
env: {
node: true,
es6: true
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ npm-debug.log
# Cover
.coverage_data/
cover_html/
coverage

npm-debug.log
.vimrc.local
Expand Down
20 changes: 0 additions & 20 deletions .jshintrc

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock = false
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
sudo: false
language: node_js
node_js:
- "4"
- "6"
- "7"
- "8.0"
- "8.1"
- 10
- 12
- 14
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ scope analyzer extracted from [esmangle project](http://github.com/estools/esman
### Example

```js
var escope = require('escope');
var esprima = require('esprima');
var estraverse = require('estraverse');
const escope = require('escope');
const esprima = require('esprima');
const estraverse = require('estraverse');

var ast = esprima.parse(code);
var scopeManager = escope.analyze(ast);
const ast = esprima.parse(code);
const scopeManager = escope.analyze(ast);

var currentScope = scopeManager.acquire(ast); // global scope
const currentScope = scopeManager.acquire(ast); // global scope

estraverse.traverse(ast, {
enter: function(node, parent) {
enter (node, parent) {
// do stuff

if (/Function/.test(node.type)) {
currentScope = scopeManager.acquire(node); // get current function scope
}
},
leave: function(node, parent) {
leave (node, parent) {
if (/Function/.test(node.type)) {
currentScope = currentScope.upper; // set to parent scope
}

// do stuff
}
});
Expand Down
13 changes: 0 additions & 13 deletions bower.json

This file was deleted.

153 changes: 0 additions & 153 deletions gulpfile.js

This file was deleted.

Loading