Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
allmarkedup committed Mar 10, 2019
1 parent 9349471 commit d8e6d75
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/compile-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const Component = require('./entities/component');
const defaultComponentMatcher = require('./component-matcher');

module.exports = async function(files, opts = {}) {
files = orderBy(files, 'path.length', 'desc'); // work from deepest to shallowest
files = orderBy(files, 'path.length', 'desc'); // Work from deepest to shallowest
const dirs = files.filter(f => f.stats.isDirectory());
let unusedFiles = files.filter(f => f.stats.isFile());

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = function(config = {}) {

let files = await readFiles(paths, {
onlyFiles: false,
gitignore: !!opts.gitignore
gitignore: Boolean(opts.gitignore)
});

ctx.files = files;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/component-matcher.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function(dir, children, opts = {}) {
if (children.length === 0) {
return false; // components cannot be empty directories
return false; // Components cannot be empty directories
}
const matchFiles = opts.matchFiles || ['package.json', 'view.', 'config.'];
for (const file of children) {
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/state.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { flatMap } = require('lodash');

module.exports = function(initial = {}) {
const state = {
components: [],
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const standardConfig = require('./fixtures/components/@standard/standard.config'

it('Reads JS config files', async () => {
const compiler = createCompiler(resolve(__dirname, './fixtures/components'));
const { components } = await compiler.run();
const standard = components.find(c => c.name === 'standard');
const { state } = await compiler.run();
const standard = state.components.find(c => c.name === 'standard');
expect(standard.config).toEqual(standardConfig);
});

0 comments on commit d8e6d75

Please sign in to comment.