diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 9a8e2c11550..4f902a408c2 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -148,13 +148,27 @@ will raise an ESLint report and suggest replacing the `style` attribute with `cs ## Testing +### Running unit tests + +Run unit tests using the following command: + +```bash +yarn test +``` + +Unit tests are written using `RuleTester` from `@typescript-eslint/rule-tester`. + ### Against an existing package To test the local changes to the plugin, you must: -1. Run `yarn pack` in the directory. -2. In your project's `package.json`, point `@elastic/eslint-plugin-eui` to `file:/path/to/package.tgz`. -3. Install dependencies: `yarn kbn bootstrap --no-validate`. +1. Install `yalc` globally if you haven't already: `npm install -g yalc`. +2. Open a terminal and navigate to this folder: `cd packages/eslint-plugin` +3. Build the package: `yarn build` +4. Run `yalc publish` in the plugin's directory to publish it locally. +5. In your project's directory, run `yalc add @elastic/eslint-plugin-eui` to link the locally published package. +6. Install dependencies: `yarn` (if you're a Kibana contributor, run `yarn kbn bootstrap --no-validate`). +7. After making further changes to the plugin, repeat the steps from 3. ## Publishing diff --git a/packages/eslint-plugin/changelogs/upcoming/8669.md b/packages/eslint-plugin/changelogs/upcoming/8669.md new file mode 100644 index 00000000000..18b979fde01 --- /dev/null +++ b/packages/eslint-plugin/changelogs/upcoming/8669.md @@ -0,0 +1,8 @@ +**Dependency updates** + +- Updated `typescript` to v5.8.3 +- Updated `@typescript-eslint/eslint-plugin` to v8.31.1 +- Updated `@typescript-eslint/parser` to v8.31.1 +- Updated `@typescript-eslint/rule-tester` to v8.31.1 +- Updated `@typescript-eslint/typescript-estree` to v8.31.1 +- Updated `@typescript-eslint/utils` to v8.31.1 diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index daa34b915f0..51a5a363693 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -27,11 +27,11 @@ "@types/dedent": "^0.7.2", "@types/jest": "^29.5.14", "@types/micromatch": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^8.22.0", - "@typescript-eslint/parser": "^8.22.0", - "@typescript-eslint/rule-tester": "^8.22.0", - "@typescript-eslint/typescript-estree": "^8.22.0", - "@typescript-eslint/utils": "^8.22.0", + "@typescript-eslint/eslint-plugin": "^8.31.1", + "@typescript-eslint/parser": "^8.31.1", + "@typescript-eslint/rule-tester": "^8.31.1", + "@typescript-eslint/typescript-estree": "^8.31.1", + "@typescript-eslint/utils": "^8.31.1", "cssstyle": "^4.2.1", "dedent": "^1.5.3", "eslint": "^8.57.0", @@ -40,7 +40,7 @@ "rimraf": "^6.0.1", "ts-jest": "^29.2.5", "ts-node": "^10.9.2", - "typescript": "^5.7.3" + "typescript": "^5.8.3" }, "scripts": { "test": "jest src", @@ -48,8 +48,7 @@ "build:clean": "rimraf lib/", "build:compile:esm": "tsc --project ./tsconfig.esm.json", "build:compile": "NODE_ENV=production babel src --out-dir=lib/cjs --extensions .js,.ts,.tsx", - "build:types": "NODE_ENV=production tsc --project tsconfig.types.json", - "build:pack": "yarn build && npm pack" + "build:types": "NODE_ENV=production tsc --project tsconfig.types.json" }, "files": [ "lib", diff --git a/yarn.lock b/yarn.lock index afa71fb8e1a..a1d3bdb501d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7054,11 +7054,11 @@ __metadata: "@types/dedent": "npm:^0.7.2" "@types/jest": "npm:^29.5.14" "@types/micromatch": "npm:^4.0.9" - "@typescript-eslint/eslint-plugin": "npm:^8.22.0" - "@typescript-eslint/parser": "npm:^8.22.0" - "@typescript-eslint/rule-tester": "npm:^8.22.0" - "@typescript-eslint/typescript-estree": "npm:^8.22.0" - "@typescript-eslint/utils": "npm:^8.22.0" + "@typescript-eslint/eslint-plugin": "npm:^8.31.1" + "@typescript-eslint/parser": "npm:^8.31.1" + "@typescript-eslint/rule-tester": "npm:^8.31.1" + "@typescript-eslint/typescript-estree": "npm:^8.31.1" + "@typescript-eslint/utils": "npm:^8.31.1" cssstyle: "npm:^4.2.1" dedent: "npm:^1.5.3" eslint: "npm:^8.57.0" @@ -7067,7 +7067,7 @@ __metadata: rimraf: "npm:^6.0.1" ts-jest: "npm:^29.2.5" ts-node: "npm:^10.9.2" - typescript: "npm:^5.7.3" + typescript: "npm:^5.8.3" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" @@ -11695,15 +11695,15 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^8.22.0": - version: 8.29.1 - resolution: "@typescript-eslint/eslint-plugin@npm:8.29.1" +"@typescript-eslint/eslint-plugin@npm:^8.31.1": + version: 8.31.1 + resolution: "@typescript-eslint/eslint-plugin@npm:8.31.1" dependencies: "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:8.29.1" - "@typescript-eslint/type-utils": "npm:8.29.1" - "@typescript-eslint/utils": "npm:8.29.1" - "@typescript-eslint/visitor-keys": "npm:8.29.1" + "@typescript-eslint/scope-manager": "npm:8.31.1" + "@typescript-eslint/type-utils": "npm:8.31.1" + "@typescript-eslint/utils": "npm:8.31.1" + "@typescript-eslint/visitor-keys": "npm:8.31.1" graphemer: "npm:^1.4.0" ignore: "npm:^5.3.1" natural-compare: "npm:^1.4.0" @@ -11712,23 +11712,23 @@ __metadata: "@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" - checksum: 10c0/a3ed7556edcac374cab622862f2f9adedc91ca305d6937db6869a0253d675858c296cb5413980e8404fc39737117faaf35b00c6804664b3c542bdc417502532f + checksum: 10c0/9d805ab413a666fd2eefb16f257fbf3cea7278ccaf0db30ceb686dfe696e4f40b3aa7c336261c7f0a39a51a7c32a4f08d3d4f16bba0e764ac12c93ae94d82896 languageName: node linkType: hard -"@typescript-eslint/parser@npm:8.29.1, @typescript-eslint/parser@npm:^8.22.0": - version: 8.29.1 - resolution: "@typescript-eslint/parser@npm:8.29.1" +"@typescript-eslint/parser@npm:8.31.1, @typescript-eslint/parser@npm:^8.31.1": + version: 8.31.1 + resolution: "@typescript-eslint/parser@npm:8.31.1" dependencies: - "@typescript-eslint/scope-manager": "npm:8.29.1" - "@typescript-eslint/types": "npm:8.29.1" - "@typescript-eslint/typescript-estree": "npm:8.29.1" - "@typescript-eslint/visitor-keys": "npm:8.29.1" + "@typescript-eslint/scope-manager": "npm:8.31.1" + "@typescript-eslint/types": "npm:8.31.1" + "@typescript-eslint/typescript-estree": "npm:8.31.1" + "@typescript-eslint/visitor-keys": "npm:8.31.1" debug: "npm:^4.3.4" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" - checksum: 10c0/af3570ff58c42c2014e5c117bebf91120737fb139d94415ca2711844990e95252c3006ccc699871fe3f592cc1a3f4ebfdc9dd5f6cb29b6b128c2524fcf311b75 + checksum: 10c0/4fffaddbe443fc6a512042b6a777a8b7d9775938b26f54d86279b232b9b3967d90d6bfd65aca0ff010d377855df19708c918545f51cedc51b1688726201added languageName: node linkType: hard @@ -11749,20 +11749,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/rule-tester@npm:^8.22.0": - version: 8.29.1 - resolution: "@typescript-eslint/rule-tester@npm:8.29.1" +"@typescript-eslint/rule-tester@npm:^8.31.1": + version: 8.31.1 + resolution: "@typescript-eslint/rule-tester@npm:8.31.1" dependencies: - "@typescript-eslint/parser": "npm:8.29.1" - "@typescript-eslint/typescript-estree": "npm:8.29.1" - "@typescript-eslint/utils": "npm:8.29.1" + "@typescript-eslint/parser": "npm:8.31.1" + "@typescript-eslint/typescript-estree": "npm:8.31.1" + "@typescript-eslint/utils": "npm:8.31.1" ajv: "npm:^6.12.6" json-stable-stringify-without-jsonify: "npm:^1.0.1" lodash.merge: "npm:4.6.2" semver: "npm:^7.6.0" peerDependencies: eslint: ^8.57.0 || ^9.0.0 - checksum: 10c0/48850b33594780400e7edbee1eae595b66ea68b39e2ec69ab44659428279df9c0351c386313a6526bfd4f3421eddcddb17a4e9f37fa7d103b604ddaec29470e2 + checksum: 10c0/283ec31d1f67eb4ce430639d84defb5069694307c9ef98086bf24fd8889643babc2f15b0d8d9b8be25d4a034ebe64272576085817c42ca2562297087d6913058 languageName: node linkType: hard @@ -11806,13 +11806,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:8.29.1": - version: 8.29.1 - resolution: "@typescript-eslint/scope-manager@npm:8.29.1" +"@typescript-eslint/scope-manager@npm:8.31.1": + version: 8.31.1 + resolution: "@typescript-eslint/scope-manager@npm:8.31.1" dependencies: - "@typescript-eslint/types": "npm:8.29.1" - "@typescript-eslint/visitor-keys": "npm:8.29.1" - checksum: 10c0/8b87a04f01ebc13075e352509bca8f31c757c3220857fa473ac155f6bdf7f30fe82765d0c3d8e790f7fad394a32765bd9f716b97c08e17581d358c76086d51af + "@typescript-eslint/types": "npm:8.31.1" + "@typescript-eslint/visitor-keys": "npm:8.31.1" + checksum: 10c0/759cfaa922f8bc97ecdcfe583df88ad31b04d02a865efc2c6dab622374c9f32839054596193ec3b1c478d8a73690999cbd996e1092605f41a54bbe6a9a62bbf3 languageName: node linkType: hard @@ -11833,18 +11833,18 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:8.29.1": - version: 8.29.1 - resolution: "@typescript-eslint/type-utils@npm:8.29.1" +"@typescript-eslint/type-utils@npm:8.31.1": + version: 8.31.1 + resolution: "@typescript-eslint/type-utils@npm:8.31.1" dependencies: - "@typescript-eslint/typescript-estree": "npm:8.29.1" - "@typescript-eslint/utils": "npm:8.29.1" + "@typescript-eslint/typescript-estree": "npm:8.31.1" + "@typescript-eslint/utils": "npm:8.31.1" debug: "npm:^4.3.4" ts-api-utils: "npm:^2.0.1" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" - checksum: 10c0/72cc01dbac866b0a7c7b1f637ad03ffd22f6d3617f70f06f485cf3096fddfc821fdc56de1a072cc6af70250c63698a3e5a910f67fe46eea941955b6e0da1b2bd + checksum: 10c0/ea5369cf200cd48f26e2c6013c81f5915cc933117e011537a7424402a1ebececc8a39e290b9572a7876a237116fbd75e9ba9313c9898ab828f5a814ab26066d2 languageName: node linkType: hard @@ -11876,10 +11876,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:8.29.1": - version: 8.29.1 - resolution: "@typescript-eslint/types@npm:8.29.1" - checksum: 10c0/bbcb9e4f38df4485092b51ac6bb62d65f321d914ab58dc0ff1eaa7787dc0b4a39e237c2617b9f2c2bcb91a343f30de523e3544f69affa1ee4287a3ef2fc10ce7 +"@typescript-eslint/types@npm:8.31.1": + version: 8.31.1 + resolution: "@typescript-eslint/types@npm:8.31.1" + checksum: 10c0/d52692559028b71d8bfda4f098c7fa08e272c11cf9dd99ea9e1cfb00036c0849d6d53694e047a942c6568b3bf5637512e46356de70b412a9216ec6cfb8b2b950 languageName: node linkType: hard @@ -11974,12 +11974,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.29.1, @typescript-eslint/typescript-estree@npm:^8.22.0": - version: 8.29.1 - resolution: "@typescript-eslint/typescript-estree@npm:8.29.1" +"@typescript-eslint/typescript-estree@npm:8.31.1, @typescript-eslint/typescript-estree@npm:^8.31.1": + version: 8.31.1 + resolution: "@typescript-eslint/typescript-estree@npm:8.31.1" dependencies: - "@typescript-eslint/types": "npm:8.29.1" - "@typescript-eslint/visitor-keys": "npm:8.29.1" + "@typescript-eslint/types": "npm:8.31.1" + "@typescript-eslint/visitor-keys": "npm:8.31.1" debug: "npm:^4.3.4" fast-glob: "npm:^3.3.2" is-glob: "npm:^4.0.3" @@ -11988,7 +11988,7 @@ __metadata: ts-api-utils: "npm:^2.0.1" peerDependencies: typescript: ">=4.8.4 <5.9.0" - checksum: 10c0/33c46c667d9262e5625d5d0064338711b342e62c5675ded6811a2cb13ee5de2f71b90e9d0be5cb338b11b1a329c376a6bbf6c3d24fa8fb457b2eefc9f3298513 + checksum: 10c0/77059f204389d2d1b6db32d4df63473c99f5bd051218200f257531c2d2b2e3f237b23aa80a79baebc9ca8a776636867f1fd2d03533d207da2685d740e2c7fbef languageName: node linkType: hard @@ -12029,18 +12029,18 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.29.1, @typescript-eslint/utils@npm:^8.22.0": - version: 8.29.1 - resolution: "@typescript-eslint/utils@npm:8.29.1" +"@typescript-eslint/utils@npm:8.31.1, @typescript-eslint/utils@npm:^8.31.1": + version: 8.31.1 + resolution: "@typescript-eslint/utils@npm:8.31.1" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:8.29.1" - "@typescript-eslint/types": "npm:8.29.1" - "@typescript-eslint/typescript-estree": "npm:8.29.1" + "@typescript-eslint/scope-manager": "npm:8.31.1" + "@typescript-eslint/types": "npm:8.31.1" + "@typescript-eslint/typescript-estree": "npm:8.31.1" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" - checksum: 10c0/1b2704b769b0c9353cf26a320ecf9775ba51c94c7c30e2af80ca31f4cb230f319762ab06535fcb26b6963144bbeaa53233b34965907c506283861b013f5b95fc + checksum: 10c0/6190551702605aa60e67828163cb5880eee7ab5f1ee789d32227e4f4297d80ea9be98776400fd0660551dcbcac2a35babef33dd94267856dcb6f36c9c94f11ab languageName: node linkType: hard @@ -12133,13 +12133,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:8.29.1": - version: 8.29.1 - resolution: "@typescript-eslint/visitor-keys@npm:8.29.1" +"@typescript-eslint/visitor-keys@npm:8.31.1": + version: 8.31.1 + resolution: "@typescript-eslint/visitor-keys@npm:8.31.1" dependencies: - "@typescript-eslint/types": "npm:8.29.1" + "@typescript-eslint/types": "npm:8.31.1" eslint-visitor-keys: "npm:^4.2.0" - checksum: 10c0/0c12e83c84a754161c89e594a96454799669979c7021a8936515ec574a1fa1d6e3119e0eacf502e07a0fa7254974558ea7a48901c8bfed3c46579a61b655e4f5 + checksum: 10c0/09dbd8e1fdff72802a10bae2c12fa6d25f7e2dab1ff9b720afc2eb4e848b723c179109032aeaeb409d0c9e4107ab4fab8c8b1b47a55d58713d3f29a1365db3ea languageName: node linkType: hard