File tree Expand file tree Collapse file tree 4 files changed +29
-10
lines changed
Expand file tree Collapse file tree 4 files changed +29
-10
lines changed Original file line number Diff line number Diff line change 66 "extends": [
77 "kentcdodds/best-practices",
88 "kentcdodds/possible-errors",
9+ "kentcdodds/es6/best-practices",
10+ "kentcdodds/es6/possible-errors",
11+ "kentcdodds/import/best-practices",
12+ "kentcdodds/import/possible-errors",
913 "kentcdodds/mocha"
1014 ],
1115 "rules": {},
Original file line number Diff line number Diff line change 11node_modules /
22.nyc_output /
33coverage /
4+ dist /
Original file line number Diff line number Diff line change 22 "name" : " starwars-names" ,
33 "version" : " 1.0.0" ,
44 "description" : " Get random Star Wars names" ,
5- "main" : " src /index.js" ,
5+ "main" : " dist /index.js" ,
66 "scripts" : {
7+ "prebuild" : " rimraf dist" ,
8+ "build" : " babel --copy-files --out-dir dist --ignore *.test.js src" ,
79 "test" : " nyc mocha" ,
810 "watch:test" : " mocha --watch" ,
911 "lint" : " eslint src" ,
10- "validate" : " npm-run-all --parallel test lint"
12+ "validate" : " npm-run-all --parallel test lint build "
1113 },
1214 "repository" : {
1315 "type" : " git" ,
1719 " random" ,
1820 " star wars"
1921 ],
22+ "files" : [
23+ " dist"
24+ ],
2025 "author" :
" Kent C. Dodds <[email protected] > (http://kentcdodds.com/)" ,
2126 "license" : " MIT" ,
2227 "bugs" : {
2732 "unique-random-array" : " 1.0.0"
2833 },
2934 "devDependencies" : {
35+ "babel-cli" : " 6.11.4" ,
36+ "babel-preset-es2015" : " 6.9.0" ,
3037 "chai" : " 3.5.0" ,
3138 "eslint" : " 3.2.0" ,
3239 "eslint-config-kentcdodds" : " ^9.0.0" ,
3340 "ghooks" : " 1.3.2" ,
3441 "mocha" : " 3.0.0" ,
3542 "npm-run-all" : " 2.3.0" ,
36- "nyc" : " 7.1.0"
43+ "nyc" : " 7.1.0" ,
44+ "rimraf" : " 2.5.4"
3745 },
3846 "nyc" : {
3947 "all" : true ,
5058 " src"
5159 ]
5260 },
61+ "babel" : {
62+ "presets" : [
63+ " es2015"
64+ ]
65+ },
5366 "config" : {
5467 "ghooks" : {
5568 "pre-commit" : " npm run validate"
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import uniqueRandomArray from 'unique-random-array'
2+ const starWarsNames = require ( './starwars-names.json' )
23
3- var uniqueRandomArray = require ( 'unique-random-array' ) ;
4- var starWarsNames = require ( './starwars-names.json' ) ;
5-
6- module . exports = {
4+ const mainExport = {
75 all : starWarsNames ,
8- random : uniqueRandomArray ( starWarsNames )
9- } ;
6+ random : uniqueRandomArray ( starWarsNames ) ,
7+ }
8+
9+ export default mainExport
10+ module . exports = mainExport // for CommonJS compatibility
You can’t perform that action at this time.
0 commit comments