diff --git a/.eslintrc.js b/.eslintrc.js
index 45fc4c94140f1c..feced45620657e 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -19,14 +19,8 @@ const majorMinorRegExp = escapeRegExp( version.replace( /\.\d+$/, '' ) ) + '(\\.
module.exports = {
root: true,
extends: [
- './eslint/config.js',
- 'plugin:jest/recommended'
- ],
- env: {
- 'jest/globals': true,
- },
- plugins: [
- 'jest',
+ '@wordpress/eslint-config',
+ 'plugin:jest/recommended',
],
rules: {
'no-restricted-syntax': [
@@ -189,9 +183,13 @@ module.exports = {
overrides: [
{
files: [ 'test/e2e/**/*.js' ],
+ env: {
+ browser: true,
+ },
globals: {
- page: true,
browser: true,
+ page: true,
+ wp: true,
},
},
],
diff --git a/docs/manifest.json b/docs/manifest.json
index c461c5d3b9a361..e199fc740e32d7 100644
--- a/docs/manifest.json
+++ b/docs/manifest.json
@@ -335,6 +335,12 @@
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/escape-html/README.md",
"parent": "packages"
},
+ {
+ "title": "@wordpress/eslint-config",
+ "slug": "packages-eslint-config",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/eslint-config/README.md",
+ "parent": "packages"
+ },
{
"title": "@wordpress/format-library",
"slug": "packages-format-library",
diff --git a/package-lock.json b/package-lock.json
index ab4562395d1a18..92f84cbe3e34e9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2590,6 +2590,15 @@
"@babel/runtime": "^7.0.0"
}
},
+ "@wordpress/eslint-config": {
+ "version": "file:packages/eslint-config",
+ "dev": true,
+ "requires": {
+ "babel-eslint": "^8.0.3",
+ "eslint-plugin-jsx-a11y": "6.0.2",
+ "eslint-plugin-react": "7.7.0"
+ }
+ },
"@wordpress/format-library": {
"version": "file:packages/format-library",
"requires": {
@@ -3055,16 +3064,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",
@@ -3323,15 +3322,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",
@@ -5671,15 +5661,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",
@@ -7565,34 +7546,12 @@
}
}
},
- "eslint-config-wordpress": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/eslint-config-wordpress/-/eslint-config-wordpress-2.0.0.tgz",
- "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",
@@ -7606,23 +7565,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": {
@@ -7632,15 +7606,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",
@@ -7653,27 +7618,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",
@@ -13298,10 +13242,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",
@@ -18617,12 +18564,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/block-library/src/classic/edit.js b/packages/block-library/src/classic/edit.js
index db1467b6301399..2502c0f7e0eb5f 100644
--- a/packages/block-library/src/classic/edit.js
+++ b/packages/block-library/src/classic/edit.js
@@ -5,6 +5,8 @@ import { Component } from '@wordpress/element';
import { __, _x } from '@wordpress/i18n';
import { BACKSPACE, DELETE, F10 } from '@wordpress/keycodes';
+const { wp } = window;
+
function isTmceEmpty( editor ) {
// When tinyMce is empty the content seems to be:
//
diff --git a/packages/edit-post/src/hooks/components/media-upload/index.js b/packages/edit-post/src/hooks/components/media-upload/index.js
index 9160f4f84c15b5..c8552168033899 100644
--- a/packages/edit-post/src/hooks/components/media-upload/index.js
+++ b/packages/edit-post/src/hooks/components/media-upload/index.js
@@ -1,7 +1,7 @@
/**
* External Dependencies
*/
-import { castArray, pick } from 'lodash';
+import { castArray, defaults, pick } from 'lodash';
/**
* WordPress dependencies
@@ -9,6 +9,8 @@ import { castArray, pick } from 'lodash';
import { Component } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
+const { wp } = window;
+
// Getter for the sake of unit tests.
const getGalleryDetailsMediaFrame = () => {
/**
@@ -36,7 +38,7 @@ const getGalleryDetailsMediaFrame = () => {
multiple: 'add',
editable: false,
- library: wp.media.query( _.defaults( {
+ library: wp.media.query( defaults( {
type: 'image',
}, this.options.library ) ),
} ),
diff --git a/packages/eslint-config/README.md b/packages/eslint-config/README.md
new file mode 100644
index 00000000000000..5f2b003e765c5d
--- /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.
+
+
+
diff --git a/packages/eslint-config/configs/es5.js b/packages/eslint-config/configs/es5.js
new file mode 100644
index 00000000000000..2e56e7a2f5fcdb
--- /dev/null
+++ b/packages/eslint-config/configs/es5.js
@@ -0,0 +1,12 @@
+/**
+ * The original version of this file is based on WordPress ESLint rules and shared configs:
+ * https://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.
+ */
+
+module.exports = {
+ env: {
+ es6: true,
+ },
+
+ rules: require( './rules/esnext' ),
+};
diff --git a/packages/eslint-config/configs/esnext.js b/packages/eslint-config/configs/esnext.js
new file mode 100644
index 00000000000000..3b3a80d7d4cd82
--- /dev/null
+++ b/packages/eslint-config/configs/esnext.js
@@ -0,0 +1,8 @@
+/**
+ * The original version of this file is based on WordPress ESLint rules and shared configs:
+ * https://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.
+ */
+
+module.exports = {
+ rules: require( './rules/es5' ),
+};
diff --git a/packages/eslint-config/configs/rules/es5.js b/packages/eslint-config/configs/rules/es5.js
new file mode 100644
index 00000000000000..61e3e01c343f1d
--- /dev/null
+++ b/packages/eslint-config/configs/rules/es5.js
@@ -0,0 +1,84 @@
+module.exports = {
+ // Possible Errors
+ // Disallow assignment in conditional expressions
+ 'no-cond-assign': [ 'error', 'except-parens' ],
+ // Disallow irregular whitespace outside of strings and comments
+ 'no-irregular-whitespace': 'error',
+ // Best Practices
+ // Specify curly brace conventions for all control statements
+ curly: [ 'error', 'all' ],
+ // Encourages use of dot notation whenever possible
+ 'dot-notation': [ 'error', {
+ allowKeywords: true,
+ allowPattern: '^[a-z]+(_[a-z]+)+$',
+ } ],
+ // Disallow use of multiline strings
+ 'no-multi-str': 'error',
+ // Disallow use of the with statement
+ 'no-with': 'error',
+ // Requires to declare all vars on top of their containing scope
+ 'vars-on-top': 'error',
+ // Require immediate function invocation to be wrapped in parentheses
+ 'wrap-iife': 'error',
+ // Require or disallow Yoda conditions
+ yoda: [ 'error', 'always' ],
+ // Strict Mode
+ // Variables
+ // Stylistic Issues
+ // Enforce spacing inside array brackets
+ 'array-bracket-spacing': [ 'error', 'always' ],
+ // Enforce one true brace style
+ 'brace-style': 'error',
+ // Require camel case names
+ camelcase: [ 'error', {
+ properties: 'always',
+ } ],
+ // Disallow or enforce trailing commas
+ 'comma-dangle': [ 'error', 'never' ],
+ // Enforce spacing before and after comma
+ 'comma-spacing': 'error',
+ // Enforce one true comma style
+ 'comma-style': [ 'error', 'last' ],
+ // Enforce newline at the end of file, with no multiple empty lines
+ 'eol-last': 'error',
+ // Enforces spacing between keys and values in object literal properties
+ 'key-spacing': [ 'error', {
+ beforeColon: false,
+ afterColon: true,
+ } ],
+ // Enforce spacing before and after keywords
+ 'keyword-spacing': 'error',
+ // Disallow mixed "LF" and "CRLF" as linebreaks
+ 'linebreak-style': [ 'error', 'unix' ],
+ // Enforces empty lines around comments
+ 'lines-around-comment': [ 'error', {
+ beforeLineComment: true,
+ } ],
+ // Disallow mixed spaces and tabs for indentation
+ 'no-mixed-spaces-and-tabs': 'error',
+ // Disallow multiple empty lines
+ 'no-multiple-empty-lines': 'error',
+ // Disallow trailing whitespace at the end of lines
+ 'no-trailing-spaces': 'error',
+ // Require or disallow an newline around variable declarations
+ 'one-var-declaration-per-line': [ 'error', 'initializations' ],
+ // Enforce operators to be placed before or after line breaks
+ 'operator-linebreak': [ 'error', 'after' ],
+ // Specify whether backticks, double or single quotes should be used
+ quotes: [ 'error', 'single' ],
+ // Require or disallow use of semicolons instead of ASI
+ semi: [ 'error', 'always' ],
+ // Require or disallow space before blocks
+ 'space-before-blocks': [ 'error', 'always' ],
+ // Require or disallow space before function opening parenthesis
+ 'space-before-function-paren': [ 'error', 'never' ],
+ // Require or disallow space before blocks
+ 'space-in-parens': [ 'error', 'always', { exceptions: [ '{}', '[]' ] } ],
+ // Require spaces around operators
+ 'space-infix-ops': 'error',
+ // Require or disallow spaces before/after unary operators (words on by default, nonwords)
+ 'space-unary-ops': [ 'error', {
+ overrides: { '!': true },
+ } ],
+ // Legacy
+};
diff --git a/packages/eslint-config/configs/rules/esnext.js b/packages/eslint-config/configs/rules/esnext.js
new file mode 100644
index 00000000000000..dcfc27f06554f3
--- /dev/null
+++ b/packages/eslint-config/configs/rules/esnext.js
@@ -0,0 +1,66 @@
+// see https://eslint.org/docs/rules/#ecmascript-6
+//
+module.exports = {
+ // require braces around arrow function bodies
+ 'arrow-body-style': 'off',
+ // require parentheses around arrow function arguments
+ 'arrow-parens': 'off',
+ // enforce consistent spacing before and after the arrow in arrow functions
+ 'arrow-spacing': 'off',
+ // require super() calls in constructors
+ 'constructor-super': 'error',
+ // enforce consistent spacing around * operators in generator functions
+ 'generator-star-spacing': 'off',
+ // disallow reassigning class members
+ 'no-class-assign': 'off',
+ // disallow arrow functions where they could be confused with comparisons
+ 'no-confusing-arrow': 'off',
+ // disallow reassigning `const` variables
+ 'no-const-assign': 'error',
+ // disallow duplicate class members
+ 'no-dupe-class-members': 'error',
+ // disallow duplicate module imports
+ 'no-duplicate-imports': 'error',
+ // disallow `new` operators with the `Symbol` object
+ 'no-new-symbol': 'off',
+ // disallow specified modules when loaded by `import`
+ 'no-restricted-imports': 'off',
+ // disallow `this`/`super` before calling `super()` in constructors
+ 'no-this-before-super': 'off',
+ // disallow unnecessary computed property keys in object literals
+ 'no-useless-computed-key': 'error',
+ // disallow unnecessary constructors
+ 'no-useless-constructor': 'error',
+ // disallow renaming import, export, and destructured assignments to the same name
+ 'no-useless-rename': 'off',
+ // require `let` or `const` instead of `var`
+ 'no-var': 'error',
+ // require or disallow method and property shorthand syntax for object literals
+ 'object-shorthand': 'off',
+ // require arrow functions as callbacks
+ 'prefer-arrow-callback': 'off',
+ // require `const` declarations for variables that are never reassigned after declared
+ 'prefer-const': 'error',
+ // require destructuring from arrays and/or objects
+ 'prefer-destructuring': 'off',
+ // disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals
+ 'prefer-numeric-literals': 'off',
+ // require rest parameters instead of `arguments`
+ 'prefer-rest-params': 'off',
+ // require spread operators instead of `.apply()`
+ 'prefer-spread': 'off',
+ // require template literals instead of string concatenation
+ 'prefer-template': 'off',
+ // require generator functions to contain `yield`
+ 'require-yield': 'off',
+ // enforce spacing between rest and spread operators and their expressions
+ 'rest-spread-spacing': 'off',
+ // enforce sorted import declarations within modules
+ 'sort-imports': 'off',
+ // require symbol descriptions
+ 'symbol-description': 'off',
+ // require or disallow spacing around embedded expressions of template strings
+ 'template-curly-spacing': [ 'error', 'always' ],
+ // require or disallow spacing around the `*` in `yield*` expressions
+ 'yield-star-spacing': 'off',
+};
diff --git a/eslint/config.js b/packages/eslint-config/index.js
similarity index 97%
rename from eslint/config.js
rename to packages/eslint-config/index.js
index 5ba1ba4f43e843..aa02fdc33ff9d5 100644
--- a/eslint/config.js
+++ b/packages/eslint-config/index.js
@@ -1,14 +1,12 @@
module.exports = {
parser: 'babel-eslint',
extends: [
- 'wordpress',
- 'plugin:wordpress/esnext',
+ './configs/es5.js',
+ './configs/esnext.js',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
],
env: {
- browser: false,
- es6: true,
node: true,
},
parserOptions: {
@@ -22,7 +20,6 @@ module.exports = {
document: true,
},
plugins: [
- 'wordpress',
'react',
'jsx-a11y',
],
diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json
new file mode 100644
index 00000000000000..07a609d7278fa2
--- /dev/null
+++ b/packages/eslint-config/package.json
@@ -0,0 +1,27 @@
+{
+ "name": "@wordpress/eslint-config",
+ "version": "1.0.0-alpha.0",
+ "description": "ESLint config for WordPress development.",
+ "author": "The WordPress Contributors",
+ "license": "GPL-2.0-or-later",
+ "keywords": [
+ "wordpress",
+ "eslint"
+ ],
+ "homepage": "https://github.com/WordPress/gutenberg/tree/master/packages/eslint-config/README.md",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/WordPress/gutenberg.git"
+ },
+ "bugs": {
+ "url": "https://github.com/WordPress/gutenberg/issues"
+ },
+ "dependencies": {
+ "babel-eslint": "^8.0.3",
+ "eslint-plugin-jsx-a11y": "6.0.2",
+ "eslint-plugin-react": "7.7.0"
+ },
+ "publishConfig": {
+ "access": "public"
+ }
+}