Skip to content

Commit 11d9045

Browse files
authored
Native Flow, use Jest (#767)
* build: Use Flow syntax without comments. We're switching to Flow annotations - not Flow comments. This gives documentation.js the ability to self-document without JSDoc types and improves our compatibility with tools like prettier. Fixes #729. Fixes #709
1 parent 5b6b3bb commit 11d9045

File tree

401 files changed

+8619
-42839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

401 files changed

+8619
-42839
lines changed

.babelrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": ["flow"],
3+
"plugins": [
4+
"transform-es2015-modules-commonjs"
5+
]
6+
}

.eslintignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
test/fixture/*
1+
__tests__/fixture/*
2+
src/default_theme/*
3+
coverage/*
4+
lib/*
5+
declarations/*

.eslintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"root": true,
33
"parser": "babel-eslint",
44
"parserOptions": {
5-
"sourceType": "script"
5+
"sourceType": "module"
66
},
77
"plugins": [
88
"flowtype"
@@ -31,6 +31,7 @@
3131
},
3232
"extends": [
3333
"eslint:recommended",
34+
"plugin:flowtype/recommended",
3435
"prettier"
3536
],
3637
"env": {

.flowconfig

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[ignore]
22
.*node_modules/.cache/.*
33
.*node_modules/conventional-changelog-core/test/fixtures/.*
4-
.*/test/fixture/.*
4+
.*/__tests__/fixture/.*
5+
./lib/.*
56

67
[include]
78

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/lib
12
coverage
23
.nyc_output
3-
node_modules
4+
/node_modules

test/.eslintrc __tests__/.eslintrc

+3
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"rules": {
33
"valid-jsdoc": [0],
44
"no-unused-vars": [0]
5+
},
6+
"env": {
7+
"jest": true
58
}
69
}
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`readme command --readme-file 1`] = `
4+
"# A title
5+
6+
# API
7+
8+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
9+
10+
## foo
11+
12+
A function with documentation.
13+
14+
**Parameters**
15+
16+
- \`a\` {string} blah
17+
18+
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** answer
19+
20+
## bar
21+
22+
A second function with docs
23+
24+
**Parameters**
25+
26+
- \`b\`
27+
28+
# Another section
29+
"
30+
`;
31+
32+
exports[`readme command updates README.md 1`] = `
33+
"# A title
34+
35+
# API
36+
37+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
38+
39+
## foo
40+
41+
A function with documentation.
42+
43+
**Parameters**
44+
45+
- \`a\` {string} blah
46+
47+
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** answer
48+
49+
## bar
50+
51+
A second function with docs
52+
53+
**Parameters**
54+
55+
- \`b\`
56+
57+
# Another section
58+
"
59+
`;

0 commit comments

Comments
 (0)