1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-23 15:32:59 +02:00

Convert to babel-preset-env and upgrade build and linting packages. (#1557)

This commit is contained in:
Zach Schneider
2018-01-26 13:55:29 -05:00
committed by Ian Storm Taylor
parent 1467d687bd
commit 00165a3155
16 changed files with 554 additions and 471 deletions

View File

@@ -1,7 +1,12 @@
{ {
"presets": [ "presets": [
"es2015", "env",
"react", "react",
"stage-0" "stage-0"
] ],
"env": {
"test": {
"plugins": ["transform-runtime"]
}
}
} }

View File

@@ -124,7 +124,7 @@
"react/jsx-no-duplicate-props": "error", "react/jsx-no-duplicate-props": "error",
"react/jsx-no-target-blank": "error", "react/jsx-no-target-blank": "error",
"react/jsx-no-undef": "error", "react/jsx-no-undef": "error",
"react/jsx-space-before-closing": ["error", "always"], "react/jsx-tag-spacing": ["error", { "beforeSelfClosing": "always" }],
"react/jsx-uses-react": "error", "react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error", "react/jsx-uses-vars": "error",
"react/jsx-wrap-multilines": "error", "react/jsx-wrap-multilines": "error",

6
browserslist Normal file
View File

@@ -0,0 +1,6 @@
last 2 Chrome versions
last 2 Firefox versions
last 2 Safari versions
last 2 Edge versions
IE 11
>1%

View File

@@ -100,6 +100,7 @@ class Emojis extends React.Component {
{EMOJIS.map((emoji, i) => { {EMOJIS.map((emoji, i) => {
const onMouseDown = e => this.onClickEmoji(e, emoji) const onMouseDown = e => this.onClickEmoji(e, emoji)
return ( return (
// eslint-disable-next-line react/jsx-no-bind
<span key={i} className="button" onMouseDown={onMouseDown}> <span key={i} className="button" onMouseDown={onMouseDown}>
<span className="material-icons">{emoji}</span> <span className="material-icons">{emoji}</span>
</span> </span>

View File

@@ -55,6 +55,7 @@ class Menu extends React.Component {
const onMouseDown = event => this.onClickMark(event, type) const onMouseDown = event => this.onClickMark(event, type)
return ( return (
// eslint-disable-next-line react/jsx-no-bind
<span className="button" onMouseDown={onMouseDown} data-active={isActive}> <span className="button" onMouseDown={onMouseDown} data-active={isActive}>
<span className="material-icons">{icon}</span> <span className="material-icons">{icon}</span>
</span> </span>

View File

@@ -226,6 +226,7 @@ class RichTextExample extends React.Component {
const onMouseDown = event => this.onClickMark(event, type) const onMouseDown = event => this.onClickMark(event, type)
return ( return (
// eslint-disable-next-line react/jsx-no-bind
<span className="button" onMouseDown={onMouseDown} data-active={isActive}> <span className="button" onMouseDown={onMouseDown} data-active={isActive}>
<span className="material-icons">{icon}</span> <span className="material-icons">{icon}</span>
</span> </span>
@@ -245,6 +246,7 @@ class RichTextExample extends React.Component {
const onMouseDown = event => this.onClickBlock(event, type) const onMouseDown = event => this.onClickBlock(event, type)
return ( return (
// eslint-disable-next-line react/jsx-no-bind
<span className="button" onMouseDown={onMouseDown} data-active={isActive}> <span className="button" onMouseDown={onMouseDown} data-active={isActive}>
<span className="material-icons">{icon}</span> <span className="material-icons">{icon}</span>
</span> </span>

View File

@@ -163,6 +163,7 @@ class SyncingEditor extends React.Component {
const onMouseDown = event => this.onClickMark(event, type) const onMouseDown = event => this.onClickMark(event, type)
return ( return (
// eslint-disable-next-line react/jsx-no-bind
<span className="button" onMouseDown={onMouseDown} data-active={isActive}> <span className="button" onMouseDown={onMouseDown} data-active={isActive}>
<span className="material-icons">{icon}</span> <span className="material-icons">{icon}</span>
</span> </span>

View File

@@ -5,22 +5,23 @@
"packages/*" "packages/*"
], ],
"devDependencies": { "devDependencies": {
"babel-cli": "^6.10.1", "babel-cli": "^6.26.0",
"babel-core": "^6.9.1", "babel-core": "^6.26.0",
"babel-eslint": "^6.1.0", "babel-eslint": "^8.2.1",
"babel-polyfill": "^6.16.0", "babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.9.0", "babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.5.0", "babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.5.0", "babel-preset-stage-0": "^6.24.1",
"babel-runtime": "^6.26.0",
"babelify": "^7.3.0", "babelify": "^7.3.0",
"browserify": "^13.0.1", "browserify": "^13.0.1",
"browserify-global-shim": "^1.0.3", "browserify-global-shim": "^1.0.3",
"chalk": "^1.1.3", "chalk": "^1.1.3",
"disc": "^1.3.2", "disc": "^1.3.2",
"envify": "^3.4.1", "envify": "^3.4.1",
"eslint": "^3.8.1", "eslint": "^4.16.0",
"eslint-plugin-import": "^2.0.1", "eslint-plugin-import": "^2.8.0",
"eslint-plugin-react": "^6.4.1", "eslint-plugin-react": "^7.6.0",
"faker": "^3.1.0", "faker": "^3.1.0",
"fbjs": "^0.8.3", "fbjs": "^0.8.3",
"fs-promise": "^1.0.0", "fs-promise": "^1.0.0",
@@ -77,7 +78,7 @@
"open": "open http://localhost:8080/dev.html", "open": "open http://localhost:8080/dev.html",
"release": "yarn run test && yarn run lint && lerna publish && yarn run gh-pages", "release": "yarn run test && yarn run lint && lerna publish && yarn run gh-pages",
"start": "http-server ./examples", "start": "http-server ./examples",
"test": "mocha --require babel-core/register ./packages/*/test/index.js", "test": "BABEL_ENV=test mocha --require babel-core/register ./packages/*/test/index.js",
"watch": "npm-run-all --parallel --print-label watch:examples watch:packages start", "watch": "npm-run-all --parallel --print-label watch:examples watch:packages start",
"watch:examples": "watchify --debug --transform babelify ./examples/index.js -o ./examples/build.dev.js -v", "watch:examples": "watchify --debug --transform babelify ./examples/index.js -o ./examples/build.dev.js -v",
"watch:packages": "lerna run --parallel watch" "watch:packages": "lerna run --parallel watch"

View File

@@ -1,10 +1,4 @@
/**
* Polyfills.
*/
import 'babel-polyfill' // eslint-disable-line import/no-extraneous-dependencies
/** /**
* Dependencies. * Dependencies.
*/ */

View File

@@ -1,10 +1,4 @@
/**
* Polyfills.
*/
import 'babel-polyfill' // eslint-disable-line import/no-extraneous-dependencies
/** /**
* Dependencies. * Dependencies.
*/ */

View File

@@ -1,10 +1,4 @@
/**
* Polyfills.
*/
import 'babel-polyfill' // eslint-disable-line import/no-extraneous-dependencies
/** /**
* Dependencies. * Dependencies.
*/ */

View File

@@ -29,7 +29,7 @@ export const output = (
</paragraph> </paragraph>
<paragraph> <paragraph>
<link> <link>
<i><b>an</b></i><focus />other <i><b>an</b></i><focus />other
</link> </link>
</paragraph> </paragraph>
</document> </document>

View File

@@ -22,7 +22,7 @@ export const output = (
<value> <value>
<document> <document>
<paragraph> <paragraph>
<i><b>a</b></i><cursor />word <i><b>a</b></i><cursor />word
</paragraph> </paragraph>
</document> </document>
</value> </value>

View File

@@ -14,7 +14,7 @@ export const input = (
</paragraph> </paragraph>
<paragraph> <paragraph>
<text key="a">one</text> <text key="a">one</text>
</paragraph> </paragraph>
</document> </document>
</value> </value>
) )

View File

@@ -1,10 +1,4 @@
/**
* Polyfills.
*/
import 'babel-polyfill' // eslint-disable-line import/no-extraneous-dependencies
/** /**
* Dependencies. * Dependencies.
*/ */

950
yarn.lock

File diff suppressed because it is too large Load Diff