Skip to content

Commit

Permalink
[eslint-config-kibana] Add jest plugin and settings
Browse files Browse the repository at this point in the history
This extracts the ui-specific eslint settings from elastic/kibana so they can
be applied to other repositories as well.
  • Loading branch information
weltenwort committed Jul 25, 2017
1 parent bdaf848 commit 88b34e0
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
'mocha',
'babel',
'react',
'import'
'import',
],

env: {
Expand Down Expand Up @@ -106,4 +106,4 @@ module.exports = {
'import/no-named-as-default-member': 'error',
'import/no-duplicates': 'error',
}
}
}
28 changes: 28 additions & 0 deletions packages/eslint-config-kibana/README.md
Original file line number Diff line number Diff line change
@@ -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'
]
}
```
15 changes: 15 additions & 0 deletions packages/eslint-config-kibana/jest.js
Original file line number Diff line number Diff line change
@@ -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',
}
}
1 change: 1 addition & 0 deletions packages/eslint-config-kibana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.1"
}
Expand Down

0 comments on commit 88b34e0

Please sign in to comment.