Skip to content

Commit 04455f8

Browse files
committed
refactor
1 parent 52cbb53 commit 04455f8

File tree

14 files changed

+890
-712
lines changed

14 files changed

+890
-712
lines changed

.editorconfig

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
# http://editorconfig.org
1+
# http://editorconfig.org/
22
root = true
33

44
[*]
5-
indent_style = space
6-
end_of_line = lf
75
charset = utf-8
6+
end_of_line = lf
87
indent_size = 2
9-
trim_trailing_whitespace = true
8+
indent_style = space
109
insert_final_newline = true
10+
trim_trailing_whitespace = true
1111

1212
[*.md]
1313
trim_trailing_whitespace = false
14-
insert_final_newline = false
15-
16-
[test/**]
17-
trim_trailing_whitespace = false
18-
insert_final_newline = false
19-
20-
[templates/**]
21-
trim_trailing_whitespace = false
22-
insert_final_newline = false

.eslintrc renamed to .eslintrc.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"ecmaFeatures": {
3-
"modules": true,
4-
"experimentalObjectRestSpread": true
5-
},
2+
"extends": [
3+
"eslint:recommended"
4+
],
65

76
"env": {
87
"browser": false,
@@ -11,6 +10,15 @@
1110
"mocha": true
1211
},
1312

13+
"parserOptions":{
14+
"ecmaVersion": 9,
15+
"sourceType": "module",
16+
"ecmaFeatures": {
17+
"modules": true,
18+
"experimentalObjectRestSpread": true
19+
}
20+
},
21+
1422
"globals": {
1523
"document": false,
1624
"navigator": false,
@@ -34,6 +42,7 @@
3442
"handle-callback-err": [2, "^(err|error)$" ],
3543
"indent": [2, 2, { "SwitchCase": 1 }],
3644
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
45+
"keyword-spacing": [2, { "before": true, "after": true }],
3746
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
3847
"new-parens": 2,
3948
"no-array-constructor": 2,
@@ -49,7 +58,6 @@
4958
"no-dupe-keys": 2,
5059
"no-duplicate-case": 2,
5160
"no-empty-character-class": 2,
52-
"no-empty-label": 2,
5361
"no-eval": 2,
5462
"no-ex-assign": 2,
5563
"no-extend-native": 2,
@@ -71,7 +79,7 @@
7179
"no-multi-spaces": 2,
7280
"no-multi-str": 2,
7381
"no-multiple-empty-lines": [2, { "max": 1 }],
74-
"no-native-reassign": 2,
82+
"no-native-reassign": 0,
7583
"no-negated-in-lhs": 2,
7684
"no-new": 2,
7785
"no-new-func": 2,
@@ -108,13 +116,10 @@
108116
"radix": 2,
109117
"semi": [2, "always"],
110118
"semi-spacing": [2, { "before": false, "after": true }],
111-
"space-after-keywords": [2, "always"],
112119
"space-before-blocks": [2, "always"],
113120
"space-before-function-paren": [2, "never"],
114-
"space-before-keywords": [2, "always"],
115121
"space-in-parens": [2, "never"],
116122
"space-infix-ops": 2,
117-
"space-return-throw-case": 2,
118123
"space-unary-ops": [2, { "words": true, "nonwords": false }],
119124
"spaced-comment": [0, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],
120125
"use-isnan": 2,

.gitignore

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1-
*.DS_store
1+
# always ignore files
2+
*.DS_Store
23
*.sublime-*
3-
_gh_pages
4-
bower_components
4+
5+
# test related, or directories generated by tests
6+
test/actual
7+
actual
8+
coverage
9+
.nyc*
10+
11+
# npm
512
node_modules
613
npm-debug.log
7-
actual
8-
test/actual
14+
15+
# yarn
16+
yarn.lock
17+
yarn-error.log
18+
19+
# misc
20+
_gh_pages
21+
_draft
22+
_drafts
23+
bower_components
24+
vendor
925
temp
1026
tmp
1127
TODO.md
12-
vendor
13-
coverage

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.travis.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
sudo: false
2+
os:
3+
- linux
4+
- osx
5+
- windows
26
language: node_js
37
node_js:
4-
- "stable"
5-
- "4"
6-
- "0.12"
7-
- "0.10"
8-
matrix:
9-
fast_finish: true
10-
allow_failures:
11-
- node_js: "0.10"
8+
- node
9+
- '11'
10+
- '10'
11+
- '9'
12+
- '8'
13+
- '7'
14+
- '6'

.verb.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
# {%= name %} {%= badge("fury") %} {%= badge("travis") %}
1+
## Getting started
22

3-
> {%= description %}
4-
5-
## Install
6-
{%= include("install-npm", {save: true}) %}
3+
- [Usage](#usage)
4+
- [API](#api)
5+
- [Examples](#examples)
6+
- [Custom parsers](#custom-parsers)
77

88
## Usage
99

1010
```js
11-
var parse = require('{%= name %}');
11+
const parse = require('{%= name %}');
12+
console.log(parse('function app(a, b, c) {\n\n}'));
1213
```
1314

15+
## API
16+
{%= apidocs('index.js') %}
17+
1418
## Examples
1519

1620
### function statement
1721

1822
```js
19-
parse("function app(a, b, c) {\n\n}");
23+
const context = parse('function app(a, b, c) {\n\n}');
24+
console.log(context);
2025
```
2126

2227
Results in:
@@ -229,23 +234,26 @@ Results in:
229234
original: 'Template.prototype.get = function(key, value, options) {}' }
230235
```
231236

232-
## Related projects
233-
{%= related(verb.related.list) %}
237+
## Custom parsers
234238

235-
## Running tests
236-
{%= include("tests") %}
239+
Instantiate the `Parser` class to register custom parsers.
237240

238-
## Contributing
239-
{%= include("contributing") %}
240241

241-
## Author
242-
{%= include("author") %}
243-
Regex originally sourced and modified from <https://github.com/visionmedia/dox>.
242+
```js
243+
const { Parser} = require('{%= name %}');
244+
const parser = new Parser();
245+
246+
parser.capture(/foo\(([^)]+)\)/, match => {
247+
return {
248+
params: match[1].split(/[,\s]+/)
249+
};
250+
});
251+
252+
console.log(parser.parse('foo(a, b, c)'));
253+
```
254+
244255

245-
## License
246-
{%= copyright() %}
247-
{%= license %}
256+
## Credit
248257

249-
***
258+
Regex was originally sourced and modified from <https://github.com/visionmedia/dox>.
250259

251-
{%= include("footer") %}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014, 2015, Jon Schlinkert.
3+
Copyright (c) 2014-present, Jon Schlinkert.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)