@alextheman/eslint-plugin 4.4.2 → 4.5.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/dist/index.cjs +83 -34
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +82 -34
- package/package.json +8 -4
package/dist/index.cjs
CHANGED
|
@@ -56,10 +56,12 @@ let eslint_plugin_react_hooks = require("eslint-plugin-react-hooks");
|
|
|
56
56
|
eslint_plugin_react_hooks = __toESM(eslint_plugin_react_hooks);
|
|
57
57
|
let eslint_plugin_package_json = require("eslint-plugin-package-json");
|
|
58
58
|
eslint_plugin_package_json = __toESM(eslint_plugin_package_json);
|
|
59
|
+
let eslint_plugin_jsdoc = require("eslint-plugin-jsdoc");
|
|
60
|
+
eslint_plugin_jsdoc = __toESM(eslint_plugin_jsdoc);
|
|
59
61
|
|
|
60
62
|
//#region package.json
|
|
61
63
|
var name = "@alextheman/eslint-plugin";
|
|
62
|
-
var version = "4.
|
|
64
|
+
var version = "4.5.0";
|
|
63
65
|
|
|
64
66
|
//#endregion
|
|
65
67
|
//#region node_modules/.pnpm/globals@16.5.0/node_modules/globals/globals.json
|
|
@@ -3425,14 +3427,14 @@ const generalRestrictedImports = { patterns: [{
|
|
|
3425
3427
|
var generalRestrictedImports_default = generalRestrictedImports;
|
|
3426
3428
|
|
|
3427
3429
|
//#endregion
|
|
3428
|
-
//#region src/utility/checkCallExpression.ts
|
|
3430
|
+
//#region src/utility/public/checkCallExpression.ts
|
|
3429
3431
|
function checkCallExpression(node, objectName, propertyName) {
|
|
3430
3432
|
return node.callee.type === __typescript_eslint_utils.AST_NODE_TYPES.MemberExpression && node.callee.object.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.object.name === objectName && node.callee.property.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.property.name === propertyName;
|
|
3431
3433
|
}
|
|
3432
3434
|
var checkCallExpression_default = checkCallExpression;
|
|
3433
3435
|
|
|
3434
3436
|
//#endregion
|
|
3435
|
-
//#region src/utility/combineRestrictedImports.ts
|
|
3437
|
+
//#region src/utility/public/combineRestrictedImports.ts
|
|
3436
3438
|
function combineRestrictedImports(...groups) {
|
|
3437
3439
|
const paths = [];
|
|
3438
3440
|
const patterns = [];
|
|
@@ -3451,14 +3453,14 @@ function combineRestrictedImports(...groups) {
|
|
|
3451
3453
|
var combineRestrictedImports_default = combineRestrictedImports;
|
|
3452
3454
|
|
|
3453
3455
|
//#endregion
|
|
3454
|
-
//#region src/utility/createRuleSchemaFromZodSchema.ts
|
|
3456
|
+
//#region src/utility/public/createRuleSchemaFromZodSchema.ts
|
|
3455
3457
|
function createRuleSchemaFromZodSchema(schema$1) {
|
|
3456
3458
|
return [(0, __alextheman_utility.omitProperties)(zod.default.toJSONSchema(schema$1), "$schema")];
|
|
3457
3459
|
}
|
|
3458
3460
|
var createRuleSchemaFromZodSchema_default = createRuleSchemaFromZodSchema;
|
|
3459
3461
|
|
|
3460
3462
|
//#endregion
|
|
3461
|
-
//#region src/utility/getImportSpecifiersAfterRemoving.ts
|
|
3463
|
+
//#region src/utility/public/getImportSpecifiersAfterRemoving.ts
|
|
3462
3464
|
function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
|
|
3463
3465
|
return specifiers.filter((specifier) => {
|
|
3464
3466
|
return !(specifier.imported.name === importToRemove);
|
|
@@ -3907,40 +3909,63 @@ var alexCLine_default = personalAlexCLine;
|
|
|
3907
3909
|
|
|
3908
3910
|
//#endregion
|
|
3909
3911
|
//#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
|
|
3910
|
-
const eslintPluginRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3912
|
+
const eslintPluginRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [
|
|
3913
|
+
...[
|
|
3914
|
+
"src/alexPlugin",
|
|
3915
|
+
"src/index",
|
|
3916
|
+
"src"
|
|
3917
|
+
].map((name$1) => {
|
|
3918
|
+
return {
|
|
3919
|
+
importNames: ["default"],
|
|
3920
|
+
message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
|
|
3921
|
+
name: name$1
|
|
3922
|
+
};
|
|
3923
|
+
}),
|
|
3924
|
+
{
|
|
3916
3925
|
importNames: ["default"],
|
|
3917
|
-
message: "
|
|
3918
|
-
name:
|
|
3919
|
-
}
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
}
|
|
3926
|
+
message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead.",
|
|
3927
|
+
name: "eslint-plugin-react-hooks"
|
|
3928
|
+
},
|
|
3929
|
+
{
|
|
3930
|
+
importNames: ["createRuleTester"],
|
|
3931
|
+
message: "Please import createRuleTester from \"tests/rule-testers/createRuleTester\" instead.",
|
|
3932
|
+
name: "eslint-vitest-rule-tester"
|
|
3933
|
+
}
|
|
3934
|
+
] });
|
|
3925
3935
|
var eslintPluginRestrictedImports_default = eslintPluginRestrictedImports;
|
|
3926
3936
|
|
|
3927
3937
|
//#endregion
|
|
3928
3938
|
//#region src/configs/personal/eslintPlugin.ts
|
|
3929
3939
|
function personalEslintPlugin(plugin) {
|
|
3930
|
-
return [
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3940
|
+
return [
|
|
3941
|
+
{
|
|
3942
|
+
name: "@alextheman/personal/eslint-plugin",
|
|
3943
|
+
plugins: {
|
|
3944
|
+
"@alextheman": plugin,
|
|
3945
|
+
jsdoc: eslint_plugin_jsdoc.default,
|
|
3946
|
+
perfectionist: eslint_plugin_perfectionist.default
|
|
3947
|
+
},
|
|
3948
|
+
rules: {
|
|
3949
|
+
"@alextheman/no-plugin-configs-access-from-src-configs": "error",
|
|
3950
|
+
"jsdoc/require-jsdoc": "off",
|
|
3951
|
+
"no-restricted-imports": ["error", eslintPluginRestrictedImports_default]
|
|
3952
|
+
}
|
|
3935
3953
|
},
|
|
3936
|
-
|
|
3937
|
-
"
|
|
3938
|
-
"
|
|
3954
|
+
{
|
|
3955
|
+
files: ["src/rules/index.ts", "src/configs/**"],
|
|
3956
|
+
rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
|
|
3957
|
+
},
|
|
3958
|
+
{
|
|
3959
|
+
files: ["src/utility/public/**"],
|
|
3960
|
+
rules: { "jsdoc/require-jsdoc": ["warn", {
|
|
3961
|
+
enableFixer: false,
|
|
3962
|
+
require: {
|
|
3963
|
+
ClassDeclaration: true,
|
|
3964
|
+
MethodDefinition: true
|
|
3965
|
+
}
|
|
3966
|
+
}] }
|
|
3939
3967
|
}
|
|
3940
|
-
|
|
3941
|
-
files: ["src/rules/index.ts", "src/configs/**"],
|
|
3942
|
-
rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
|
|
3943
|
-
}];
|
|
3968
|
+
];
|
|
3944
3969
|
}
|
|
3945
3970
|
var eslintPlugin_default = personalEslintPlugin;
|
|
3946
3971
|
|
|
@@ -4039,6 +4064,17 @@ function personalTypeScript(plugin) {
|
|
|
4039
4064
|
}
|
|
4040
4065
|
var typeScript_default$2 = personalTypeScript;
|
|
4041
4066
|
|
|
4067
|
+
//#endregion
|
|
4068
|
+
//#region src/configs/personal/typeScriptPackage.ts
|
|
4069
|
+
const personalTypeScriptPackage = [eslint_plugin_jsdoc.default.configs["flat/recommended-typescript"], { rules: { "jsdoc/require-jsdoc": ["warn", {
|
|
4070
|
+
enableFixer: false,
|
|
4071
|
+
require: {
|
|
4072
|
+
ClassDeclaration: true,
|
|
4073
|
+
MethodDefinition: true
|
|
4074
|
+
}
|
|
4075
|
+
}] } }];
|
|
4076
|
+
var typeScriptPackage_default$1 = personalTypeScriptPackage;
|
|
4077
|
+
|
|
4042
4078
|
//#endregion
|
|
4043
4079
|
//#region src/configs/personal/utility.ts
|
|
4044
4080
|
const personalUtility = [{
|
|
@@ -4060,6 +4096,17 @@ function combinedTypeScript(plugin) {
|
|
|
4060
4096
|
}
|
|
4061
4097
|
var typeScript_default = combinedTypeScript;
|
|
4062
4098
|
|
|
4099
|
+
//#endregion
|
|
4100
|
+
//#region src/configs/combined/typeScriptPackage.ts
|
|
4101
|
+
function combinedTypeScriptPackage(plugin) {
|
|
4102
|
+
return [
|
|
4103
|
+
{ name: "@alextheman/combined/typescript-package" },
|
|
4104
|
+
...typeScript_default(plugin),
|
|
4105
|
+
...typeScriptPackage_default$1
|
|
4106
|
+
];
|
|
4107
|
+
}
|
|
4108
|
+
var typeScriptPackage_default = combinedTypeScriptPackage;
|
|
4109
|
+
|
|
4063
4110
|
//#endregion
|
|
4064
4111
|
//#region src/configs/combined/typeScriptReact.ts
|
|
4065
4112
|
function combinedTypeScriptReact(plugin) {
|
|
@@ -4072,14 +4119,14 @@ function combinedTypeScriptReact(plugin) {
|
|
|
4072
4119
|
var typeScriptReact_default = combinedTypeScriptReact;
|
|
4073
4120
|
|
|
4074
4121
|
//#endregion
|
|
4075
|
-
//#region src/utility/camelToKebab.ts
|
|
4122
|
+
//#region src/utility/private/camelToKebab.ts
|
|
4076
4123
|
function camelToKebab(string) {
|
|
4077
4124
|
return (0, __alextheman_utility.camelToKebab)(string.replace(/[Tt]ypeScript/, "typescript").replace(/[Jj]avaScript/, "javascript"));
|
|
4078
4125
|
}
|
|
4079
4126
|
var camelToKebab_default = camelToKebab;
|
|
4080
4127
|
|
|
4081
4128
|
//#endregion
|
|
4082
|
-
//#region src/utility/createConfigGroup.ts
|
|
4129
|
+
//#region src/utility/private/createConfigGroup.ts
|
|
4083
4130
|
function createConfigGroup(group, configs) {
|
|
4084
4131
|
const newConfigs = {};
|
|
4085
4132
|
for (const key in configs) newConfigs[`${camelToKebab_default(group)}/${camelToKebab_default(key)}`] = configs[key];
|
|
@@ -4088,7 +4135,7 @@ function createConfigGroup(group, configs) {
|
|
|
4088
4135
|
var createConfigGroup_default = createConfigGroup;
|
|
4089
4136
|
|
|
4090
4137
|
//#endregion
|
|
4091
|
-
//#region src/utility/createPluginConfigs.ts
|
|
4138
|
+
//#region src/utility/private/createPluginConfigs.ts
|
|
4092
4139
|
function createPluginConfigs(config) {
|
|
4093
4140
|
const allConfigs = {};
|
|
4094
4141
|
for (const configGroupEntries of Object.entries(config)) Object.assign(allConfigs, createConfigGroup_default(...configGroupEntries));
|
|
@@ -4106,6 +4153,7 @@ function createAlexPluginConfigs(plugin) {
|
|
|
4106
4153
|
react: [...react_default, ...packageJson_default],
|
|
4107
4154
|
tests: [...tests_default(plugin), ...packageJson_default],
|
|
4108
4155
|
typeScript: [...typeScript_default(plugin), ...packageJson_default],
|
|
4156
|
+
typeScriptPackage: [...typeScriptPackage_default(plugin), ...packageJson_default],
|
|
4109
4157
|
typeScriptReact: [...typeScriptReact_default(plugin), ...packageJson_default]
|
|
4110
4158
|
},
|
|
4111
4159
|
general: {
|
|
@@ -4123,6 +4171,7 @@ function createAlexPluginConfigs(plugin) {
|
|
|
4123
4171
|
react: react_default$2,
|
|
4124
4172
|
tests: tests_default$1,
|
|
4125
4173
|
typeScript: typeScript_default$2(plugin),
|
|
4174
|
+
typeScriptPackage: typeScriptPackage_default$1,
|
|
4126
4175
|
utility: utility_default
|
|
4127
4176
|
},
|
|
4128
4177
|
plugin: {
|
package/dist/index.d.cts
CHANGED
|
@@ -12,14 +12,14 @@ import { JSONSchema4 } from "@typescript-eslint/utils/json-schema";
|
|
|
12
12
|
declare let name: string;
|
|
13
13
|
declare let version: string;
|
|
14
14
|
//#endregion
|
|
15
|
-
//#region src/utility/camelToKebab.d.ts
|
|
15
|
+
//#region src/utility/private/camelToKebab.d.ts
|
|
16
16
|
type CamelToKebab<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${CamelToKebab<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${CamelToKebab<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/configs/AlexPluginConfigGroup.d.ts
|
|
19
19
|
type GeneralConfig = "javaScript" | "typeScript" | "react" | "packageJson";
|
|
20
20
|
type PluginConfig = "base" | "tests";
|
|
21
|
-
type PersonalConfig = "javaScript" | "typeScript" | "react" | "tests" | "eslintPlugin" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utility" | "alexCLine";
|
|
22
|
-
type CombinedConfig = "javaScript" | "typeScript" | "react" | "tests" | "typeScriptReact" | "javaScriptReact";
|
|
21
|
+
type PersonalConfig = "javaScript" | "typeScript" | "react" | "tests" | "eslintPlugin" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utility" | "alexCLine" | "typeScriptPackage";
|
|
22
|
+
type CombinedConfig = "javaScript" | "typeScript" | "react" | "tests" | "typeScriptReact" | "javaScriptReact" | "typeScriptPackage";
|
|
23
23
|
interface AlexPluginConfigGroup {
|
|
24
24
|
general: Record<GeneralConfig, Linter.Config[]>;
|
|
25
25
|
plugin: Record<PluginConfig, Linter.Config[]>;
|
|
@@ -231,16 +231,16 @@ declare function parseUseNormalizedImportsOptions(data: unknown): {
|
|
|
231
231
|
fixable?: boolean | undefined;
|
|
232
232
|
};
|
|
233
233
|
//#endregion
|
|
234
|
-
//#region src/utility/checkCallExpression.d.ts
|
|
234
|
+
//#region src/utility/public/checkCallExpression.d.ts
|
|
235
235
|
declare function checkCallExpression(node: TSESTree.CallExpression, objectName: string, propertyName: string): boolean;
|
|
236
236
|
//#endregion
|
|
237
|
-
//#region src/utility/combineRestrictedImports.d.ts
|
|
237
|
+
//#region src/utility/public/combineRestrictedImports.d.ts
|
|
238
238
|
declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions[]): NoRestrictedImportsOptions;
|
|
239
239
|
//#endregion
|
|
240
|
-
//#region src/utility/createRuleSchemaFromZodSchema.d.ts
|
|
240
|
+
//#region src/utility/public/createRuleSchemaFromZodSchema.d.ts
|
|
241
241
|
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4[];
|
|
242
242
|
//#endregion
|
|
243
|
-
//#region src/utility/getImportSpecifiersAfterRemoving.d.ts
|
|
243
|
+
//#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
|
|
244
244
|
declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [ConsistentTestFunctionOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
245
245
|
//#endregion
|
|
246
246
|
export { type AlexPlugin, AlexPluginConfigGroup, CombinedConfig, ConfigGroupName, ConfigKey, ConsistentTestFunctionOptions, GeneralConfig, NoNamespaceImportsOptions, NoRelativeImportsOptions, type NoRestrictedImportsOptions, PersonalConfig, PluginConfig, type RestrictedPathImport, type RestrictedPatternImport, RuleFixerFunction, StandardiseErrorMessagesOptions, TestFunction, UseNormalizedImportsOptions, checkCallExpression, combineRestrictedImports, createRuleSchemaFromZodSchema, alexPlugin as default, fixOnCondition, getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, reactLanguageOptions, sortExports, sortImports, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns, vitestConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,14 +12,14 @@ import { JSONSchema4 } from "@typescript-eslint/utils/json-schema";
|
|
|
12
12
|
declare let name: string;
|
|
13
13
|
declare let version: string;
|
|
14
14
|
//#endregion
|
|
15
|
-
//#region src/utility/camelToKebab.d.ts
|
|
15
|
+
//#region src/utility/private/camelToKebab.d.ts
|
|
16
16
|
type CamelToKebab<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${CamelToKebab<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${CamelToKebab<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/configs/AlexPluginConfigGroup.d.ts
|
|
19
19
|
type GeneralConfig = "javaScript" | "typeScript" | "react" | "packageJson";
|
|
20
20
|
type PluginConfig = "base" | "tests";
|
|
21
|
-
type PersonalConfig = "javaScript" | "typeScript" | "react" | "tests" | "eslintPlugin" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utility" | "alexCLine";
|
|
22
|
-
type CombinedConfig = "javaScript" | "typeScript" | "react" | "tests" | "typeScriptReact" | "javaScriptReact";
|
|
21
|
+
type PersonalConfig = "javaScript" | "typeScript" | "react" | "tests" | "eslintPlugin" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utility" | "alexCLine" | "typeScriptPackage";
|
|
22
|
+
type CombinedConfig = "javaScript" | "typeScript" | "react" | "tests" | "typeScriptReact" | "javaScriptReact" | "typeScriptPackage";
|
|
23
23
|
interface AlexPluginConfigGroup {
|
|
24
24
|
general: Record<GeneralConfig, Linter.Config[]>;
|
|
25
25
|
plugin: Record<PluginConfig, Linter.Config[]>;
|
|
@@ -231,16 +231,16 @@ declare function parseUseNormalizedImportsOptions(data: unknown): {
|
|
|
231
231
|
fixable?: boolean | undefined;
|
|
232
232
|
};
|
|
233
233
|
//#endregion
|
|
234
|
-
//#region src/utility/checkCallExpression.d.ts
|
|
234
|
+
//#region src/utility/public/checkCallExpression.d.ts
|
|
235
235
|
declare function checkCallExpression(node: TSESTree.CallExpression, objectName: string, propertyName: string): boolean;
|
|
236
236
|
//#endregion
|
|
237
|
-
//#region src/utility/combineRestrictedImports.d.ts
|
|
237
|
+
//#region src/utility/public/combineRestrictedImports.d.ts
|
|
238
238
|
declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions[]): NoRestrictedImportsOptions;
|
|
239
239
|
//#endregion
|
|
240
|
-
//#region src/utility/createRuleSchemaFromZodSchema.d.ts
|
|
240
|
+
//#region src/utility/public/createRuleSchemaFromZodSchema.d.ts
|
|
241
241
|
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4[];
|
|
242
242
|
//#endregion
|
|
243
|
-
//#region src/utility/getImportSpecifiersAfterRemoving.d.ts
|
|
243
|
+
//#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
|
|
244
244
|
declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [ConsistentTestFunctionOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
245
245
|
//#endregion
|
|
246
246
|
export { type AlexPlugin, AlexPluginConfigGroup, CombinedConfig, ConfigGroupName, ConfigKey, type ConsistentTestFunctionOptions, GeneralConfig, type NoNamespaceImportsOptions, type NoRelativeImportsOptions, type NoRestrictedImportsOptions, PersonalConfig, PluginConfig, type RestrictedPathImport, type RestrictedPatternImport, type RuleFixerFunction, type StandardiseErrorMessagesOptions, type TestFunction, type UseNormalizedImportsOptions, checkCallExpression, combineRestrictedImports, createRuleSchemaFromZodSchema, alexPlugin as default, fixOnCondition, getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, reactLanguageOptions, sortExports, sortImports, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns, vitestConfig };
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import reactPlugin from "eslint-plugin-react";
|
|
|
14
14
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
15
15
|
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
16
16
|
import packageJson from "eslint-plugin-package-json";
|
|
17
|
+
import jsdoc from "eslint-plugin-jsdoc";
|
|
17
18
|
|
|
18
19
|
//#region rolldown:runtime
|
|
19
20
|
var __create = Object.create;
|
|
@@ -45,7 +46,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
45
46
|
//#endregion
|
|
46
47
|
//#region package.json
|
|
47
48
|
var name = "@alextheman/eslint-plugin";
|
|
48
|
-
var version = "4.
|
|
49
|
+
var version = "4.5.0";
|
|
49
50
|
|
|
50
51
|
//#endregion
|
|
51
52
|
//#region node_modules/.pnpm/globals@16.5.0/node_modules/globals/globals.json
|
|
@@ -3411,14 +3412,14 @@ const generalRestrictedImports = { patterns: [{
|
|
|
3411
3412
|
var generalRestrictedImports_default = generalRestrictedImports;
|
|
3412
3413
|
|
|
3413
3414
|
//#endregion
|
|
3414
|
-
//#region src/utility/checkCallExpression.ts
|
|
3415
|
+
//#region src/utility/public/checkCallExpression.ts
|
|
3415
3416
|
function checkCallExpression(node, objectName, propertyName) {
|
|
3416
3417
|
return node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.object.type === AST_NODE_TYPES.Identifier && node.callee.object.name === objectName && node.callee.property.type === AST_NODE_TYPES.Identifier && node.callee.property.name === propertyName;
|
|
3417
3418
|
}
|
|
3418
3419
|
var checkCallExpression_default = checkCallExpression;
|
|
3419
3420
|
|
|
3420
3421
|
//#endregion
|
|
3421
|
-
//#region src/utility/combineRestrictedImports.ts
|
|
3422
|
+
//#region src/utility/public/combineRestrictedImports.ts
|
|
3422
3423
|
function combineRestrictedImports(...groups) {
|
|
3423
3424
|
const paths = [];
|
|
3424
3425
|
const patterns = [];
|
|
@@ -3437,14 +3438,14 @@ function combineRestrictedImports(...groups) {
|
|
|
3437
3438
|
var combineRestrictedImports_default = combineRestrictedImports;
|
|
3438
3439
|
|
|
3439
3440
|
//#endregion
|
|
3440
|
-
//#region src/utility/createRuleSchemaFromZodSchema.ts
|
|
3441
|
+
//#region src/utility/public/createRuleSchemaFromZodSchema.ts
|
|
3441
3442
|
function createRuleSchemaFromZodSchema(schema$1) {
|
|
3442
3443
|
return [omitProperties(z.toJSONSchema(schema$1), "$schema")];
|
|
3443
3444
|
}
|
|
3444
3445
|
var createRuleSchemaFromZodSchema_default = createRuleSchemaFromZodSchema;
|
|
3445
3446
|
|
|
3446
3447
|
//#endregion
|
|
3447
|
-
//#region src/utility/getImportSpecifiersAfterRemoving.ts
|
|
3448
|
+
//#region src/utility/public/getImportSpecifiersAfterRemoving.ts
|
|
3448
3449
|
function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
|
|
3449
3450
|
return specifiers.filter((specifier) => {
|
|
3450
3451
|
return !(specifier.imported.name === importToRemove);
|
|
@@ -3893,40 +3894,63 @@ var alexCLine_default = personalAlexCLine;
|
|
|
3893
3894
|
|
|
3894
3895
|
//#endregion
|
|
3895
3896
|
//#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
|
|
3896
|
-
const eslintPluginRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3897
|
+
const eslintPluginRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [
|
|
3898
|
+
...[
|
|
3899
|
+
"src/alexPlugin",
|
|
3900
|
+
"src/index",
|
|
3901
|
+
"src"
|
|
3902
|
+
].map((name$1) => {
|
|
3903
|
+
return {
|
|
3904
|
+
importNames: ["default"],
|
|
3905
|
+
message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
|
|
3906
|
+
name: name$1
|
|
3907
|
+
};
|
|
3908
|
+
}),
|
|
3909
|
+
{
|
|
3902
3910
|
importNames: ["default"],
|
|
3903
|
-
message: "
|
|
3904
|
-
name:
|
|
3905
|
-
}
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
}
|
|
3911
|
+
message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead.",
|
|
3912
|
+
name: "eslint-plugin-react-hooks"
|
|
3913
|
+
},
|
|
3914
|
+
{
|
|
3915
|
+
importNames: ["createRuleTester"],
|
|
3916
|
+
message: "Please import createRuleTester from \"tests/rule-testers/createRuleTester\" instead.",
|
|
3917
|
+
name: "eslint-vitest-rule-tester"
|
|
3918
|
+
}
|
|
3919
|
+
] });
|
|
3911
3920
|
var eslintPluginRestrictedImports_default = eslintPluginRestrictedImports;
|
|
3912
3921
|
|
|
3913
3922
|
//#endregion
|
|
3914
3923
|
//#region src/configs/personal/eslintPlugin.ts
|
|
3915
3924
|
function personalEslintPlugin(plugin) {
|
|
3916
|
-
return [
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3925
|
+
return [
|
|
3926
|
+
{
|
|
3927
|
+
name: "@alextheman/personal/eslint-plugin",
|
|
3928
|
+
plugins: {
|
|
3929
|
+
"@alextheman": plugin,
|
|
3930
|
+
jsdoc,
|
|
3931
|
+
perfectionist
|
|
3932
|
+
},
|
|
3933
|
+
rules: {
|
|
3934
|
+
"@alextheman/no-plugin-configs-access-from-src-configs": "error",
|
|
3935
|
+
"jsdoc/require-jsdoc": "off",
|
|
3936
|
+
"no-restricted-imports": ["error", eslintPluginRestrictedImports_default]
|
|
3937
|
+
}
|
|
3921
3938
|
},
|
|
3922
|
-
|
|
3923
|
-
"
|
|
3924
|
-
"
|
|
3939
|
+
{
|
|
3940
|
+
files: ["src/rules/index.ts", "src/configs/**"],
|
|
3941
|
+
rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
|
|
3942
|
+
},
|
|
3943
|
+
{
|
|
3944
|
+
files: ["src/utility/public/**"],
|
|
3945
|
+
rules: { "jsdoc/require-jsdoc": ["warn", {
|
|
3946
|
+
enableFixer: false,
|
|
3947
|
+
require: {
|
|
3948
|
+
ClassDeclaration: true,
|
|
3949
|
+
MethodDefinition: true
|
|
3950
|
+
}
|
|
3951
|
+
}] }
|
|
3925
3952
|
}
|
|
3926
|
-
|
|
3927
|
-
files: ["src/rules/index.ts", "src/configs/**"],
|
|
3928
|
-
rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
|
|
3929
|
-
}];
|
|
3953
|
+
];
|
|
3930
3954
|
}
|
|
3931
3955
|
var eslintPlugin_default = personalEslintPlugin;
|
|
3932
3956
|
|
|
@@ -4025,6 +4049,17 @@ function personalTypeScript(plugin) {
|
|
|
4025
4049
|
}
|
|
4026
4050
|
var typeScript_default$2 = personalTypeScript;
|
|
4027
4051
|
|
|
4052
|
+
//#endregion
|
|
4053
|
+
//#region src/configs/personal/typeScriptPackage.ts
|
|
4054
|
+
const personalTypeScriptPackage = [jsdoc.configs["flat/recommended-typescript"], { rules: { "jsdoc/require-jsdoc": ["warn", {
|
|
4055
|
+
enableFixer: false,
|
|
4056
|
+
require: {
|
|
4057
|
+
ClassDeclaration: true,
|
|
4058
|
+
MethodDefinition: true
|
|
4059
|
+
}
|
|
4060
|
+
}] } }];
|
|
4061
|
+
var typeScriptPackage_default$1 = personalTypeScriptPackage;
|
|
4062
|
+
|
|
4028
4063
|
//#endregion
|
|
4029
4064
|
//#region src/configs/personal/utility.ts
|
|
4030
4065
|
const personalUtility = [{
|
|
@@ -4046,6 +4081,17 @@ function combinedTypeScript(plugin) {
|
|
|
4046
4081
|
}
|
|
4047
4082
|
var typeScript_default = combinedTypeScript;
|
|
4048
4083
|
|
|
4084
|
+
//#endregion
|
|
4085
|
+
//#region src/configs/combined/typeScriptPackage.ts
|
|
4086
|
+
function combinedTypeScriptPackage(plugin) {
|
|
4087
|
+
return [
|
|
4088
|
+
{ name: "@alextheman/combined/typescript-package" },
|
|
4089
|
+
...typeScript_default(plugin),
|
|
4090
|
+
...typeScriptPackage_default$1
|
|
4091
|
+
];
|
|
4092
|
+
}
|
|
4093
|
+
var typeScriptPackage_default = combinedTypeScriptPackage;
|
|
4094
|
+
|
|
4049
4095
|
//#endregion
|
|
4050
4096
|
//#region src/configs/combined/typeScriptReact.ts
|
|
4051
4097
|
function combinedTypeScriptReact(plugin) {
|
|
@@ -4058,14 +4104,14 @@ function combinedTypeScriptReact(plugin) {
|
|
|
4058
4104
|
var typeScriptReact_default = combinedTypeScriptReact;
|
|
4059
4105
|
|
|
4060
4106
|
//#endregion
|
|
4061
|
-
//#region src/utility/camelToKebab.ts
|
|
4107
|
+
//#region src/utility/private/camelToKebab.ts
|
|
4062
4108
|
function camelToKebab$1(string) {
|
|
4063
4109
|
return camelToKebab(string.replace(/[Tt]ypeScript/, "typescript").replace(/[Jj]avaScript/, "javascript"));
|
|
4064
4110
|
}
|
|
4065
4111
|
var camelToKebab_default = camelToKebab$1;
|
|
4066
4112
|
|
|
4067
4113
|
//#endregion
|
|
4068
|
-
//#region src/utility/createConfigGroup.ts
|
|
4114
|
+
//#region src/utility/private/createConfigGroup.ts
|
|
4069
4115
|
function createConfigGroup(group, configs) {
|
|
4070
4116
|
const newConfigs = {};
|
|
4071
4117
|
for (const key in configs) newConfigs[`${camelToKebab_default(group)}/${camelToKebab_default(key)}`] = configs[key];
|
|
@@ -4074,7 +4120,7 @@ function createConfigGroup(group, configs) {
|
|
|
4074
4120
|
var createConfigGroup_default = createConfigGroup;
|
|
4075
4121
|
|
|
4076
4122
|
//#endregion
|
|
4077
|
-
//#region src/utility/createPluginConfigs.ts
|
|
4123
|
+
//#region src/utility/private/createPluginConfigs.ts
|
|
4078
4124
|
function createPluginConfigs(config) {
|
|
4079
4125
|
const allConfigs = {};
|
|
4080
4126
|
for (const configGroupEntries of Object.entries(config)) Object.assign(allConfigs, createConfigGroup_default(...configGroupEntries));
|
|
@@ -4092,6 +4138,7 @@ function createAlexPluginConfigs(plugin) {
|
|
|
4092
4138
|
react: [...react_default, ...packageJson_default],
|
|
4093
4139
|
tests: [...tests_default(plugin), ...packageJson_default],
|
|
4094
4140
|
typeScript: [...typeScript_default(plugin), ...packageJson_default],
|
|
4141
|
+
typeScriptPackage: [...typeScriptPackage_default(plugin), ...packageJson_default],
|
|
4095
4142
|
typeScriptReact: [...typeScriptReact_default(plugin), ...packageJson_default]
|
|
4096
4143
|
},
|
|
4097
4144
|
general: {
|
|
@@ -4109,6 +4156,7 @@ function createAlexPluginConfigs(plugin) {
|
|
|
4109
4156
|
react: react_default$2,
|
|
4110
4157
|
tests: tests_default$1,
|
|
4111
4158
|
typeScript: typeScript_default$2(plugin),
|
|
4159
|
+
typeScriptPackage: typeScriptPackage_default$1,
|
|
4112
4160
|
utility: utility_default
|
|
4113
4161
|
},
|
|
4114
4162
|
plugin: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "A package to provide custom ESLint rules and configs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"eslint-config-prettier": "^10.1.8",
|
|
33
33
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
34
34
|
"eslint-plugin-import": "^2.32.0",
|
|
35
|
+
"eslint-plugin-jsdoc": "^61.5.0",
|
|
35
36
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
36
37
|
"eslint-plugin-package-json": "^0.85.0",
|
|
37
38
|
"eslint-plugin-perfectionist": "^4.15.1",
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"eslint-config-prettier": ">=10.0.0",
|
|
58
59
|
"eslint-import-resolver-typescript": ">=4.0.0",
|
|
59
60
|
"eslint-plugin-import": ">=2.0.0",
|
|
61
|
+
"eslint-plugin-jsdoc": ">=61.5.0",
|
|
60
62
|
"eslint-plugin-jsx-a11y": ">=6.0.0",
|
|
61
63
|
"eslint-plugin-package-json": ">=0.85.0",
|
|
62
64
|
"eslint-plugin-perfectionist": ">=4.0.0",
|
|
@@ -69,7 +71,7 @@
|
|
|
69
71
|
"vitest": ">=4.0.13"
|
|
70
72
|
},
|
|
71
73
|
"scripts": {
|
|
72
|
-
"build": "tsdown
|
|
74
|
+
"build": "tsdown",
|
|
73
75
|
"change-major": "pnpm version major -m \"Change version number to v%s\"",
|
|
74
76
|
"change-minor": "pnpm version minor -m \"Change version number to v%s\"",
|
|
75
77
|
"change-patch": "pnpm version patch -m \"Change version number to v%s\"",
|
|
@@ -87,10 +89,12 @@
|
|
|
87
89
|
"lint-prettier-javascript": "prettier --check \"./**/*.js\"",
|
|
88
90
|
"lint-prettier-typescript": "prettier --check --parser typescript \"./**/*.ts\"",
|
|
89
91
|
"lint-tsc": "tsc --noEmit",
|
|
92
|
+
"prepare-live-utility": "pnpm uninstall @alextheman/utility && pnpm install @alextheman/utility",
|
|
93
|
+
"prepare-local-utility": "dotenv -e .env -- sh -c 'UTILITY_PATH=${LOCAL_UTILITY_PATH:-../utility}; pnpm --dir \"$UTILITY_PATH\" run build && pnpm uninstall @alextheman/utility && pnpm install file:\"$UTILITY_PATH\"'",
|
|
90
94
|
"test": "vitest run",
|
|
91
95
|
"test-watch": "vitest",
|
|
92
96
|
"update-dependencies": "pnpm update --latest && pnpm update",
|
|
93
|
-
"use-live-utility": "pnpm
|
|
94
|
-
"use-local-utility": "
|
|
97
|
+
"use-live-utility": "pnpm run prepare-live-utility",
|
|
98
|
+
"use-local-utility": "pnpm run prepare-local-utility"
|
|
95
99
|
}
|
|
96
100
|
}
|