@activatus/code-standards 2.0.0 → 3.0.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 +12 -14
- package/docs/Guides/_category_.json +2 -2
- package/docs/Guides/migrating.md +50 -25
- package/docs/Guides/setup.md +52 -17
- package/docs/Standards/_category_.json +2 -2
- package/docs/Standards/agent-skills.md +29 -29
- package/docs/Standards/agent-specs.md +17 -32
- package/docs/Standards/direnv.mdx +8 -8
- package/docs/Standards/documentation.md +5 -2
- package/docs/Standards/editorconfig.md +23 -21
- package/docs/Standards/eslint.md +593 -402
- package/docs/Standards/human-readable-names.md +62 -22
- package/docs/Standards/lint-errors.md +3 -7
- package/docs/Standards/prettier.md +35 -26
- package/docs/Standards/readable-code.md +30 -0
- package/docs/Standards/stylelint.md +26 -11
- package/docs/Standards/styling.md +9 -3
- package/docs/Standards/tech-stack.md +3 -2
- package/docs/Structure/_category_.json +2 -2
- package/docs/Structure/component-organization.md +9 -2
- package/docs/Structure/folder-structure.md +26 -13
- package/docs/Structure/naming-conventions.md +0 -2
- package/docs/intro.md +1 -3
- package/docs/ontology.md +21 -26
- package/docs/templates.mdx +12 -49
- package/docs/version-history.md +143 -10
- package/package.json +6 -2
- package/scripts/renameSymbol.mjs +230 -0
- package/static/templates/.editorconfig +8 -11
- package/static/templates/AGENTS.md +16 -13
- package/static/templates/docs/development/coding-standards.md +4 -0
- package/static/templates/docsSite/docusaurus.config.mjs +144 -0
- package/static/templates/docsSite/sidebars.mjs +7 -0
- package/static/templates/docsSite/src/css/custom.css +6 -0
- package/static/templates/docsSite/tsconfig.json +5 -5
- package/static/templates/eslint/base/eslint.config.mjs +95 -70
- package/static/templates/eslint/nextjs/eslint.config.mjs +170 -126
- package/static/templates/eslint/react/eslint.config.mjs +160 -125
- package/static/templates/eslint/typescript/eslint.config.mjs +143 -115
- package/static/templates/globals.css +9 -9
- package/static/templates/next.config.mjs +13 -10
- package/static/templates/prettier.config.mjs +26 -0
- package/static/templates/stylelint/css/stylelint.config.mjs +37 -25
- package/static/templates/stylelint/scss/stylelint.config.mjs +10 -7
- package/docs/Standards/branch-naming.md +0 -66
- package/docs/Standards/conventional-commits.md +0 -189
- package/static/templates/.commitlintrc.json +0 -3
- package/static/templates/docsSite/docusaurus.config.ts +0 -119
- package/static/templates/docsSite/sidebars.ts +0 -8
- package/static/templates/husky/commit-msg +0 -1
- package/static/templates/husky/pre-commit +0 -1
- package/static/templates/prettier.config.js +0 -17
|
@@ -6,74 +6,99 @@ import unicorn from "eslint-plugin-unicorn";
|
|
|
6
6
|
import globals from "globals";
|
|
7
7
|
|
|
8
8
|
export default [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
9
|
+
{ ignores: ["dist/", "build/", "coverage/", "**/vendor/**"] },
|
|
10
|
+
js.configs.recommended,
|
|
11
|
+
comments.recommended,
|
|
12
|
+
importX.recommended,
|
|
13
|
+
unicorn.configs.recommended,
|
|
14
|
+
{
|
|
15
|
+
languageOptions: { globals: { ...globals.node } },
|
|
16
|
+
rules: {
|
|
17
|
+
"@eslint-community/eslint-comments/require-description":
|
|
18
|
+
"error",
|
|
19
|
+
"func-style": ["error", "expression"],
|
|
20
|
+
"max-depth": ["error", 3],
|
|
21
|
+
"max-lines": [
|
|
22
|
+
"error",
|
|
23
|
+
{ max: 300, skipBlankLines: true, skipComments: true },
|
|
24
|
+
],
|
|
25
|
+
"no-nested-ternary": "error",
|
|
26
|
+
"no-var": "error",
|
|
27
|
+
"prefer-arrow-callback": "error",
|
|
28
|
+
"prefer-const": "error",
|
|
29
|
+
"no-magic-numbers": [
|
|
30
|
+
"error",
|
|
31
|
+
{
|
|
32
|
+
ignore: [-1, 0, 1],
|
|
33
|
+
ignoreArrayIndexes: true,
|
|
34
|
+
ignoreDefaultValues: true,
|
|
35
|
+
enforceConst: true,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
"no-restricted-syntax": [
|
|
39
|
+
"error",
|
|
40
|
+
{
|
|
41
|
+
selector: "ClassDeclaration",
|
|
42
|
+
message: "Use functions, not classes.",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
selector: "ClassExpression",
|
|
46
|
+
message: "Use functions, not classes.",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
selector: "VariableDeclarator > FunctionExpression",
|
|
50
|
+
message: "Use an arrow function.",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
selector: "VariableDeclaration[kind='let']",
|
|
54
|
+
message:
|
|
55
|
+
"Use const. If this value really must be reassigned, disable this rule on this line with a comment saying why.",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
selector: "FunctionDeclaration[params.length>1]",
|
|
59
|
+
message:
|
|
60
|
+
"Use a single object parameter when a function needs more than one value.",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
selector:
|
|
64
|
+
"VariableDeclarator > :matches(ArrowFunctionExpression, FunctionExpression)[params.length>1]",
|
|
65
|
+
message:
|
|
66
|
+
"Use a single object parameter when a function needs more than one value.",
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
"import-x/no-cycle": "error",
|
|
70
|
+
"import-x/no-default-export": "error",
|
|
71
|
+
"no-use-before-define": "error",
|
|
72
|
+
"unicorn/default-export-style": "off",
|
|
73
|
+
"unicorn/filename-case": [
|
|
74
|
+
"error",
|
|
75
|
+
{ cases: { camelCase: true, pascalCase: true } },
|
|
76
|
+
],
|
|
77
|
+
"unicorn/name-replacements": [
|
|
78
|
+
"error",
|
|
79
|
+
{
|
|
80
|
+
// Dictionary words: see "Dictionary" in the Human-Readable Names standard.
|
|
81
|
+
replacements: {
|
|
82
|
+
docs: false,
|
|
83
|
+
lib: false,
|
|
84
|
+
props: false,
|
|
85
|
+
ref: false,
|
|
86
|
+
repo: false,
|
|
87
|
+
utils: false,
|
|
88
|
+
},
|
|
89
|
+
// Third-party names, allowed only exactly as they are.
|
|
90
|
+
allowList: { params: true, searchParams: true },
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
files: ["**/*.test.{js,mjs}"],
|
|
97
|
+
rules: { "max-lines": "off", "no-magic-numbers": "off" },
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
files: ["**/*.config.{js,mjs}"],
|
|
101
|
+
rules: { "import-x/no-default-export": "off" },
|
|
102
|
+
},
|
|
103
|
+
prettier,
|
|
79
104
|
];
|
|
@@ -8,130 +8,174 @@ import unicorn from "eslint-plugin-unicorn";
|
|
|
8
8
|
import globals from "globals";
|
|
9
9
|
|
|
10
10
|
export default [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
11
|
+
{
|
|
12
|
+
ignores: [
|
|
13
|
+
".next/",
|
|
14
|
+
"out/",
|
|
15
|
+
"build/",
|
|
16
|
+
"coverage/",
|
|
17
|
+
"next-env.d.ts",
|
|
18
|
+
"**/vendor/**",
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
...nextVitals,
|
|
22
|
+
...nextTypescript,
|
|
23
|
+
comments.recommended,
|
|
24
|
+
importX.recommended,
|
|
25
|
+
importX.typescript,
|
|
26
|
+
unicorn.configs.recommended,
|
|
27
|
+
{
|
|
28
|
+
languageOptions: {
|
|
29
|
+
globals: { ...globals.browser, ...globals.node },
|
|
30
|
+
},
|
|
31
|
+
settings: {
|
|
32
|
+
// Keep this. eslint-plugin-react crashes on ESLint 10 if it has to detect the version itself.
|
|
33
|
+
// Update the number when the project upgrades React.
|
|
34
|
+
react: { version: "19.0" },
|
|
35
|
+
"import-x/resolver-next": [createTypeScriptImportResolver()],
|
|
36
|
+
},
|
|
37
|
+
rules: {
|
|
38
|
+
"@eslint-community/eslint-comments/require-description":
|
|
39
|
+
"error",
|
|
40
|
+
"func-style": ["error", "expression"],
|
|
41
|
+
"max-depth": ["error", 3],
|
|
42
|
+
"max-lines": [
|
|
43
|
+
"error",
|
|
44
|
+
{ max: 300, skipBlankLines: true, skipComments: true },
|
|
45
|
+
],
|
|
46
|
+
"no-nested-ternary": "error",
|
|
47
|
+
"no-var": "error",
|
|
48
|
+
"prefer-arrow-callback": "error",
|
|
49
|
+
"prefer-const": "error",
|
|
50
|
+
"no-magic-numbers": [
|
|
51
|
+
"error",
|
|
52
|
+
{
|
|
53
|
+
ignore: [-1, 0, 1],
|
|
54
|
+
ignoreArrayIndexes: true,
|
|
55
|
+
ignoreDefaultValues: true,
|
|
56
|
+
enforceConst: true,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
"no-restricted-syntax": [
|
|
60
|
+
"error",
|
|
61
|
+
{
|
|
62
|
+
selector: "ClassDeclaration",
|
|
63
|
+
message: "Use functions, not classes.",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
selector: "ClassExpression",
|
|
67
|
+
message: "Use functions, not classes.",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
selector: "VariableDeclarator > FunctionExpression",
|
|
71
|
+
message: "Use an arrow function.",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
selector: "VariableDeclaration[kind='let']",
|
|
75
|
+
message:
|
|
76
|
+
"Use const. If this value really must be reassigned, disable this rule on this line with a comment saying why.",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
selector: "FunctionDeclaration[params.length>1]",
|
|
80
|
+
message:
|
|
81
|
+
"Use a single object parameter when a function needs more than one value.",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
selector:
|
|
85
|
+
"VariableDeclarator > :matches(ArrowFunctionExpression, FunctionExpression)[params.length>1]",
|
|
86
|
+
message:
|
|
87
|
+
"Use a single object parameter when a function needs more than one value.",
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
"import-x/no-cycle": "error",
|
|
91
|
+
"import-x/no-default-export": "error",
|
|
92
|
+
"no-use-before-define": "error",
|
|
93
|
+
"unicorn/default-export-style": "off",
|
|
94
|
+
"unicorn/filename-case": [
|
|
95
|
+
"error",
|
|
96
|
+
{ cases: { camelCase: true, pascalCase: true } },
|
|
97
|
+
],
|
|
98
|
+
"unicorn/name-replacements": [
|
|
99
|
+
"error",
|
|
100
|
+
{
|
|
101
|
+
// Dictionary words: see "Dictionary" in the Human-Readable Names standard.
|
|
102
|
+
replacements: {
|
|
103
|
+
docs: false,
|
|
104
|
+
lib: false,
|
|
105
|
+
props: false,
|
|
106
|
+
ref: false,
|
|
107
|
+
repo: false,
|
|
108
|
+
utils: false,
|
|
109
|
+
},
|
|
110
|
+
// Third-party names, allowed only exactly as they are.
|
|
111
|
+
allowList: { params: true, searchParams: true },
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
"react/function-component-definition": [
|
|
115
|
+
"error",
|
|
116
|
+
{
|
|
117
|
+
namedComponents: "arrow-function",
|
|
118
|
+
unnamedComponents: "arrow-function",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
"react/jsx-no-bind": "error",
|
|
122
|
+
"react/no-multi-comp": "error",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
files: ["**/*.{ts,tsx}"],
|
|
127
|
+
rules: {
|
|
128
|
+
"no-undef": "off",
|
|
129
|
+
"no-magic-numbers": "off",
|
|
130
|
+
"no-use-before-define": "off",
|
|
131
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
132
|
+
"error",
|
|
133
|
+
{ assertionStyle: "never" },
|
|
134
|
+
],
|
|
135
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
136
|
+
"@typescript-eslint/naming-convention": [
|
|
137
|
+
"error",
|
|
138
|
+
{
|
|
139
|
+
selector: ["typeAlias", "interface"],
|
|
140
|
+
format: ["PascalCase"],
|
|
141
|
+
custom: { regex: "(Props|Type)$", match: true },
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
145
|
+
"@typescript-eslint/no-magic-numbers": [
|
|
146
|
+
"error",
|
|
147
|
+
{
|
|
148
|
+
ignore: [-1, 0, 1],
|
|
149
|
+
ignoreArrayIndexes: true,
|
|
150
|
+
ignoreDefaultValues: true,
|
|
151
|
+
enforceConst: true,
|
|
152
|
+
ignoreEnums: true,
|
|
153
|
+
ignoreNumericLiteralTypes: true,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
157
|
+
"@typescript-eslint/no-use-before-define": "error",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
files: ["**/*.test.{ts,tsx}"],
|
|
162
|
+
rules: {
|
|
163
|
+
"max-lines": "off",
|
|
164
|
+
"no-magic-numbers": "off",
|
|
165
|
+
"@typescript-eslint/no-magic-numbers": "off",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
files: [
|
|
170
|
+
"**/*.config.{js,mjs,ts}",
|
|
171
|
+
"**/*.stories.tsx",
|
|
172
|
+
"app/**/{page,layout,template,default,loading,error,global-error,not-found}.tsx",
|
|
173
|
+
],
|
|
174
|
+
rules: { "import-x/no-default-export": "off" },
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
files: ["**/*.config.{js,mjs,ts}"],
|
|
178
|
+
rules: { "unicorn/no-top-level-side-effects": "off" },
|
|
179
|
+
},
|
|
180
|
+
prettier,
|
|
137
181
|
];
|