Skip to content

Commit db98804

Browse files
committed
[fix] - Simplify import/export module syntax for getAttributeValue workflow.
1 parent 410b329 commit db98804

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

.eslintignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
node_modules/**
2-
reports/**
3-
index.js
1+
node_modules/
2+
reports/
43
lib/

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"build": "rimraf lib && babel src --out-dir lib",
2121
"prepublish": "npm run lint && npm run test && npm run build",
2222
"coveralls": "cat ./reports/coverage/lcov.info | coveralls",
23-
"lint": "eslint --config .eslintrc.js src/**/*.js tests/**/*.js",
23+
"lint": "eslint --config .eslintrc.js .",
2424
"pretest": "npm run lint",
2525
"test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/**/*.js -- --compilers js:babel-core/register --reporter dot"
2626
},

src/util/getAttributeValue.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
'use strict';
22

3-
import {
4-
default as getValue,
5-
getLiteralValue
6-
} from './values';
3+
import getValue, { getLiteralValue } from './values';
74

85

96

src/util/values/index.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import assign from 'object-assign';
44
import Literal from './Literal';
55
import JSXElement from './JSXElement';
6-
import JSXExpressionContainer from './expressions';
7-
import { extractLiteral } from './expressions';
6+
import JSXExpressionContainer, { extractLiteral } from './expressions';
87

98

109

@@ -30,9 +29,9 @@ const LITERAL_TYPES = assign({}, TYPES, {
3029
*
3130
* @param value - AST Value object on a JSX Attribute.
3231
*/
33-
const getValue = function getValue(value) {
32+
export default function getValue(value) {
3433
return TYPES[value.type](value);
35-
};
34+
}
3635

3736
/**
3837
* This function maps an AST value node
@@ -43,12 +42,6 @@ const getValue = function getValue(value) {
4342
*
4443
* @param value - AST Value object on a JSX Attribute.
4544
*/
46-
const getLiteralValue = function getLiteralValue(value) {
45+
export function getLiteralValue(value) {
4746
return LITERAL_TYPES[value.type](value);
48-
};
49-
50-
export {
51-
getValue as default,
52-
getLiteralValue
53-
};
54-
47+
}

0 commit comments

Comments
 (0)