@meistrari/mise-en-place 2.9.0 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +2 -1
- package/README.md +39 -11
- package/dist/eslint.mjs +15 -2
- package/package.json +1 -1
package/Makefile
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
default: help
|
|
3
3
|
|
|
4
4
|
_MISE_EN_PLACE_PACKAGE_NAME = @meistrari/mise-en-place
|
|
5
|
+
MISE_EN_PLACE_INSTALL_DIR ?= .
|
|
5
6
|
|
|
6
7
|
# region Public commands
|
|
7
8
|
|
|
@@ -21,7 +22,7 @@ mise-en-place: .editorconfig ## Setup the mise en place to start cooking
|
|
|
21
22
|
.PHONY: help
|
|
22
23
|
help:
|
|
23
24
|
@echo "Make tasks:"
|
|
24
|
-
@grep -hE '^[%a-zA-Z_-]+:.*?## .*$$' Makefile
|
|
25
|
+
@grep -hE '^[%a-zA-Z_-]+:.*?## .*$$' Makefile $(MISE_EN_PLACE_INSTALL_DIR)/node_modules/$(_MISE_EN_PLACE_PACKAGE_NAME)/Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-17s\033[0m %s\n", $$1, $$2}'
|
|
25
26
|
@echo ""
|
|
26
27
|
|
|
27
28
|
# endregion
|
package/README.md
CHANGED
|
@@ -15,30 +15,41 @@ Add `mise-en-place postinstall` to your project's `package.json` `postinstall` s
|
|
|
15
15
|
}
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Then install the package as a development dependency:
|
|
18
|
+
Then install the package as a development dependency and run the postinstall script:
|
|
19
19
|
```sh
|
|
20
|
-
|
|
20
|
+
bun i -D @meistrari/mise-en-place
|
|
21
|
+
bunx mise-en-place postinstall
|
|
21
22
|
```
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
It will also setup the initial _mise-en-place_ in your project.
|
|
24
|
+
It will also setup the initial _mise-en-place_ in your project. Which includes:
|
|
25
|
+
- Adding a `Makefile` with useful commands.
|
|
26
|
+
- Adding an `.editorconfig` file.
|
|
27
|
+
- Adding ESLint configuration.
|
|
28
|
+
- Adding TypeScript configuration.
|
|
29
|
+
- Setting up `postinstall` script to keep all `@meistrari/*` packages up to date.
|
|
30
30
|
|
|
31
31
|
# Features
|
|
32
32
|
|
|
33
33
|
## Keep all @meistrari/* packages up to date
|
|
34
|
-
By adding the `postinstall` script
|
|
34
|
+
By adding the `postinstall` script to run `mise-en-place postinstall`, every time you run install your dependencies, it will check for the latest versions of all `@meistrari/*` packages in your project and update them if necessary.
|
|
35
|
+
|
|
36
|
+
This process will add a leading caret (`^`) to the version range if it is not already present. Which means that it will update to the latest minor and patch versions automatically but never the major version.
|
|
35
37
|
|
|
36
38
|
## Makefile
|
|
37
39
|
Commands with `##` after the target are 'public' commands and are intended to be used by developers and will show up in the help message.
|
|
40
|
+
|
|
38
41
|
The other commands are 'hidden' and are intended to be used by automations or by other 'public' commands.
|
|
39
42
|
|
|
43
|
+
If you installed `@meistrari/mise-en-place` on a parent directory, you may need to set the `MISE_EN_PLACE_INSTALL_DIR` variable before including the `Makefile`:
|
|
44
|
+
|
|
45
|
+
```Makefile
|
|
46
|
+
MISE_EN_PLACE_INSTALL_DIR=.. # Parent directory
|
|
47
|
+
-include $(MISE_EN_PLACE_INSTALL_DIR)/node_modules/@meistrari/mise-en-place/Makefile
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
40
51
|
## EditorConfig
|
|
41
|
-
|
|
52
|
+
Since the editorconfig file [don't support extending from other files](https://github.com/editorconfig/editorconfig/issues/236), the postinstall script will always copy the `.editorconfig` file from this project to your project root.
|
|
42
53
|
|
|
43
54
|
## Eslint Config
|
|
44
55
|
Add the following code in your `eslint.config.mjs` to include this project's ESLint configuration:
|
|
@@ -47,6 +58,23 @@ Add the following code in your `eslint.config.mjs` to include this project's ESL
|
|
|
47
58
|
export { default } from '@meistrari/mise-en-place/eslint'
|
|
48
59
|
```
|
|
49
60
|
|
|
61
|
+
> If some rules needs to be updated, you can update the rules in this project (preferrable) or customize them in your own configuration (not preferrable).
|
|
62
|
+
> You probably don't need to customize the configuration, since it is already designed to be a good starting point for most projects.
|
|
63
|
+
> Remember that customizing too much can make your project diverge from the standard and make it harder to maintain.
|
|
64
|
+
|
|
65
|
+
If you understand the risk and NEED to customize the configuration, you can import the default configuration and extend it:
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
import miseEnPlaceEslintConfig from '@meistrari/mise-en-place/eslint'
|
|
69
|
+
|
|
70
|
+
export default miseEnPlaceEslintConfig
|
|
71
|
+
.append({
|
|
72
|
+
rules: {
|
|
73
|
+
// your custom rules here
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
```
|
|
77
|
+
|
|
50
78
|
## TSConfig
|
|
51
79
|
|
|
52
80
|
Add the following code in your `tsconfig.json` to include this project's TypeScript configuration:
|
package/dist/eslint.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import antfu from '@antfu/eslint-config';
|
|
2
|
-
import drizzle from 'eslint-plugin-drizzle';
|
|
3
2
|
import * as eslintPluginDiff from 'eslint-plugin-diff';
|
|
3
|
+
import drizzle from 'eslint-plugin-drizzle';
|
|
4
4
|
|
|
5
5
|
const isCI = process.env.CI === "true";
|
|
6
6
|
const eslintConfig = antfu(
|
|
@@ -24,7 +24,12 @@ const eslintConfig = antfu(
|
|
|
24
24
|
overridesTypeAware: {
|
|
25
25
|
"ts/no-floating-promises": "error",
|
|
26
26
|
"ts/no-unnecessary-condition": "error",
|
|
27
|
-
"ts/return-await": ["error", "always"]
|
|
27
|
+
"ts/return-await": ["error", "always"],
|
|
28
|
+
/**
|
|
29
|
+
* Rule docs do not recommend this for newer TS Projects since the compiler already checks this
|
|
30
|
+
* @see {@link https://typescript-eslint.io/rules/no-redeclare/}
|
|
31
|
+
*/
|
|
32
|
+
"ts/no-redeclare": "off"
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
35
|
ignores: [
|
|
@@ -39,6 +44,14 @@ const eslintConfig = antfu(
|
|
|
39
44
|
"**/node_modules"
|
|
40
45
|
],
|
|
41
46
|
rules: {
|
|
47
|
+
// All the 'no-unsafe-*' rules cause too much noise and end up having us jumping through hoops to
|
|
48
|
+
// satisfy the linter with no actual runtime benefits. We can enable them again if we figure out a way to make them less noisy or more useful.
|
|
49
|
+
"ts/no-unsafe-assignment": "off",
|
|
50
|
+
"ts/no-unsafe-argument": "off",
|
|
51
|
+
"ts/no-unsafe-member-acces": "off",
|
|
52
|
+
"ts/no-unsafe-return": "off",
|
|
53
|
+
// No actual harm in unnecessary conditions. This is just a stylistic choice
|
|
54
|
+
"ts/no-unnecessary-condition": "off",
|
|
42
55
|
"ts/strict-boolean-expressions": "off",
|
|
43
56
|
"node/prefer-global/process": ["off", "always"],
|
|
44
57
|
"ts/consistent-type-definitions": "off",
|