Skip to content

Commit

Permalink
feature(@putout/plugin-strict-mode) add support of flow
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Aug 14, 2019
1 parent cf2b750 commit 27a0439
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/plugin-strict-mode/lib/add/fixture/flow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @flow
type BabelFileModulesMetadata = {
imports: Array<Object>,
exports: {
exported: Array<Object>,
specifiers: Array<Object>
}
};

2 changes: 1 addition & 1 deletion packages/plugin-strict-mode/lib/add/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports.traverse = ({push}) => {
const isModule = store();

return {
'ImportDeclaration|ExportNamedDeclaration|ExportDefaultDeclaration'() {
'ImportDeclaration|ExportNamedDeclaration|ExportDefaultDeclaration|TypeAlias'() {
isModule(true);
},
Program: {
Expand Down
5 changes: 5 additions & 0 deletions packages/plugin-strict-mode/lib/add/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ test('plugin-strict-mode: add: import', (t) => {
t.end();
});

test('plugin-strict-mode: add: no transform: flow', (t) => {
t.noTransform('flow');
t.end();
});

0 comments on commit 27a0439

Please sign in to comment.