diff --git a/.eslintrc.js b/.eslintrc.js
index 45fc4c94140f1c..285f4668eb53bb 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -19,7 +19,7 @@ const majorMinorRegExp = escapeRegExp( version.replace( /\.\d+$/, '' ) ) + '(\\.
module.exports = {
root: true,
extends: [
- './eslint/config.js',
+ '@wordpress/eslint-config',
'plugin:jest/recommended'
],
env: {
diff --git a/package-lock.json b/package-lock.json
index c2e08b8f0d9031..067cdb63b36755 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2593,6 +2593,16 @@
"@babel/runtime": "^7.0.0"
}
},
+ "@wordpress/eslint-config": {
+ "version": "file:packages/eslint-config",
+ "dev": true,
+ "requires": {
+ "babel-eslint": "^8.0.3",
+ "eslint-config-wordpress": "2.0.0",
+ "eslint-plugin-jsx-a11y": "6.0.2",
+ "eslint-plugin-react": "7.7.0"
+ }
+ },
"@wordpress/format-library": {
"version": "file:packages/format-library",
"requires": {
@@ -3058,16 +3068,6 @@
}
}
},
- "aria-query": {
- "version": "0.7.1",
- "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-0.7.1.tgz",
- "integrity": "sha1-Jsu1r/ZBRLCoJb4YRuCxbPoAsR4=",
- "dev": true,
- "requires": {
- "ast-types-flow": "0.0.7",
- "commander": "^2.11.0"
- }
- },
"arr-diff": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
@@ -3326,15 +3326,6 @@
"integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==",
"dev": true
},
- "axobject-query": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-0.1.0.tgz",
- "integrity": "sha1-YvWdvFnJ+SQnWco0mWDnov48NsA=",
- "dev": true,
- "requires": {
- "ast-types-flow": "0.0.7"
- }
- },
"babel-code-frame": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
@@ -5674,15 +5665,6 @@
"integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==",
"dev": true
},
- "comment-parser": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.4.2.tgz",
- "integrity": "sha1-+lo/eAEwcBFIZtx7jpzzF6ljX3Q=",
- "dev": true,
- "requires": {
- "readable-stream": "^2.0.4"
- }
- },
"commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
@@ -7574,28 +7556,12 @@
"integrity": "sha1-UgEgbGlk1kgxUjLt9t+9LpJeTNY=",
"dev": true
},
- "eslint-plugin-i18n": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-i18n/-/eslint-plugin-i18n-1.2.0.tgz",
- "integrity": "sha1-SfP0OA7e/oyHbwyXlh9lw6w3zao=",
- "dev": true
- },
"eslint-plugin-jest": {
"version": "21.5.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.5.0.tgz",
"integrity": "sha512-4fxfe2RcqzU+IVNQL5n4pqibLcUhKKxihYsA510+6kC/FTdGInszDDHgO4ntBzPWu8mcHAvKJLs8o3AQw6eHTg==",
"dev": true
},
- "eslint-plugin-jsdoc": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-3.5.0.tgz",
- "integrity": "sha512-qoNpVicVWGjGBXAJsqRoqVuAnajgX7PWtSa2Men36XKRiXe3RS/QmRv215PXZwo4OHskYOsUoJUeiPiWtS9ULA==",
- "dev": true,
- "requires": {
- "comment-parser": "^0.4.2",
- "lodash": "^4.17.4"
- }
- },
"eslint-plugin-jsx-a11y": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.2.tgz",
@@ -7609,23 +7575,38 @@
"damerau-levenshtein": "^1.0.0",
"emoji-regex": "^6.1.0",
"jsx-ast-utils": "^1.4.0"
- }
- },
- "eslint-plugin-node": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz",
- "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==",
- "dev": true,
- "requires": {
- "ignore": "^3.3.6",
- "minimatch": "^3.0.4",
- "resolve": "^1.3.3",
- "semver": "^5.4.1"
+ },
+ "dependencies": {
+ "aria-query": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-0.7.1.tgz",
+ "integrity": "sha1-Jsu1r/ZBRLCoJb4YRuCxbPoAsR4=",
+ "dev": true,
+ "requires": {
+ "ast-types-flow": "0.0.7",
+ "commander": "^2.11.0"
+ }
+ },
+ "axobject-query": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-0.1.0.tgz",
+ "integrity": "sha1-YvWdvFnJ+SQnWco0mWDnov48NsA=",
+ "dev": true,
+ "requires": {
+ "ast-types-flow": "0.0.7"
+ }
+ },
+ "jsx-ast-utils": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz",
+ "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=",
+ "dev": true
+ }
}
},
"eslint-plugin-react": {
"version": "7.7.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz",
+ "resolved": "http://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz",
"integrity": "sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==",
"dev": true,
"requires": {
@@ -7635,15 +7616,6 @@
"prop-types": "^15.6.0"
},
"dependencies": {
- "jsx-ast-utils": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz",
- "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=",
- "dev": true,
- "requires": {
- "array-includes": "^3.0.3"
- }
- },
"prop-types": {
"version": "15.6.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz",
@@ -7656,27 +7628,6 @@
}
}
},
- "eslint-plugin-wordpress": {
- "version": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#1774343f6226052a46b081e01db3fca8793cc9f1",
- "from": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#1774343f6226052a46b081e01db3fca8793cc9f1",
- "dev": true,
- "requires": {
- "eslint-plugin-i18n": "~1.2.0",
- "eslint-plugin-jsdoc": "~3.5.0",
- "eslint-plugin-node": "~6.0.1",
- "eslint-plugin-wpcalypso": "~4.0.1",
- "merge": "~1.2.0"
- }
- },
- "eslint-plugin-wpcalypso": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-wpcalypso/-/eslint-plugin-wpcalypso-4.0.1.tgz",
- "integrity": "sha512-fU5NSc0XGdel/tlEIUoESOdqphBWQN2FfSgXXNHpXKX7ftTcqXacqgzXU8OVziyhXz6s2RUzK0+JSJaNxhZ+Mw==",
- "dev": true,
- "requires": {
- "requireindex": "^1.1.0"
- }
- },
"eslint-scope": {
"version": "3.7.3",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz",
@@ -13301,10 +13252,13 @@
}
},
"jsx-ast-utils": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz",
- "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=",
- "dev": true
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz",
+ "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=",
+ "dev": true,
+ "requires": {
+ "array-includes": "^3.0.3"
+ }
},
"keyv": {
"version": "3.0.0",
@@ -18625,12 +18579,6 @@
}
}
},
- "requireindex": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz",
- "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==",
- "dev": true
- },
"resolve": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
diff --git a/package.json b/package.json
index 41b226272d1bad..4b7ebb5d84f854 100644
--- a/package.json
+++ b/package.json
@@ -62,6 +62,7 @@
"@wordpress/babel-preset-default": "file:packages/babel-preset-default",
"@wordpress/browserslist-config": "file:packages/browserslist-config",
"@wordpress/custom-templated-path-webpack-plugin": "file:packages/custom-templated-path-webpack-plugin",
+ "@wordpress/eslint-config": "file:packages/eslint-config",
"@wordpress/jest-console": "file:packages/jest-console",
"@wordpress/jest-preset-default": "file:packages/jest-preset-default",
"@wordpress/library-export-default-webpack-plugin": "file:packages/library-export-default-webpack-plugin",
@@ -80,11 +81,7 @@
"deasync": "0.1.13",
"deep-freeze": "0.0.1",
"doctrine": "2.1.0",
- "eslint-config-wordpress": "2.0.0",
"eslint-plugin-jest": "21.5.0",
- "eslint-plugin-jsx-a11y": "6.0.2",
- "eslint-plugin-react": "7.7.0",
- "eslint-plugin-wordpress": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#1774343f6226052a46b081e01db3fca8793cc9f1",
"espree": "3.5.4",
"glob": "7.1.2",
"husky": "0.14.3",
diff --git a/packages/eslint-config/README.md b/packages/eslint-config/README.md
new file mode 100644
index 00000000000000..e4d484632bc9d2
--- /dev/null
+++ b/packages/eslint-config/README.md
@@ -0,0 +1,24 @@
+# Eslint Config
+
+[Eslint](https://eslint.org/) config for WordPress development.
+
+## Installation
+
+Install the module
+
+```bash
+npm install @wordpress/eslint-config --save-dev
+```
+
+### Usage
+
+Next, extend the configuration from your project's `.eslintrc` file:
+
+```json
+"extends": "@wordpress/eslint-config"
+```
+
+Refer to the [ESLint documentation on Shareable Configs](http://eslint.org/docs/developer-guide/shareable-configs) for more information.
+
+
+