Commit graph

37 commits

Author SHA1 Message Date
Patryk Kopyciński 9ef198ad0d
Bump eslint@7 (#94347) (#114256)
# Conflicts:
#	packages/elastic-eslint-config-kibana/javascript.js
#	packages/kbn-eslint-plugin-eslint/rules/disallow_license_headers.test.js
#	packages/kbn-eslint-plugin-eslint/rules/no_restricted_paths.test.js
#	packages/kbn-eslint-plugin-eslint/rules/require_license_header.test.js
#	src/dev/eslint/lint_files.ts
#	x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/processor.tsx
#	yarn.lock

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-07 13:35:23 -04:00
Kibana Machine f095537175
[eslint] forbid trailing slashes in package imports (#113455) (#113558)
Co-authored-by: spalger <spalger@users.noreply.github.com>

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-09-30 15:29:48 -04:00
Spencer 41129dbd9c
[7.x] [eslint] add rule to forbid async forEach bodies (#111637) (#112178)
* [eslint] add rule to forbid async forEach bodies (#111637)

Co-authored-by: spalger <spalger@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/event_log/server/es/init.ts

* remove unnecessary async forEach

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-09-14 20:33:48 -04:00
Kibana Machine 795302394e
[eslint] add rule to prevent export* in plugin index files (#109357) (#110928)
* [eslint] add rule to prevent export* in plugin index files

* deduplicate export names for types/instances with the same name

* attempt to auto-fix duplicate exports too

* capture exported enums too

* enforce no_export_all for core too

* disable rule by default, allow opting-in for help fixing

* update tests

* reduce yarn.lock duplication

* add rule but no fixes

* disable all existing violations

* update api docs with new line numbers

* revert unnecessary changes to yarn.lock which only had drawbacks

* remove unnecessary eslint-disable

* rework codegen to split type exports and use babel to generate valid code

* check for "export types" deeply

* improve test by using fixtures

* add comments to some helper functions

* disable fix for namespace exports including types

* label all eslint-disable comments with related team-specific issue

* ensure that child exports of `export type` are always tracked as types

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-09-02 00:23:09 -04:00
Kibana Machine 2ee5e66b26
[7.x] [eslint] prevent async Promise constructor mistakes (#110349) (#110727)
* [eslint] prevent async Promise constructor mistakes (#110349)

Co-authored-by: spalger <spalger@users.noreply.github.com>

* autofix one more violation

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-09-01 21:18:23 -04:00
Greg Thompson b13e90e6d1
Enable CSS-in-JS styling with emotion (#98157) (#105223)
* emotion deps

* kbn-babel

* kbn-test

* examples

* babel-plugin-styled-components config

* css prop type fixes

* type context

* declaration location

* some emotion types resolved

* clean up

* emotion v10 accomodations

* types

* kbn-crypto

* kbn-telemetry-tools

* bazel

* eslint rule; shared file regex array

* update paths

* Update packages/kbn-eslint-plugin-eslint/rules/module_migration.js

Co-authored-by: Spencer <email@spalger.com>

* remove placeholder styles

* doc api changes

* snapshot updates

* storybook comments

* use constant

* bump new deps

* condense versions

Co-authored-by: Spencer <email@spalger.com>

Co-authored-by: Spencer <email@spalger.com>
2021-07-12 12:23:24 -04:00
Kibana Machine c803b93ba9
[eslint/module-migration] add support for re-export defs and test rule (#102840) (#103567)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-06-29 15:46:35 -04:00
Kibana Machine a86745c47d
chore(NA): moving @kbn/eslint-plugin-eslint into bazel (#98926) (#98992)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2021-04-30 19:35:23 -04:00
Brandon Kobel 57af8462e4
[7.x] Elastic License 2.0 (#90192)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:39:13 -08:00
Tyler Smalley baf56d80c4
[7.x] Updating the License (#88343) (#88745)
* Updating the Licenses, except for applying eslint, building

* Applying ESLint rules,building @kbn/pm, regenerating api docs

Co-authored-by: kobelb <brandon.kobel@elastic.co>
2021-01-19 17:54:11 -08:00
Tyler Smalley 9e75c86101
Converts some Mocha unit tests to Jest (#85514) (#85687)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
# Conflicts:
#	src/dev/code_coverage/ingest_coverage/either.test.js
#	src/dev/code_coverage/ingest_coverage/ingest_helpers.test.js
#	src/dev/code_coverage/ingest_coverage/team_assignment/enumerate_patterns.test.js
#	src/dev/code_coverage/ingest_coverage/team_assignment/enumeration_helpers.test.js
#	src/dev/code_coverage/ingest_coverage/transforms.test.js
2020-12-10 18:32:22 -08:00
Tiago Costa 620cbc8ba5
chore(NA): move into single pkg json (#80015) (#82378)
* chore(NA): update gitignore to include first changes from moving into a single package.json

* chore(NA): update gitignore

* chore(NA): move all the dependencies into the single package.json and apply changes to bootstrap

* chore(NA): fix types problems after the single package json

* chore(NA): include code to find the dependencies used across the code

* chore(NA): introduce pure lockfile for install dependencies on build

* chore(NA): update clean task to not delete anything from xpack node_modules

* chore(NA): update gitignore to remove development temporary rules

* chore(NA): update notice file

* chore(NA): update jest snapshots

* chore(NA): fix whitelisted licenses to include a new specify form of an already included one

* chore(NA): remove check lockfile symlinks from child projects

* chore(NA): fix eslint and add missing declared deps on single pkg json

* chore(NA): correctly update notice

* chore(NA): fix failing jest test for storyshots.test.tsx

* chore(NA): fix cypress multi reporter path

* chore(NA): fix Project tests check

* chore(NA): fix problem with logic to detect used dependes on oss build

* chore(NA): include correct x-pack plugins dep discovery

* chore(NA): discover entries under dynamic requires on vis_type_timelion

* chore(NA): remove canvas

* test(NA): fix jest unit tests

* chore(NA): remove double react declaration from storyshot test file

* chore(NA): try removing isOSS check

* chore(NA): support for plugin development

* chore(NA): update logic to fix unit tests and typechecking

* chore(NA): support to run npm scripts in child kbn projects across all envs

* chore(NA): support github checks reporter on x-pack and remove cpy types as the package correctly provides them

* chore(NA): update cpy version

* chore(NA): include last kbn pm changes

* chore(NA): update style on build_production_projects.ts

* chore(NA): remove any cast fom telemetry opt in stats

* chore(NA): remove del and re-use rm -rf again

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	package.json
#	packages/kbn-pm/dist/index.js
#	x-pack/package.json
#	yarn.lock
2020-11-02 23:22:35 +00:00
Spencer 1122493db9
[7.x] [kbn/bootstrap] validate that certain deps don't ship in production (#80549) (#80710)
Co-authored-by: spalger <spalger@users.noreply.github.com>
# Conflicts:
#	packages/kbn-pm/dist/index.js
2020-10-15 12:00:44 -07:00
restrry 2fefd60e90 update code style 2020-05-22 10:35:02 +02:00
Mikhail Shustov 36ab9d32ba
lint import from restricted zones for export exressions (#66588) (#66754)
* line restricted zones for export exressions

* more robust rule

* fix or mute eslint errors

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-15 19:56:58 +02:00
Joe Portner ded2238fac
[7.x] Add lockfile symlinks (#66211) 2020-05-12 12:59:26 -04:00
patrykkopycinski b81fc7de4c
Update eslint related packages (#54107) (#54166) 2020-01-08 05:49:06 +01:00
spalger aa3bb0e0f5 Revert "[7.x] Update eslint related packages (#53078) (#53091)"
This reverts commit 94c580dc36.
2019-12-17 12:34:35 -07:00
Spencer 94c580dc36
[7.x] Update eslint related packages (#53078) (#53091) 2019-12-16 09:26:57 -07:00
Liza Katz 0e2e40ef3c
eslint no-restricted-path false positive: bug caused by dir names that start with "index". (#46544) (#49852)
* index* to index.{ts,tsx}

* Added test.

* Added invalid test.

* Added js.
2019-10-31 14:01:31 +02:00
Spencer 0bed68933b
Update eslint related packages (#48513) (#48853)
* Update eslint related packages

* add errorMessage to no-restricted-paths validation

* add license to eslintrc file

* ignore broken plugin fixture

* upgrade tangled peer deps

* give name to unnamed func to avoid typescript-eslint/typescript-eslint#1078

* migrate away from removed prefer-interface

* migrate away from removed no-angle-bracket-type-assertions rule

* migrate away from removed no-triple-slash-reference rule

* old config was invalid and made this rule a noop

* fix array-type rule config

* fix readonly paramProperties that weren't being checked

* fix propType ordering

* remove references to non-existent rules

* remove unnecessary disable that is improperly formatted

* fix comment-related spacing

* fix typo/invalid namespace overrides

* rename fn to avoid hook-alike behavior

* remove reference to old removed rule

* use caret version for prettier

* reference babel-eslint with absolute path
2019-10-22 06:41:28 -07:00
Spencer bbacb1c365
[7.x] [mkdirp] remove in favor of recursive fs.mkdir (#47251) (#47333)
* [mkdirp] remove in favor of recursive fs.mkdir

* add eslint rule to educate future contributors

* reword the eslint error message to prevent copy-pasting callback code

* Commit updated kbn-pm dist

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Fix typo

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

# Conflicts:
#	renovate.json5
2019-10-04 09:35:21 -07:00
Spencer 8660e0b0ca
[7.x] Update dependency babel-eslint to ^10.0.3 (#44029) (#44159)
(cherry picked from commit 075c68baf3)
2019-08-27 21:53:56 -07:00
Spencer a0513b0cb9
[7.x] Update dependency write-pkg to v4 (#43226) (#43906)
* Update dependency write-pkg to v4

* rebuild kbn-pm and point worker_threads to built-in module
2019-08-27 14:41:36 -07:00
Spencer 16e59a3d16
[7.x] Update eslint related packages (#43902) (#43921)
(cherry picked from commit b1d48d949e)
2019-08-26 12:02:22 -07:00
Spencer 31e7eec1ce
[7.x] Update babel related packages (#43595) (#43837)
* Update babel related packages (#43595)

* upgrade all babel related modules, and bump lodash minors

* update kbn-pm dist

* update fetch-mock, necessary to use core-js 3

* use regenerator transform in jest tests, as required by EUI

* disable useBuiltIns rather than using regenerator plugin

* remove extra regenerator-runtime import

* Update package.json

* update yarn.lock
2019-08-23 08:24:52 -07:00
Vadim Dalecky ce3c46584b
[7.x] chore: 🤖 forbid import from ui/** (#40537) (#41514)
* chore: 🤖 forbid importing from ui/** from within shims

* chore: 🤖 allow importing platfrom in dashboard embeddable sihm

* chore: 🤖 use np_ready folder, improve rule

* chore: 🤖 update ESLint error message

* feat: 🎸 improve eslint plugin rule

* test: 💍 add tests for restricted paths linter rule

* test: 💍 add ESLint package to CI testing suite

* chore: 🤖 fix linter errors
2019-07-18 23:55:21 +02:00
Spencer 26806fb1eb
[7.x] Update dependency babel-eslint to v10.0.2 (#39932) (#39951) 2019-06-28 15:40:22 -07:00
Spencer 3fe5c954bf
[7.x] dependency updated (#37406) (#37465)
* Pin dependencies (#37406)

* Pin dependencies

* include core-js in babel packages

* specify core-js version when using `useBuiltIns`

* dedupe @babel/types to avoid "range of null" problem

* chore(deps): update dependency del to v4 (#37466)

* chore(deps): update dependency del to v4

* remove @types/del since they ship with the package now

(cherry picked from commit c60e3491a2)

* Update gulp related packages (#37456)

(cherry picked from commit 62893ec0bc)

* Update babel related packages (#37464)

(cherry picked from commit 830bd1f0ca)
2019-05-30 14:57:56 -07:00
Spencer 737a4df891
[7.x] Pin dependencies (#37404) (#37451)
* Pin dependencies (#37404)

* Pin dependencies

* [eslint] ignore large files that take a long time to parse

* [eslint-plugin-import] force `querystring` to be considered a core module

* [eslint-plugin-import] auto-fix import order issues

* Pin dependencies (#37454)

(cherry picked from commit b2340d5cae)
2019-05-29 23:17:57 -07:00
Mikhail Shustov e0afa46852
[New platform] Restrict import from core&plugin internals for ts files (#34688) (#34859)
* eslint-plugin-import should resolve *.ts files

* no_restricted_paths adc support filename exclusion

* fix linter errors

* update autogenerateds docs

* export directly
2019-04-10 15:58:32 +02:00
Tiago Costa f062c97302
chore(NA): merge and solve conflicts with 7.x (#34645) 2019-04-05 19:14:26 +01:00
Mikhail Shustov 8257078086
use eslint-import-plugin/no-export-default instead of custom rule (#34285) (#34332) 2019-04-02 09:38:07 +02:00
Mikhail Shustov 6faa1da282
[New platform] Restrict import from core&plugin internals for js files (#33697) (#34139)
* restrict import from core&plugin internals

* Fork import/no-restricted-paths and add allowSameFolder option

Our use case requires to restrict imports from plugin folders, which names are unknown for us yet. We cannot use 'import/no-restricted-paths' in the current state, because if we define 'from: plugins/*/server/' the rule will report all relative imports in the same folder as well. To fix this problem we added another option 'allowSameFolder' that makes the rule to ignore imports in the same folder.

* update notices

* add basePath option

* support glob pattern instead of reagexp

* remove @notice, make basePath required
2019-03-29 10:25:39 +01:00
Tiago Costa 4213441df7
[7.x] Migration to Babel7 and @babel/preset-typescript (#33093) (#33889)
* chore(NA): merge and solve conflicts with 7.x branch

* docs(NA): fix docs build with page headers.
2019-03-27 00:40:12 +00:00
Spencer 883ea31bd2
[@kbn/expect] "fork" expect.js into repo (#33761) (#33794)
* [@kbn/expect] "fork" expect.js into repo

* [eslint] autofix references to expect.js

* [tslint] autofix all expect.js imports

* now that expect.js is in strict mode, avoid reassigning fn.length
2019-03-25 13:13:21 -07:00
Spencer f09e17e76c
[7.x] [eslint] merge custom rules into a single plugin (#33733) (#33758)
Backports the following commits to 7.x:
 - [eslint] merge custom rules into a single plugin  (#33733)
2019-03-22 18:53:45 -07:00