Commit graph

22 commits

Author SHA1 Message Date
Aleh Zasypkin
fd70b4faf3
Upgrade eslint/tslint/prettier plugin versions. (#23562) 2018-09-27 14:17:45 +02:00
pavel06081991
4c331b1348
Update versions of @babel/parser and @babel/types (#23268) (#23469)
Update versions of @babel/parser, @babel/types, eslint, babel-eslint
2018-09-25 16:18:05 +03:00
Spencer
9a7fa9a938
Upgrade to Jest 23.5.0 (#22791) (#22846)
I'd really like to upgrade to Typescript 3 for its `unknown` type, but we need to upgrade to `jest@23` to support a recent version of `ts-jest@23`.

The [jest changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) breaks down the breaking changes in 23.x, but I found it to be slightly incomplete so I've broken down the changes that actually caused breaks for us here, and addressed each in individual commits to make review a little easier:

- the `testURL` config default was changed from `about:blank` to `http://localhost`
    - this cause some XHR requests powered by JSdom to start failing. It seems these requests just do nothing in master but start to fail when JSdom is initialized with an actual URL... I think we would ideally stop sending meaningless XHR requests in the tests, but it was a lot easier to just set the config to `about:blank` for now, and we can worry about cleanup later if necessary
- `expect(...).toThrow()` only passes if an actual error was thrown.
     - In two places in the index pattern code we were throwing strings, which broke the assertions. Fortunately/Unfortunately the errors are not being consumed by anything, so I was able to wrap them in `new Error()` without causing any issues.
- snapshots of mock functions now include a `results` array, detailing the return values of the function
- React fragments are now serialized as `<React.Fragment>` instead of `<UNDEFINED>`
- undefined props in React components are now stripped from snapshots
- minor changes to the ordering of mocks, imports resolution, and before hooks caused the uiSettings API tests to start breaking, but I'm replacing them with totally new tests in #22694 so I just deleted them here
- mocks created with `jest.spyOn()` that are restored now have their `mock.calls` reset, so some of the kbn-pm tests stated failing. This was fixed by restoring them with `jest.restoreAllMocks()` rather than trying to do it before the assertions
2018-09-07 20:30:49 -07:00
Tim Sullivan
c80a34f84e
[ESLint] Turn off no-multi-str rule in eslint config (#22525) (#22602)
* remove inline rule disabling comments

* turn off no-multi-str
2018-08-31 13:56:12 -07:00
CJ Cenizal
c6be289f21
Fix misspellings (#19981) (#20284) 2018-06-27 20:50:06 -07:00
Spencer
30653d9d92
[6.x] [eslint-plugin-no-unsanitized] upgrade for import() support (#19315) (#19413)
Backports the following commits to 6.x:
 - [eslint-plugin-no-unsanitized] upgrade for `import()` support  (#19315)
2018-05-24 15:32:20 -07:00
Tim Roes
e5ea9dd2a6
Update React to 16.3 (#18768) (#19033)
* Update React to 16.3

* Switch off specific eslint rules

* Update enzyme snapshots

* Incorporate PR feedback
2018-05-14 15:15:18 +02:00
Larry Gregory
56fe6cbb33
Disallow use of "dangerouslySetInnerHTML" on React components (#17759) (#18565)
Disallows use of "dangerouslySetInnerHTML" on React components, except where explicitly whitelisted
2018-04-25 11:58:48 -04:00
Kim Joar Bekkelund
ed63f6d5a0
Use Jest on cli tests (#16389) (#17635)
* Move CLI tests to Jest

* Get rid of logs from the output

* Allow skipped tests

* Move integration tests into integration_tests folder
2018-04-10 18:55:39 +02:00
Kim Joar Bekkelund
1429347c97
[kbn-pm] Include Kibana's transitive _projects_ in build (#16813) (#17097) 2018-03-12 12:01:11 +01:00
Spencer
faee234674
[6.x] [eslint-config-kibana] remove stub test command (#16625) (#16681) 2018-02-12 11:41:50 -07:00
Court Ewing
d896576632 lint: error on innerHTML and family (#16477)
* lint for innerHTML and family

Browser apis like innerHTML and document.write are dangerous when used
incorrectly, so we should not be using them unless we explicitly opt-out
of the linting rule on a case by case basis.

* add no-unsanitized to eslint peerDependencies
2018-02-04 08:40:29 -05:00
Kim Joar Bekkelund
96d8995315
Build multiple Kibana packages for production (#16313) (#16496)
* Build packages before running ESLint on CI

* Add production task to kbn-build

* Ensure packages are bootstrapped before running the build

* Run ESLint on kbn-build
2018-02-02 22:47:18 +01:00
Spencer
98a1c5a0f1
[6.x] Upgrade to eslint 4 (#14862) (#14951)
* [eslint] upgrade to 4.10.0

* [eslint-config-kibana] limit jest config to jest test files

* [ui_framework] remove trailing comma from rest-spreads

* [dashboard/tests] tag jest helpers with .test.js suffix

* explicitly import expect.js where used

* [eslint] apply auto-fixes

* [eslint] manually add/wrap some parens for compliance

* [npm] point to local packages for testing/review

* [jest] remove .test extension from jest helpers

* [ui_framework] fix trailing comma removal from 3bc661a1c8

* [packages] upgrade eslint packages
2017-11-14 20:20:37 -07:00
CJ Cenizal
7cda1aae09 [eslint-config-kibana] Apply AirBnB spacing rules (#14522) (#14590)
* Add AirBnB key-spacing rule.
* Add AirBnB comma-spacing rule.
2017-10-25 15:19:19 -07:00
Spencer
9884ec8147 Eslint/remove last amd modules (#14282)
* [timelion] remove last remaining amd modules

* [eslint-config-kibana] remove env.amd

(cherry picked from commit bd53cc6370)
2017-10-10 16:11:32 +02:00
Kim Joar Bekkelund
feff479f77 Use Object spread instead of Object.assign where it makes sense (#13903) (#14397)
* Prefer Object spread

* Add eslint rules for Object spread

* no slice
2017-10-10 15:55:06 +02:00
Kim Joar Bekkelund
dfa1d12acb Upgrade to Jest 21 (#13863) (#13879)
* Upgrade to Jest 21

* Bump eslint-config-kibana to v0.11.0
2017-09-07 13:13:19 +02:00
CJ Cenizal
0ac9c2fdf2 [6.x] [eslint-config-kibana] 0.9.0 and 0.10.0 (#13318)
* [eslint-config-kibana] Add jest plugin and settings (#13090)
* Add AirBnB linting rules for React best practices. Bump to v0.10.0. (#13259)
2017-08-03 08:49:38 -07:00
CJ Cenizal
7bffcda1ae Upgrade eslint config to 0.8.1. (#13128) (#13155)
* Fix incorrect peerDependency and bump eslint config version to 0.8.1.
* Upgrade eslint config to 0.8.1. Fix JSX to adhere to new formatting rules.
2017-07-27 11:27:05 -07:00
CJ Cenizal
223d9d951e Add linting rules for formatting JSX. (#12810) (#13125)
* Add linting rules for formatting JSX.
* Bump eslint config version to 0.8.0.
2017-07-26 08:57:49 -07:00
CJ Cenizal
739360aac9 Move eslint-config-kibana into core (#12725) (#13124)
* Initial commit

* added actual config

* version 0.0.1

* version 0.0.2

* [no-const-assign] Disallow assignment to const

http://eslint.org/docs/rules/no-const-assign

* [no-redeclare] Disallow redeclaring variables

http://eslint.org/docs/rules/no-redeclare

* version 0.0.3

* [no-unused-vars]: Disallow declaration of variables that are not used in the code.

* Bump to 0.1.0.

* upgrade deps in preperation for babel6 transition

* 0.2.0-alpha1

* use yaml for readability

* 0.2.0

* update/pin peed dependency versions

* 0.2.1

* [quotes] allow template literals

This allows eslint to validate this rule from the styleguide: https://github.com/elastic/kibana/blob/master/style_guides/js_style_guide.md#use-template-strings-to-avoid-escaping-single-quotes

* 0.2.2

* add object-curly-spacing and no-global-assign rules

* sort .eslintrc.yaml rules

* 0.3.0

* add basic react support

* 0.4.0

* Disallow using 'context' in tests

* 0.5.0

* move from .eslintrc.yaml to .eslintrc.js without .json generation (#6)

* Implement import plugin (#7)

* update deps

* include eslint-plugin-import

* Dereference import config (#8)

* reorganize existing rules into groups

* defreference eslint-plugin-import "recommended" config

Based on ea9c92c732/config/recommended.js

* 0.6.0

* set environment info for import rule

* 0.6.1

* update peerDependencies

* 0.7.0

* Move eslint-config-kibana into packages directory
2017-07-26 08:54:48 -07:00