承接 indentno/laravel-linter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

indentno/laravel-linter

最新稳定版本:0.6.6

Composer 安装命令:

composer require indentno/laravel-linter

包简介

Linting for your laravel project

README 文档

README

Linting for your laravel project.

Build Status PRs Welcome psr-2

A laravel linter based on the tlint package from the folks over at Tighten.

Installation

Install the package as a dev dependency:

composer require indentno/laravel-linter --dev

Create a config (tlint.json), at the root of your repository, with the following contents:

{
  "preset": "Indent\\LaravelLinter\\Presets\\IndentPreset",
  "excluded": [
    "tests/",
    "database/"
  ]
}

Usage

Run the linter with all linters in the preset:

./vendor/bin/tlint

Run the linter against a single file or directory:

./vendor/bin/tlint lint app/Http/Controllers/PageController.php
./vendor/bin/tlint lint app

Lint the project with a single linter:

./vendor/bin/tlint --only="NoCompact"

Configuration

The tlint.json config supports three different config keys.

Preset

The "preset" defines which preset that should be used for linting the project. A preset is basicly just a set of linters, or rules, that the project should adhere to.

Excluded

"excluded" is an array of paths that should be excluded from the linting process.

Disabled

The "disabled" key can be used to disable a set of linters from being run in your project.

{
  "preset": "Indent\\LaravelLinter\\Presets\\IndentPreset",
  "disabled": [
      "NoCompact",
      "UseConfigOverEnv"
  ],
  "excluded": [
    "tests/",
    "database/"
  ]
}

Rules

An overview of rules that needs further explanation.

ValidRouteStructure

Routes should be structured the way we prefer.

Examples

Route::get('articles', [ArticleController::class, 'index'])->name('article.index');

Route::patch('page/{id}', [PageController::class, 'update'])
    ->name('admin.page.update')
    ->middleware(CanUpdatePage::class);

License

MIT © Indent

统计信息

  • 总下载量: 904
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-18