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

chore(v2): test flowtype + refactor #1443

Merged
merged 16 commits into from
May 8, 2019
Merged
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- run:
name: Check ESLint
command: yarn lint
- run:
name: Check Flow
command: yarn flow check
- run:
name: Check Prettier
command: yarn prettier:diff
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ scripts
packages/docusaurus-1.x/lib/core/metadata.js
packages/docusaurus-1.x/lib/core/MetadataBlog.js
packages/docusaurus-1.x/lib/core/__tests__/split-tab.test.js
packages/docusaurus-utils/lib
packages/docusaurus/lib
14 changes: 14 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[ignore]
<PROJECT_ROOT>/packages/.*/lib
<PROJECT_ROOT>/packages/.*/__tests__

[include]

[libs]

[lints]

[options]
module.name_mapper='^@docusaurus\/\([a-zA-Z0-9_\-]+\)$' -> '<PROJECT_ROOT>/packages/docusaurus-\1/src/index'

[strict]
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ yarn-error.log
build
.docusaurus
.cache-loader
packages/docusaurus-utils/lib
packages/docusaurus/lib/

5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
dist
node_modules
build
.docusaurus
.docusaurus
packages/docusaurus-utils/lib
packages/docusaurus/lib
flow-typed
13 changes: 12 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@
*/

module.exports = {
presets: ['@babel/env', '@babel/react'],
presets: [
[
'@babel/env',
{
targets: {
node: 'current',
},
},
],
'@babel/react',
'@babel/preset-flow',
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

const babelConfig = require('./babel.config');

module.exports = require('babel-jest').createTransformer(babelConfig);
declare module 'escape-string-regexp' {
declare module.exports: (input: string) => string;
}
Loading