eslint-plugin-strict-eg-rulez 2.1.1 → 2.1.3
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 +22 -31
- package/dist/index.d.ts +15 -15
- package/dist/index.js +9 -9
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# eslint-plugin-eg-
|
|
1
|
+
# eslint-plugin-strict-eg-rulez
|
|
2
2
|
|
|
3
3
|
A collection of custom ESLint rules for React + TypeScript projects. Designed to enforce consistency, readability, and maintainability across frontend codebases.
|
|
4
4
|
|
|
@@ -24,7 +24,7 @@ A collection of custom ESLint rules for React + TypeScript projects. Designed to
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npm install eslint-plugin-eg-
|
|
27
|
+
npm install eslint-plugin-strict-eg-rulez --save-dev
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
> **Peer dependency:** ESLint `>=8.0.0` is required.
|
|
@@ -33,38 +33,29 @@ npm install eslint-plugin-eg-rules --save-dev
|
|
|
33
33
|
|
|
34
34
|
## Usage
|
|
35
35
|
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
...egRules.configs.recommended.rules,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
];
|
|
36
|
+
`.eslintrc.cjs` or `.eslintrc.json` (Legacy Config):
|
|
37
|
+
|
|
38
|
+
Using the recommended config:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"plugins": ["strict-eg-rulez"],
|
|
43
|
+
"extends": [
|
|
44
|
+
"plugin:strict-eg-rulez/recommended"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
51
47
|
```
|
|
52
48
|
|
|
53
49
|
Or configure rules individually:
|
|
54
50
|
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
'eg-rules/boolean-prop-naming': 'warn',
|
|
64
|
-
// ...
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
];
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"plugins": ["strict-eg-rulez"],
|
|
54
|
+
"rules": {
|
|
55
|
+
"strict-eg-rulez/api-type-suffix": "error",
|
|
56
|
+
"strict-eg-rulez/boolean-prop-naming": "warn"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
68
59
|
```
|
|
69
60
|
|
|
70
61
|
---
|
|
@@ -442,7 +433,7 @@ npm run lint
|
|
|
442
433
|
recommended: {
|
|
443
434
|
rules: {
|
|
444
435
|
// ...
|
|
445
|
-
'eg-
|
|
436
|
+
'strict-eg-rulez/my-new-rule': 'error',
|
|
446
437
|
},
|
|
447
438
|
},
|
|
448
439
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
export declare const rules: {
|
|
2
2
|
'api-type-suffix': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"invalidSuffix" | "consecutiveSuffix", [{
|
|
3
3
|
suffixes?: string[];
|
|
4
|
-
}],
|
|
4
|
+
}], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
5
5
|
'component-callback-naming': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"invalidCallbackProp" | "pastTenseEvent" | "blacklistedEvent", [{
|
|
6
6
|
allowPastTense?: boolean;
|
|
7
7
|
blacklist?: string[];
|
|
8
8
|
whitelist?: string[];
|
|
9
|
-
}],
|
|
9
|
+
}], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
10
10
|
'jsx-event-handler-naming': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"missingHandlePrefix" | "strictMismatch", [{
|
|
11
11
|
strict?: boolean;
|
|
12
|
-
}],
|
|
13
|
-
'functions-naming': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"missingRenderPrefix" | "missingBooleanPrefix" | "missingValuePrefix", [],
|
|
12
|
+
}], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
13
|
+
'functions-naming': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"missingRenderPrefix" | "missingBooleanPrefix" | "missingValuePrefix", [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
14
14
|
'boolean-prop-naming': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"missingPrefix", [{
|
|
15
15
|
prefixes?: string[];
|
|
16
|
-
}],
|
|
16
|
+
}], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
17
17
|
'test-statement-match': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"itMustStartWithShould" | "testMustContainConjunction", [{
|
|
18
18
|
conjunctions?: string[];
|
|
19
19
|
ignoreTestPatterns?: string[];
|
|
20
|
-
}],
|
|
20
|
+
}], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
21
21
|
'react-component-layout': import("eslint").Rule.RuleModule;
|
|
22
22
|
'no-test-attrs': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noTestAttr", [{
|
|
23
23
|
attrs?: string[];
|
|
24
|
-
}],
|
|
24
|
+
}], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
25
25
|
};
|
|
26
26
|
export declare const configs: {
|
|
27
27
|
recommended: {
|
|
28
28
|
plugins: string[];
|
|
29
29
|
rules: {
|
|
30
|
-
'eg-
|
|
31
|
-
'eg-
|
|
32
|
-
'eg-
|
|
33
|
-
'eg-
|
|
34
|
-
'eg-
|
|
35
|
-
'eg-
|
|
36
|
-
'eg-
|
|
37
|
-
'eg-
|
|
30
|
+
'strict-eg-rulez/api-type-suffix': string;
|
|
31
|
+
'strict-eg-rulez/component-callback-naming': string;
|
|
32
|
+
'strict-eg-rulez/jsx-event-handler-naming': string;
|
|
33
|
+
'strict-eg-rulez/functions-naming': string;
|
|
34
|
+
'strict-eg-rulez/boolean-prop-naming': string;
|
|
35
|
+
'strict-eg-rulez/test-statement-match': string;
|
|
36
|
+
'strict-eg-rulez/react-component-layout': string;
|
|
37
|
+
'strict-eg-rulez/no-test-attrs': string;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
};
|
package/dist/index.js
CHANGED
|
@@ -23,16 +23,16 @@ exports.rules = {
|
|
|
23
23
|
'no-test-attrs': no_test_attrs_1.default,
|
|
24
24
|
};
|
|
25
25
|
const legacyRecommended = {
|
|
26
|
-
plugins: ['eg-
|
|
26
|
+
plugins: ['strict-eg-rulez'],
|
|
27
27
|
rules: {
|
|
28
|
-
'eg-
|
|
29
|
-
'eg-
|
|
30
|
-
'eg-
|
|
31
|
-
'eg-
|
|
32
|
-
'eg-
|
|
33
|
-
'eg-
|
|
34
|
-
'eg-
|
|
35
|
-
'eg-
|
|
28
|
+
'strict-eg-rulez/api-type-suffix': 'error',
|
|
29
|
+
'strict-eg-rulez/component-callback-naming': 'error',
|
|
30
|
+
'strict-eg-rulez/jsx-event-handler-naming': 'error',
|
|
31
|
+
'strict-eg-rulez/functions-naming': 'error',
|
|
32
|
+
'strict-eg-rulez/boolean-prop-naming': 'error',
|
|
33
|
+
'strict-eg-rulez/test-statement-match': 'error',
|
|
34
|
+
'strict-eg-rulez/react-component-layout': 'warn',
|
|
35
|
+
'strict-eg-rulez/no-test-attrs': 'error',
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
exports.configs = {
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-strict-eg-rulez",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Custom ESLint rules for frontend",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"test": "vitest"
|
|
9
|
+
"test": "vitest",
|
|
10
|
+
"prepublishOnly": "npm run build"
|
|
10
11
|
},
|
|
11
12
|
"keywords": [
|
|
12
13
|
"eslint",
|
|
@@ -19,10 +20,11 @@
|
|
|
19
20
|
"eslint": ">=8.0.0"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
23
|
+
"@types/eslint": "^9.6.1",
|
|
22
24
|
"@types/node": "^25.3.2",
|
|
23
25
|
"@typescript-eslint/parser": "^8.56.1",
|
|
24
26
|
"@typescript-eslint/rule-tester": "^8.56.1",
|
|
25
|
-
"eslint": "^
|
|
27
|
+
"eslint": "^8.57.0",
|
|
26
28
|
"typescript": "^5.9.3",
|
|
27
29
|
"vitest": "^3.2.4"
|
|
28
30
|
},
|
|
@@ -30,6 +32,6 @@
|
|
|
30
32
|
"dist"
|
|
31
33
|
],
|
|
32
34
|
"dependencies": {
|
|
33
|
-
"@typescript-eslint/utils": "^
|
|
35
|
+
"@typescript-eslint/utils": "^7.18.0"
|
|
34
36
|
}
|
|
35
|
-
}
|
|
37
|
+
}
|