diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..ae17938 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,20 @@ +{ + "root": true, + "extends": [ + "wordpress", + "plugin:react/recommended" + ], + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + } + }, + "plugins": [ + "react" + ], + "rules": { + "react/react-in-jsx-scope": "off" + } +}; diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 653d5c3..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - extends: 'wordpress', - root: true -}; diff --git a/blocks/activity-list/index.js b/blocks/activity-list/index.js index 133a5f9..1754339 100644 --- a/blocks/activity-list/index.js +++ b/blocks/activity-list/index.js @@ -214,5 +214,5 @@ export default registerBlockType( save() { return renderStaticActivityList(); } - }, + } ); diff --git a/blocks/discover/index.js b/blocks/discover/index.js index 842281f..5d7a293 100644 --- a/blocks/discover/index.js +++ b/blocks/discover/index.js @@ -1,3 +1,4 @@ + /** * Internal block libraries. */ @@ -49,5 +50,5 @@ export default registerBlockType( save() { return renderStaticDiscoverBlock(); } - }, + } ); diff --git a/blocks/featured/index.js b/blocks/featured/index.js index a6cdf2b..cf7a5a7 100644 --- a/blocks/featured/index.js +++ b/blocks/featured/index.js @@ -102,5 +102,5 @@ export default registerBlockType( // @todo WARNING: If the user does not have unfiltered_html, then the amp-img elements will be removed from the saved post_content! Should wp_kses_allowed_html be filtered to allow all AMP elements and attributes that will be used in blocks here? return renderStaticFeaturedBlock(); } - }, + } ); diff --git a/blocks/hero/index.js b/blocks/hero/index.js index b215225..8324b92 100644 --- a/blocks/hero/index.js +++ b/blocks/hero/index.js @@ -182,5 +182,5 @@ export default registerBlockType( ); } - }, + } ); diff --git a/blocks/popular/index.js b/blocks/popular/index.js index 4efda6a..2572387 100644 --- a/blocks/popular/index.js +++ b/blocks/popular/index.js @@ -21,7 +21,7 @@ export default registerBlockType( __( 'Travel' ) ], - edit: props => { + edit() { return (
@@ -159,7 +159,7 @@ export default registerBlockType(
); }, - save: props => { + save() { return (
@@ -292,5 +292,5 @@ export default registerBlockType(
); } - }, + } ); diff --git a/blocks/search/index.js b/blocks/search/index.js index f28c7f3..88a90ed 100644 --- a/blocks/search/index.js +++ b/blocks/search/index.js @@ -68,5 +68,5 @@ export default registerBlockType( save() { return renderStaticSearchBlock(); } - }, + } ); diff --git a/blocks/travel-angles/index.js b/blocks/travel-angles/index.js index a1ff856..123cdb7 100644 --- a/blocks/travel-angles/index.js +++ b/blocks/travel-angles/index.js @@ -18,7 +18,7 @@ export default registerBlockType( ], // Copy from Travel HTML template. - edit: props => { + edit() { // Don't display the travel angels since that will hide the block configure buttons behind an image. return ( @@ -27,7 +27,7 @@ export default registerBlockType( ); }, - save: props => { + save() { return (
@@ -42,5 +42,5 @@ export default registerBlockType(
); } - }, + } ); diff --git a/package.json b/package.json index be03a17..f2c00bd 100755 --- a/package.json +++ b/package.json @@ -20,9 +20,6 @@ }, "homepage": "https://github.com/xwp/travel#readme", "devDependencies": { - "eslint": "^4.13.1", - "eslint-config-wordpress": "^2.0.0", - "wp-dev-lib": "github:xwp/wp-dev-lib", "babel-core": "^6.25.0", "babel-loader": "^7.1.1", "babel-plugin-transform-object-rest-spread": "^6.26.0", @@ -30,10 +27,14 @@ "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.1", "cross-env": "^5.1.1", + "eslint": "^4.13.1", + "eslint-config-wordpress": "^2.0.0", + "eslint-plugin-react": "^7.7.0", "grunt-cli": "^1.2.0", "jscs": "^3.0.7", "jshint": "^2.9.5", "raw-loader": "^0.5.1", - "webpack": "^3.10.0" + "webpack": "^3.10.0", + "wp-dev-lib": "github:xwp/wp-dev-lib" } }