eslint-plugin-th-rules 3.1.4 → 3.1.6
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 +17 -2
- package/dist/configs/bundles/recommended-react.d.ts.map +1 -1
- package/dist/configs/bundles/recommended-typescript-react.d.ts.map +1 -1
- package/dist/configs/bundles/recommended-typescript-react.js +1 -5
- package/dist/configs/bundles/recommended-typescript.d.ts.map +1 -1
- package/dist/configs/bundles/recommended-typescript.js +1 -4
- package/dist/configs/bundles/recommended.d.ts.map +1 -1
- package/dist/configs/bundles/recommended.js +1 -5
- package/dist/configs/core/base.d.ts.map +1 -1
- package/dist/configs/core/react.d.ts.map +1 -1
- package/dist/configs/core/typescript.d.ts.map +1 -1
- package/dist/configs/externals/base.d.ts.map +1 -1
- package/dist/configs/externals/base.js +2 -1
- package/dist/configs/externals/opinionated.d.ts.map +1 -1
- package/dist/configs/externals/opinionated.js +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/rules/no-boolean-coercion.d.ts.map +1 -1
- package/dist/rules/no-boolean-coercion.js +6 -19
- package/dist/rules/no-comments.d.ts.map +1 -1
- package/dist/rules/no-comments.js +3 -6
- package/dist/rules/no-default-export.d.ts.map +1 -1
- package/dist/rules/no-default-export.js +2 -7
- package/dist/rules/no-destructuring.d.ts.map +1 -1
- package/dist/rules/no-destructuring.js +2 -4
- package/dist/rules/prefer-is-empty.d.ts.map +1 -1
- package/dist/rules/prefer-is-empty.js +9 -21
- package/dist/rules/schemas-in-schemas-file.d.ts.map +1 -1
- package/dist/rules/schemas-in-schemas-file.js +12 -25
- package/dist/rules/top-level-functions.d.ts.map +1 -1
- package/dist/rules/top-level-functions.js +7 -22
- package/dist/rules/types-in-dts.d.ts.map +1 -1
- package/dist/rules/types-in-dts.js +2 -4
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -20,6 +20,10 @@ This plugin provides:
|
|
|
20
20
|
```bash
|
|
21
21
|
npm install --save-dev eslint-plugin-th-rules
|
|
22
22
|
```
|
|
23
|
+
or
|
|
24
|
+
```bash
|
|
25
|
+
yarn add -D eslint-plugin-th-rules
|
|
26
|
+
```
|
|
23
27
|
|
|
24
28
|
This plugin requires ESLint Flat Config (ESLint 8.21+).
|
|
25
29
|
|
|
@@ -56,7 +60,7 @@ Recommended plus full strict/stylistic TypeScript configurations.
|
|
|
56
60
|
import thRules from "eslint-plugin-th-rules";
|
|
57
61
|
|
|
58
62
|
export default [
|
|
59
|
-
...thRules.configs
|
|
63
|
+
...thRules.configs.recommendedTypescript
|
|
60
64
|
];
|
|
61
65
|
```
|
|
62
66
|
|
|
@@ -72,7 +76,18 @@ Recommended plus:
|
|
|
72
76
|
import thRules from "eslint-plugin-th-rules";
|
|
73
77
|
|
|
74
78
|
export default [
|
|
75
|
-
...thRules.configs
|
|
79
|
+
...thRules.configs.recommendedReact
|
|
80
|
+
];
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Recommended + TypeScript + React
|
|
84
|
+
Recommended plus TypeScript and React extensions.
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
import thRules from "eslint-plugin-th-rules";
|
|
88
|
+
|
|
89
|
+
export default [
|
|
90
|
+
...thRules.configs.recommendedTypescriptReact
|
|
76
91
|
];
|
|
77
92
|
```
|
|
78
93
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended-react.d.ts","sourceRoot":"","sources":["../../../src/configs/bundles/recommended-react.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"recommended-react.d.ts","sourceRoot":"","sources":["../../../src/configs/bundles/recommended-react.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKrC,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAMvB,CAAC;AAEtB,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended-typescript-react.d.ts","sourceRoot":"","sources":["../../../src/configs/bundles/recommended-typescript-react.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"recommended-typescript-react.d.ts","sourceRoot":"","sources":["../../../src/configs/bundles/recommended-typescript-react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMrC,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAA0G,CAAC;AAEjK,eAAe,0BAA0B,CAAC"}
|
|
@@ -2,9 +2,5 @@ import { resolveFlatConfig } from '@leancodepl/resolve-eslint-flat-config';
|
|
|
2
2
|
import { recommendedReact } from './recommended-react.js';
|
|
3
3
|
import { recommendedTypescript } from './recommended-typescript.js';
|
|
4
4
|
import { recommended } from './recommended.js';
|
|
5
|
-
export const recommendedTypescriptReact = resolveFlatConfig([
|
|
6
|
-
...recommended,
|
|
7
|
-
...recommendedTypescript,
|
|
8
|
-
...recommendedReact,
|
|
9
|
-
]);
|
|
5
|
+
export const recommendedTypescriptReact = resolveFlatConfig([...recommended, ...recommendedTypescript, ...recommendedReact]);
|
|
10
6
|
export default recommendedTypescriptReact;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended-typescript.d.ts","sourceRoot":"","sources":["../../../src/configs/bundles/recommended-typescript.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"recommended-typescript.d.ts","sourceRoot":"","sources":["../../../src/configs/bundles/recommended-typescript.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAA8E,CAAC;AAEhI,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { resolveFlatConfig } from '@leancodepl/resolve-eslint-flat-config';
|
|
2
2
|
import { coreTypescript } from '../core/typescript.js';
|
|
3
3
|
import { recommended } from './recommended.js';
|
|
4
|
-
export const recommendedTypescript = resolveFlatConfig([
|
|
5
|
-
...recommended,
|
|
6
|
-
...coreTypescript,
|
|
7
|
-
]);
|
|
4
|
+
export const recommendedTypescript = resolveFlatConfig([...recommended, ...coreTypescript]);
|
|
8
5
|
export default recommendedTypescript;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../../src/configs/bundles/recommended.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../../src/configs/bundles/recommended.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKrC,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAmG,CAAC;AAE3I,eAAe,WAAW,CAAC"}
|
|
@@ -2,9 +2,5 @@ import { resolveFlatConfig } from '@leancodepl/resolve-eslint-flat-config';
|
|
|
2
2
|
import { coreBase } from '../core/base.js';
|
|
3
3
|
import { externalsBase } from '../externals/base.js';
|
|
4
4
|
import { externalsOpinionated } from '../externals/opinionated.js';
|
|
5
|
-
export const recommended = resolveFlatConfig([
|
|
6
|
-
...coreBase,
|
|
7
|
-
...externalsBase,
|
|
8
|
-
...externalsOpinionated,
|
|
9
|
-
]);
|
|
5
|
+
export const recommended = resolveFlatConfig([...coreBase, ...externalsBase, ...externalsOpinionated]);
|
|
10
6
|
export default recommended;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/configs/core/base.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/configs/core/base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,eAAO,MAAM,QAAQ,EAAE,iBAAiB,EAwBvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/configs/core/react.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/configs/core/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,eAAO,MAAM,SAAS,EAAE,iBAAiB,EAOxC,CAAC;AACF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../src/configs/core/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../src/configs/core/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,eAAO,MAAM,cAAc,EAAE,iBAAiB,EAmB7C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/configs/externals/base.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/configs/externals/base.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,eAAO,MAAM,aAAa,EAAE,iBAAiB,EAW5C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -2,6 +2,7 @@ import lodash from 'eslint-plugin-lodash';
|
|
|
2
2
|
import n from 'eslint-plugin-n';
|
|
3
3
|
import sonarjs from 'eslint-plugin-sonarjs';
|
|
4
4
|
import security from 'eslint-plugin-security';
|
|
5
|
+
import prettier from 'eslint-plugin-prettier/recommended';
|
|
5
6
|
export const externalsBase = [
|
|
6
7
|
{
|
|
7
8
|
name: 'th-rules/externals-base',
|
|
@@ -11,7 +12,7 @@ export const externalsBase = [
|
|
|
11
12
|
sonarjs,
|
|
12
13
|
security,
|
|
13
14
|
},
|
|
14
|
-
rules: {},
|
|
15
15
|
},
|
|
16
|
+
prettier,
|
|
16
17
|
];
|
|
17
18
|
export default externalsBase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opinionated.d.ts","sourceRoot":"","sources":["../../../src/configs/externals/opinionated.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opinionated.d.ts","sourceRoot":"","sources":["../../../src/configs/externals/opinionated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EAuBnD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
1
|
export const externalsOpinionated = [
|
|
3
2
|
{
|
|
4
3
|
name: 'th-rules/externals-opinionated',
|
|
@@ -10,6 +9,16 @@ export const externalsOpinionated = [
|
|
|
10
9
|
'sonarjs/no-clear-text-protocols': 'off',
|
|
11
10
|
'import-x/extensions': 'off',
|
|
12
11
|
'unicorn/filename-case': 'off',
|
|
12
|
+
'prettier/prettier': [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
useTabs: true,
|
|
16
|
+
tabWidth: 2,
|
|
17
|
+
printWidth: 200,
|
|
18
|
+
singleQuote: true,
|
|
19
|
+
trailingComma: 'all',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
13
22
|
},
|
|
14
23
|
},
|
|
15
24
|
];
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAC;AAQhD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,QAAA,MAAM,KAAK,EAAoC;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC;AACpI,eAAe,KAAK,CAAC"}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASjB,CAAC;AAEF,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASjB,CAAC;AAEF,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAY,CAAC;AACzB,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-boolean-coercion.d.ts","sourceRoot":"","sources":["../../src/rules/no-boolean-coercion.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"no-boolean-coercion.d.ts","sourceRoot":"","sources":["../../src/rules/no-boolean-coercion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAItE,QAAA,MAAM,iBAAiB;;CAwFrB,CAAC;AACH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ESLintUtils
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
2
|
const createRule = ESLintUtils.RuleCreator(() => 'https://github.com/tomerh2001/eslint-plugin-th-rules/blob/main/docs/rules/no-boolean-coercion.md');
|
|
3
3
|
const noBooleanCoercion = createRule({
|
|
4
4
|
name: 'no-boolean-coercion',
|
|
@@ -20,16 +20,10 @@ const noBooleanCoercion = createRule({
|
|
|
20
20
|
const services = ESLintUtils.getParserServices(context);
|
|
21
21
|
const checker = services?.program?.getTypeChecker?.();
|
|
22
22
|
function isBooleanCall(node) {
|
|
23
|
-
return
|
|
24
|
-
&& node.callee.type === 'Identifier'
|
|
25
|
-
&& node.callee.name === 'Boolean'
|
|
26
|
-
&& node.arguments.length === 1);
|
|
23
|
+
return node.type === 'CallExpression' && node.callee.type === 'Identifier' && node.callee.name === 'Boolean' && node.arguments.length === 1;
|
|
27
24
|
}
|
|
28
25
|
function isDoubleNegation(node) {
|
|
29
|
-
return
|
|
30
|
-
&& node.operator === '!'
|
|
31
|
-
&& node.argument.type === 'UnaryExpression'
|
|
32
|
-
&& node.argument.operator === '!');
|
|
26
|
+
return node.type === 'UnaryExpression' && node.operator === '!' && node.argument.type === 'UnaryExpression' && node.argument.operator === '!';
|
|
33
27
|
}
|
|
34
28
|
function isCollectionLikeByTS(node) {
|
|
35
29
|
if (!checker || !services.esTreeNodeToTSNodeMap) {
|
|
@@ -41,20 +35,13 @@ const noBooleanCoercion = createRule({
|
|
|
41
35
|
}
|
|
42
36
|
const type = checker.getTypeAtLocation(tsNode);
|
|
43
37
|
const typeString = checker.typeToString(type);
|
|
44
|
-
return
|
|
45
|
-
|| typeString === 'string'
|
|
46
|
-
|| typeString === 'object'
|
|
47
|
-
|| typeString.startsWith('Array<')
|
|
48
|
-
|| typeString.startsWith('ReadonlyArray<'));
|
|
38
|
+
return typeString.includes('[]') || typeString === 'string' || typeString === 'object' || typeString.startsWith('Array<') || typeString.startsWith('ReadonlyArray<');
|
|
49
39
|
}
|
|
50
40
|
function isCollectionLikeBySyntax(node) {
|
|
51
|
-
return
|
|
52
|
-
|| node.type === 'ObjectExpression'
|
|
53
|
-
|| (node.type === 'Literal' && typeof node.value === 'string'));
|
|
41
|
+
return node.type === 'ArrayExpression' || node.type === 'ObjectExpression' || (node.type === 'Literal' && typeof node.value === 'string');
|
|
54
42
|
}
|
|
55
43
|
function report(node, valueNode) {
|
|
56
|
-
const isCollection = isCollectionLikeBySyntax(valueNode)
|
|
57
|
-
|| isCollectionLikeByTS(valueNode);
|
|
44
|
+
const isCollection = isCollectionLikeBySyntax(valueNode) || isCollectionLikeByTS(valueNode);
|
|
58
45
|
const suggestedFn = isCollection ? '_.isEmpty' : '_.isNil';
|
|
59
46
|
const replacement = `!${suggestedFn}(${sourceCode.getText(valueNode)})`;
|
|
60
47
|
context.report({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-comments.d.ts","sourceRoot":"","sources":["../../src/rules/no-comments.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"no-comments.d.ts","sourceRoot":"","sources":["../../src/rules/no-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAEtE,KAAK,OAAO,GAAG;IACd;QACC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACF,CAAC;AAYF,QAAA,MAAM,UAAU;;CAgFd,CAAC;AACH,eAAe,UAAU,CAAC"}
|
|
@@ -39,17 +39,14 @@ const noComments = ESLintUtils.RuleCreator(() => 'https://github.com/tomerh2001/
|
|
|
39
39
|
defaultOptions: [],
|
|
40
40
|
create(context) {
|
|
41
41
|
const option = context.options[0] ?? {};
|
|
42
|
-
const userAllowedPatterns = (option.allow ?? []).map(pattern => new RegExp(pattern));
|
|
43
|
-
const userDisallowedPatterns = (option.disallow ?? []).map(pattern => new RegExp(pattern));
|
|
42
|
+
const userAllowedPatterns = (option.allow ?? []).map((pattern) => new RegExp(pattern));
|
|
43
|
+
const userDisallowedPatterns = (option.disallow ?? []).map((pattern) => new RegExp(pattern));
|
|
44
44
|
function isCommentAllowed(comment) {
|
|
45
45
|
const text = comment.value.trim();
|
|
46
46
|
if (comment.type === 'Block' && comment.value.startsWith('*')) {
|
|
47
47
|
return true;
|
|
48
48
|
}
|
|
49
|
-
for (const pattern of [
|
|
50
|
-
...DEFAULT_ALLOWED_PATTERNS,
|
|
51
|
-
...userAllowedPatterns,
|
|
52
|
-
]) {
|
|
49
|
+
for (const pattern of [...DEFAULT_ALLOWED_PATTERNS, ...userAllowedPatterns]) {
|
|
53
50
|
if (pattern.test(text)) {
|
|
54
51
|
return true;
|
|
55
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-default-export.d.ts","sourceRoot":"","sources":["../../src/rules/no-default-export.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"no-default-export.d.ts","sourceRoot":"","sources":["../../src/rules/no-default-export.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAEtE,QAAA,MAAM,eAAe;;CA2DnB,CAAC;AACH,eAAe,eAAe,CAAC"}
|
|
@@ -17,17 +17,12 @@ const noDefaultExport = ESLintUtils.RuleCreator(() => 'https://github.com/tomerh
|
|
|
17
17
|
create(context) {
|
|
18
18
|
function generateExportNameFromFileName(fileName) {
|
|
19
19
|
const cleaned = fileName.replaceAll(/[^a-zA-Z\d]+/g, ' ');
|
|
20
|
-
const parts = cleaned
|
|
21
|
-
.trim()
|
|
22
|
-
.split(/\s+/g)
|
|
23
|
-
.filter(Boolean);
|
|
20
|
+
const parts = cleaned.trim().split(/\s+/g).filter(Boolean);
|
|
24
21
|
if (parts.length === 0) {
|
|
25
22
|
return 'defaultExport';
|
|
26
23
|
}
|
|
27
24
|
const [first, ...rest] = parts;
|
|
28
|
-
return
|
|
29
|
-
.map(p => p.charAt(0).toUpperCase() + p.slice(1))
|
|
30
|
-
.join('');
|
|
25
|
+
return first.charAt(0).toLowerCase() + first.slice(1) + rest.map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join('');
|
|
31
26
|
}
|
|
32
27
|
return {
|
|
33
28
|
ExportDefaultDeclaration(node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-destructuring.d.ts","sourceRoot":"","sources":["../../src/rules/no-destructuring.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"no-destructuring.d.ts","sourceRoot":"","sources":["../../src/rules/no-destructuring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAItE,QAAA,MAAM,eAAe;;;;;CA2InB,CAAC;AACH,eAAe,eAAe,CAAC"}
|
|
@@ -34,16 +34,14 @@ const noDestructuring = ESLintUtils.RuleCreator(() => 'https://github.com/tomerh
|
|
|
34
34
|
const MAX_LINE_LENGTH = options.maximumLineLength ?? 100;
|
|
35
35
|
const sourceCode = context.getSourceCode();
|
|
36
36
|
function reportIfNeeded(patternNode, reportNode = patternNode) {
|
|
37
|
-
if (patternNode?.type !== 'ObjectPattern'
|
|
38
|
-
|| !patternNode.loc) {
|
|
37
|
+
if (patternNode?.type !== 'ObjectPattern' || !patternNode.loc) {
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
40
|
const startLine = patternNode.loc.start.line;
|
|
42
41
|
const endLine = patternNode.loc.end.line;
|
|
43
42
|
const lineText = sourceCode.lines[startLine - 1] ?? '';
|
|
44
43
|
const indentCount = lineText.search(/\S|$/);
|
|
45
|
-
const propertyCount =
|
|
46
|
-
?.length ?? 0;
|
|
44
|
+
const propertyCount = patternNode.properties?.length ?? 0;
|
|
47
45
|
let maxSpannedLineLength = 0;
|
|
48
46
|
for (let i = startLine; i <= endLine; i++) {
|
|
49
47
|
const t = sourceCode.lines[i - 1] ?? '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-is-empty.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-is-empty.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"prefer-is-empty.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-is-empty.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAEtF,QAAA,MAAM,aAAa;;CAoFjB,CAAC;AACH,eAAe,aAAa,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable new-cap */
|
|
2
2
|
/* eslint-disable complexity */
|
|
3
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
4
3
|
import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils';
|
|
5
4
|
const preferIsEmpty = ESLintUtils.RuleCreator(() => 'https://github.com/tomerh2001/eslint-plugin-th-rules/blob/main/docs/rules/prefer-is-empty.md')({
|
|
6
5
|
name: 'prefer-is-empty',
|
|
@@ -18,20 +17,14 @@ const preferIsEmpty = ESLintUtils.RuleCreator(() => 'https://github.com/tomerh20
|
|
|
18
17
|
defaultOptions: [],
|
|
19
18
|
create(context) {
|
|
20
19
|
function isLengthAccess(node) {
|
|
21
|
-
return
|
|
22
|
-
&& node.property.type === AST_NODE_TYPES.Identifier
|
|
23
|
-
&& node.property.name === 'length'
|
|
24
|
-
&& !node.computed);
|
|
20
|
+
return node?.type === AST_NODE_TYPES.MemberExpression && node.property.type === AST_NODE_TYPES.Identifier && node.property.name === 'length' && !node.computed;
|
|
25
21
|
}
|
|
26
22
|
function isNumericLiteral(node) {
|
|
27
|
-
return
|
|
28
|
-
&& typeof node.value === 'number');
|
|
23
|
+
return node?.type === AST_NODE_TYPES.Literal && typeof node.value === 'number';
|
|
29
24
|
}
|
|
30
25
|
function report(node, collectionNode, operator, value, isEmptyCheck) {
|
|
31
26
|
const collectionText = context.sourceCode.getText(collectionNode.object);
|
|
32
|
-
const replacement = isEmptyCheck
|
|
33
|
-
? `_.isEmpty(${collectionText})`
|
|
34
|
-
: `!_.isEmpty(${collectionText})`;
|
|
27
|
+
const replacement = isEmptyCheck ? `_.isEmpty(${collectionText})` : `!_.isEmpty(${collectionText})`;
|
|
35
28
|
context.report({
|
|
36
29
|
node,
|
|
37
30
|
messageId: 'useIsEmpty',
|
|
@@ -58,27 +51,22 @@ const preferIsEmpty = ESLintUtils.RuleCreator(() => 'https://github.com/tomerh20
|
|
|
58
51
|
return {
|
|
59
52
|
BinaryExpression(node) {
|
|
60
53
|
if (isLengthAccess(node.left) && isNumericLiteral(node.right)) {
|
|
61
|
-
if ((node.operator === '===' && node.right.value === 0)
|
|
62
|
-
|| (node.operator === '<=' && node.right.value === 0)
|
|
63
|
-
|| (node.operator === '<' && node.right.value === 1)) {
|
|
54
|
+
if ((node.operator === '===' && node.right.value === 0) || (node.operator === '<=' && node.right.value === 0) || (node.operator === '<' && node.right.value === 1)) {
|
|
64
55
|
report(node, node.left, node.operator, node.right.value, true);
|
|
65
56
|
return;
|
|
66
57
|
}
|
|
67
|
-
if ((node.operator === '>' && node.right.value === 0)
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
if ((node.operator === '>' && node.right.value === 0) ||
|
|
59
|
+
(node.operator === '>=' && node.right.value === 1) ||
|
|
60
|
+
((node.operator === '!=' || node.operator === '!==') && node.right.value === 0)) {
|
|
70
61
|
report(node, node.left, node.operator, node.right.value, false);
|
|
71
62
|
}
|
|
72
63
|
}
|
|
73
64
|
if (isNumericLiteral(node.left) && isLengthAccess(node.right)) {
|
|
74
|
-
if ((node.operator === '===' && node.left.value === 0)
|
|
75
|
-
|| (node.operator === '>=' && node.left.value === 0)
|
|
76
|
-
|| (node.operator === '>' && node.left.value === 0)) {
|
|
65
|
+
if ((node.operator === '===' && node.left.value === 0) || (node.operator === '>=' && node.left.value === 0) || (node.operator === '>' && node.left.value === 0)) {
|
|
77
66
|
report(node, node.right, node.operator, node.left.value, true);
|
|
78
67
|
return;
|
|
79
68
|
}
|
|
80
|
-
if ((node.operator === '<' && node.left.value === 1)
|
|
81
|
-
|| (node.operator === '<=' && node.left.value === 0)) {
|
|
69
|
+
if ((node.operator === '<' && node.left.value === 1) || (node.operator === '<=' && node.left.value === 0)) {
|
|
82
70
|
report(node, node.right, node.operator, node.left.value, false);
|
|
83
71
|
}
|
|
84
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas-in-schemas-file.d.ts","sourceRoot":"","sources":["../../src/rules/schemas-in-schemas-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schemas-in-schemas-file.d.ts","sourceRoot":"","sources":["../../src/rules/schemas-in-schemas-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAEtF,QAAA,MAAM,oBAAoB;;;;;;CAyJxB,CAAC;AACH,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
1
|
import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils';
|
|
3
2
|
const schemasInSchemasFile = ESLintUtils.RuleCreator(() => 'https://github.com/tomerh2001/eslint-plugin-th-rules/blob/main/docs/rules/schemas-in-schemas-file.md')({
|
|
4
3
|
name: 'schemas-in-schemas-file',
|
|
@@ -42,23 +41,20 @@ const schemasInSchemasFile = ESLintUtils.RuleCreator(() => 'https://github.com/t
|
|
|
42
41
|
if (!filename || filename === '<input>') {
|
|
43
42
|
return false;
|
|
44
43
|
}
|
|
45
|
-
if (allowInTests
|
|
46
|
-
&& /\.(test|spec)\.[jt]sx?$/.test(filename)) {
|
|
44
|
+
if (allowInTests && /\.(test|spec)\.[jt]sx?$/.test(filename)) {
|
|
47
45
|
return true;
|
|
48
46
|
}
|
|
49
|
-
return allowedSuffixes.some(suffix => filename.endsWith(suffix));
|
|
47
|
+
return allowedSuffixes.some((suffix) => filename.endsWith(suffix));
|
|
50
48
|
}
|
|
51
49
|
function isZodModuleImport(node) {
|
|
52
|
-
return
|
|
50
|
+
return node.source.value === 'zod';
|
|
53
51
|
}
|
|
54
52
|
function collectZodIdentifiersFromImport(node) {
|
|
55
53
|
if (!isZodModuleImport(node)) {
|
|
56
54
|
return;
|
|
57
55
|
}
|
|
58
56
|
for (const spec of node.specifiers) {
|
|
59
|
-
if (spec.type === AST_NODE_TYPES.ImportSpecifier
|
|
60
|
-
&& spec.imported.type === AST_NODE_TYPES.Identifier
|
|
61
|
-
&& spec.imported.name === 'z') {
|
|
57
|
+
if (spec.type === AST_NODE_TYPES.ImportSpecifier && spec.imported.type === AST_NODE_TYPES.Identifier && spec.imported.name === 'z') {
|
|
62
58
|
zodIdentifiers.add(spec.local.name);
|
|
63
59
|
}
|
|
64
60
|
if (spec.type === AST_NODE_TYPES.ImportNamespaceSpecifier) {
|
|
@@ -68,38 +64,30 @@ const schemasInSchemasFile = ESLintUtils.RuleCreator(() => 'https://github.com/t
|
|
|
68
64
|
}
|
|
69
65
|
function isZodBuilderCall(node) {
|
|
70
66
|
const { callee } = node;
|
|
71
|
-
if (callee.type !== AST_NODE_TYPES.MemberExpression
|
|
72
|
-
|| callee.computed) {
|
|
67
|
+
if (callee.type !== AST_NODE_TYPES.MemberExpression || callee.computed) {
|
|
73
68
|
return false;
|
|
74
69
|
}
|
|
75
70
|
const { object } = callee;
|
|
76
71
|
const { property } = callee;
|
|
77
|
-
return (object.type === AST_NODE_TYPES.Identifier
|
|
78
|
-
&& zodIdentifiers.has(object.name)
|
|
79
|
-
&& property.type === AST_NODE_TYPES.Identifier);
|
|
72
|
+
return object.type === AST_NODE_TYPES.Identifier && zodIdentifiers.has(object.name) && property.type === AST_NODE_TYPES.Identifier;
|
|
80
73
|
}
|
|
81
74
|
function isZodChainedBuilderCall(node) {
|
|
82
75
|
const { callee } = node;
|
|
83
|
-
if (callee.type !== AST_NODE_TYPES.MemberExpression
|
|
84
|
-
|| callee.computed) {
|
|
76
|
+
if (callee.type !== AST_NODE_TYPES.MemberExpression || callee.computed) {
|
|
85
77
|
return false;
|
|
86
78
|
}
|
|
87
79
|
let current = callee.object;
|
|
88
|
-
while (current.type === AST_NODE_TYPES.MemberExpression
|
|
89
|
-
&& !current.computed) {
|
|
80
|
+
while (current.type === AST_NODE_TYPES.MemberExpression && !current.computed) {
|
|
90
81
|
current = current.object;
|
|
91
82
|
}
|
|
92
|
-
return
|
|
93
|
-
&& zodIdentifiers.has(current.name));
|
|
83
|
+
return current.type === AST_NODE_TYPES.Identifier && zodIdentifiers.has(current.name);
|
|
94
84
|
}
|
|
95
85
|
function getAssignmentTargetName(callNode) {
|
|
96
86
|
const { parent } = callNode;
|
|
97
|
-
if (parent.type === AST_NODE_TYPES.VariableDeclarator
|
|
98
|
-
&& parent.id.type === AST_NODE_TYPES.Identifier) {
|
|
87
|
+
if (parent.type === AST_NODE_TYPES.VariableDeclarator && parent.id.type === AST_NODE_TYPES.Identifier) {
|
|
99
88
|
return parent.id.name;
|
|
100
89
|
}
|
|
101
|
-
if (parent.type === AST_NODE_TYPES.AssignmentExpression
|
|
102
|
-
&& parent.left.type === AST_NODE_TYPES.Identifier) {
|
|
90
|
+
if (parent.type === AST_NODE_TYPES.AssignmentExpression && parent.left.type === AST_NODE_TYPES.Identifier) {
|
|
103
91
|
return parent.left.name;
|
|
104
92
|
}
|
|
105
93
|
}
|
|
@@ -127,8 +115,7 @@ const schemasInSchemasFile = ESLintUtils.RuleCreator(() => 'https://github.com/t
|
|
|
127
115
|
if (zodIdentifiers.size === 0) {
|
|
128
116
|
return;
|
|
129
117
|
}
|
|
130
|
-
if (isZodBuilderCall(node)
|
|
131
|
-
|| isZodChainedBuilderCall(node)) {
|
|
118
|
+
if (isZodBuilderCall(node) || isZodChainedBuilderCall(node)) {
|
|
132
119
|
report(node);
|
|
133
120
|
}
|
|
134
121
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-level-functions.d.ts","sourceRoot":"","sources":["../../src/rules/top-level-functions.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"top-level-functions.d.ts","sourceRoot":"","sources":["../../src/rules/top-level-functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAEtE,QAAA,MAAM,iBAAiB;;CA4JrB,CAAC;AACH,eAAe,iBAAiB,CAAC"}
|
|
@@ -20,9 +20,7 @@ const topLevelFunctions = ESLintUtils.RuleCreator(() => 'https://github.com/tome
|
|
|
20
20
|
function buildArrowFunctionReplacement(functionName, arrow, isExport) {
|
|
21
21
|
const asyncKeyword = arrow.async ? 'async ' : '';
|
|
22
22
|
const exportKeyword = isExport ? 'export ' : '';
|
|
23
|
-
const parametersText = arrow.params
|
|
24
|
-
.map(parameter => sourceCode.getText(parameter))
|
|
25
|
-
.join(', ');
|
|
23
|
+
const parametersText = arrow.params.map((parameter) => sourceCode.getText(parameter)).join(', ');
|
|
26
24
|
let bodyText;
|
|
27
25
|
if (arrow.body.type === 'BlockStatement') {
|
|
28
26
|
bodyText = sourceCode.getText(arrow.body);
|
|
@@ -36,9 +34,7 @@ const topLevelFunctions = ESLintUtils.RuleCreator(() => 'https://github.com/tome
|
|
|
36
34
|
function buildFunctionExpressionReplacement(functionName, funcExpr, isExport) {
|
|
37
35
|
const asyncKeyword = funcExpr.async ? 'async ' : '';
|
|
38
36
|
const exportKeyword = isExport ? 'export ' : '';
|
|
39
|
-
const parametersText = funcExpr.params
|
|
40
|
-
.map(parameter => sourceCode.getText(parameter))
|
|
41
|
-
.join(', ');
|
|
37
|
+
const parametersText = funcExpr.params.map((parameter) => sourceCode.getText(parameter)).join(', ');
|
|
42
38
|
const bodyText = sourceCode.getText(funcExpr.body);
|
|
43
39
|
return `${exportKeyword}${asyncKeyword}function ${functionName}(${parametersText}) ${bodyText}`;
|
|
44
40
|
}
|
|
@@ -48,12 +44,7 @@ const topLevelFunctions = ESLintUtils.RuleCreator(() => 'https://github.com/tome
|
|
|
48
44
|
const asyncFunctionRegex = /^\s*async\s+function\s*\(/;
|
|
49
45
|
const functionRegex = /^\s*function\s*\(/;
|
|
50
46
|
let replaced = originalText;
|
|
51
|
-
|
|
52
|
-
replaced = replaced.replace(asyncFunctionRegex, `async function ${functionName}(`);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
replaced = replaced.replace(functionRegex, `function ${functionName}(`);
|
|
56
|
-
}
|
|
47
|
+
replaced = asyncFunctionRegex.test(replaced) ? replaced.replace(asyncFunctionRegex, `async function ${functionName}(`) : replaced.replace(functionRegex, `function ${functionName}(`);
|
|
57
48
|
if (isExport && !replaced.trimStart().startsWith('export')) {
|
|
58
49
|
replaced = `${exportKeyword}${replaced}`;
|
|
59
50
|
}
|
|
@@ -61,14 +52,11 @@ const topLevelFunctions = ESLintUtils.RuleCreator(() => 'https://github.com/tome
|
|
|
61
52
|
}
|
|
62
53
|
function isTopLevel(node) {
|
|
63
54
|
const { parent } = node;
|
|
64
|
-
return
|
|
65
|
-
|| parent?.type === 'ExportNamedDeclaration'
|
|
66
|
-
|| parent?.type === 'ExportDefaultDeclaration');
|
|
55
|
+
return parent?.type === 'Program' || parent?.type === 'ExportNamedDeclaration' || parent?.type === 'ExportDefaultDeclaration';
|
|
67
56
|
}
|
|
68
57
|
function isExportContext(node) {
|
|
69
58
|
const p = node.parent;
|
|
70
|
-
return
|
|
71
|
-
|| p?.type === 'ExportDefaultDeclaration');
|
|
59
|
+
return p?.type === 'ExportNamedDeclaration' || p?.type === 'ExportDefaultDeclaration';
|
|
72
60
|
}
|
|
73
61
|
return {
|
|
74
62
|
VariableDeclarator(node) {
|
|
@@ -77,14 +65,11 @@ const topLevelFunctions = ESLintUtils.RuleCreator(() => 'https://github.com/tome
|
|
|
77
65
|
if (!grandParent) {
|
|
78
66
|
return;
|
|
79
67
|
}
|
|
80
|
-
const topLevel = grandParent.type === 'Program'
|
|
81
|
-
|| grandParent.type === 'ExportNamedDeclaration'
|
|
82
|
-
|| grandParent.type === 'ExportDefaultDeclaration';
|
|
68
|
+
const topLevel = grandParent.type === 'Program' || grandParent.type === 'ExportNamedDeclaration' || grandParent.type === 'ExportDefaultDeclaration';
|
|
83
69
|
if (!topLevel) {
|
|
84
70
|
return;
|
|
85
71
|
}
|
|
86
|
-
const isExport = grandParent.type === 'ExportNamedDeclaration'
|
|
87
|
-
|| grandParent.type === 'ExportDefaultDeclaration';
|
|
72
|
+
const isExport = grandParent.type === 'ExportNamedDeclaration' || grandParent.type === 'ExportDefaultDeclaration';
|
|
88
73
|
if (!node.init) {
|
|
89
74
|
return;
|
|
90
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-in-dts.d.ts","sourceRoot":"","sources":["../../src/rules/types-in-dts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types-in-dts.d.ts","sourceRoot":"","sources":["../../src/rules/types-in-dts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAStE,QAAA,MAAM,UAAU;;;;;CAuFd,CAAC;AACH,eAAe,UAAU,CAAC"}
|
|
@@ -39,10 +39,8 @@ const typesInDts = ESLintUtils.RuleCreator(() => 'https://github.com/tomerh2001/
|
|
|
39
39
|
if ('declare' in node && node.declare) {
|
|
40
40
|
return true;
|
|
41
41
|
}
|
|
42
|
-
const modifiers = 'modifiers' in node && Array.isArray(node.modifiers)
|
|
43
|
-
|
|
44
|
-
: [];
|
|
45
|
-
return modifiers.some(m => m?.type === 'TSDeclareKeyword');
|
|
42
|
+
const modifiers = 'modifiers' in node && Array.isArray(node.modifiers) ? node.modifiers : [];
|
|
43
|
+
return modifiers.some((m) => m?.type === 'TSDeclareKeyword');
|
|
46
44
|
}
|
|
47
45
|
function reportIfNotDts(node) {
|
|
48
46
|
const filename = context.getFilename();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-th-rules",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"description": "A List of custom ESLint rules created by Tomer Horowitz",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"@babel/eslint-parser": "^7.28.6",
|
|
26
26
|
"@eslint/eslintrc": "^3.3.3",
|
|
27
27
|
"@leancodepl/resolve-eslint-flat-config": "^9.7.0",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^8.53.0",
|
|
29
|
+
"@typescript-eslint/parser": "^8.53.0",
|
|
30
|
+
"@typescript-eslint/rule-tester": "^8.53.0",
|
|
31
|
+
"@typescript-eslint/utils": "^8.53.0",
|
|
28
32
|
"eslint-config-jsdoc": "^15.4.0",
|
|
29
33
|
"eslint-config-xo": "^0.49.0",
|
|
30
34
|
"eslint-config-xo-react": "^0.29.0",
|
|
@@ -40,7 +44,8 @@
|
|
|
40
44
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
41
45
|
"globals": "^17.0.0",
|
|
42
46
|
"lodash": "^4.17.21",
|
|
43
|
-
"requireindex": "^1.2.0"
|
|
47
|
+
"requireindex": "^1.2.0",
|
|
48
|
+
"typescript-eslint": "^8.53.0"
|
|
44
49
|
},
|
|
45
50
|
"devDependencies": {
|
|
46
51
|
"@codedependant/semantic-release-docker": "^5.1.1",
|
|
@@ -58,15 +63,11 @@
|
|
|
58
63
|
"@types/node": "^25.0.9",
|
|
59
64
|
"@types/requireindex": "^1.2.4",
|
|
60
65
|
"@types/xo": "^0.39.9",
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "^8.53.0",
|
|
62
|
-
"@typescript-eslint/parser": "^8.53.0",
|
|
63
|
-
"@typescript-eslint/rule-tester": "^8.53.0",
|
|
64
|
-
"@typescript-eslint/utils": "^8.53.0",
|
|
65
66
|
"bun-types": "latest",
|
|
66
67
|
"eslint": "^9.39.2",
|
|
68
|
+
"eslint-config-prettier": "^10.1.8",
|
|
67
69
|
"eslint-doc-generator": "^3.0.2",
|
|
68
|
-
"eslint-plugin-
|
|
69
|
-
"eslint-plugin-node": "^11.1.0",
|
|
70
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
70
71
|
"eslint-plugin-th-rules": "2.7.1",
|
|
71
72
|
"jest": "^30.2.0",
|
|
72
73
|
"mocha": "^11.7.5",
|
|
@@ -74,7 +75,6 @@
|
|
|
74
75
|
"semantic-release": "^25.0.2",
|
|
75
76
|
"ts-jest": "^29.4.6",
|
|
76
77
|
"typescript": "^5.9.3",
|
|
77
|
-
"typescript-eslint": "^8.53.0",
|
|
78
78
|
"xo": "^1.2.3"
|
|
79
79
|
},
|
|
80
80
|
"license": "ISC",
|