From a40efe672f5458ee6ca58d5ce32391f8221c24b9 Mon Sep 17 00:00:00 2001 From: Ifycode Date: Tue, 7 Apr 2026 22:28:49 +0100 Subject: [PATCH 1/4] Fix: Ensure consistency in file extensions for eslint and prettier --- README.md | 2 +- docs.users/README.md | 2 +- lint-staged.config.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ebf0182..7bea6ae 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ npm install -D @build-in-blocks/dev.setup // NOTE: Change folder name to where your ts files reside const TARGET_FOLDER = 'src'; - const TARGET_FILES = `${TARGET_FOLDER}/**/*.{ts,js,tsx}`; + const TARGET_FILES = `${TARGET_FOLDER}/**/*.{mjs,ts,js}`; export default defineConfig([ //------------------------------------------------------------------ diff --git a/docs.users/README.md b/docs.users/README.md index fe95c77..7cf37e3 100644 --- a/docs.users/README.md +++ b/docs.users/README.md @@ -88,7 +88,7 @@ import { defineConfig } from 'eslint/config'; import blocksDevSetupConfig from '@build-in-blocks/dev.setup'; const TARGET_FOLDER = 'src'; // NOTE: Change folder name to where your ts files reside -const TARGET_FILES = `${TARGET_FOLDER}/**/*.{ts,js,tsx}`; +const TARGET_FILES = `${TARGET_FOLDER}/**/*.{mjs,ts,js}`; export default defineConfig([ //--------------------------------------------------------------------------- diff --git a/lint-staged.config.js b/lint-staged.config.js index d3926ba..3eed321 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,5 +1,5 @@ export default { - '*.{js,jsx,ts,tsx}': [ + '*.{mjs,ts,js}': [ // Formats script file types 'eslint --fix', 'prettier --write', diff --git a/package.json b/package.json index 27a4485..d4f0822 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "scripts": { "eslint:lint": "eslint .", - "prettier:format": "prettier --write \"**/*.{js,ts,css,html}\"", + "prettier:format": "prettier --write \"**/*.{mjs,ts,js,html,css,scss}\"", "prepare": "husky" }, "dependencies": { From 39b38007165c730795db8bc132857094b83e52a3 Mon Sep 17 00:00:00 2001 From: Ifycode Date: Tue, 7 Apr 2026 22:43:14 +0100 Subject: [PATCH 2/4] Fix: Update prettier config and .gitignore --- .prettierignore | 9 ++++++--- docs.users/README.md | 4 ++++ prettier.config.mjs | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.prettierignore b/.prettierignore index 162a220..53a9a15 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,13 +4,16 @@ # 2. Allow directories !*/ -# 3. Specifically allow these FOUR types -!*.js +# 3. Specifically allow these SIX types +!*.mjs !*.ts -!*.css +!*.js !*.html +!*.css +!*.scss # 4. Standard ignores +.build-in-blocks/ node_modules/ build/ dist/ diff --git a/docs.users/README.md b/docs.users/README.md index 7cf37e3..1cc1664 100644 --- a/docs.users/README.md +++ b/docs.users/README.md @@ -41,6 +41,8 @@ In addition to `prettier`'s default settings, our preconfigured settings tells ` - Add trailing comma to the last item in an object - End every single code statement with a semicolon - Ensure that every file ends with exactly one empty line +- Allow e.g. import statements, function arguments etc. to be on straight line without breaking (only wrap to next line if printWidth exceeds 350) +- Add spaces between brackets in object literals, imports, and similar structures ```` { @@ -50,6 +52,8 @@ In addition to `prettier`'s default settings, our preconfigured settings tells ` trailingComma: 'all', semi: true, endOfLine: 'lf', + printWidth: 350, + bracketSpacing: true, }; ```` diff --git a/prettier.config.mjs b/prettier.config.mjs index 6baf04e..68ff83e 100644 --- a/prettier.config.mjs +++ b/prettier.config.mjs @@ -5,4 +5,6 @@ export default { trailingComma: 'all', semi: true, endOfLine: 'lf', + printWidth: 350, + bracketSpacing: true, }; From cb48b682510f6e3932ef9aa7c66353edf850e784 Mon Sep 17 00:00:00 2001 From: Ifycode Date: Tue, 7 Apr 2026 23:06:46 +0100 Subject: [PATCH 3/4] Fix: Root README structure fix, minor fixes to user doc --- README.md | 18 ++++++++++++++---- docs.users/README.md | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7bea6ae..ae9a677 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,24 @@ # @build-in-blocks/dev.setup -**Supported Node.js versions:** Node.js v20.x, v22.x, v24.x and v25.x +![Latest Version](https://img.shields.io/npm/v/@build-in-blocks/dev.setup.svg?label=latest&color=brightgreen&style=flat-square) ![NPM Downloads](https://img.shields.io/npm/d18m/%40build-in-blocks%2Fdev.setup?color=blue&label=downloads%20(last%2018%20months)) ![build passing](https://img.shields.io/badge/build-passing-brightgreen?style=flat-square) + +[![License: AGPL v3.0](https://img.shields.io/badge/license-AGPL%20v3.0-blue.svg?style=flat-square)](https://www.gnu.org/licenses/agpl-3.0) [![All Contributors](https://img.shields.io/github/all-contributors/build-in-blocks/dev.setup?color=ee8449&style=flat-square)](#contributors) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat-square)](https://github.com/build-in-blocks/dev.setup/blob/develop/docs.contributors/README.md) + +# + +**Built with:** Node.js v24.0.2 + +# + +**Supported Node.js versions:** Node.js v20.x, v22.x, v24.x and v25.x - Monitored by (internal) central Blocks CI # -**Description:** Code linting, formatting, pre-commit hook and GitHub actions development environment setup for your `typescript` code repository. +**Overview:** Code linting, formatting, pre-commit hook and GitHub actions development environment setup for your `typescript` code repository. # -**How it works:** Using code quality checks from `eslint`, `husky` works with `lint-staged` to prevent code that don't meet your code quality requirements, from being commited to git and pushed to your repository's remote - it also formats your code with `prettier` based on your code formatting preferences at this point. `GitHub Actions` then runs the code quality and node version compatibilty checks on pull requests, on push or on merge to your repository's `develop` and/or `main` branch. Ensuring code from all code contributors working on your project pass through the quality checks that you've configured. +**Description:** **@build-in-blocks/dev.setup** provides TS development environment setup and comes with preconfigured settings. It helps to automate code compatibilty, quality and formatting checks within your typescript code repository's Git workflow, ensuring that only clean, consistent code is committed to the repository. It also includes GitHub Actions Continuous Integration (CI) setup for running these checks on the contributions submitted to your repository, by your open source contributors or work colleagues. Of course, you can configure it to use your preferred settings too. # @@ -230,7 +240,7 @@ Make sure to add and commit all your setup files to git, and push/merge it to yo ### Contributors -[![All Contributors](https://img.shields.io/github/all-contributors/build-in-blocks/dev.setup?color=ee8449&style=flat-square)](#contributors) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/build-in-blocks/dev.setup/blob/develop/docs.contributors/README.md) [![License: AGPL v3.0](https://img.shields.io/badge/License-AGPL%20v3.0-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) +Thanks to these amazing contributors to the **@build-in-blocks/dev.setup** project. This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. See [emoji key](https://allcontributors.org/docs/en/emoji-key). Contributions of any kind welcome! diff --git a/docs.users/README.md b/docs.users/README.md index 1cc1664..b1046f1 100644 --- a/docs.users/README.md +++ b/docs.users/README.md @@ -61,8 +61,8 @@ In addition to `prettier`'s default settings, our preconfigured settings tells ` ### Preconfigured Husky + lint-staged settings -- Run `eslint` and `prettier` anytime a developer tries to commit code to git. -- Prevent code commit to git when any of the code linting and formatting requirements are not met. +- Runs `eslint` and `prettier` anytime a developer tries to commit code to git. +- Prevents code commit to git when any of the code linting and formatting requirements are not met. # From b7560ed09381dc046409446e9f32df37ebdb0708 Mon Sep 17 00:00:00 2001 From: Ifycode Date: Tue, 7 Apr 2026 23:07:36 +0100 Subject: [PATCH 4/4] Fix: package.json keyword consistency with other blocks packages --- package.json | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d4f0822..6883d61 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,17 @@ "framework", "library", "package", + "typescript", + "javascript", + "node", + "web", + "shared", + "core", + "local development", + "local", + "development", + "dev", + "setup", "eslint", "prettier", "husky", @@ -60,12 +71,7 @@ "pre-commit hook", "code quality", "code formatting", - "typescript", - "javascript", - "node", "config", - "setup", - "dev environment", "ci", "continuous integration" ],