eslint-config-typed 3.9.0 → 3.11.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/README.md +4 -1
- package/dist/configs/plugins.mjs +1 -0
- package/dist/configs/plugins.mjs.map +1 -1
- package/dist/entry-point.mjs +1 -0
- package/dist/entry-point.mjs.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/index.d.mts +1 -0
- package/dist/plugins/index.d.mts.map +1 -1
- package/dist/plugins/index.mjs +1 -0
- package/dist/plugins/index.mjs.map +1 -1
- package/dist/plugins/n/index.d.mts +2 -0
- package/dist/plugins/n/index.d.mts.map +1 -0
- package/dist/plugins/n/index.mjs +2 -0
- package/dist/plugins/n/index.mjs.map +1 -0
- package/dist/plugins/n/plugin.d.mts +3 -0
- package/dist/plugins/n/plugin.d.mts.map +1 -0
- package/dist/plugins/n/plugin.mjs +6 -0
- package/dist/plugins/n/plugin.mjs.map +1 -0
- package/dist/plugins/react-coding-style/rules/display-name.d.mts +14 -0
- package/dist/plugins/react-coding-style/rules/display-name.d.mts.map +1 -0
- package/dist/plugins/react-coding-style/rules/display-name.mjs +86 -0
- package/dist/plugins/react-coding-style/rules/display-name.mjs.map +1 -0
- package/dist/plugins/react-coding-style/rules/rules.d.mts +3 -0
- package/dist/plugins/react-coding-style/rules/rules.d.mts.map +1 -1
- package/dist/plugins/react-coding-style/rules/rules.mjs +2 -0
- package/dist/plugins/react-coding-style/rules/rules.mjs.map +1 -1
- package/dist/plugins/ts-restrictions/rules/check-destructuring-completeness.d.mts.map +1 -1
- package/dist/plugins/ts-restrictions/rules/check-destructuring-completeness.mjs +46 -46
- package/dist/plugins/ts-restrictions/rules/check-destructuring-completeness.mjs.map +1 -1
- package/dist/rules/eslint-n-rules.d.mts +42 -0
- package/dist/rules/eslint-n-rules.d.mts.map +1 -0
- package/dist/rules/eslint-n-rules.mjs +44 -0
- package/dist/rules/eslint-n-rules.mjs.map +1 -0
- package/dist/rules/eslint-react-coding-style-rules.d.mts +3 -0
- package/dist/rules/eslint-react-coding-style-rules.d.mts.map +1 -1
- package/dist/rules/eslint-react-coding-style-rules.mjs +1 -0
- package/dist/rules/eslint-react-coding-style-rules.mjs.map +1 -1
- package/dist/rules/index.d.mts +1 -0
- package/dist/rules/index.d.mts.map +1 -1
- package/dist/rules/index.mjs +1 -0
- package/dist/rules/index.mjs.map +1 -1
- package/dist/types/rules/eslint-n-rules.d.mts +161 -0
- package/dist/types/rules/eslint-n-rules.d.mts.map +1 -0
- package/dist/types/rules/eslint-n-rules.mjs +2 -0
- package/dist/types/rules/eslint-n-rules.mjs.map +1 -0
- package/dist/types/rules/eslint-react-coding-style-rules.d.mts +37 -0
- package/dist/types/rules/eslint-react-coding-style-rules.d.mts.map +1 -1
- package/dist/types/rules/index.d.mts +1 -0
- package/dist/types/rules/index.d.mts.map +1 -1
- package/package.json +2 -1
- package/src/plugins/index.mts +1 -0
- package/src/plugins/n/index.mts +1 -0
- package/src/plugins/n/plugin.mts +7 -0
- package/src/plugins/react-coding-style/README.md +22 -0
- package/src/plugins/react-coding-style/rules/display-name.mts +117 -0
- package/src/plugins/react-coding-style/rules/display-name.test.mts +87 -0
- package/src/plugins/react-coding-style/rules/rules.mts +2 -0
- package/src/plugins/ts-restrictions/rules/check-destructuring-completeness.mts +59 -59
- package/src/rules/eslint-n-rules.mts +43 -0
- package/src/rules/eslint-react-coding-style-rules.mts +1 -0
- package/src/rules/index.mts +1 -0
- package/src/types/rules/eslint-n-rules.mts +200 -0
- package/src/types/rules/eslint-react-coding-style-rules.mts +42 -0
- package/src/types/rules/index.mts +1 -0
package/README.md
CHANGED
|
@@ -438,6 +438,7 @@ Add the following to `.vscode/settings.json` for proper ESLint integration:
|
|
|
438
438
|
- eslint-plugin-import-x
|
|
439
439
|
- eslint-plugin-strict-dependencies
|
|
440
440
|
- eslint-plugin-tree-shakable (Reimplemented in this repository to support flat config)
|
|
441
|
+
- eslint-plugin-n
|
|
441
442
|
- eslint-plugin-react
|
|
442
443
|
- eslint-plugin-react-hooks
|
|
443
444
|
- eslint-plugin-react-perf
|
|
@@ -501,6 +502,7 @@ Pre-configured rule sets that can be imported and customized:
|
|
|
501
502
|
| **`eslintTreeShakableRules`** | `eslint-plugin-tree-shakable` | Tree-shaking optimization rules |
|
|
502
503
|
| **`eslintStylisticRules`** | `@stylistic/eslint-plugin` | Stylistic formatting rules disabled to mirror Prettier |
|
|
503
504
|
| **`eslintTsRestrictionsRules`** | `eslint-plugin-ts-restrictions` | Restrict some syntax in TypeScript |
|
|
505
|
+
| **`eslintNRules`** | `eslint-plugin-n` | Node.js-specific rules |
|
|
504
506
|
| **`eslintReactRules`** | `eslint-plugin-react` | React-specific rules |
|
|
505
507
|
| **`eslintReactHooksRules`** | `eslint-plugin-react-hooks` | React Hooks rules |
|
|
506
508
|
| **`eslintReactPerfRules`** | `eslint-plugin-react-perf` | React performance optimization rules |
|
|
@@ -560,7 +562,7 @@ export default [
|
|
|
560
562
|
'warn',
|
|
561
563
|
...eslintRules['no-restricted-syntax'].slice(1),
|
|
562
564
|
],
|
|
563
|
-
'
|
|
565
|
+
'ts-restrictions/no-restricted-syntax': [
|
|
564
566
|
'error',
|
|
565
567
|
{
|
|
566
568
|
// Restrict import style of React
|
|
@@ -611,6 +613,7 @@ Each plugin provides typed rule definitions:
|
|
|
611
613
|
- **`EslintTreeShakableRules`** (no options)
|
|
612
614
|
- **`EslintStylisticRules`** & **`EslintStylisticRulesOption`**
|
|
613
615
|
- **`EslintTsRestrictionsRules`** & **`EslintTsRestrictionsRulesOption`**
|
|
616
|
+
- **`EslintNRules`** (no options)
|
|
614
617
|
- React & JSX
|
|
615
618
|
- **`EslintReactRules`** & **`EslintReactRulesOption`**
|
|
616
619
|
- **`EslintReactHooksRules`** & **`EslintReactHooksRulesOption`**
|
package/dist/configs/plugins.mjs
CHANGED
|
@@ -19,6 +19,7 @@ import eslintPluginReactRefresh from 'eslint-plugin-react-refresh';
|
|
|
19
19
|
import eslintPluginReactPerf from 'eslint-plugin-react-perf';
|
|
20
20
|
import eslintPluginJsxA11y from 'eslint-plugin-jsx-a11y';
|
|
21
21
|
import eslintPluginEslintPlugin from 'eslint-plugin-eslint-plugin';
|
|
22
|
+
import 'eslint-plugin-n';
|
|
22
23
|
import { eslintPluginReactCodingStyle } from '../plugins/react-coding-style/plugin.mjs';
|
|
23
24
|
import { eslintPluginStrictDependencies } from '../plugins/strict-dependencies/plugin.mjs';
|
|
24
25
|
import { eslintPluginTotalFunctions } from '../plugins/total-functions/plugin.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.mjs","sources":["../../src/configs/plugins.mts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.mjs","sources":["../../src/configs/plugins.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AA8DO,MAAM,OAAO,GA6BhB;AACF,IAAA,oBAAoB,EAAE,gBAAgB;AACtC,IAAA,YAAY,EAAE,SAAS;;AAEvB,IAAA,YAAY,EAAE,qBAAqB;AACnC,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,UAAU,EAAE,sBAAsB;AAClC,IAAA,UAAU,EAAE,sBAAsB;;AAElC,IAAA,uBAAuB,EAAE,+BAA+B;AACxD,IAAA,UAAU,EAAE,kBAAkB;AAC9B,IAAA,IAAI,EAAE,gBAAgB;AACtB,IAAA,MAAM,EAAE,kBAAkB;;AAE1B,IAAA,UAAU,EAAE,mBAAmB;AAC/B,IAAA,wBAAwB,EAAE,gCAAgC;;AAE1D,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,KAAK,EAAE,iBAAiB;;AAExB,IAAA,aAAa,EAAE,sBAAiD;AAChE,IAAA,eAAe,EAAE,wBAAwB;;AAEzC,IAAA,YAAY,EAAE,qBAAqB;;AAEnC,IAAA,QAAQ,EAAE,oBAAoB;AAC9B,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,qBAAqB,EAAE,8BAA8B;AACrD,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,oBAAoB,EAAE,4BAA4B;AAClD,IAAA,qBAAqB,EAAE,6BAA6B;;;;;"}
|
package/dist/entry-point.mjs
CHANGED
|
@@ -40,6 +40,7 @@ export { eslintConfigForTestingLibrary } from './configs/testing-library.mjs';
|
|
|
40
40
|
export { eslintConfigForTypeScriptWithoutRules } from './configs/typescript-without-rules.mjs';
|
|
41
41
|
export { eslintConfigForTypeScript } from './configs/typescript.mjs';
|
|
42
42
|
export { eslintConfigForVitest } from './configs/vitest.mjs';
|
|
43
|
+
import 'eslint-plugin-n';
|
|
43
44
|
export { eslintPluginReactCodingStyle } from './plugins/react-coding-style/plugin.mjs';
|
|
44
45
|
export { eslintPluginStrictDependencies } from './plugins/strict-dependencies/plugin.mjs';
|
|
45
46
|
export { eslintPluginTotalFunctions } from './plugins/total-functions/plugin.mjs';
|
package/dist/entry-point.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-point.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry-point.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -11,6 +11,7 @@ export { eslintConfigForTestingLibrary } from './configs/testing-library.mjs';
|
|
|
11
11
|
export { eslintConfigForTypeScriptWithoutRules } from './configs/typescript-without-rules.mjs';
|
|
12
12
|
export { eslintConfigForTypeScript } from './configs/typescript.mjs';
|
|
13
13
|
export { eslintConfigForVitest } from './configs/vitest.mjs';
|
|
14
|
+
export { eslintPluginN } from './plugins/n/plugin.mjs';
|
|
14
15
|
export { eslintPluginReactCodingStyle } from './plugins/react-coding-style/plugin.mjs';
|
|
15
16
|
export { eslintPluginStrictDependencies } from './plugins/strict-dependencies/plugin.mjs';
|
|
16
17
|
export { eslintPluginTotalFunctions } from './plugins/total-functions/plugin.mjs';
|
|
@@ -24,6 +25,7 @@ export { eslintFunctionalRules } from './rules/eslint-functional-rules.mjs';
|
|
|
24
25
|
export { eslintImportsRules } from './rules/eslint-import-rules.mjs';
|
|
25
26
|
export { eslintJestRules } from './rules/eslint-jest-rules.mjs';
|
|
26
27
|
export { eslintJsxA11yRules } from './rules/eslint-jsx-a11y-rules.mjs';
|
|
28
|
+
export { eslintNRules } from './rules/eslint-n-rules.mjs';
|
|
27
29
|
export { eslintPlaywrightRules } from './rules/eslint-playwright-rules.mjs';
|
|
28
30
|
export { eslintPluginRules } from './rules/eslint-plugin-rules.mjs';
|
|
29
31
|
export { eslintPluginSortDestructureKeysRules } from './rules/eslint-plugin-sort-destructure-keys-rules.mjs';
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/plugins/index.mts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/plugins/index.mts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC"}
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { eslintPluginN } from './n/plugin.mjs';
|
|
1
2
|
export { eslintPluginReactCodingStyle } from './react-coding-style/plugin.mjs';
|
|
2
3
|
export { eslintPluginStrictDependencies } from './strict-dependencies/plugin.mjs';
|
|
3
4
|
export { eslintPluginTotalFunctions } from './total-functions/plugin.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/plugins/n/index.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","sourceRoot":"","sources":["../../../src/plugins/n/plugin.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAGvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":["../../../src/plugins/n/plugin.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGO,MAAM,aAAa,GAAkC;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type Options = readonly [
|
|
3
|
+
Readonly<{
|
|
4
|
+
ignoreTranspilerName?: boolean;
|
|
5
|
+
}>?
|
|
6
|
+
];
|
|
7
|
+
type MessageIds = 'missingDisplayName';
|
|
8
|
+
/**
|
|
9
|
+
* Rule to require displayName property for React components
|
|
10
|
+
* This helps with debugging and component identification in React DevTools
|
|
11
|
+
*/
|
|
12
|
+
export declare const displayNameRule: TSESLint.RuleModule<MessageIds, Options>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=display-name.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-name.d.mts","sourceRoot":"","sources":["../../../../src/plugins/react-coding-style/rules/display-name.mts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EAEd,MAAM,0BAA0B,CAAC;AAIlC,KAAK,OAAO,GAAG,SAAS;IACtB,QAAQ,CAAC;QACP,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC,CAAC;CACJ,CAAC;AAEF,KAAK,UAAU,GAAG,oBAAoB,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAgGpE,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import 'ts-data-forge';
|
|
3
|
+
import { isReactApiCall } from './shared.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Rule to require displayName property for React components
|
|
7
|
+
* This helps with debugging and component identification in React DevTools
|
|
8
|
+
*/
|
|
9
|
+
const displayNameRule = {
|
|
10
|
+
meta: {
|
|
11
|
+
type: 'suggestion',
|
|
12
|
+
docs: {
|
|
13
|
+
description: 'Require displayName property for React components created with React.memo',
|
|
14
|
+
},
|
|
15
|
+
schema: [
|
|
16
|
+
{
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
ignoreTranspilerName: {
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
description: 'When true, ignores components that get displayName from variable name',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
messages: {
|
|
28
|
+
missingDisplayName: 'Component should have a displayName property for better debugging',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
create: (context) => {
|
|
32
|
+
const options = context.options[0] ?? {};
|
|
33
|
+
const ignoreTranspilerName = options.ignoreTranspilerName ?? false;
|
|
34
|
+
const checkComponent = (node) => {
|
|
35
|
+
if (node.id.type !== AST_NODE_TYPES.Identifier) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (node.init?.type !== AST_NODE_TYPES.CallExpression) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (!isReactApiCall(context, node.init, 'memo')) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const componentName = node.id.name;
|
|
45
|
+
if (ignoreTranspilerName) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const parent = node.parent;
|
|
49
|
+
const grandParent = parent.parent;
|
|
50
|
+
if (grandParent.type !== AST_NODE_TYPES.Program) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const program = grandParent;
|
|
54
|
+
const componentIndex = program.body.indexOf(parent);
|
|
55
|
+
if (componentIndex === -1) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const nextStatement = program.body[componentIndex + 1];
|
|
59
|
+
const hasDisplayName = nextStatement !== undefined &&
|
|
60
|
+
nextStatement.type === AST_NODE_TYPES.ExpressionStatement &&
|
|
61
|
+
nextStatement.expression.type === AST_NODE_TYPES.AssignmentExpression &&
|
|
62
|
+
nextStatement.expression.left.type ===
|
|
63
|
+
AST_NODE_TYPES.MemberExpression &&
|
|
64
|
+
nextStatement.expression.left.object.type ===
|
|
65
|
+
AST_NODE_TYPES.Identifier &&
|
|
66
|
+
nextStatement.expression.left.object.name === componentName &&
|
|
67
|
+
nextStatement.expression.left.property.type ===
|
|
68
|
+
AST_NODE_TYPES.Identifier &&
|
|
69
|
+
nextStatement.expression.left.property.name === 'displayName';
|
|
70
|
+
if (!hasDisplayName) {
|
|
71
|
+
context.report({
|
|
72
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
73
|
+
node: node.id,
|
|
74
|
+
messageId: 'missingDisplayName',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
VariableDeclarator: checkComponent,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
defaultOptions: [{ ignoreTranspilerName: false }],
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export { displayNameRule };
|
|
86
|
+
//# sourceMappingURL=display-name.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-name.mjs","sources":["../../../../src/plugins/react-coding-style/rules/display-name.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAgBA;;;AAGG;AACI,MAAM,eAAe,GAA6C;AACvE,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,YAAY;AAClB,QAAA,IAAI,EAAE;AACJ,YAAA,WAAW,EACT,2EAA2E;AAC9E,SAAA;AACD,QAAA,MAAM,EAAE;AACN,YAAA;AACE,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE;AACV,oBAAA,oBAAoB,EAAE;AACpB,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,WAAW,EACT,uEAAuE;AAC1E,qBAAA;AACF,iBAAA;AACD,gBAAA,oBAAoB,EAAE,KAAK;AAC5B,aAAA;AACF,SAAA;AACD,QAAA,QAAQ,EA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AAa,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI;AAChC,oBAAA,cAAc,CAAC,gBAAgB;AACjC,gBAAA,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;AACvC,oBAAA,cAAc,CAAC,UAAU;gBAC3B,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa;AAC3D,gBAAA,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;AACzC,oBAAA,cAAc,CAAC,UAAU;gBAC3B,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,aAAa;YAE/D,IAAI,CAAC,cAAc,EAAE;gBACnB,OAAO,CAAC,MAAM,CAAC;;oBAEb,IAAI,EAAE,IAAI,CAAC,EAAW;AACtB,oBAAA,SAAS,EAAE,oBAAoB;AAChC,iBAAA,CAAC;;AAEN,QAAA,CAAC;QAED,OAAO;AACL,YAAA,kBAAkB,EAAE,cAAc;SACnC;KACF;AACD,IAAA,cAAc,EAAE,CAAC,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;;;;;"}
|
|
@@ -12,5 +12,8 @@ export declare const reactCodingStyleRules: {
|
|
|
12
12
|
readonly 'react-memo-type-parameter': import("@typescript-eslint/utils/ts-eslint").RuleModule<"requirePropsTypeParameter" | "omitTypeParameterWhenPropsEmpty", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
13
13
|
readonly 'use-memo-hook-style': import("@typescript-eslint/utils/ts-eslint").RuleModule<"disallowUseMemoTypeAnnotation", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
14
14
|
readonly 'ban-use-imperative-handle-hook': import("@typescript-eslint/utils/ts-eslint").RuleModule<"disallowUseImperativeHandle", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
15
|
+
readonly 'display-name': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingDisplayName", readonly [(Readonly<{
|
|
16
|
+
ignoreTranspilerName?: boolean;
|
|
17
|
+
}> | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
15
18
|
};
|
|
16
19
|
//# sourceMappingURL=rules.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.mts","sourceRoot":"","sources":["../../../../src/plugins/react-coding-style/rules/rules.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rules.d.mts","sourceRoot":"","sources":["../../../../src/plugins/react-coding-style/rules/rules.mts"],"names":[],"mappings":"AAWA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;CAUQ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { banUseImperativeHandleHook } from './ban-use-imperative-handle-hook.mjs';
|
|
2
2
|
import { componentNameRule } from './component-name.mjs';
|
|
3
3
|
import { componentVarTypeAnnotationRule } from './component-var-type-annotation.mjs';
|
|
4
|
+
import { displayNameRule } from './display-name.mjs';
|
|
4
5
|
import { importStyleRule } from './import-style.mjs';
|
|
5
6
|
import { propsTypeAnnotationStyleRule } from './props-type-annotation-style.mjs';
|
|
6
7
|
import { reactMemoPropsArgumentNameRule } from './react-memo-props-argument-name.mjs';
|
|
@@ -16,6 +17,7 @@ const reactCodingStyleRules = {
|
|
|
16
17
|
'react-memo-type-parameter': reactMemoTypeParameterRule,
|
|
17
18
|
'use-memo-hook-style': useMemoHooksStyleRule,
|
|
18
19
|
'ban-use-imperative-handle-hook': banUseImperativeHandleHook,
|
|
20
|
+
'display-name': displayNameRule,
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
export { reactCodingStyleRules };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.mjs","sources":["../../../../src/plugins/react-coding-style/rules/rules.mts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rules.mjs","sources":["../../../../src/plugins/react-coding-style/rules/rules.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAWO,MAAM,qBAAqB,GAAG;AACnC,IAAA,gBAAgB,EAAE,iBAAiB;AACnC,IAAA,+BAA+B,EAAE,8BAA8B;AAC/D,IAAA,cAAc,EAAE,eAAe;AAC/B,IAAA,6BAA6B,EAAE,4BAA4B;AAC3D,IAAA,gCAAgC,EAAE,8BAA8B;AAChE,IAAA,2BAA2B,EAAE,0BAA0B;AACvD,IAAA,qBAAqB,EAAE,qBAAqB;AAC5C,IAAA,gCAAgC,EAAE,0BAA0B;AAC5D,IAAA,cAAc,EAAE,eAAe;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-destructuring-completeness.d.mts","sourceRoot":"","sources":["../../../../src/plugins/ts-restrictions/rules/check-destructuring-completeness.mts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EAEd,MAAM,0BAA0B,CAAC;AAGlC,KAAK,OAAO,GAAG,SAAS;IACtB,QAAQ,CAAC;QACP,8BAA8B,CAAC,EAAE,OAAO,CAAC;QACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC,CAAC;CACJ,CAAC;AAEF,KAAK,UAAU,GAAG,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"check-destructuring-completeness.d.mts","sourceRoot":"","sources":["../../../../src/plugins/ts-restrictions/rules/check-destructuring-completeness.mts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EAEd,MAAM,0BAA0B,CAAC;AAGlC,KAAK,OAAO,GAAG,SAAS;IACtB,QAAQ,CAAC;QACP,8BAA8B,CAAC,EAAE,OAAO,CAAC;QACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC,CAAC;CACJ,CAAC;AAEF,KAAK,UAAU,GAAG,yBAAyB,CAAC;AAI5C,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,UAAU,CAC9D,UAAU,EACV,OAAO,CAmOR,CAAC"}
|
|
@@ -1,51 +1,6 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_DIRECTIVE_KEYWORD = '@check-destructuring-completeness';
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
5
|
-
const getObjectTypeProperties = (type) => {
|
|
6
|
-
try {
|
|
7
|
-
const properties = type.getProperties();
|
|
8
|
-
// Limit to reasonable number of properties to avoid hangs
|
|
9
|
-
if (properties.length > 1000) {
|
|
10
|
-
return [];
|
|
11
|
-
}
|
|
12
|
-
return properties
|
|
13
|
-
.map((prop) => prop.name)
|
|
14
|
-
.filter((name) =>
|
|
15
|
-
// Filter out symbol properties and internal properties
|
|
16
|
-
!name.startsWith('__') &&
|
|
17
|
-
// Only include string property names
|
|
18
|
-
typeof name === 'string' &&
|
|
19
|
-
name.length > 0);
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
// If there's any error getting properties, return empty array
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const isReactComponentFunction = (node) => {
|
|
27
|
-
if (node === undefined || node === null)
|
|
28
|
-
return false;
|
|
29
|
-
// Arrow function component
|
|
30
|
-
if (node.type === AST_NODE_TYPES.ArrowFunctionExpression) {
|
|
31
|
-
const { body } = node;
|
|
32
|
-
if (body.type === AST_NODE_TYPES.BlockStatement) {
|
|
33
|
-
return body.body.some((statement) => {
|
|
34
|
-
if (statement.type !== AST_NODE_TYPES.ReturnStatement)
|
|
35
|
-
return false;
|
|
36
|
-
const { argument } = statement;
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
38
|
-
if (argument === null || argument === undefined)
|
|
39
|
-
return false;
|
|
40
|
-
const argType = argument.type;
|
|
41
|
-
return argType === 'JSXElement' || argType === 'JSXFragment';
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
const bodyType = body.type;
|
|
45
|
-
return bodyType === 'JSXElement' || bodyType === 'JSXFragment';
|
|
46
|
-
}
|
|
47
|
-
return false;
|
|
48
|
-
};
|
|
49
4
|
const checkDestructuringCompleteness = {
|
|
50
5
|
meta: {
|
|
51
6
|
type: 'suggestion',
|
|
@@ -210,7 +165,52 @@ const checkDestructuringCompleteness = {
|
|
|
210
165
|
},
|
|
211
166
|
};
|
|
212
167
|
},
|
|
213
|
-
defaultOptions: [],
|
|
168
|
+
defaultOptions: [{ alwaysCheckReactComponentProps: true }],
|
|
169
|
+
};
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
171
|
+
const getObjectTypeProperties = (type) => {
|
|
172
|
+
try {
|
|
173
|
+
const properties = type.getProperties();
|
|
174
|
+
// Limit to reasonable number of properties to avoid hangs
|
|
175
|
+
if (properties.length > 1000) {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
return properties
|
|
179
|
+
.map((prop) => prop.name)
|
|
180
|
+
.filter((name) =>
|
|
181
|
+
// Filter out symbol properties and internal properties
|
|
182
|
+
!name.startsWith('__') &&
|
|
183
|
+
// Only include string property names
|
|
184
|
+
typeof name === 'string' &&
|
|
185
|
+
name.length > 0);
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
// If there's any error getting properties, return empty array
|
|
189
|
+
return [];
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
const isReactComponentFunction = (node) => {
|
|
193
|
+
if (node === undefined || node === null)
|
|
194
|
+
return false;
|
|
195
|
+
// Arrow function component
|
|
196
|
+
if (node.type === AST_NODE_TYPES.ArrowFunctionExpression) {
|
|
197
|
+
const { body } = node;
|
|
198
|
+
if (body.type === AST_NODE_TYPES.BlockStatement) {
|
|
199
|
+
return body.body.some((statement) => {
|
|
200
|
+
if (statement.type !== AST_NODE_TYPES.ReturnStatement)
|
|
201
|
+
return false;
|
|
202
|
+
const { argument } = statement;
|
|
203
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
204
|
+
if (argument === null || argument === undefined)
|
|
205
|
+
return false;
|
|
206
|
+
const argType = argument.type;
|
|
207
|
+
return argType === 'JSXElement' || argType === 'JSXFragment';
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const bodyType = body.type;
|
|
211
|
+
return bodyType === 'JSXElement' || bodyType === 'JSXFragment';
|
|
212
|
+
}
|
|
213
|
+
return false;
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
export { checkDestructuringCompleteness };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-destructuring-completeness.mjs","sources":["../../../../src/plugins/ts-restrictions/rules/check-destructuring-completeness.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAgBA,MAAM,yBAAyB,GAAG,mCAAmC;
|
|
1
|
+
{"version":3,"file":"check-destructuring-completeness.mjs","sources":["../../../../src/plugins/ts-restrictions/rules/check-destructuring-completeness.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAgBA,MAAM,yBAAyB,GAAG,mCAAmC;AAE9D,MAAM,8BAA8B,GAGvC;AACF,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,YAAY;AAClB,QAAA,IAAI,EAAE;AACJ,YAAA,WAAW,EACT,iFAAiF;AACpF,SAAA;AACD,QAAA,MAAM,EAAE;AACN,YAAA;AACE,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE;AACV,oBAAA,8BAA8B,EAAE;AAC9B,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,WAAW,EACT,4EAA4E;AAC/E,qBAAA;AACD,oBAAA,gBAAgB,EAAE;AAChB,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,WAAW,EACT,4FAA4F;AAC/F,qBAAA;AACF,iBAAA;AACD,gBAAA,oBAAoB,EAAE,KAAK;AAC5B,aAAA;AACF,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,uBAAuB,EACrB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OAAO,OAAO,KAAK,YAAY,IAAI,OAAO,KAAK,aAAa;AAC9D,YAAA,CAAC,CAAC;QACJ;AAEA,QAAA,MAAM,QAAQ,GAAI,IAA0B,CAAC,IAAI;AAEjD,QAAA,OAAO,QAAQ,KAAK,YAAY,IAAI,QAAQ,KAAK,aAAa;IAChE;AAEA,IAAA,OAAO,KAAK;AACd,CAAC;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const eslintNRules: {
|
|
2
|
+
readonly 'n/callback-return': "off";
|
|
3
|
+
readonly 'n/exports-style': "off";
|
|
4
|
+
readonly 'n/file-extension-in-import': "off";
|
|
5
|
+
readonly 'n/global-require': "off";
|
|
6
|
+
readonly 'n/handle-callback-err': "off";
|
|
7
|
+
readonly 'n/hashbang': "off";
|
|
8
|
+
readonly 'n/no-callback-literal': "off";
|
|
9
|
+
readonly 'n/no-deprecated-api': "error";
|
|
10
|
+
readonly 'n/no-exports-assign': "error";
|
|
11
|
+
readonly 'n/no-extraneous-import': "off";
|
|
12
|
+
readonly 'n/no-extraneous-require': "off";
|
|
13
|
+
readonly 'n/no-missing-import': "off";
|
|
14
|
+
readonly 'n/no-missing-require': "off";
|
|
15
|
+
readonly 'n/no-mixed-requires': "off";
|
|
16
|
+
readonly 'n/no-new-require': "error";
|
|
17
|
+
readonly 'n/no-path-concat': "error";
|
|
18
|
+
readonly 'n/no-process-env': "off";
|
|
19
|
+
readonly 'n/no-process-exit': "off";
|
|
20
|
+
readonly 'n/no-restricted-import': "off";
|
|
21
|
+
readonly 'n/no-restricted-require': "off";
|
|
22
|
+
readonly 'n/no-sync': "off";
|
|
23
|
+
readonly 'n/no-top-level-await': "off";
|
|
24
|
+
readonly 'n/no-unpublished-bin': "error";
|
|
25
|
+
readonly 'n/no-unpublished-import': "off";
|
|
26
|
+
readonly 'n/no-unpublished-require': "off";
|
|
27
|
+
readonly 'n/no-unsupported-features/es-builtins': "off";
|
|
28
|
+
readonly 'n/no-unsupported-features/es-syntax': "off";
|
|
29
|
+
readonly 'n/no-unsupported-features/node-builtins': "off";
|
|
30
|
+
readonly 'n/prefer-global/buffer': "off";
|
|
31
|
+
readonly 'n/prefer-global/console': "off";
|
|
32
|
+
readonly 'n/prefer-global/process': "off";
|
|
33
|
+
readonly 'n/prefer-global/text-decoder': "off";
|
|
34
|
+
readonly 'n/prefer-global/text-encoder': "off";
|
|
35
|
+
readonly 'n/prefer-global/url-search-params': "off";
|
|
36
|
+
readonly 'n/prefer-global/url': "off";
|
|
37
|
+
readonly 'n/prefer-node-protocol': "error";
|
|
38
|
+
readonly 'n/prefer-promises/dns': "off";
|
|
39
|
+
readonly 'n/prefer-promises/fs': "off";
|
|
40
|
+
readonly 'n/process-exit-as-throw': "off";
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=eslint-n-rules.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-n-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-n-rules.mts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCQ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const eslintNRules = {
|
|
2
|
+
'n/callback-return': 'off',
|
|
3
|
+
'n/exports-style': 'off',
|
|
4
|
+
'n/file-extension-in-import': 'off',
|
|
5
|
+
'n/global-require': 'off',
|
|
6
|
+
'n/handle-callback-err': 'off',
|
|
7
|
+
'n/hashbang': 'off',
|
|
8
|
+
'n/no-callback-literal': 'off',
|
|
9
|
+
'n/no-deprecated-api': 'error',
|
|
10
|
+
'n/no-exports-assign': 'error',
|
|
11
|
+
'n/no-extraneous-import': 'off',
|
|
12
|
+
'n/no-extraneous-require': 'off',
|
|
13
|
+
'n/no-missing-import': 'off',
|
|
14
|
+
'n/no-missing-require': 'off',
|
|
15
|
+
'n/no-mixed-requires': 'off',
|
|
16
|
+
'n/no-new-require': 'error',
|
|
17
|
+
'n/no-path-concat': 'error',
|
|
18
|
+
'n/no-process-env': 'off',
|
|
19
|
+
'n/no-process-exit': 'off',
|
|
20
|
+
'n/no-restricted-import': 'off',
|
|
21
|
+
'n/no-restricted-require': 'off',
|
|
22
|
+
'n/no-sync': 'off',
|
|
23
|
+
'n/no-top-level-await': 'off',
|
|
24
|
+
'n/no-unpublished-bin': 'error',
|
|
25
|
+
'n/no-unpublished-import': 'off',
|
|
26
|
+
'n/no-unpublished-require': 'off',
|
|
27
|
+
'n/no-unsupported-features/es-builtins': 'off',
|
|
28
|
+
'n/no-unsupported-features/es-syntax': 'off',
|
|
29
|
+
'n/no-unsupported-features/node-builtins': 'off',
|
|
30
|
+
'n/prefer-global/buffer': 'off',
|
|
31
|
+
'n/prefer-global/console': 'off',
|
|
32
|
+
'n/prefer-global/process': 'off',
|
|
33
|
+
'n/prefer-global/text-decoder': 'off',
|
|
34
|
+
'n/prefer-global/text-encoder': 'off',
|
|
35
|
+
'n/prefer-global/url-search-params': 'off',
|
|
36
|
+
'n/prefer-global/url': 'off',
|
|
37
|
+
'n/prefer-node-protocol': 'error',
|
|
38
|
+
'n/prefer-promises/dns': 'off',
|
|
39
|
+
'n/prefer-promises/fs': 'off',
|
|
40
|
+
'n/process-exit-as-throw': 'off',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { eslintNRules };
|
|
44
|
+
//# sourceMappingURL=eslint-n-rules.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-n-rules.mjs","sources":["../../src/rules/eslint-n-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,YAAY,GAAG;AAC1B,IAAA,mBAAmB,EAAE,KAAK;AAC1B,IAAA,iBAAiB,EAAE,KAAK;AACxB,IAAA,4BAA4B,EAAE,KAAK;AACnC,IAAA,kBAAkB,EAAE,KAAK;AACzB,IAAA,uBAAuB,EAAE,KAAK;AAC9B,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,uBAAuB,EAAE,KAAK;AAC9B,IAAA,qBAAqB,EAAE,OAAO;AAC9B,IAAA,qBAAqB,EAAE,OAAO;AAC9B,IAAA,wBAAwB,EAAE,KAAK;AAC/B,IAAA,yBAAyB,EAAE,KAAK;AAChC,IAAA,qBAAqB,EAAE,KAAK;AAC5B,IAAA,sBAAsB,EAAE,KAAK;AAC7B,IAAA,qBAAqB,EAAE,KAAK;AAC5B,IAAA,kBAAkB,EAAE,OAAO;AAC3B,IAAA,kBAAkB,EAAE,OAAO;AAC3B,IAAA,kBAAkB,EAAE,KAAK;AACzB,IAAA,mBAAmB,EAAE,KAAK;AAC1B,IAAA,wBAAwB,EAAE,KAAK;AAC/B,IAAA,yBAAyB,EAAE,KAAK;AAChC,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,sBAAsB,EAAE,KAAK;AAC7B,IAAA,sBAAsB,EAAE,OAAO;AAC/B,IAAA,yBAAyB,EAAE,KAAK;AAChC,IAAA,0BAA0B,EAAE,KAAK;AACjC,IAAA,uCAAuC,EAAE,KAAK;AAC9C,IAAA,qCAAqC,EAAE,KAAK;AAC5C,IAAA,yCAAyC,EAAE,KAAK;AAChD,IAAA,wBAAwB,EAAE,KAAK;AAC/B,IAAA,yBAAyB,EAAE,KAAK;AAChC,IAAA,yBAAyB,EAAE,KAAK;AAChC,IAAA,8BAA8B,EAAE,KAAK;AACrC,IAAA,8BAA8B,EAAE,KAAK;AACrC,IAAA,mCAAmC,EAAE,KAAK;AAC1C,IAAA,qBAAqB,EAAE,KAAK;AAC5B,IAAA,wBAAwB,EAAE,OAAO;AACjC,IAAA,uBAAuB,EAAE,KAAK;AAC9B,IAAA,sBAAsB,EAAE,KAAK;AAC7B,IAAA,yBAAyB,EAAE,KAAK;;;;;"}
|
|
@@ -11,5 +11,8 @@ export declare const eslintReactCodingStyleRules: {
|
|
|
11
11
|
readonly 'react-coding-style/react-memo-type-parameter': "error";
|
|
12
12
|
readonly 'react-coding-style/ban-use-imperative-handle-hook': "error";
|
|
13
13
|
readonly 'react-coding-style/use-memo-hook-style': "error";
|
|
14
|
+
readonly 'react-coding-style/display-name': readonly ["error", {
|
|
15
|
+
readonly ignoreTranspilerName: false;
|
|
16
|
+
}];
|
|
14
17
|
};
|
|
15
18
|
//# sourceMappingURL=eslint-react-coding-style-rules.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-react-coding-style-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-react-coding-style-rules.mts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"eslint-react-coding-style-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-react-coding-style-rules.mts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;CAYQ,CAAC"}
|
|
@@ -8,6 +8,7 @@ const eslintReactCodingStyleRules = {
|
|
|
8
8
|
'react-coding-style/react-memo-type-parameter': 'error',
|
|
9
9
|
'react-coding-style/ban-use-imperative-handle-hook': 'error',
|
|
10
10
|
'react-coding-style/use-memo-hook-style': 'error',
|
|
11
|
+
'react-coding-style/display-name': ['error', { ignoreTranspilerName: false }],
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export { eslintReactCodingStyleRules };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-react-coding-style-rules.mjs","sources":["../../src/rules/eslint-react-coding-style-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,2BAA2B,GAAG;;IAEzC,iCAAiC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;IAE1E,mCAAmC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AACjE,IAAA,kDAAkD,EAAE,OAAO;AAC3D,IAAA,gDAAgD,EAAE,OAAO;AACzD,IAAA,mDAAmD,EAAE,OAAO;AAC5D,IAAA,8CAA8C,EAAE,OAAO;AACvD,IAAA,mDAAmD,EAAE,OAAO;AAC5D,IAAA,wCAAwC,EAAE,OAAO;;;;;"}
|
|
1
|
+
{"version":3,"file":"eslint-react-coding-style-rules.mjs","sources":["../../src/rules/eslint-react-coding-style-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,2BAA2B,GAAG;;IAEzC,iCAAiC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;IAE1E,mCAAmC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AACjE,IAAA,kDAAkD,EAAE,OAAO;AAC3D,IAAA,gDAAgD,EAAE,OAAO;AACzD,IAAA,mDAAmD,EAAE,OAAO;AAC5D,IAAA,8CAA8C,EAAE,OAAO;AACvD,IAAA,mDAAmD,EAAE,OAAO;AAC5D,IAAA,wCAAwC,EAAE,OAAO;IACjD,iCAAiC,EAAE,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;;;;;"}
|
package/dist/rules/index.d.mts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './eslint-functional-rules.mjs';
|
|
|
5
5
|
export * from './eslint-import-rules.mjs';
|
|
6
6
|
export * from './eslint-jest-rules.mjs';
|
|
7
7
|
export * from './eslint-jsx-a11y-rules.mjs';
|
|
8
|
+
export * from './eslint-n-rules.mjs';
|
|
8
9
|
export * from './eslint-playwright-rules.mjs';
|
|
9
10
|
export * from './eslint-plugin-rules.mjs';
|
|
10
11
|
export * from './eslint-plugin-sort-destructure-keys-rules.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/rules/index.mts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,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AAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC"}
|
package/dist/rules/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ export { eslintFunctionalRules } from './eslint-functional-rules.mjs';
|
|
|
5
5
|
export { eslintImportsRules } from './eslint-import-rules.mjs';
|
|
6
6
|
export { eslintJestRules } from './eslint-jest-rules.mjs';
|
|
7
7
|
export { eslintJsxA11yRules } from './eslint-jsx-a11y-rules.mjs';
|
|
8
|
+
export { eslintNRules } from './eslint-n-rules.mjs';
|
|
8
9
|
export { eslintPlaywrightRules } from './eslint-playwright-rules.mjs';
|
|
9
10
|
export { eslintPluginRules } from './eslint-plugin-rules.mjs';
|
|
10
11
|
export { eslintPluginSortDestructureKeysRules } from './eslint-plugin-sort-destructure-keys-rules.mjs';
|
package/dist/rules/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|