@peerigon/configs 14.0.7 → 14.1.0
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/CHANGELOG.md +14 -0
- package/ai/coding-styleguide-js-ts.mdc +15 -1
- package/dist/eslint/presets/javascript-browser.js +1 -0
- package/dist/eslint/presets/javascript-node.js +1 -0
- package/dist/eslint/presets/typescript-node.js +1 -0
- package/dist/eslint/presets/typescript-react.js +1 -0
- package/dist/eslint/presets/typescript.js +1 -0
- package/dist/eslint/rules/base.js +1 -0
- package/dist/eslint/rules/browser.js +1 -0
- package/dist/eslint/rules/javascript.js +1 -0
- package/dist/eslint/rules/node.js +1 -0
- package/dist/eslint/rules/playwright.js +1 -0
- package/dist/eslint/rules/react.js +1 -0
- package/dist/eslint/rules/tanstack-query.js +1 -0
- package/dist/eslint/rules/typescript.js +1 -0
- package/dist/eslint/rules/vitest.js +1 -0
- package/dist/eslint/styles/jsx-no-literals.js +1 -0
- package/dist/eslint/styles/no-default-export.js +1 -0
- package/dist/eslint/styles/no-null.js +1 -0
- package/dist/eslint/styles/prefer-array-shorthand.js +1 -0
- package/dist/eslint/styles/prefer-interface.js +1 -0
- package/dist/prettier/base.js +1 -0
- package/dist/semantic-release/base.js +1 -0
- package/dist/semantic-release/cross-publish.js +23 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [14.1.0](https://github.com/peerigon/configs/compare/v14.0.8...v14.1.0) (2026-02-13)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- Add file and class structure to coding style guidelines ([265c438](https://github.com/peerigon/configs/commit/265c4383d95cd4748d9c94fd6266cf3b3b54cad7))
|
|
6
|
+
|
|
7
|
+
## [14.0.8](https://github.com/peerigon/configs/compare/v14.0.7...v14.0.8) (2026-02-12)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- Do not try to publish unscoped packages on Github ([99c5846](https://github.com/peerigon/configs/commit/99c5846a7b130e6e8355781a82bc4f1cc1b4daca))
|
|
12
|
+
- Remove [@ts-self-types](https://github.com/ts-self-types) annotation ([9590c6f](https://github.com/peerigon/configs/commit/9590c6f12a434f17eb9c71d9096a7698e83b0212))
|
|
13
|
+
- Restore original jsr.json config ([7c3e1d5](https://github.com/peerigon/configs/commit/7c3e1d568b8f783ed8afad8d4894a64aa30a9f27))
|
|
14
|
+
|
|
1
15
|
## [14.0.7](https://github.com/peerigon/configs/compare/v14.0.6...v14.0.7) (2026-02-10)
|
|
2
16
|
|
|
3
17
|
### Bug Fixes
|
|
@@ -20,6 +20,15 @@ globs: **/*.js, **/*.ts, **/*.mjs, **/*.cjs, **/*.mts, **/*.cts
|
|
|
20
20
|
- Avoid default imports and default exports
|
|
21
21
|
- Avoid barrel files (index files that only re-export) unless its a package entry file
|
|
22
22
|
|
|
23
|
+
## File structure
|
|
24
|
+
|
|
25
|
+
- Begin with a `@file` overview JSDoc comment (**not** for test or config files)
|
|
26
|
+
- Then imports
|
|
27
|
+
- Then important top-level constants or variables
|
|
28
|
+
- Then order by importance (in relation to the file purpose): the most important classes/functions of the file should be at the beginning
|
|
29
|
+
- Unimportant helper functions and variables should be at the bottom of the file
|
|
30
|
+
- Exception: when module execution requires a function to be defined before it is used, define it earlier
|
|
31
|
+
|
|
23
32
|
## Naming Conventions
|
|
24
33
|
|
|
25
34
|
- `camelCase` for variables, functions, methods
|
|
@@ -63,6 +72,12 @@ globs: **/*.js, **/*.ts, **/*.mjs, **/*.cjs, **/*.mts, **/*.cts
|
|
|
63
72
|
- Write pure functions when possible
|
|
64
73
|
- Optimize function names for readability on the call side
|
|
65
74
|
|
|
75
|
+
## Class structure
|
|
76
|
+
|
|
77
|
+
- Constructor **must** be at the top of the class
|
|
78
|
+
- Then properties: public first, then private; order by importance in relation to the class purpose
|
|
79
|
+
- Then methods: public first, then private; order by importance in relation to the class purpose
|
|
80
|
+
|
|
66
81
|
## Types
|
|
67
82
|
|
|
68
83
|
- Use strict mode
|
|
@@ -81,7 +96,6 @@ globs: **/*.js, **/*.ts, **/*.mjs, **/*.cjs, **/*.mts, **/*.cts
|
|
|
81
96
|
## Comments
|
|
82
97
|
|
|
83
98
|
- Use JSDoc comments and its tags where appropriate
|
|
84
|
-
- When generating new files, include a `@file` overview at the top of the file (**not** for test files or config files)
|
|
85
99
|
|
|
86
100
|
## Testing
|
|
87
101
|
|
package/dist/prettier/base.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// @ts-self-types="./cross-publish.d.ts"
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
1
4
|
import { config as baseConfig } from "./base.js";
|
|
2
5
|
/**
|
|
3
6
|
* Generic semantic-release config shape for portable declaration output.
|
|
@@ -11,7 +14,10 @@ import { config as baseConfig } from "./base.js";
|
|
|
11
14
|
* @param {{ github: boolean; jsr: boolean }} options?
|
|
12
15
|
* @returns {SemanticReleaseConfig}
|
|
13
16
|
*/
|
|
14
|
-
export function config({ github =
|
|
17
|
+
export function config({ github = defaultGithub, jsr = false } = {
|
|
18
|
+
github: defaultGithub,
|
|
19
|
+
jsr: true,
|
|
20
|
+
}) {
|
|
15
21
|
/** @type {unknown[]} */
|
|
16
22
|
const plugins = [];
|
|
17
23
|
if (baseConfig.plugins) {
|
|
@@ -40,4 +46,20 @@ export function config({ github = false, jsr = false } = { github: true, jsr: tr
|
|
|
40
46
|
plugins,
|
|
41
47
|
};
|
|
42
48
|
}
|
|
49
|
+
const defaultGithub = (() => {
|
|
50
|
+
try {
|
|
51
|
+
const packageJsonPath = resolve(process.cwd(), "package.json");
|
|
52
|
+
const packageJsonContent = readFileSync(packageJsonPath, "utf8");
|
|
53
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
54
|
+
if (typeof packageJson !== "object" || packageJson === null) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const typedPackageJson = /** @type {{ name?: unknown }} */ (packageJson);
|
|
58
|
+
const name = typedPackageJson.name;
|
|
59
|
+
return typeof name === "string" && name.startsWith("@");
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
})();
|
|
43
65
|
export default config();
|