-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from ember-learn/indent-style-space
unify indent style to space
- Loading branch information
Showing
30 changed files
with
1,376 additions
and
1,380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
module.exports = { | ||
env: { | ||
es6: true, | ||
node: true, | ||
}, | ||
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'plugin:n/recommended'], | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
'n/no-process-exit': 0, | ||
}, | ||
overrides: [ | ||
{ | ||
files: 'test/**/*', | ||
env: { | ||
mocha: true, | ||
}, | ||
rules: { | ||
'n/no-unpublished-import': 0, | ||
}, | ||
}, | ||
], | ||
env: { | ||
es6: true, | ||
node: true, | ||
}, | ||
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'plugin:n/recommended'], | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
'n/no-process-exit': 0, | ||
}, | ||
overrides: [ | ||
{ | ||
files: 'test/**/*', | ||
env: { | ||
mocha: true, | ||
}, | ||
rules: { | ||
'n/no-unpublished-import': 0, | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
import _ from 'lodash' | ||
|
||
export default function addInheritedItems(docSets) { | ||
docSets.forEach(versionData => { | ||
let data = versionData.data | ||
let classes = _.values(data.classes).filter(klass => klass && klass.name) | ||
classes = classes.filter(removeLongDocsBecauseEmber1HasWeirdDocs) | ||
let classItems = data.classitems.filter(({ itemtype }) => itemtype) | ||
docSets.forEach(versionData => { | ||
let data = versionData.data | ||
let classes = _.values(data.classes).filter(klass => klass && klass.name) | ||
classes = classes.filter(removeLongDocsBecauseEmber1HasWeirdDocs) | ||
let classItems = data.classitems.filter(({ itemtype }) => itemtype) | ||
|
||
classes.forEach(klass => { | ||
let parents = getParents(klass, classes) | ||
classes.forEach(klass => { | ||
let parents = getParents(klass, classes) | ||
|
||
for (let i = 0; i < parents.length; ++i) { | ||
parents = parents.concat(getParents(parents[i], classes)) | ||
} | ||
parents.forEach(parent => { | ||
if (!parent) return | ||
let parentItems = classItems.filter(item => item.class === parent.name) | ||
parentItems = parentItems.map(item => { | ||
item = _.clone(item) | ||
item.inherited = true | ||
item.inheritedFrom = item.class | ||
item.class = klass.name | ||
return item | ||
}) | ||
data.classitems = data.classitems.concat(parentItems) | ||
}) | ||
}) | ||
}) | ||
for (let i = 0; i < parents.length; ++i) { | ||
parents = parents.concat(getParents(parents[i], classes)) | ||
} | ||
parents.forEach(parent => { | ||
if (!parent) return | ||
let parentItems = classItems.filter(item => item.class === parent.name) | ||
parentItems = parentItems.map(item => { | ||
item = _.clone(item) | ||
item.inherited = true | ||
item.inheritedFrom = item.class | ||
item.class = klass.name | ||
return item | ||
}) | ||
data.classitems = data.classitems.concat(parentItems) | ||
}) | ||
}) | ||
}) | ||
|
||
return Promise.resolve(docSets) | ||
return Promise.resolve(docSets) | ||
} | ||
|
||
function getParents(klass, classes) { | ||
let parents = [] | ||
if (klass.extends) { | ||
parents = parents.concat([klass.extends]) | ||
} | ||
if (klass.uses && klass.uses.length) { | ||
parents = parents.concat(klass.uses.reverse()) | ||
} | ||
return parents | ||
.map(parent => _.find(classes, ({ name }) => name === parent)) | ||
.filter(parent => parent) | ||
let parents = [] | ||
if (klass.extends) { | ||
parents = parents.concat([klass.extends]) | ||
} | ||
if (klass.uses && klass.uses.length) { | ||
parents = parents.concat(klass.uses.reverse()) | ||
} | ||
return parents | ||
.map(parent => _.find(classes, ({ name }) => name === parent)) | ||
.filter(parent => parent) | ||
} | ||
|
||
function removeLongDocsBecauseEmber1HasWeirdDocs({ name }) { | ||
let str = 'A Suite can' | ||
return !name.includes(str) | ||
let str = 'A Suite can' | ||
return !name.includes(str) | ||
} |
Oops, something went wrong.