Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group_to_single_imports rule not working #358

Open
RazinTeqB opened this issue Mar 6, 2025 · 0 comments
Open

group_to_single_imports rule not working #358

RazinTeqB opened this issue Mar 6, 2025 · 0 comments

Comments

@RazinTeqB
Copy link

RazinTeqB commented Mar 6, 2025

Pint Version

1.21.0

PHP Version

8.3.17

Description

Before:

<?php

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;

After:

No Changes. Same as before.

Terminal Output

Image

  • pint.json
{
    "preset": "laravel",
    "rules": {
        "concat_space": {
            "spacing": "one"
        },
        "ordered_imports": {
            "sort_algorithm": "length",
            "imports_order": ["const", "class", "function"]
        },
        "braces": false,
        "single_import_per_statement": {
            "group_to_single_imports": true
        },
        "binary_operator_spaces": {
            "default": "align_single_space_minimal"
        }
    },
    "exclude": [
        "vendor/"
    ]
}

Steps To Reproduce

  • Issue rule pint.json
{
    "preset": "laravel",
    "rules": {
        "single_import_per_statement": {
            "group_to_single_imports": true
        }
    },
    "exclude": ["vendor/"]
}
  • Add some import statement with same namespace
<?php

use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schedule;

dd(Artisan::class, Cache::class, DB::class, Schedule::class);
  • run pint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant