brnshkr / config
Centralized collection of configuration and tooling used across all @brnshkr projects
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 1
Forks: 0
Open Issues: 0
Language:TypeScript
Type:composer-plugin
pkg:composer/brnshkr/config
Requires
- php: >=8.5
- composer-plugin-api: ^2.0.0
- ext-json: *
- ext-mbstring: *
Requires (Dev)
- ext-ctype: *
- ext-date: *
- ext-dom: *
- ext-filter: *
- ext-hash: *
- ext-iconv: *
- ext-libxml: *
- ext-openssl: *
- ext-pcre: *
- ext-phar: *
- ext-reflection: *
- ext-simplexml: *
- ext-tokenizer: *
- ext-xml: *
- ext-xmlwriter: *
- composer/composer: 2.9.5
- friendsofphp/php-cs-fixer: 3.93.1
- kubawerlos/php-cs-fixer-custom-fixers: 3.36.0
- pestphp/pest: 4.3.2
- phpstan/extension-installer: 1.4.3
- phpstan/phpstan: 2.1.38
- phpstan/phpstan-deprecation-rules: 2.0.3
- phpstan/phpstan-doctrine: 2.0.14
- phpstan/phpstan-phpunit: 2.0.12
- phpstan/phpstan-strict-rules: 2.0.8
- phpstan/phpstan-symfony: 2.0.12
- phpstan/phpstan-webmozart-assert: 2.0.0
- phpunit/phpunit: 12.5.8
- rector/rector: 2.3.5
- rector/type-perfect: 2.1.2
- spatie/phpunit-snapshot-assertions: 5.3.0
- symfony/finder: 8.0.5
- symplify/phpstan-rules: 14.9.11
- ticketswap/phpstan-error-formatter: 1.2.4
Suggests
- friendsofphp/php-cs-fixer: Needed for automatically applying PHP coding standards
- kubawerlos/php-cs-fixer-custom-fixers: Optional additional PHP CS Fixer rules
- phpstan/extension-installer: Needed when using PHPStan
- phpstan/phpstan: Needed for static code analysis
- phpstan/phpstan-deprecation-rules: Optional PHPStan rules for deprecations
- phpstan/phpstan-doctrine: Optional additional PHPStan rules for Doctrine (It is recommended to configure parameters.doctrine.objectManagerLoader when using this extension)
- phpstan/phpstan-phpunit: Optional additional PHPStan rules for PHPUnit
- phpstan/phpstan-strict-rules: Needed when using PHPStan
- phpstan/phpstan-symfony: Optional additional PHPStan rules for Symfony (It is recommended to configure parameters.symfony.consoleApplicationLoader when using this extension)
- phpstan/phpstan-webmozart-assert: Optional additional PHPStan rules for Webmozart\Assert
- rector/rector: Needed for automatically applying upgrades and refactorings
- rector/type-perfect: Needed when using PHPStan
- symfony/finder: Needed when using PHP CS Fixer or Rector
- symplify/phpstan-rules: Needed when using PHPStan
- ticketswap/phpstan-error-formatter: Optional PHPStan error output formatter
Conflicts
- friendsofphp/php-cs-fixer: <3.89.1 || >=4
- kubawerlos/php-cs-fixer-custom-fixers: <3.36.0 || >=4
- phpstan/extension-installer: <1.4.3 || >=3
- phpstan/phpstan: <2.1.38 || >=3
- phpstan/phpstan-deprecation-rules: <2.0.3 || >=3
- phpstan/phpstan-doctrine: <2.0.14 || >=3
- phpstan/phpstan-phpunit: <2.0.12 || >=3
- phpstan/phpstan-strict-rules: <2.0.8 || >=3
- phpstan/phpstan-symfony: <2.0.12 || >=3
- phpstan/phpstan-webmozart-assert: <2.0.0 || >=3
- rector/rector: <2.3.5 || >=3
- rector/type-perfect: <2.1.2 || >=3
- symfony/finder: <8.0.5 || >=9
- symplify/phpstan-rules: <14.9.11 || >=15
- ticketswap/phpstan-error-formatter: <1.2.4 || >=2
This package is auto-updated.
Last update: 2026-02-11 21:19:05 UTC
README
Centralized collection of configuration and tooling used across all @brnshkr projects.
☄️ Bug Reports / Feature Requests »
Table of Contents
- 👋 About the Project
- ☕ JS
- 🐘 PHP
- 🔨 TODOs / Roadmap
- ❤️ Contributing
- 🔖 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.
☕ JS
🧰 Prerequisites
- Node.js >= v24 or Bun >= 1.3 (Older versions may work, but are untested)
- Any JavaScript package manager (Bun, Yarn, PNPM, NPM)
🚀 Installation
Bun
bun a -D @brnshkr/config
Yarn
yarn add -D @brnshkr/config
PNPM
pnpm add -D @brnshkr/config
NPM
npm i -D @brnshkr/config
This repository currently only provides one way to integrate configuration files (An automatic setup is planned, See 🔨 TODOs / Roadmap):
- Manual setup by copying the example configuration files yourself
✋ Manual
Take a look at the peerDependencies in the package.json file and install the ones you need for the modules you want to use.
You can then copy the specific configs to your project:
TypeScript
cp -v ./node_modules/@brnshkr/config/conf/tsconfig.json.example ./tsconfig.json
ESLint
cp -v ./node_modules/@brnshkr/config/conf/eslint.config.mjs.example ./conf/eslint.config.mjs
Stylelint
cp -v ./node_modules/@brnshkr/config/conf/stylelint.config.mjs.example ./conf/stylelint.config.mjs
All
cp -v ./node_modules/@brnshkr/config/conf/tsconfig.json.example ./tsconfig.json \ && cp -v ./node_modules/@brnshkr/config/conf/eslint.config.mjs.example ./conf/eslint.config.mjs \ && cp -v ./node_modules/@brnshkr/config/conf/stylelint.config.mjs.example ./conf/stylelint.config.mjs
🎨 Custom
Take a look at the function signatures for exact details.
ESLint
// ./eslint.config.mjs import { getConfig } from '@brnshkr/config/eslint'; export default getConfig(/* customize */);
Stylelint
// ./stylelint.config.mjs import { getConfig } from '@brnshkr/config/stylelint'; export default getConfig(/* customize */);
👀 Usage
Run Tooling
This package provides configurations, not a hard requirement on how you run tools.
A few possible ways are listed below:
Option 1 — Run Tools Directly (Most Flexible)
ESLint
Example call, adjust as needed
bun eslint --config ./conf/eslint.config.ts --cache --cache-location ./.cache/eslint.cache.json
Stylelint
Example call, adjust as needed
bun stylelint --config ./conf/stylelint.config.mjs --cache --cache-location ./.cache/stylelint.cache.json **/*.{css,ejs,html,less,postcss,scss,svelte,svg,vue}
Option 2 — Run Helper Scripts (Bun Only, @brnshkr Convention)
For these scripts to work you need to follow the convention of putting your configuration files into the ./conf directory (Exactly how it is done in this project as well).
ESLint (TypeScript Only)
Expected configuration file: ./conf/eslint.config.ts
bun ./node_modules/@brnshkr/config/dist/scripts/eslint.mjs
Stylelint
Expected configuration file: ./conf/stylelint.config.mjs
bun ./node_modules/@brnshkr/config/dist/scripts/stylelint.mjs
IDE Setup
When using the recommended way of putting config files into the ./conf directory it might be neccesary to instruct your IDE to read these files correctly.
If you need a VSCode setup and have the specific extensions installed you can take a look at the Project specific section in ./.vscode/settings.json.
💻 Development
Setup
Install dependencies and setup git hooks:
bun install \
&& bun install-hooks
Scripts
We recommend using the scripts provided in the package.json file as the primary way of running common tasks.
Have a look yourself for a full list of available targets.
Common targets
Here are some frequently used examples:
bun lint— Run ESLint, Stylelint and Commitlintbun inspect:eslint— Inspect ESLint configurationbun check— Run TypeScript checks, linters and Vitestbun run test— Run Vitest test suitebun test-update— Run Vitest test suite and update snapshotsbun run build— Build the project and generate typesbun watch— Build the project in watch mode
🐘 PHP
🧰 Prerequisites
- PHP >= 8.5 (Older versions may work, but are untested)
- Composer >= 2.9 (Older versions may work, but are untested)
- PHP Extensions:
jsonmbstring
🚀 Installation
Composer
composer req --dev brnshkr/config
This repository provides two ways to integrate configuration files and setup tools into your project:
- Automatic setup via the Composer plugin
- Manual setup by copying the example configuration files yourself
🤖 Automatic
If you allow this package to run as a Composer plugin (Composer will prompt you on first install), several helper commands become available.
The most commonly used is the automatic setup command which installs packages for selected modules, copies example config files into your repository, and can optionally create a Makefile and/or a .gitignore file.
Run the automatic setup with defaults:
composer brnshkr:config:setup
Run the automatic setup with all flags enabled:
composer brnshkr:config:setup -gofacme
Take a look at the plugin commands section to see a full list of available commands.
✋ Manual
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.
You can then copy the specific configs to your project:
PHP CS Fixer
cp -v ./vendor/brnshkr/config/conf/.php-cs-fixer.php.example ./conf/.php-cs-fixer.php \
&& cp -v ./vendor/brnshkr/config/conf/.php-cs-fixer.dist.php.example ./conf/.php-cs-fixer.dist.php
Rector
cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php \
&& cp -v ./vendor/brnshkr/config/conf/rector.dist.php.example ./conf/rector.dist.php
PHPStan
cp -v ./vendor/brnshkr/config/conf/phpstan.neon.example ./conf/phpstan.neon \
&& cp -v ./vendor/brnshkr/config/conf/phpstan.dist.neon.example ./conf/phpstan.dist.neon
Makefile
cp -v ./vendor/brnshkr/config/conf/Makefile.example ./Makefile
Gitignore
cp -v ./vendor/brnshkr/config/conf/.gitignore.example ./.gitignore
All
cp -v ./vendor/brnshkr/config/conf/.php-cs-fixer.php.example ./conf/.php-cs-fixer.php \ && cp -v ./vendor/brnshkr/config/conf/.php-cs-fixer.dist.php.example ./conf/.php-cs-fixer.dist.php \ && cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php \ && cp -v ./vendor/brnshkr/config/conf/rector.dist.php.example ./conf/rector.dist.php \ && cp -v ./vendor/brnshkr/config/conf/phpstan.neon.example ./conf/phpstan.neon \ && cp -v ./vendor/brnshkr/config/conf/phpstan.dist.neon.example ./conf/phpstan.dist.neon \ && cp -v ./vendor/brnshkr/config/conf/Makefile.example ./Makefile \ && cp -v ./vendor/brnshkr/config/conf/.gitignore.example ./.gitignore
🎨 Custom
Take a look at the function signatures for exact details.
PHP CS Fixer
// ./.php-cs-fixer.dist.php <?php declare(strict_types=1); use Brnshkr\Config\PhpCsFixerConfig; return PhpCsFixerConfig::get(/* customize */);
Rector
// ./rector.php <?php declare(strict_types=1); use Brnshkr\Config\RectorConfig; return RectorConfig::get(/* customize */);
PHPStan
# phpstan.dist.neon includes: - '%currentWorkingDirectory%/vendor/brnshkr/config/conf/phpstan.dist.neon' # customize
👀 Usage
Run Tooling
This package provides configurations, not a hard requirement on how you run tools.
A few possible ways are listed below:
Option 1 — Run Tools Directly (Most Flexible)
PHP CS Fixer
Example call, adjust as needed
php ./vendor/bin/php-cs-fixer fix -v --show-progress=dots --config ./conf/.php-cs-fixer.php
Rector
Example call, adjust as needed
php ./vendor/bin/rector process --config ./conf/rector.php
PHPStan
Example call, adjust as needed
php ./vendor/bin/phpstan analyze --memory-limit=-1 --configuration ./conf/phpstan.neon
Option 2 — Run Helper Scripts (Make Only, @brnshkr Convention)
For these scripts to work you need to follow the convention of putting your configuration files into the ./conf directory (Exactly how it is done in this project as well).
Do not forget to setup your Makefile with this projects Makefile as a base:
include ./vendor/brnshkr/config/conf/Makefile
PHP CS Fixer
Expected configuration file: ./conf/.php-cs-fixer.php
make php-cs-fixer
Rector
Expected configuration file: ./conf/rector.php
make rector
PHPStan
Expected configuration file: ./conf/phpstan.neon
make phpstan
IDE Setup
When using the recommended way of putting config files into the ./conf directory it might be neccesary to instruct your IDE to read these files correctly.
If you need a VSCode setup and have the specific extensions installed you can take a look at the Project specific section in ./.vscode/settings.json.
Plugin Commands
Overview of all commands provided by the composer plugin.
For full usage run composer help <command>, composer <command> --help or composer <command> -h.
| Command | Alias | Description |
|---|---|---|
brnshkr:config |
b:c |
Displays the plugin overview and a list of available commands. Useful to quickly discover what the plugin exposes. |
brnshkr:config:setup [<modules>...] |
b:c:s |
Interactive setup helper: installs suggested packages for modules, copies example config files, and can create a Makefile and/or a .gitignore file. |
brnshkr:config:update-php-extensions |
b:c:upe |
Scans installed packages and updates composer.json with required ext-* platform packages. |
brnshkr:config:extract-phar <package> |
b:c:ep |
Extracts a .phar file from a given vendor package. |
💻 Development
Setup
Install dependencies and setup project tooling with the following commands and adjust as needed:
composer install \ && cp -v ./conf/.php-cs-fixer.php.example ./conf/.php-cs-fixer.php \ && cp -v ./conf/rector.php.example ./conf/rector.php \ && cp -v ./conf/phpstan.neon.example ./conf/phpstan.neon
Make
We recommend using GNU Make as the primary task runner.
See the Makefile for a full list of available targets.
You can also run make help or simply make to view all targets with brief descriptions.
If you need local overrides, create a ./.local/Makefile — the main Makefile automatically includes it if present.
Common targets
Here are some frequently used examples (see make help for the complete list):
make help— Show available targets and usagemake rector— Run Rector to apply automated PHP refactoringsmake php-cs-fixer— Run PHP-CS-Fixer to format and fix coding-style issuesmake phpstan— Run PHPStan static analysismake test— Run PHPUnit test suitemake test-update— Run PHPUnit test suite and update snapshotsmake check— Run Rector, PHP-CS-Fixer, PHPStan and PHPUnit
🔨 TODOs / Roadmap
- Add setup command for JS package (like
composer brnshkr:config:setup) - Expand
⚙️ Worflowssection in readme - Write sections about custom PHPStan and ESLint rules
- Add all around support for enforcing TypeScript aliases with ESLint
- Add Vue support
- Add React support
- Add Tailwind support via https://github.com/schoero/eslint-plugin-better-tailwindcss
- Improve test setup
Any help is always greatly appreciated 🙂
❤️ 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
💄 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.
Also please note the following additional information:
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.