Skip to content

Commit

Permalink
Merge pull request #6539 from Automattic/add/babel-plugin-lodash
Browse files Browse the repository at this point in the history
Framework: Add babel-plugin-lodash to enable root Lodash imports
  • Loading branch information
aduth authored Jul 6, 2016
2 parents fe9c452 + 3d5e4d2 commit 4f02000
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 36 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"add-module-exports",
"syntax-jsx",
"transform-react-jsx",
"transform-react-display-name"
"transform-react-display-name",
"lodash"
]
}
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ module.exports = {
// Common top-of-file requires, expressions between external, interal
'vars-on-top': 1,
// Custom rules
'wpcalypso/no-lodash-import': 2,
'wpcalypso/i18n-ellipsis': 1,
'wpcalypso/i18n-no-variables': 1,
'wpcalypso/i18n-no-placeholders-only': 1,
Expand Down
7 changes: 1 addition & 6 deletions client/state/sites/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
/**
* External dependencies
*/
import map from 'lodash/map';
import filter from 'lodash/filter';
import some from 'lodash/some';
import includes from 'lodash/includes';
import find from 'lodash/find';
import get from 'lodash/get';
import { map, filter, some, includes, find, get } from 'lodash';

/**
* Internal dependencies
Expand Down
50 changes: 22 additions & 28 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"babel-core": "6.9.1",
"babel-loader": "6.2.4",
"babel-plugin-add-module-exports": "0.2.1",
"babel-plugin-lodash": "3.2.0",
"babel-plugin-syntax-jsx": "6.8.0",
"babel-plugin-transform-class-properties": "6.9.1",
"babel-plugin-transform-export-extensions": "6.8.0",
Expand Down
7 changes: 7 additions & 0 deletions server/config/test/data/mocks.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
/**
* External dependencies
*/
import path from 'path';
import fs from 'fs';

function toJSON( val ) {
return JSON.stringify( val );
}

export default {
INVALID_PATH: {
...fs,
existsSync: () => false,
readFileSync: () => ''
},

VALID_SECRETS: {
...fs,
existsSync: ( file ) => {
switch ( path.basename( file ) ) {
case 'secrets.json':
Expand Down Expand Up @@ -38,6 +44,7 @@ export default {
},

VALID_ENV_FILES: {
...fs,
existsSync: ( file ) => {
switch ( path.basename( file ) ) {
case '_shared.json':
Expand Down

0 comments on commit 4f02000

Please sign in to comment.