-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major Patch: ES6-Babel-6-Full-Dependencies-Upgrade #111
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"stage": 0 | ||
"presets": ["es2015", "stage-0", "react"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
{ | ||
"ecmaFeatures": { | ||
"jsx": true, | ||
"modules": true | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"parser": "babel-eslint", | ||
"extends": "eslint-config-airbnb", | ||
"rules": { | ||
"no-loop-func": 0, | ||
"quotes": [2, "single"], | ||
"strict": [2, "never"], | ||
"react/jsx-uses-react": 2, | ||
"react/jsx-uses-vars": 2, | ||
"react/react-in-jsx-scope": 2, | ||
"indent": [2, 2, {"SwitchCase": 1}], | ||
"no-console": [0], | ||
"func-names": [0], | ||
"semi": [2, "never"], | ||
"no-extra-semi": [2], | ||
"space-before-function-paren": [2, "always"], | ||
"no-else-return": [0], | ||
"no-else-return": [0] | ||
}, | ||
"globals": { | ||
"__PREFIX_LINKS__": true, | ||
"__PREFIX_LINKS__": true | ||
}, | ||
"plugins": [ | ||
"react" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"node": true, | ||
"browser": true, | ||
"esnext": true, | ||
"newcap": false | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import program from 'commander' | ||
import path from 'path' | ||
|
||
const packageJson = require('../package.json') | ||
|
||
// Use compiled version of code when installed globally, otherwise use babel script version. | ||
const build = require(('./published.js') ? ('../dist/utils/build') : ('../lib/utils/build')) | ||
|
||
program | ||
.version(packageJson.version) | ||
.option('--prefix-links', 'Build site with links prefixed (set prefix in your config).') | ||
.parse(process.argv) | ||
|
||
let relativeDirectory = program.args[0] | ||
if (!(typeof relativeDirectory !== 'undefined' && relativeDirectory !== null)) { relativeDirectory = '.' } | ||
const directory = path.resolve(relativeDirectory) | ||
|
||
program.directory = directory | ||
program.relativeDirectory = relativeDirectory | ||
|
||
build(program, function (err) { | ||
if ((typeof err !== 'undefined' && err !== null)) { | ||
throw err | ||
} else { | ||
return console.log('Done') | ||
} | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env node | ||
|
||
require('coffee-script/register') | ||
require('./index') |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import program from 'commander' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reminder that this code needs to be ES5/commonjs as Babel doesn't work when code is globally installed https://phabricator.babeljs.io/T1889 #54 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah indeed, I'll will adjust this to utilize requires instead along with ES5 compliant code. |
||
import path from 'path' | ||
|
||
import packageJson from '../package.json' | ||
|
||
// Use compiled version of code when installed globally, otherwise use babel script version. | ||
const develop = require(('./published.js') ? ('../dist/utils/develop') : ('../lib/utils/develop')) | ||
|
||
program | ||
.version(packageJson.version) | ||
.option('-h, --host <url>', 'Set host. Defaults to 0.0.0.0', '0.0.0.0') | ||
.option('-p, --port <port>', 'Set port. Defaults to 8000', '8000') | ||
.parse(process.argv) | ||
|
||
let relativeDirectory = program.args[0] | ||
if (!(typeof relativeDirectory !== 'undefined' && relativeDirectory !== null)) { relativeDirectory = '.' } | ||
const directory = path.resolve(relativeDirectory) | ||
|
||
program.directory = directory | ||
program.relativeDirectory = relativeDirectory | ||
|
||
develop(program) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
require('babel/register') | ||
require('coffee-script/register') | ||
require('babel-register') | ||
require('./build') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env node | ||
require('babel/register') | ||
|
||
require('coffee-script/register') | ||
require('babel-register') | ||
require('./develop') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
require('coffee-script/register') | ||
require('babel/register') | ||
require('babel-register') | ||
require('./new') |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const program = require('commander') | ||
const loggy = require('loggy') | ||
|
||
const packageJson = require('../package.json') | ||
|
||
// Use compiled version of code when installed globally, otherwise use babelscript version. | ||
const initStarter = require(('./published.js') ? ('../dist/utils/init-starter') : ('../lib/utils/init-starter')) | ||
|
||
program | ||
.version(packageJson.version) | ||
.parse(process.argv) | ||
|
||
const rootPath = program.args[0] | ||
const starter = ((program.args.length === 1) ? ('gh:gatsbyjs/gatsby-starter-default') : (program.args[1])) | ||
|
||
initStarter(starter, { | ||
rootPath, | ||
logger: loggy, | ||
}, function (error) { | ||
if (error) { | ||
return loggy.error(error) | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are redundant as they're already set in the airbnb eslint config https://github.com/airbnb/javascript/blob/fbf81eba3a02ef2dc4c92b0d98f93a4bad99869d/packages/eslint-config-airbnb/rules/react.js#L70
Only add rules here if we need to override eslint defaults or rules we inherit from airbnb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, I'll remove
"quotes": [2, "single"],
"strict": [2, "never"],
"react/jsx-uses-react": 2,
However, I'll keep "no-loop-func": 0, until glob-pages.js is modified to support this requirement.