diff --git a/.eslintignore b/.eslintignore index 9b745756b6706..bfa69083b1e09 100644 --- a/.eslintignore +++ b/.eslintignore @@ -30,7 +30,7 @@ snapshots.js /x-pack/plugins/reporting/server/export_types/printable_pdf_v2/server/lib/pdf/assets/** # package overrides -/packages/elastic-eslint-config-kibana +/packages/kbn-eslint-config /packages/kbn-plugin-generator/template /packages/kbn-generate/templates /packages/kbn-pm/dist diff --git a/.eslintrc.js b/.eslintrc.js index dfbdd4de96f0a..a921718a97f79 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -230,7 +230,7 @@ const RESTRICTED_IMPORTS = [ module.exports = { root: true, - extends: ['@elastic/eslint-config-kibana', 'plugin:@elastic/eui/recommended'], + extends: ['plugin:@elastic/eui/recommended', '@kbn/eslint-config'], overrides: [ /** @@ -304,7 +304,7 @@ module.exports = { */ { files: [ - 'packages/elastic-eslint-config-kibana/**/*.{js,mjs,ts,tsx}', + 'packages/kbn-eslint-config/**/*.{js,mjs,ts,tsx}', 'packages/kbn-datemath/**/*.{js,mjs,ts,tsx}', ], rules: { diff --git a/docs/developer/getting-started/running-kibana-advanced.asciidoc b/docs/developer/getting-started/running-kibana-advanced.asciidoc index 68a4951ea1c21..5b2a58836008c 100644 --- a/docs/developer/getting-started/running-kibana-advanced.asciidoc +++ b/docs/developer/getting-started/running-kibana-advanced.asciidoc @@ -30,7 +30,7 @@ If you’re installing dependencies and seeing an error that looks something like .... -Unsupported URL Type: link:packages/elastic-eslint-config-kibana +Unsupported URL Type: link:packages/kbn-eslint-config .... you’re likely running `npm`. To install dependencies in {kib} you diff --git a/package.json b/package.json index 74e4b3e211504..c90e61a4fb396 100644 --- a/package.json +++ b/package.json @@ -470,7 +470,6 @@ "@cypress/code-coverage": "^3.9.12", "@cypress/snapshot": "^2.1.7", "@cypress/webpack-preprocessor": "^5.6.0", - "@elastic/eslint-config-kibana": "link:bazel-bin/packages/elastic-eslint-config-kibana", "@elastic/eslint-plugin-eui": "0.0.2", "@elastic/github-checks-reporter": "0.0.20b3", "@elastic/makelogs": "^6.0.0", @@ -493,6 +492,7 @@ "@kbn/docs-utils": "link:bazel-bin/packages/kbn-docs-utils", "@kbn/es": "link:bazel-bin/packages/kbn-es", "@kbn/es-archiver": "link:bazel-bin/packages/kbn-es-archiver", + "@kbn/eslint-config": "link:bazel-bin/packages/kbn-eslint-config", "@kbn/eslint-plugin-eslint": "link:bazel-bin/packages/kbn-eslint-plugin-eslint", "@kbn/expect": "link:bazel-bin/packages/kbn-expect", "@kbn/find-used-node-modules": "link:bazel-bin/packages/kbn-find-used-node-modules", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 5f435f583a36a..5a06233d0e72d 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -15,7 +15,6 @@ filegroup( "//packages/analytics/shippers/elastic_v3/server:build", "//packages/analytics/shippers/fullstory:build", "//packages/elastic-apm-synthtrace:build", - "//packages/elastic-eslint-config-kibana:build", "//packages/elastic-safer-lodash-set:build", "//packages/kbn-ace:build", "//packages/kbn-alerts:build", @@ -43,6 +42,7 @@ filegroup( "//packages/kbn-es-archiver:build", "//packages/kbn-es-query:build", "//packages/kbn-es:build", + "//packages/kbn-eslint-config:build", "//packages/kbn-eslint-plugin-eslint:build", "//packages/kbn-eslint-plugin-imports:build", "//packages/kbn-expect:build", diff --git a/packages/elastic-eslint-config-kibana/.npmignore b/packages/elastic-eslint-config-kibana/.npmignore deleted file mode 100644 index 2ba159593147d..0000000000000 --- a/packages/elastic-eslint-config-kibana/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.eslintrc.yaml -tasks diff --git a/packages/kbn-babel-preset/styled_components_files.js b/packages/kbn-babel-preset/styled_components_files.js index 53052809b6b2f..1c5cf2af81f0f 100644 --- a/packages/kbn-babel-preset/styled_components_files.js +++ b/packages/kbn-babel-preset/styled_components_files.js @@ -9,7 +9,7 @@ module.exports = { /** * Synchronized regex list of files that use `styled-components`. - * Used by `kbn-babel-preset` and `elastic-eslint-config-kibana`. + * Used by `kbn-babel-preset` and `kbn-eslint-config`. */ USES_STYLED_COMPONENTS: [ /packages[\/\\]kbn-ui-shared-deps-(npm|src)[\/\\]/, diff --git a/packages/elastic-eslint-config-kibana/.eslintrc.js b/packages/kbn-eslint-config/.eslintrc.js similarity index 100% rename from packages/elastic-eslint-config-kibana/.eslintrc.js rename to packages/kbn-eslint-config/.eslintrc.js diff --git a/packages/elastic-eslint-config-kibana/.gitignore b/packages/kbn-eslint-config/.gitignore similarity index 100% rename from packages/elastic-eslint-config-kibana/.gitignore rename to packages/kbn-eslint-config/.gitignore diff --git a/packages/elastic-eslint-config-kibana/BUILD.bazel b/packages/kbn-eslint-config/BUILD.bazel similarity index 88% rename from packages/elastic-eslint-config-kibana/BUILD.bazel rename to packages/kbn-eslint-config/BUILD.bazel index 9dceec268418b..6eb7ff7c723ac 100644 --- a/packages/elastic-eslint-config-kibana/BUILD.bazel +++ b/packages/kbn-eslint-config/BUILD.bazel @@ -1,8 +1,8 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "pkg_npm") -PKG_BASE_NAME = "elastic-eslint-config-kibana" -PKG_REQUIRE_NAME = "@elastic/eslint-config-kibana" +PKG_BASE_NAME = "kbn-eslint-config" +PKG_REQUIRE_NAME = "@kbn/eslint-config" SOURCE_FILES = glob([ ".eslintrc.js", @@ -22,7 +22,6 @@ filegroup( NPM_MODULE_EXTRA_FILES = [ "package.json", - "README.md", ] RUNTIME_DEPS = [ diff --git a/packages/elastic-eslint-config-kibana/README.md b/packages/kbn-eslint-config/README.md similarity index 68% rename from packages/elastic-eslint-config-kibana/README.md rename to packages/kbn-eslint-config/README.md index 2049440cd8ff7..cca5551a07aba 100644 --- a/packages/elastic-eslint-config-kibana/README.md +++ b/packages/kbn-eslint-config/README.md @@ -10,7 +10,7 @@ in your `.eslintrc`: ```javascript { extends: [ - '@elastic/eslint-config-kibana' + '@kbn/eslint-config' ] } ``` @@ -18,14 +18,14 @@ in your `.eslintrc`: ## 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 +the `@kbn/eslint-config/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' + '@kbn/eslint-config', + '@kbn/eslint-config/jest' ] } ``` diff --git a/packages/elastic-eslint-config-kibana/javascript.js b/packages/kbn-eslint-config/javascript.js similarity index 100% rename from packages/elastic-eslint-config-kibana/javascript.js rename to packages/kbn-eslint-config/javascript.js diff --git a/packages/elastic-eslint-config-kibana/jest.js b/packages/kbn-eslint-config/jest.js similarity index 100% rename from packages/elastic-eslint-config-kibana/jest.js rename to packages/kbn-eslint-config/jest.js diff --git a/packages/elastic-eslint-config-kibana/package.json b/packages/kbn-eslint-config/package.json similarity index 78% rename from packages/elastic-eslint-config-kibana/package.json rename to packages/kbn-eslint-config/package.json index a5007de28584c..eb9f7a4b08246 100644 --- a/packages/elastic-eslint-config-kibana/package.json +++ b/packages/kbn-eslint-config/package.json @@ -1,6 +1,6 @@ { - "name": "@elastic/eslint-config-kibana", - "version": "0.15.0", + "name": "@kbn/eslint-config", + "version": "1.0.0", "description": "The eslint config used by the kibana team", "main": ".eslintrc.js", "repository": { @@ -14,7 +14,7 @@ "author": "Spencer Alger ", "license": "Apache-2.0", "bugs": { - "url": "https://github.com/elastic/kibana/tree/main/packages/elastic-eslint-config-kibana" + "url": "https://github.com/elastic/kibana/tree/main/packages/kbn-eslint-config" }, - "homepage": "https://github.com/elastic/kibana/tree/main/packages/elastic-eslint-config-kibana" + "homepage": "https://github.com/elastic/kibana/tree/main/packages/kbn-eslint-config" } \ No newline at end of file diff --git a/packages/elastic-eslint-config-kibana/react.js b/packages/kbn-eslint-config/react.js similarity index 100% rename from packages/elastic-eslint-config-kibana/react.js rename to packages/kbn-eslint-config/react.js diff --git a/packages/elastic-eslint-config-kibana/restricted_globals.js b/packages/kbn-eslint-config/restricted_globals.js similarity index 100% rename from packages/elastic-eslint-config-kibana/restricted_globals.js rename to packages/kbn-eslint-config/restricted_globals.js diff --git a/packages/elastic-eslint-config-kibana/typescript.js b/packages/kbn-eslint-config/typescript.js similarity index 100% rename from packages/elastic-eslint-config-kibana/typescript.js rename to packages/kbn-eslint-config/typescript.js diff --git a/packages/kbn-plugin-generator/template/.eslintrc.js.ejs b/packages/kbn-plugin-generator/template/.eslintrc.js.ejs index d063fc481b718..5a65d0cfb8e02 100644 --- a/packages/kbn-plugin-generator/template/.eslintrc.js.ejs +++ b/packages/kbn-plugin-generator/template/.eslintrc.js.ejs @@ -1,7 +1,7 @@ module.exports = { root: true, extends: [ - '@elastic/eslint-config-kibana', + '@kbn/eslint-config', 'plugin:@elastic/eui/recommended' ], rules: { diff --git a/packages/kbn-pm/README.md b/packages/kbn-pm/README.md index eb1ac6ffa92aa..33d1fe6590f4b 100644 --- a/packages/kbn-pm/README.md +++ b/packages/kbn-pm/README.md @@ -19,7 +19,7 @@ From a plugin perspective there are two different types of Kibana dependencies: runtime and static dependencies. Runtime dependencies are things that are instantiated at runtime and that are injected into the plugin, for example config and elasticsearch clients. Static dependencies are those dependencies -that we want to `import`. `elastic-eslint-config-kibana` is one example of this, and +that we want to `import`. `kbn-eslint-config` is one example of this, and it's actually needed because eslint requires it to be a separate package. But we also have dependencies like `datemath`, `flot`, `eui` and others that we control, but where we want to `import` them in plugins instead of injecting them diff --git a/yarn.lock b/yarn.lock index 19882f1516155..556cd07b2ea67 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1499,10 +1499,6 @@ semver "^7.3.2" topojson-client "^3.1.0" -"@elastic/eslint-config-kibana@link:bazel-bin/packages/elastic-eslint-config-kibana": - version "0.0.0" - uid "" - "@elastic/eslint-plugin-eui@0.0.2": version "0.0.2" resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314" @@ -3017,6 +3013,10 @@ version "0.0.0" uid "" +"@kbn/eslint-config@link:bazel-bin/packages/kbn-eslint-config": + version "0.0.0" + uid "" + "@kbn/eslint-plugin-eslint@link:bazel-bin/packages/kbn-eslint-plugin-eslint": version "0.0.0" uid ""