Download the PHP package brnshkr/config without Composer
On this page you can find all versions of the php package brnshkr/config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brnshkr/config
More information about brnshkr/config
Files in brnshkr/config
Package config
Short Description Centralized collection of configuration and tooling used across all @brnshkr projects
License MIT
Homepage https://github.com/brnshkr/config
Informations about the package config
[![Semantic Versioning 2.0.0][semver-2.0.0-shield-url]][semver-2.0.0-url]
[![MIT License][license-shield-url]][license-url]
[![Stars][stars-shield-url]][stars-url]
[![Forks][forks-shield-url]][forks-url]
[![Issues][issues-shield-url]][issues-url]
[![Release][release-shield-url]][release-url]
Centralized collection of configuration and tooling used across all @brnshkr projects.
โ๏ธ Bug Reports / Feature Requests ยป
Table of Contents
- ๐ About the Project
- ๐ Documentation
- ๐งฐ Prerequisites
- ๐ Installation
- ๐ Usage
- ๐งฉ Custom Rules
- โค๏ธ Contributing
- ๐ Commit Style
- โ๏ธ Workflows
- ๐ Versioning
- ๐ License
- ๐ Acknowledgments
โฌ
๐ About the Project
@brnshkr/config is a centralized, opinionated collection of shared configuration files, tooling, and workflows for JavaScript and PHP projects. It helps standardizing linting, formatting, static analysis, and development workflows across repositories โ reducing setup time, preventing config drift, and improving code quality and consistency.
โ Note โ
While you're more than welcome to use this in your own projects, the configurations are tailored specifically for the @brnshkr ecosystem and may not be a perfect fit elsewhere.
โฌ
๐ Documentation
This README covers installation and usage. The full reference โ custom rules, config builders, the Composer plugin,
the shared Makefile, and the development setup
โ lives in ./docs, organized by stack and tool.
โฌ
๐งฐ Prerequisites
JS
- Node.js >= v24.15 or Bun >= v1.4 (Older versions may work, but are untested)
- Any JavaScript package manager (Bun, Yarn, PNPM, NPM)
PHP
- PHP >= 8.5 (Older versions may work, but are untested)
- Composer >= 2.9 (Older versions may work, but are untested)
- PHP Extensions:
jsonmbstring
โฌ
๐ Installation
Bun
Any other JavaScript package manager works the same way,
e.g. yarn add -D -E @brnshkr/config, pnpm add -D -E @brnshkr/config or npm i -D -E @brnshkr/config.
Take a look at the peerDependencies in the package.json file
and install the ones you need for the modules you want to use.
Composer
Take a look at the suggested packages in the composer.json file and install the ones
you need for the modules you want to use.
To have the packages installed for you, pick the modules interactively:
โฌ
๐ Usage
This package provides configurations, not a hard requirement on how you run tools.
๐จ Configuration
Each tool reads a config file like the ones below. Put it wherever the tool looks for one,
or anywhere else and point the tool to it with its --config option; @brnshkr projects keep them in ./conf.
To use the defaults as they are, re-export them:
To customize them, pass your options to getConfig().
Take a look at the function signatures for exact details.
The other config builders work the same way, with their module listed in the table below.
PHPStan reads a .neon file by default and a .php one with --configuration, and both can include ours:
Every tool and its options are described in the docs.
Run Tooling
A few possible ways are listed below:
Option 1 โ Run Tools Directly (Most Flexible)
Example calls, adjust as needed (these are the commands the make targets run)
Option 2 โ Run Make Targets (@brnshkr Convention)
Your own Makefile includes this one. Copy the starter rather than writing the include by hand: it guards the
include, so a fresh clone can run a plain make before anything is installed.
When installed through Composer, the starter lives in ./vendor/brnshkr/config/conf/Makefile.dist instead.
A target appears once the tool it runs is installed, so make help lists what your repository actually has,
make ci runs all of it, and make startup writes the .gitignore, .gitattributes and editor files you are still missing.
The full reference is ./docs/Makefile.md.
These targets look for your configuration files in the ./conf directory
(exactly how it is done in this project as well; see ./conf)
and use the defaults of this package without one.
| Tool | Module | Target | Optional configuration file |
|---|---|---|---|
| ESLint | @brnshkr/config/eslint |
make eslint |
./conf/eslint.dist.mjs |
| Stylelint | @brnshkr/config/stylelint |
make stylelint |
./conf/stylelint.dist.mjs |
| markdownlint | @brnshkr/config/markdownlint |
make markdownlint |
./conf/markdownlint.dist.mjs |
| commitlint | @brnshkr/config/commitlint |
make commitlint |
./conf/commitlint.dist.mjs |
| TypeScript | @brnshkr/config/conf/tsconfig.json |
make typescript |
./tsconfig.json |
| Vitest | @brnshkr/config/vitest |
make vitest |
./conf/vitest.dist.mjs |
| PHP CS Fixer | Brnshkr\Config\PhpCsFixer |
make php-cs-fixer |
./conf/php-cs-fixer.dist.php |
| Rector | Brnshkr\Config\Rector |
make rector |
./conf/rector.dist.php |
| PHPStan | Brnshkr\Config\PhpStan |
make phpstan |
./conf/phpstan.dist.php |
| Twig CS Fixer | Brnshkr\Config\TwigCsFixer |
make twig-cs-fixer |
./conf/twig-cs-fixer.dist.php |
| PHPUnit | โ | make phpunit |
./conf/phpunit.dist.xml |
| semgrep | โ | make semgrep |
./conf/semgrep.dist.yaml |
| hadolint | โ | make hadolint |
./conf/hadolint.dist.yaml |
| actionlint | โ | make actionlint |
./conf/actionlint.dist.yaml |
When using the ./conf directory it might be necessary to instruct your IDE to read these files correctly.
If you need a VS Code setup and have the specific extensions
installed, make configs writes the settings they need into ./.vscode/settings.json,
pointing at the files the targets use.
Composer Plugin
The Composer package also adds a few helper commands, see the Composer plugin docs.
โฌ
๐งฉ Custom Rules
Both stacks ship custom rules on top of the upstream ones. Each rule is documented with examples in the Custom ESLint Rules docs and the Custom PHPStan Rules docs.
โฌ
โค๏ธ Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the project
- Create your feature branch =>
git checkout -b feature/my-new-feature - Commit your changes =>
git commit -m 'feat(my-new-feature): add some awesome new feature' - Push to the branch =>
git push origin feature/my-new-feature - Open a pull request
New to the codebase? The Development docs cover environment setup and the day-to-day commands for both stacks.
Any help is always greatly appreciated ๐
๐ Commit Style
This project mostly follows the Conventional Commits specification.
There are only a few differences. The main one is that the scope is required:
So instead of this commit message signature: <type>[optional scope]: <description>
You should use this one: <type><scope>: <description>
Further details can be found in the commitlint configuration.
โ๏ธ Workflows
See ./.github/workflows for more information.
โฌ
๐ Versioning
This project follows Semantic Versioning 2.0.0.
The NPM and Composer packages are versioned in sync,
so a version change does not necessarily indicate a change in a specific package.
โ Note โ
Since changes to rules and dependencies are not considered breaking, even a patch release may introduce new errors in code that hasn't changed and break your CI without notice. We therefore strongly recommend pinning to an exact version (-Efor the JS package managers,composer r --dev brnshkr/config:X.Y.Zfor Composer) so updates stay opt-in and can be applied on your own schedule.
Changes Considered as Breaking Changes
- Version requirement changes of Node.js, Bun, PHP or Composer
- Changes that might break existing userland configs
Changes Considered as Non-Breaking Changes
- Changes regarding used rules and their options
- Version updates, introduction or removal of dependencies
- Updates of minimum required versions of optional dependencies
โฌ
๐ License
Distributed under the MIT License. See LICENSE for more information.
โฌ
๐ Acknowledgments
- TypeScript
- ESLint
- markdownlint-cli2
- Stylelint
- commitlint
- @antfu/eslint-config
- PHP
- PHPStan
- Rector
- PHP-CS-Fixer
- Twig-CS-Fixer
- GNU Make
- Best-README-Template
- Choose an Open Source License
- Shields.io
-
@brnshkr organization
โฌ
All versions of config with dependencies
ext-json Version *
ext-mbstring Version *
composer-plugin-api Version ^2.0.0