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,7 +32,8 @@ const getDeploymentGroups = query =>
.filter(find(cleanQuery(query))) .filter(find(cleanQuery(query)))
.map(getDeploymentGroupServices); .map(getDeploymentGroupServices);
const getPortal = () => Object.assign({}, portal, { const getPortal = () =>
Object.assign({}, portal, {
datacenter, datacenter,
deploymentGroups: getDeploymentGroups() deploymentGroups: getDeploymentGroups()
}); });
@ -42,8 +43,10 @@ const getServices = query =>
module.exports = { module.exports = {
portal: (options, request, fn) => fn(null, getPortal()), portal: (options, request, fn) => fn(null, getPortal()),
deploymentGroups: (options, request, fn) => fn(null, getDeploymentGroups(options)), deploymentGroups: (options, request, fn) =>
deploymentGroup: (options, request, fn) => fn(null, getDeploymentGroups(options).shift()), fn(null, getDeploymentGroups(options)),
deploymentGroup: (options, request, fn) =>
fn(null, getDeploymentGroups(options).shift()),
services: (options, request, fn) => fn(null, getServices()), services: (options, request, fn) => fn(null, getServices()),
service: (options, request, fn) => fn(null, getServices(options).shift()) service: (options, request, fn) => fn(null, getServices(options).shift())
}; };

View File

@ -24,7 +24,8 @@
"dist" "dist"
], ],
"scripts": { "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: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-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", "test": "redrun build test:run",

View File

@ -9,7 +9,7 @@
"scripts": { "scripts": {
"lint:css": "exit 0", "lint:css": "exit 0",
"lint-ci: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-ci:js": "eslint . --format junit --output-file $CIRCLE_TEST_REPORTS/lint/ui-toolkit.xml",
"lint": "redrun -s lint:*", "lint": "redrun -s lint:*",
"lint-ci": "redrun -s lint-ci:*", "lint-ci": "redrun -s lint-ci:*",

View File

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

View File

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

View File

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