1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-29 13:20:06 +02:00

style: update root lint rules

This commit is contained in:
Sérgio Ramos 2017-05-31 20:17:12 +01:00
parent 0667ca8ad3
commit 61d1df94c1
7 changed files with 25 additions and 29 deletions

View File

@ -1,3 +1,7 @@
{
"extends": "./packages/eslint-config/index.js"
"extends": "./packages/eslint-config/index.js",
"rules": {
"new-cap": 0,
"no-console": 0
}
}

View File

@ -32,18 +32,21 @@ const getDeploymentGroups = query =>
.filter(find(cleanQuery(query)))
.map(getDeploymentGroupServices);
const getPortal = () => Object.assign({}, portal, {
datacenter,
deploymentGroups: getDeploymentGroups()
});
const getPortal = () =>
Object.assign({}, portal, {
datacenter,
deploymentGroups: getDeploymentGroups()
});
const getServices = query =>
services.filter(find(query)).map(getDeploymentGroupServices);
module.exports = {
portal: (options, request, fn) => fn(null, getPortal()),
deploymentGroups: (options, request, fn) => fn(null, getDeploymentGroups(options)),
deploymentGroup: (options, request, fn) => fn(null, getDeploymentGroups(options).shift()),
deploymentGroups: (options, request, fn) =>
fn(null, getDeploymentGroups(options)),
deploymentGroup: (options, request, fn) =>
fn(null, getDeploymentGroups(options).shift()),
services: (options, request, fn) => fn(null, getServices()),
service: (options, request, fn) => fn(null, getServices(options).shift())
};

View File

@ -24,7 +24,8 @@
"dist"
],
"scripts": {
"lint": "eslint . --fix --format=tap",
"lint": "eslint . --fix",
"lint-ci": "eslint . --format junit --output-file $CIRCLE_TEST_REPORTS/lint/pseudo-yaml-ast.xml",
"test:run": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text ava",
"test-ci:run": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text ava --tap | tap-xunit > $CIRCLE_TEST_REPORTS/test/pseudo-yaml-ast.xml",
"test": "redrun build test:run",

View File

@ -9,7 +9,7 @@
"scripts": {
"lint:css": "exit 0",
"lint-ci:css": "exit 0",
"lint:js": "eslint . --fix --format=tap",
"lint:js": "eslint . --fix",
"lint-ci:js": "eslint . --format junit --output-file $CIRCLE_TEST_REPORTS/lint/ui-toolkit.xml",
"lint": "redrun -s lint:*",
"lint-ci": "redrun -s lint-ci:*",

View File

@ -34,7 +34,7 @@ const StyledButton = styled(Button)`
}
`;
const TooltipButton = (props) => (
const TooltipButton = props => (
<li>
<StyledButton {...props} />
</li>

View File

@ -8,10 +8,10 @@ import { border, borderRadius, tooltipShadow } from '../boxes';
const StyledContainer = styled.div`
position: absolute;
top: ${(props) => props.top};
left: ${(props) => props.left};
bottom: ${(props) => props.bottoms};
right: ${(props) => props.right};
top: ${props => props.top};
left: ${props => props.left};
bottom: ${props => props.bottoms};
right: ${props => props.right};
`;
const StyledList = styled.ul`
@ -61,14 +61,9 @@ const Tooltip = ({
bottom = 'auto',
right = 'auto'
}) => (
<StyledContainer
top={top}
left={left}
bottom={bottom}
right={right}
>
<StyledContainer top={top} left={left} bottom={bottom} right={right}>
<StyledList>
{ children }
{children}
</StyledList>
</StyledContainer>
);
@ -79,6 +74,6 @@ Tooltip.propTypes = {
left: PropTypes.number,
bottom: PropTypes.number,
right: PropTypes.number
}
};
export default Tooltip;

View File

@ -344,15 +344,12 @@ const tasks = [
const tagName = `${pkg.name}-${releaseType}@${version}`;
const tagBody = `${EOL}${lastCommits}`;
// eslint-disable-next-line no-console
console.log(
`${prefix}${chalk.yellow('Tag Name: ')}\n${prefix}${prefix}${chalk.dim(tagName)}`
);
// eslint-disable-next-line no-console
console.log(`${prefix}${chalk.yellow('Tag Description: ')}`);
// eslint-disable-next-line no-console
console.log(
`${chalk.dim(lastCommits
.split(/\n/)
@ -441,12 +438,10 @@ const run = (tasks = [], ctx = {}, prefix = '') =>
}
if (isString(title)) {
// eslint-disable-next-line no-console
console.log(`${prefix}${chalk.green(figures.arrowRight)} ${title}`);
}
if (isString(description)) {
// eslint-disable-next-line no-console
console.log(
`${chalk.dim(`${prefix}${figures.arrowRight} ${description}`)}`
);
@ -459,10 +454,8 @@ const run = (tasks = [], ctx = {}, prefix = '') =>
const [err, nCtx] = await intercept(task(context));
if (err) {
// eslint-disable-next-line no-console
console.log(`${chalk.red(figures.cross)} ${chalk.dim(err.message)}`);
// eslint-disable-next-line no-console
console.log(
`${chalk.dim(err.stack.replace(`Error: ${err.message}`, '').trim())}`
);