@synergyerp/frontend-standards 1.1.3 → 1.2.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/eslint.config.js +44 -0
- package/package.json +1 -1
- package/scripts/check-modularization.mjs +2 -11
package/eslint.config.js
CHANGED
|
@@ -149,6 +149,50 @@ export default tseslint.config(
|
|
|
149
149
|
ignore: ['^[A-Z].*\\.tsx$'],
|
|
150
150
|
},
|
|
151
151
|
],
|
|
152
|
+
'no-restricted-syntax': [
|
|
153
|
+
'error',
|
|
154
|
+
{
|
|
155
|
+
selector: "VariableDeclarator[id.name='data']",
|
|
156
|
+
message:
|
|
157
|
+
"Variable name 'data' is banned (FRONTEND_STANDARDS.md Section 5.2). Use a descriptive name like 'users', 'response', etc.",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
selector: "VariableDeclarator[id.name='temp']",
|
|
161
|
+
message:
|
|
162
|
+
"Variable name 'temp' is banned. Use a descriptive name like 'formattedDate'.",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
selector: "VariableDeclarator[id.name='arr']",
|
|
166
|
+
message:
|
|
167
|
+
"Variable name 'arr' is banned. Use a descriptive name like 'permissions'.",
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
selector: "VariableDeclarator[id.name='obj']",
|
|
171
|
+
message:
|
|
172
|
+
"Variable name 'obj' is banned. Use a descriptive name like 'config'.",
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
selector: "VariableDeclarator[id.name='str']",
|
|
176
|
+
message:
|
|
177
|
+
"Variable name 'str' is banned. Use a descriptive name like 'message'.",
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
selector: "VariableDeclarator[id.name='result']",
|
|
181
|
+
message:
|
|
182
|
+
"Variable name 'result' is banned. Use a descriptive name like 'validationResult'.",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
selector: "VariableDeclarator[id.name='myVar']",
|
|
186
|
+
message:
|
|
187
|
+
"Variable name 'myVar' is banned. Use a descriptive name like 'username'.",
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
selector:
|
|
191
|
+
"FunctionDeclaration[id.name='handle'], FunctionExpression[id.name='handle']",
|
|
192
|
+
message:
|
|
193
|
+
"Function name 'handle' is banned. Use a descriptive name like 'handleFormSubmit'.",
|
|
194
|
+
},
|
|
195
|
+
],
|
|
152
196
|
|
|
153
197
|
// ===== REACT =====
|
|
154
198
|
'react/jsx-pascal-case': ['error', { allowAllCaps: true }],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synergyerp/frontend-standards",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "SynergyERP frontend standards — ESLint, Prettier, commitlint, Husky, Vitest, TypeScript configs, modularization enforcement, and PR templates.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -12,18 +12,9 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { existsSync, readdirSync, statSync } from 'fs';
|
|
15
|
-
import {
|
|
16
|
-
import { fileURLToPath } from 'url';
|
|
15
|
+
import { join } from 'path';
|
|
17
16
|
|
|
18
|
-
const
|
|
19
|
-
const __dirname = dirname(__filename);
|
|
20
|
-
|
|
21
|
-
// Resolve project root: 2 levels up from scripts/ when installed as node_modules
|
|
22
|
-
let PROJECT_ROOT = join(__dirname, '..', '..', '..');
|
|
23
|
-
// If running from the standards package itself, go up 1 level
|
|
24
|
-
if (!existsSync(join(PROJECT_ROOT, 'src'))) {
|
|
25
|
-
PROJECT_ROOT = join(__dirname, '..');
|
|
26
|
-
}
|
|
17
|
+
const PROJECT_ROOT = process.cwd();
|
|
27
18
|
|
|
28
19
|
const SRC = join(PROJECT_ROOT, 'src');
|
|
29
20
|
|