Linting and Patch

This commit is contained in:
Belen Curcio
2017-04-06 18:49:12 -03:00
parent 5e2d64709c
commit 27408e1fa1
3 changed files with 8 additions and 12 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
import React, { Component } from "react";
import { getSlotElements } from "coral-framework/helpers/plugins";
import React, {Component} from 'react';
import {getSlotElements} from 'coral-framework/helpers/plugins';
class Slot extends Component {
render() {
const { fill, ...rest } = this.props;
const {fill, ...rest} = this.props;
return (
<div>
{getSlotElements(fill, rest)}
@@ -7,10 +7,10 @@
* module.exports = [{plugin: string, module: object}, ...]
*
*/
const { stripIndent } = require("common-tags");
const {stripIndent} = require('common-tags');
function getPluginList(config) {
return config.client.map(x => typeof x === "string" ? x : Object.keys(x)[0]);
return config.client.map(x => typeof x === 'string' ? x : Object.keys(x)[0]);
}
module.exports = function(source) {
@@ -18,15 +18,11 @@ module.exports = function(source) {
const config = this.exec(source, this.resourcePath);
const plugins = getPluginList(config);
plugins.map(plugin => {
list.push(
`{module: require('plugins/${plugin}/client/index.js'), plugin: '${plugin}'}`
);
});
plugins.map(plugin => `{module: require('plugins/${plugin}/client/index.js'), plugin: '${plugin}'}`);
return stripIndent`
module.exports = [
${plugins.join(",")}
${plugins.join(',')}
];
`;
};
+1 -1
View File
@@ -7,7 +7,7 @@
"postinstall": "./bin/cli plugins reconcile --skip-remote",
"start": "./bin/cli serve --jobs",
"dev-start": "nodemon --config .nodemon.json --exec \"./bin/cli -c .env serve --jobs\"",
"build": "NODE_ENV=production webpack --progress -p --config webpack.config.js --bail",
"build": "NODE_ENV=production webpack -p --config webpack.config.js --bail",
"build-watch": "NODE_ENV=development webpack --progress --config webpack.config.js --watch",
"lint": "eslint bin/* .",
"lint-fix": "eslint bin/* . --fix",