diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js index 0da188502cf7f..91f200949342c 100644 --- a/packages/eslint-config-kibana/.eslintrc.js +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -5,7 +5,7 @@ module.exports = { 'mocha', 'babel', 'react', - 'import' + 'import', ], env: { diff --git a/packages/eslint-config-kibana/README.md b/packages/eslint-config-kibana/README.md index 4b20fc999b48a..68c1639b834a5 100644 --- a/packages/eslint-config-kibana/README.md +++ b/packages/eslint-config-kibana/README.md @@ -1,3 +1,31 @@ # eslint-config-kibana The eslint config used by the kibana team + +## Usage + +To use this eslint config, just install the peer dependencies and reference it +in your `.eslintrc`: + +```javascript +{ + extends: [ + '@elastic/eslint-config-kibana' + ] +} +``` + +## Optional jest config + +If the project uses the [jest test runner](https://facebook.github.io/jest/), +the `@elastic/eslint-config-kibana/jest` config can be extended as well to use +`eslint-plugin-jest` and add settings specific to it: + +```javascript +{ + extends: [ + '@elastic/eslint-config-kibana', + '@elastic/eslint-config-kibana/jest' + ] +} +``` diff --git a/packages/eslint-config-kibana/jest.js b/packages/eslint-config-kibana/jest.js new file mode 100644 index 0000000000000..68776bb3db147 --- /dev/null +++ b/packages/eslint-config-kibana/jest.js @@ -0,0 +1,15 @@ +module.exports = { + plugins: [ + 'jest', + ], + + env: { + 'jest/globals': true, + }, + + rules: { + 'jest/no-disabled-tests': 'error', + 'jest/no-focused-tests': 'error', + 'jest/no-identical-title': 'error', + }, +}; diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index f3bb21dfe7c6d..9c042fe34734f 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -1,6 +1,6 @@ { "name": "@elastic/eslint-config-kibana", - "version": "0.8.1", + "version": "0.9.0", "description": "The eslint config used by the kibana team", "main": ".eslintrc.js", "scripts": { @@ -22,6 +22,7 @@ "eslint": "^4.1.0", "eslint-plugin-babel": "^4.1.1", "eslint-plugin-import": "^2.6.0", + "eslint-plugin-jest": "^20.0.3", "eslint-plugin-mocha": "^4.9.0", "eslint-plugin-react": "^7.1.0" }