@devbie/style-guide 1.3.0 → 1.3.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/README.md +4 -0
- package/eslint/base.js +30 -2
- package/package.json +1 -1
- package/eslint/core.js +0 -37
package/README.md
CHANGED
|
@@ -87,6 +87,10 @@ default, only as a deliberate milestone.
|
|
|
87
87
|
|
|
88
88
|
## Changelog
|
|
89
89
|
|
|
90
|
+
- 1.3.1 — the internal `core` entry is inlined into `base` and removed. Nothing
|
|
91
|
+
imported it directly (`base` was its only consumer), and keeping two files
|
|
92
|
+
for one entry set made the loading order harder to read: `nest` and `next`
|
|
93
|
+
each also end on `prettierConfig`, so there is no shared tail to factor out.
|
|
90
94
|
- 1.3.0 — new `nest` layer backed by `@darraghor/eslint-plugin-nestjs-typed`
|
|
91
95
|
(recommended flat config, four type-aware rules), and `next` reshaped into a
|
|
92
96
|
layer. Consumers now compose `[...base, ...nest]` / `[...base, ...next]`;
|
package/eslint/base.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import tseslint from "typescript-eslint";
|
|
2
2
|
import prettierConfig from "eslint-config-prettier";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -10,7 +10,35 @@ import prettierConfig from "eslint-config-prettier";
|
|
|
10
10
|
* source registry) use `base` alone: every rule here is syntactic, so it runs
|
|
11
11
|
* without installing module dependencies.
|
|
12
12
|
*
|
|
13
|
+
* Formatting rules (quotes, eol-last, trailing spaces, ...) are deliberately
|
|
14
|
+
* absent: prettier owns formatting. `prettierConfig` is appended last so that
|
|
15
|
+
* composing a layer on top still ends on the formatting-rule shutdown.
|
|
16
|
+
*
|
|
13
17
|
* Repo-specific rules and ignores belong in the consumer's own
|
|
14
18
|
* eslint.config.mjs, spread after this entry.
|
|
15
19
|
*/
|
|
16
|
-
export default [
|
|
20
|
+
export default [
|
|
21
|
+
...tseslint.configs.recommended,
|
|
22
|
+
{
|
|
23
|
+
rules: {
|
|
24
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
25
|
+
"@typescript-eslint/no-unused-vars": [
|
|
26
|
+
"error",
|
|
27
|
+
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" },
|
|
28
|
+
],
|
|
29
|
+
|
|
30
|
+
// Code-quality rules carried over from the legacy gts-derived config.
|
|
31
|
+
"block-scoped-var": "error",
|
|
32
|
+
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
33
|
+
"no-var": "error",
|
|
34
|
+
"prefer-const": "error",
|
|
35
|
+
"prefer-arrow-callback": "error",
|
|
36
|
+
"no-restricted-properties": [
|
|
37
|
+
"error",
|
|
38
|
+
{ object: "describe", property: "only" },
|
|
39
|
+
{ object: "it", property: "only" },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
prettierConfig,
|
|
44
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devbie/style-guide",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Single source of truth for devbie ecosystem code style: shared prettier config and composable eslint flat layers (base, nest, next)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "worldzhy",
|
package/eslint/core.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import tseslint from "typescript-eslint";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Language-level baseline shared by every devbie codebase.
|
|
5
|
-
*
|
|
6
|
-
* Formatting rules (quotes, eol-last, trailing spaces, ...) are deliberately
|
|
7
|
-
* absent: prettier owns formatting. Every public entry appends
|
|
8
|
-
* eslint-config-prettier last so no plugin can re-enable eslint formatting
|
|
9
|
-
* rules afterwards.
|
|
10
|
-
*
|
|
11
|
-
* Internal entry: consumers import `base` (or compose a layer such as
|
|
12
|
-
* `nest` / `next` on top of it), never this file.
|
|
13
|
-
*/
|
|
14
|
-
export default [
|
|
15
|
-
...tseslint.configs.recommended,
|
|
16
|
-
{
|
|
17
|
-
rules: {
|
|
18
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
19
|
-
"@typescript-eslint/no-unused-vars": [
|
|
20
|
-
"error",
|
|
21
|
-
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" },
|
|
22
|
-
],
|
|
23
|
-
|
|
24
|
-
// Code-quality rules carried over from the legacy gts-derived config.
|
|
25
|
-
"block-scoped-var": "error",
|
|
26
|
-
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
27
|
-
"no-var": "error",
|
|
28
|
-
"prefer-const": "error",
|
|
29
|
-
"prefer-arrow-callback": "error",
|
|
30
|
-
"no-restricted-properties": [
|
|
31
|
-
"error",
|
|
32
|
-
{ object: "describe", property: "only" },
|
|
33
|
-
{ object: "it", property: "only" },
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
];
|