Skip to content

Commit

Permalink
Fix XO lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 24, 2017
1 parent 691e670 commit b559ed6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function assembleStyles() {
white: [37, 39],
gray: [90, 39],

// bright color
// Bright color
redBright: [91, 39],
greenBright: [92, 39],
yellowBright: [93, 39],
Expand All @@ -59,7 +59,7 @@ function assembleStyles() {
bgCyan: [46, 49],
bgWhite: [47, 49],

// bright color
// Bright color
bgBlackBright: [100, 49],
bgRedBright: [101, 49],
bgGreenBright: [102, 49],
Expand All @@ -71,7 +71,7 @@ function assembleStyles() {
}
};

// fix humans
// Fix humans
styles.color.grey = styles.color.gray;

Object.keys(styles).forEach(groupName => {
Expand All @@ -80,10 +80,12 @@ function assembleStyles() {
Object.keys(group).forEach(styleName => {
const style = group[styleName];

styles[styleName] = group[styleName] = {
styles[styleName] = {
open: `\u001B[${style[0]}m`,
close: `\u001B[${style[1]}m`
};

group[styleName] = styles[styleName];
});

Object.defineProperty(styles, groupName, {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@
},
"devDependencies": {
"ava": "*",
"babel-polyfill": "^6.23.0",
"xo": "*"
},
"xo": {
"esnext": true
"ava": {
"require": "babel-polyfill"
}
}
10 changes: 5 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import test from 'ava';
import style from './';
import style from '.';

// generates the screenshot
for (const [key, val] of Object.entries(style)) { // eslint-disable-line no-use-extend-native/no-use-extend-native
// Generates the screenshot
for (const [key, val] of Object.entries(style)) {
let code = val.open;

if (key === 'reset' || key === 'hidden' || key === 'grey') {
Expand Down Expand Up @@ -35,8 +35,8 @@ test('groups should not be enumerable', t => {
});

test('don\'t pollute other objects', t => {
const obj1 = require('./');
const obj2 = require('./');
const obj1 = require('.');
const obj2 = require('.');

obj1.foo = true;
t.not(obj1.foo, obj2.foo);
Expand Down

0 comments on commit b559ed6

Please sign in to comment.