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

Npm updates #21

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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.

3 changes: 3 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
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
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist

!.eslintrc.js
coverage
48 changes: 48 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use strict';
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true
},
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
}
}],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018
},
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']
}
};
16 changes: 0 additions & 16 deletions .npmignore

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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sudo: false
language: node_js
node_js:
- "6"
- "8"
- "10"
- 10
- 12
- 14
19 changes: 19 additions & 0 deletions LICENSE.BSD
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following code will output all variables declared at the root of a file.

```javascript
esrecurse.visit(ast, {
XXXStatement: function (node) {
XXXStatement (node) {
this.visit(node.left);
// do something...
this.visit(node.right);
Expand All @@ -21,8 +21,8 @@ esrecurse.visit(ast, {
We can use `Visitor` instance.

```javascript
var visitor = new esrecurse.Visitor({
XXXStatement: function (node) {
const visitor = new esrecurse.Visitor({
XXXStatement (node) {
this.visit(node.left);
// do something...
this.visit(node.right);
Expand All @@ -36,8 +36,7 @@ We can inherit `Visitor` instance easily.

```javascript
class Derived extends esrecurse.Visitor {
constructor()
{
constructor() {
super(null);
}

Expand Down Expand Up @@ -76,7 +75,7 @@ We can use user-defined node types.

```javascript
// This tree contains a user-defined `TestExpression` node.
var tree = {
const tree = {
type: 'TestExpression',

// This 'argument' is the property containing the other **node**.
Expand All @@ -91,7 +90,7 @@ var tree = {
esrecurse.visit(
ast,
{
Literal: function (node) {
Literal (node) {
// do something...
}
},
Expand All @@ -113,7 +112,7 @@ Please note circular references cause the stack overflow. AST might have circula
esrecurse.visit(
ast,
{
Literal: function (node) {
Literal (node) {
// do something...
}
},
Expand All @@ -130,13 +129,13 @@ Please note circular references cause the stack overflow. AST might have circula
esrecurse.visit(
ast,
{
Literal: function (node) {
Literal (node) {
// do something...
}
},
{
fallback: function (node) {
return Object.keys(node).filter(function(key) {
fallback (node) {
return Object.keys(node).filter((key) => {
return key !== 'argument'
});
}
Expand Down
3 changes: 3 additions & 0 deletions esrecurse.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Todo: Remove eslint disable directive once have a Babel routine
/* eslint-disable no-var, prefer-template */
/*
Copyright (C) 2014 Yusuke Suzuki <[email protected]>

Expand Down Expand Up @@ -27,6 +29,7 @@
var estraverse = require('estraverse');

function isNode(node) {
// istanbul ignore if -- Is currently always truthy
if (node == null) {
return false;
}
Expand Down
92 changes: 0 additions & 92 deletions gulpfile.babel.js

This file was deleted.

Loading