@@ -436,4 +436,138 @@ describe("blockESLint", () => {
436
436
}
437
437
` ) ;
438
438
} ) ;
439
+
440
+ test ( "with options.bin" , ( ) => {
441
+ const creation = testBlock ( blockESLint , {
442
+ options : {
443
+ ...optionsBase ,
444
+ bin : "bin/index.js" ,
445
+ } ,
446
+ } ) ;
447
+
448
+ expect ( creation ) . toMatchInlineSnapshot ( `
449
+ {
450
+ "addons": [
451
+ {
452
+ "addons": {
453
+ "words": [
454
+ "tseslint",
455
+ ],
456
+ },
457
+ "block": [Function],
458
+ },
459
+ {
460
+ "addons": {
461
+ "sections": {
462
+ "Linting": {
463
+ "contents": {
464
+ "after": [
465
+ "
466
+ For example, ESLint can be run with \`--fix\` to auto-fix some lint rule complaints:
467
+
468
+ \`\`\`shell
469
+ pnpm run lint --fix
470
+ \`\`\`
471
+ ",
472
+ ],
473
+ "before": "
474
+ This package includes several forms of linting to enforce consistent code quality and styling.
475
+ Each should be shown in VS Code, and can be run manually on the command-line:
476
+ ",
477
+ "items": [
478
+ "- \`pnpm lint\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files",
479
+ ],
480
+ "plural": "Read the individual documentation for each linter to understand how it can be configured and used best.",
481
+ },
482
+ },
483
+ },
484
+ },
485
+ "block": [Function],
486
+ },
487
+ {
488
+ "addons": {
489
+ "jobs": [
490
+ {
491
+ "name": "Lint",
492
+ "steps": [
493
+ {
494
+ "run": "pnpm build",
495
+ },
496
+ {
497
+ "run": "pnpm lint",
498
+ },
499
+ ],
500
+ },
501
+ ],
502
+ },
503
+ "block": [Function],
504
+ },
505
+ {
506
+ "addons": {
507
+ "properties": {
508
+ "devDependencies": {
509
+ "@eslint/js": "9.17.0",
510
+ "@types/node": "22.10.2",
511
+ "eslint": "9.17.0",
512
+ "typescript-eslint": "8.19.0",
513
+ },
514
+ "scripts": {
515
+ "lint": "eslint . --max-warnings 0",
516
+ },
517
+ },
518
+ },
519
+ "block": [Function],
520
+ },
521
+ {
522
+ "addons": {
523
+ "extensions": [
524
+ "dbaeumer.vscode-eslint",
525
+ ],
526
+ "settings": {
527
+ "editor.codeActionsOnSave": {
528
+ "source.fixAll.eslint": "explicit",
529
+ },
530
+ "eslint.probe": [
531
+ "javascript",
532
+ "javascriptreact",
533
+ "json",
534
+ "jsonc",
535
+ "markdown",
536
+ "typescript",
537
+ "typescriptreact",
538
+ "yaml",
539
+ ],
540
+ "eslint.rules.customizations": [
541
+ {
542
+ "rule": "*",
543
+ "severity": "warn",
544
+ },
545
+ ],
546
+ },
547
+ },
548
+ "block": [Function],
549
+ },
550
+ ],
551
+ "files": {
552
+ "eslint.config.js": "import eslint from "@eslint/js";
553
+ import tseslint from "typescript-eslint";
554
+
555
+ export default tseslint.config(
556
+ { ignores: ["lib", "node_modules", "pnpm-lock.yaml"] },
557
+ { linterOptions: {"reportUnusedDisableDirectives":"error"} },
558
+ eslint.configs.recommended,
559
+ { extends: [tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked], files: ["**/*.js", "**/*.ts"], languageOptions: {"parserOptions":{"projectService":{"allowDefaultProject":["*.config.*s","bin/index.js"]},"tsconfigRootDir":import.meta.dirname}}, }
560
+ );",
561
+ },
562
+ "scripts": [
563
+ {
564
+ "commands": [
565
+ "pnpm lint --fix",
566
+ ],
567
+ "phase": 3,
568
+ },
569
+ ],
570
+ }
571
+ ` ) ;
572
+ } ) ;
439
573
} ) ;
0 commit comments