diff --git a/.eslines.json b/.eslines.json new file mode 100644 index 00000000000000..46acda6d92df1d --- /dev/null +++ b/.eslines.json @@ -0,0 +1,11 @@ +{ + "branches": { + "default": ["downgrade-unmodified-lines"] + }, + "processors": { + "downgrade-unmodified-lines": { + "remote": "origin/master", + "rulesNotToDowngrade": ["no-unused-vars"] + } + } +} \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index 5b848d9c369920..3defeb47624cd0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,6 +3,7 @@ "parser": "babel-eslint", "extends": [ "wordpress", + "plugin:wordpress/jsdoc", "plugin:react/recommended", "plugin:jsx-a11y/recommended", "plugin:jest/recommended" @@ -27,6 +28,7 @@ "document": true }, "plugins": [ + "wordpress", "react", "jsx-a11y", "jest" @@ -176,5 +178,13 @@ "valid-jsdoc": [ "error", { "requireReturn": false } ], "valid-typeof": "error", "yoda": "off" - } + }, + "overrides": [ + { + "files": [ "{blocks,components,date,editor,element,i18n,data,utils}/**/test/*.js" ], + "rules": { + "require-jsdoc": "off" + } + } + ] } diff --git a/package.json b/package.json index 86ef6443102036..8c7b9a8754899a 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "dom-scroll-into-view": "1.2.1", "element-closest": "2.0.2", "escape-string-regexp": "1.0.5", + "eslint-plugin-wordpress": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#327b6bdec434177a6e841bd3210e87627ccfcecb", "hpq": "1.2.0", "jed": "1.1.1", "jquery": "3.2.1", @@ -73,6 +74,7 @@ "deep-freeze": "0.0.1", "enzyme": "3.2.0", "enzyme-adapter-react-16": "1.1.0", + "eslines": "1.1.0", "eslint": "4.9.0", "eslint-config-wordpress": "2.0.0", "eslint-plugin-jest": "21.5.0", @@ -134,7 +136,7 @@ "prebuild": "check-node-version --package", "build": "cross-env BABEL_ENV=default NODE_ENV=production webpack", "gettext-strings": "cross-env BABEL_ENV=gettext webpack", - "lint": "eslint .", + "lint": "eslint -f json . | eslines", "predev": "check-node-version --package", "dev": "cross-env BABEL_ENV=default webpack --watch", "test": "npm run lint && npm run test-unit",