Skip to content

Conversation

@LISBON11
Copy link

No description provided.

package.json Outdated
"eslint-config-pedant": "^0.8.0",
"mocha": "^3.1.0",
"rimraf": "^2.5.4"
"proxyquire": "^2.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- "proxyquire": "^2.0.1",
- "sinon": "^4.4.8"

var isPiped = template instanceof stream.Readable,
content = (isPiped || typeof template === 'string') ? template :
template(entity, bemNaming(options.naming)),
var isPiped = content instanceof stream.Readable,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless

also try to use createTree for all

test/test1.js Outdated

function testEntityHelper(entities, levels, techs, options, expected) {
const actualPaths = prepareEntityData(entities, levels, techs, options)
.map(({ path }) => path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- .map(({ path }) => path)
+ .map(item => item.path)

and remove eslint rule

levelOptions.forceRewrite = options.forceRewrite;
}

return {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most likely there's no need to tunnel all the fields here.
try to get it directly from global opts (maybe there's some common computation so it could be one more additional module).

var levelsMap = config.levelMapSync(),
levelList = Object.keys(levelsMap);

var defaultLevels = levelList.filter(function(level) {
Copy link

@dustyo-O dustyo-O May 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

возможно, нужно вычислять только после levelByCwd, потому что на строке https://github.com/bem-tools/bem-tools-create/pull/53/files#diff-d854c73a37caf2bcd71fe93eba02959fR40 стоит справа от или


var levelByCwd = levelList.filter(function(level) {
return cwd.indexOf(level) === 0;
}).sort().reverse()[0];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

затащить reverse внутрь sort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants