Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .eslintrc.js

This file was deleted.

29 changes: 28 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,31 @@ serve: install
$(YARN) run start


#
upgrade:\
.git/hooks/commit-msg\
upgrade-remove-husky\
upgrade-eslint
@# Upgrade target, depends on other upgrades


upgrade-remove-husky:
test -d .husky\
&& rm -R .husky\
&& git add .husky\
&& git commit -m"maint: @patternslib/dev upgrade - remove .husky directory in favor of git hooks."\
|| :
-git config --unset core.hooksPath


eslint.config.js upgrade-eslint:
test -f "eslint.config.js"\
|| (\
echo 'module.exports = require("@patternslib/dev/eslint.config.js");' > eslint.config.js\
&& git add eslint.config.js\
&& git commit -m"maint: @patternslib/dev upgrade - create eslint.config.js."\
)
test -f ".eslintrc.js"\
&& rm .eslintrc.js\
&& git add .eslintrc.js\
&& git commit -m"maint: @patternslib/dev upgrade - remove old .eslintrc.js."\
|| :
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# Development helpers and config for Patternslib and add-ons.

This repository includes base files which are extended in Patternslib, Mockup or other projects.

It includes a Makefile which helps in installing and releasing packages.

## Upgrading

Run `make upgrade` in your project.

Alternatively, if there is a new `@patternslib/dev` version installed, the `postinstall` package.json script will automatically run `make upgrade` in the directory where package installer was invoked, that is your project directory which depends on `@patternslib/dev`.


## Code style

The release process based on release-it includes automatic changelog generation via conventional-commit, commitlint and a pre-commit hook by husky.
The release process based on release-it includes automatic changelog generation via conventional-commit, commitlint and a git pre-commit hook.
Please check the [code style guide](https://github.com/Patternslib/Patterns/blob/master/docs/developer/styleguide.md#commits-messages) for the commit specification!

37 changes: 37 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const js = require("@eslint/js");
const config_prettier = require("eslint-config-prettier");
const globals = require("globals");
const babel_parser = require("@babel/eslint-parser");

module.exports = [
js.configs.recommended,
config_prettier,
{
languageOptions: {
ecmaVersion: 2022,
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
parser: babel_parser,
},
ignores: [
"cache/",
"coverage/",
"dist/",
"node_modules/",
"stats.json",
"style/",
],
rules: {
"no-debugger": 1,
"no-duplicate-imports": 1,
// Do keep due avoid unintendet consequences.
"no-alert": 0,
"no-control-regex": 0,
"no-self-assign": 0,
"no-useless-escape": 0,
},
}
];
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
"@release-it/conventional-changelog": "^10.0.0",
"babel-loader": "^9.2.1",
"css-loader": "^7.1.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint": "^9.20.1",
"eslint-config-prettier": "^10.0.1",
"globals": "^15.15.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand All @@ -37,6 +38,7 @@
"node": ">=18.18"
},
"scripts": {
"postinstall": "cd $INIT_CWD && make upgrade",
"test": "jest"
},
"author": {
Expand Down
Loading