@alextheman/eslint-plugin 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +137 -58
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +137 -58
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3715,7 +3715,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
3715
3715
|
|
|
3716
3716
|
// package.json
|
|
3717
3717
|
var name = "@alextheman/eslint-plugin";
|
|
3718
|
-
var version = "2.
|
|
3718
|
+
var version = "2.2.0";
|
|
3719
3719
|
|
|
3720
3720
|
// src/configs/general/javaScriptBase.ts
|
|
3721
3721
|
var import_js = __toESM(require_src(), 1);
|
|
@@ -3868,16 +3868,47 @@ var javaScriptBase = [
|
|
|
3868
3868
|
];
|
|
3869
3869
|
var javaScriptBase_default = javaScriptBase;
|
|
3870
3870
|
|
|
3871
|
+
// src/configs/plugin/pluginBase.ts
|
|
3872
|
+
function createPluginBaseConfig(plugin) {
|
|
3873
|
+
return [
|
|
3874
|
+
{
|
|
3875
|
+
plugins: {
|
|
3876
|
+
"@alextheman": plugin
|
|
3877
|
+
},
|
|
3878
|
+
rules: {
|
|
3879
|
+
"@alextheman/no-namespace-imports": "error",
|
|
3880
|
+
"@alextheman/no-relative-imports": "error",
|
|
3881
|
+
"@alextheman/use-normalized-imports": "error",
|
|
3882
|
+
"@alextheman/use-object-shorthand": "error"
|
|
3883
|
+
}
|
|
3884
|
+
}
|
|
3885
|
+
];
|
|
3886
|
+
}
|
|
3887
|
+
var pluginBase_default = createPluginBaseConfig;
|
|
3888
|
+
|
|
3889
|
+
// src/configs/combined/javaScriptBase.ts
|
|
3890
|
+
function createCombinedJavaScriptBaseConfig(plugin) {
|
|
3891
|
+
return [...pluginBase_default(plugin), ...javaScriptBase_default];
|
|
3892
|
+
}
|
|
3893
|
+
var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
|
|
3894
|
+
|
|
3871
3895
|
// src/configs/general/reactBase.ts
|
|
3872
3896
|
var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
|
|
3873
3897
|
var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
|
|
3874
3898
|
var import_eslint_plugin_react_refresh = __toESM(require("eslint-plugin-react-refresh"), 1);
|
|
3875
3899
|
var import_globals2 = __toESM(require_globals2(), 1);
|
|
3876
3900
|
var reactBase = [
|
|
3901
|
+
import_eslint_plugin_react.default.configs.flat.recommended,
|
|
3902
|
+
import_eslint_plugin_react.default.configs.flat["jsx-runtime"],
|
|
3877
3903
|
{
|
|
3878
3904
|
languageOptions: {
|
|
3879
3905
|
ecmaVersion: 2020,
|
|
3880
|
-
globals: import_globals2.default.browser
|
|
3906
|
+
globals: import_globals2.default.browser,
|
|
3907
|
+
parserOptions: {
|
|
3908
|
+
ecmaFeatures: {
|
|
3909
|
+
jsx: true
|
|
3910
|
+
}
|
|
3911
|
+
}
|
|
3881
3912
|
},
|
|
3882
3913
|
name: "@alextheman/eslint-config-react-base",
|
|
3883
3914
|
plugins: {
|
|
@@ -3885,7 +3916,7 @@ var reactBase = [
|
|
|
3885
3916
|
"react-hooks": import_eslint_plugin_react_hooks.default,
|
|
3886
3917
|
"react-refresh": import_eslint_plugin_react_refresh.default
|
|
3887
3918
|
},
|
|
3888
|
-
rules: __spreadProps(__spreadValues(
|
|
3919
|
+
rules: __spreadProps(__spreadValues({}, import_eslint_plugin_react_hooks.default.configs.recommended.rules), {
|
|
3889
3920
|
"no-restricted-imports": [
|
|
3890
3921
|
"error",
|
|
3891
3922
|
{
|
|
@@ -3899,11 +3930,46 @@ var reactBase = [
|
|
|
3899
3930
|
],
|
|
3900
3931
|
"react-hooks/exhaustive-deps": "off",
|
|
3901
3932
|
"react-refresh/only-export-components": "off"
|
|
3902
|
-
})
|
|
3933
|
+
}),
|
|
3934
|
+
settings: {
|
|
3935
|
+
react: {
|
|
3936
|
+
version: "detect"
|
|
3937
|
+
}
|
|
3938
|
+
}
|
|
3903
3939
|
}
|
|
3904
3940
|
];
|
|
3905
3941
|
var reactBase_default = reactBase;
|
|
3906
3942
|
|
|
3943
|
+
// src/configs/combined/reactBase.ts
|
|
3944
|
+
function createCombinedReactBaseConfig(plugin) {
|
|
3945
|
+
return [...pluginBase_default(plugin), ...reactBase_default];
|
|
3946
|
+
}
|
|
3947
|
+
var reactBase_default2 = createCombinedReactBaseConfig;
|
|
3948
|
+
|
|
3949
|
+
// src/configs/plugin/testsBase.ts
|
|
3950
|
+
function createPluginTestsBaseConfig(plugin) {
|
|
3951
|
+
return [
|
|
3952
|
+
{
|
|
3953
|
+
files: ["**/*.test.ts"],
|
|
3954
|
+
plugins: {
|
|
3955
|
+
"@alextheman": plugin
|
|
3956
|
+
},
|
|
3957
|
+
rules: {
|
|
3958
|
+
"@alextheman/consistent-test-function": ["error", { preference: "test" }],
|
|
3959
|
+
"@alextheman/no-isolated-tests": "error",
|
|
3960
|
+
"@alextheman/no-skipped-tests": "warn"
|
|
3961
|
+
}
|
|
3962
|
+
}
|
|
3963
|
+
];
|
|
3964
|
+
}
|
|
3965
|
+
var testsBase_default2 = createPluginTestsBaseConfig;
|
|
3966
|
+
|
|
3967
|
+
// src/configs/combined/testsBase.ts
|
|
3968
|
+
function createCombinedTestsBaseConfig(plugin) {
|
|
3969
|
+
return [...pluginBase_default(plugin), ...testsBase_default];
|
|
3970
|
+
}
|
|
3971
|
+
var testsBase_default3 = createCombinedTestsBaseConfig;
|
|
3972
|
+
|
|
3907
3973
|
// src/configs/general/typeScriptBase.ts
|
|
3908
3974
|
var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
|
|
3909
3975
|
var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
|
@@ -3960,65 +4026,24 @@ var typeScriptBase = [
|
|
|
3960
4026
|
];
|
|
3961
4027
|
var typeScriptBase_default = typeScriptBase;
|
|
3962
4028
|
|
|
3963
|
-
// src/configs/plugin/pluginBase.ts
|
|
3964
|
-
function createPluginBaseConfig(plugin) {
|
|
3965
|
-
return [
|
|
3966
|
-
{
|
|
3967
|
-
plugins: {
|
|
3968
|
-
"@alextheman": plugin
|
|
3969
|
-
},
|
|
3970
|
-
rules: {
|
|
3971
|
-
"@alextheman/no-namespace-imports": "error",
|
|
3972
|
-
"@alextheman/no-relative-imports": "error",
|
|
3973
|
-
"@alextheman/use-object-shorthand": "error"
|
|
3974
|
-
}
|
|
3975
|
-
}
|
|
3976
|
-
];
|
|
3977
|
-
}
|
|
3978
|
-
var pluginBase_default = createPluginBaseConfig;
|
|
3979
|
-
|
|
3980
|
-
// src/configs/plugin/testsBase.ts
|
|
3981
|
-
function createPluginTestsBaseConfig(plugin) {
|
|
3982
|
-
return [
|
|
3983
|
-
{
|
|
3984
|
-
files: ["**/*.test.ts"],
|
|
3985
|
-
plugins: {
|
|
3986
|
-
"@alextheman": plugin
|
|
3987
|
-
},
|
|
3988
|
-
rules: {
|
|
3989
|
-
"@alextheman/consistent-test-function": ["error", { preference: "test" }],
|
|
3990
|
-
"@alextheman/no-isolated-tests": "error",
|
|
3991
|
-
"@alextheman/no-skipped-tests": "warn"
|
|
3992
|
-
}
|
|
3993
|
-
}
|
|
3994
|
-
];
|
|
3995
|
-
}
|
|
3996
|
-
var testsBase_default2 = createPluginTestsBaseConfig;
|
|
3997
|
-
|
|
3998
|
-
// src/configs/combined/javaScriptBase.ts
|
|
3999
|
-
function createCombinedJavaScriptBaseConfig(plugin) {
|
|
4000
|
-
return [...pluginBase_default(plugin), ...javaScriptBase_default];
|
|
4001
|
-
}
|
|
4002
|
-
var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
|
|
4003
|
-
|
|
4004
|
-
// src/configs/combined/reactBase.ts
|
|
4005
|
-
function createCombinedReactBaseConfig(plugin) {
|
|
4006
|
-
return [...pluginBase_default(plugin), ...reactBase_default];
|
|
4007
|
-
}
|
|
4008
|
-
var reactBase_default2 = createCombinedReactBaseConfig;
|
|
4009
|
-
|
|
4010
|
-
// src/configs/combined/testsBase.ts
|
|
4011
|
-
function createCombinedTestsBaseConfig(plugin) {
|
|
4012
|
-
return [...pluginBase_default(plugin), ...testsBase_default];
|
|
4013
|
-
}
|
|
4014
|
-
var testsBase_default3 = createCombinedTestsBaseConfig;
|
|
4015
|
-
|
|
4016
4029
|
// src/configs/combined/typeScriptBase.ts
|
|
4017
4030
|
function createCombinedTypeScriptBaseConfig(plugin) {
|
|
4018
4031
|
return [...pluginBase_default(plugin), ...typeScriptBase_default];
|
|
4019
4032
|
}
|
|
4020
4033
|
var typeScriptBase_default2 = createCombinedTypeScriptBaseConfig;
|
|
4021
4034
|
|
|
4035
|
+
// src/configs/combined/typeScriptReactBase.ts
|
|
4036
|
+
function createCombinedTypeScriptReactBaseConfig(plugin) {
|
|
4037
|
+
return [...pluginBase_default(plugin), ...typeScriptBase_default, ...reactBase_default];
|
|
4038
|
+
}
|
|
4039
|
+
var typeScriptReactBase_default = createCombinedTypeScriptReactBaseConfig;
|
|
4040
|
+
|
|
4041
|
+
// src/configs/combined/javaScriptReactBase.ts
|
|
4042
|
+
function createCombinedJavaScriptReactBaseConfig(plugin) {
|
|
4043
|
+
return [...pluginBase_default(plugin), ...javaScriptBase_default, ...reactBase_default];
|
|
4044
|
+
}
|
|
4045
|
+
var javaScriptReactBase_default = createCombinedJavaScriptReactBaseConfig;
|
|
4046
|
+
|
|
4022
4047
|
// src/rules/consistent-test-function.ts
|
|
4023
4048
|
var import_utils2 = require("@typescript-eslint/utils");
|
|
4024
4049
|
var import_zod = __toESM(require("zod"), 1);
|
|
@@ -4439,6 +4464,57 @@ var noSkippedTests = createRule_default({
|
|
|
4439
4464
|
});
|
|
4440
4465
|
var no_skipped_tests_default = noSkippedTests;
|
|
4441
4466
|
|
|
4467
|
+
// src/rules/use-normalized-imports.ts
|
|
4468
|
+
var import_path = __toESM(require("path"), 1);
|
|
4469
|
+
var useNormalizedImports = createRule_default({
|
|
4470
|
+
name: "use-normalized-imports",
|
|
4471
|
+
meta: {
|
|
4472
|
+
docs: {
|
|
4473
|
+
description: "Enforce the usage of normalised imports (i.e. import paths that you would only get from path.posix.normalize())"
|
|
4474
|
+
},
|
|
4475
|
+
messages: {
|
|
4476
|
+
pathNotNormalized: "Import path {{nonNormalized}} is not normalised. Please use {{normalized}} instead."
|
|
4477
|
+
},
|
|
4478
|
+
type: "suggestion",
|
|
4479
|
+
schema: [
|
|
4480
|
+
{
|
|
4481
|
+
type: "object",
|
|
4482
|
+
properties: {
|
|
4483
|
+
fixable: {
|
|
4484
|
+
type: "boolean"
|
|
4485
|
+
}
|
|
4486
|
+
}
|
|
4487
|
+
}
|
|
4488
|
+
],
|
|
4489
|
+
fixable: "code"
|
|
4490
|
+
},
|
|
4491
|
+
defaultOptions: [{ fixable: true }],
|
|
4492
|
+
create(context) {
|
|
4493
|
+
var _a, _b;
|
|
4494
|
+
const isFixable = (_b = (_a = context.options[0]) == null ? void 0 : _a.fixable) != null ? _b : true;
|
|
4495
|
+
return {
|
|
4496
|
+
ImportDeclaration(node) {
|
|
4497
|
+
const normalizedPath = import_path.default.posix.normalize(node.source.value);
|
|
4498
|
+
if (node.source.value !== normalizedPath) {
|
|
4499
|
+
return context.report({
|
|
4500
|
+
node,
|
|
4501
|
+
messageId: "pathNotNormalized",
|
|
4502
|
+
data: {
|
|
4503
|
+
nonNormalized: node.source.value,
|
|
4504
|
+
normalized: normalizedPath
|
|
4505
|
+
},
|
|
4506
|
+
fix: isFixable ? (fixer) => {
|
|
4507
|
+
const [quote] = node.source.raw;
|
|
4508
|
+
return fixer.replaceText(node.source, `${quote}${normalizedPath}${quote}`);
|
|
4509
|
+
} : void 0
|
|
4510
|
+
});
|
|
4511
|
+
}
|
|
4512
|
+
}
|
|
4513
|
+
};
|
|
4514
|
+
}
|
|
4515
|
+
});
|
|
4516
|
+
var use_normalized_imports_default = useNormalizedImports;
|
|
4517
|
+
|
|
4442
4518
|
// src/rules/use-object-shorthand.ts
|
|
4443
4519
|
var import_utils4 = require("@typescript-eslint/utils");
|
|
4444
4520
|
var useObjectShorthand = createRule_default({
|
|
@@ -4485,6 +4561,7 @@ var rules_default = {
|
|
|
4485
4561
|
"no-plugin-configs-access-from-src-configs": no_plugin_configs_access_from_src_configs_default,
|
|
4486
4562
|
"no-relative-imports": no_relative_imports_default,
|
|
4487
4563
|
"no-skipped-tests": no_skipped_tests_default,
|
|
4564
|
+
"use-normalized-imports": use_normalized_imports_default,
|
|
4488
4565
|
"use-object-shorthand": use_object_shorthand_default
|
|
4489
4566
|
};
|
|
4490
4567
|
|
|
@@ -4542,7 +4619,9 @@ alexPlugin.configs = createPluginConfigs_default({
|
|
|
4542
4619
|
javaScript: javaScriptBase_default2(alexPlugin),
|
|
4543
4620
|
typeScript: typeScriptBase_default2(alexPlugin),
|
|
4544
4621
|
react: reactBase_default2(alexPlugin),
|
|
4545
|
-
tests: testsBase_default3(alexPlugin)
|
|
4622
|
+
tests: testsBase_default3(alexPlugin),
|
|
4623
|
+
typeScriptReact: typeScriptReactBase_default(alexPlugin),
|
|
4624
|
+
javaScriptReact: javaScriptReactBase_default(alexPlugin)
|
|
4546
4625
|
}
|
|
4547
4626
|
});
|
|
4548
4627
|
var alexPlugin_default = alexPlugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
|
-
import { Config } from 'prettier';
|
|
3
2
|
import z from 'zod';
|
|
3
|
+
import { Config } from 'prettier';
|
|
4
4
|
|
|
5
5
|
var name = "@alextheman/eslint-plugin";
|
|
6
|
-
var version = "2.
|
|
6
|
+
var version = "2.2.0";
|
|
7
7
|
|
|
8
8
|
interface AlexPluginConfigs {
|
|
9
9
|
general: {
|
|
@@ -21,6 +21,8 @@ interface AlexPluginConfigs {
|
|
|
21
21
|
typeScript: Linter.Config[];
|
|
22
22
|
react: Linter.Config[];
|
|
23
23
|
tests: Linter.Config[];
|
|
24
|
+
typeScriptReact: Linter.Config[];
|
|
25
|
+
javaScriptReact: Linter.Config[];
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
declare function createPluginConfigs(config: AlexPluginConfigs): Record<`${string}/${string}`, Linter.Config[]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
|
-
import { Config } from 'prettier';
|
|
3
2
|
import z from 'zod';
|
|
3
|
+
import { Config } from 'prettier';
|
|
4
4
|
|
|
5
5
|
var name = "@alextheman/eslint-plugin";
|
|
6
|
-
var version = "2.
|
|
6
|
+
var version = "2.2.0";
|
|
7
7
|
|
|
8
8
|
interface AlexPluginConfigs {
|
|
9
9
|
general: {
|
|
@@ -21,6 +21,8 @@ interface AlexPluginConfigs {
|
|
|
21
21
|
typeScript: Linter.Config[];
|
|
22
22
|
react: Linter.Config[];
|
|
23
23
|
tests: Linter.Config[];
|
|
24
|
+
typeScriptReact: Linter.Config[];
|
|
25
|
+
javaScriptReact: Linter.Config[];
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
declare function createPluginConfigs(config: AlexPluginConfigs): Record<`${string}/${string}`, Linter.Config[]>;
|
package/dist/index.js
CHANGED
|
@@ -3700,7 +3700,7 @@ var require_globals2 = __commonJS({
|
|
|
3700
3700
|
|
|
3701
3701
|
// package.json
|
|
3702
3702
|
var name = "@alextheman/eslint-plugin";
|
|
3703
|
-
var version = "2.
|
|
3703
|
+
var version = "2.2.0";
|
|
3704
3704
|
|
|
3705
3705
|
// src/configs/general/javaScriptBase.ts
|
|
3706
3706
|
var import_js = __toESM(require_src(), 1);
|
|
@@ -3853,16 +3853,47 @@ var javaScriptBase = [
|
|
|
3853
3853
|
];
|
|
3854
3854
|
var javaScriptBase_default = javaScriptBase;
|
|
3855
3855
|
|
|
3856
|
+
// src/configs/plugin/pluginBase.ts
|
|
3857
|
+
function createPluginBaseConfig(plugin) {
|
|
3858
|
+
return [
|
|
3859
|
+
{
|
|
3860
|
+
plugins: {
|
|
3861
|
+
"@alextheman": plugin
|
|
3862
|
+
},
|
|
3863
|
+
rules: {
|
|
3864
|
+
"@alextheman/no-namespace-imports": "error",
|
|
3865
|
+
"@alextheman/no-relative-imports": "error",
|
|
3866
|
+
"@alextheman/use-normalized-imports": "error",
|
|
3867
|
+
"@alextheman/use-object-shorthand": "error"
|
|
3868
|
+
}
|
|
3869
|
+
}
|
|
3870
|
+
];
|
|
3871
|
+
}
|
|
3872
|
+
var pluginBase_default = createPluginBaseConfig;
|
|
3873
|
+
|
|
3874
|
+
// src/configs/combined/javaScriptBase.ts
|
|
3875
|
+
function createCombinedJavaScriptBaseConfig(plugin) {
|
|
3876
|
+
return [...pluginBase_default(plugin), ...javaScriptBase_default];
|
|
3877
|
+
}
|
|
3878
|
+
var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
|
|
3879
|
+
|
|
3856
3880
|
// src/configs/general/reactBase.ts
|
|
3857
3881
|
var import_globals2 = __toESM(require_globals2(), 1);
|
|
3858
3882
|
import reactPlugin from "eslint-plugin-react";
|
|
3859
3883
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
3860
3884
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
3861
3885
|
var reactBase = [
|
|
3886
|
+
reactPlugin.configs.flat.recommended,
|
|
3887
|
+
reactPlugin.configs.flat["jsx-runtime"],
|
|
3862
3888
|
{
|
|
3863
3889
|
languageOptions: {
|
|
3864
3890
|
ecmaVersion: 2020,
|
|
3865
|
-
globals: import_globals2.default.browser
|
|
3891
|
+
globals: import_globals2.default.browser,
|
|
3892
|
+
parserOptions: {
|
|
3893
|
+
ecmaFeatures: {
|
|
3894
|
+
jsx: true
|
|
3895
|
+
}
|
|
3896
|
+
}
|
|
3866
3897
|
},
|
|
3867
3898
|
name: "@alextheman/eslint-config-react-base",
|
|
3868
3899
|
plugins: {
|
|
@@ -3870,7 +3901,7 @@ var reactBase = [
|
|
|
3870
3901
|
"react-hooks": reactHooks,
|
|
3871
3902
|
"react-refresh": reactRefresh
|
|
3872
3903
|
},
|
|
3873
|
-
rules: __spreadProps(__spreadValues(
|
|
3904
|
+
rules: __spreadProps(__spreadValues({}, reactHooks.configs.recommended.rules), {
|
|
3874
3905
|
"no-restricted-imports": [
|
|
3875
3906
|
"error",
|
|
3876
3907
|
{
|
|
@@ -3884,11 +3915,46 @@ var reactBase = [
|
|
|
3884
3915
|
],
|
|
3885
3916
|
"react-hooks/exhaustive-deps": "off",
|
|
3886
3917
|
"react-refresh/only-export-components": "off"
|
|
3887
|
-
})
|
|
3918
|
+
}),
|
|
3919
|
+
settings: {
|
|
3920
|
+
react: {
|
|
3921
|
+
version: "detect"
|
|
3922
|
+
}
|
|
3923
|
+
}
|
|
3888
3924
|
}
|
|
3889
3925
|
];
|
|
3890
3926
|
var reactBase_default = reactBase;
|
|
3891
3927
|
|
|
3928
|
+
// src/configs/combined/reactBase.ts
|
|
3929
|
+
function createCombinedReactBaseConfig(plugin) {
|
|
3930
|
+
return [...pluginBase_default(plugin), ...reactBase_default];
|
|
3931
|
+
}
|
|
3932
|
+
var reactBase_default2 = createCombinedReactBaseConfig;
|
|
3933
|
+
|
|
3934
|
+
// src/configs/plugin/testsBase.ts
|
|
3935
|
+
function createPluginTestsBaseConfig(plugin) {
|
|
3936
|
+
return [
|
|
3937
|
+
{
|
|
3938
|
+
files: ["**/*.test.ts"],
|
|
3939
|
+
plugins: {
|
|
3940
|
+
"@alextheman": plugin
|
|
3941
|
+
},
|
|
3942
|
+
rules: {
|
|
3943
|
+
"@alextheman/consistent-test-function": ["error", { preference: "test" }],
|
|
3944
|
+
"@alextheman/no-isolated-tests": "error",
|
|
3945
|
+
"@alextheman/no-skipped-tests": "warn"
|
|
3946
|
+
}
|
|
3947
|
+
}
|
|
3948
|
+
];
|
|
3949
|
+
}
|
|
3950
|
+
var testsBase_default2 = createPluginTestsBaseConfig;
|
|
3951
|
+
|
|
3952
|
+
// src/configs/combined/testsBase.ts
|
|
3953
|
+
function createCombinedTestsBaseConfig(plugin) {
|
|
3954
|
+
return [...pluginBase_default(plugin), ...testsBase_default];
|
|
3955
|
+
}
|
|
3956
|
+
var testsBase_default3 = createCombinedTestsBaseConfig;
|
|
3957
|
+
|
|
3892
3958
|
// src/configs/general/typeScriptBase.ts
|
|
3893
3959
|
import tsparser from "@typescript-eslint/parser";
|
|
3894
3960
|
import tseslint from "typescript-eslint";
|
|
@@ -3945,65 +4011,24 @@ var typeScriptBase = [
|
|
|
3945
4011
|
];
|
|
3946
4012
|
var typeScriptBase_default = typeScriptBase;
|
|
3947
4013
|
|
|
3948
|
-
// src/configs/plugin/pluginBase.ts
|
|
3949
|
-
function createPluginBaseConfig(plugin) {
|
|
3950
|
-
return [
|
|
3951
|
-
{
|
|
3952
|
-
plugins: {
|
|
3953
|
-
"@alextheman": plugin
|
|
3954
|
-
},
|
|
3955
|
-
rules: {
|
|
3956
|
-
"@alextheman/no-namespace-imports": "error",
|
|
3957
|
-
"@alextheman/no-relative-imports": "error",
|
|
3958
|
-
"@alextheman/use-object-shorthand": "error"
|
|
3959
|
-
}
|
|
3960
|
-
}
|
|
3961
|
-
];
|
|
3962
|
-
}
|
|
3963
|
-
var pluginBase_default = createPluginBaseConfig;
|
|
3964
|
-
|
|
3965
|
-
// src/configs/plugin/testsBase.ts
|
|
3966
|
-
function createPluginTestsBaseConfig(plugin) {
|
|
3967
|
-
return [
|
|
3968
|
-
{
|
|
3969
|
-
files: ["**/*.test.ts"],
|
|
3970
|
-
plugins: {
|
|
3971
|
-
"@alextheman": plugin
|
|
3972
|
-
},
|
|
3973
|
-
rules: {
|
|
3974
|
-
"@alextheman/consistent-test-function": ["error", { preference: "test" }],
|
|
3975
|
-
"@alextheman/no-isolated-tests": "error",
|
|
3976
|
-
"@alextheman/no-skipped-tests": "warn"
|
|
3977
|
-
}
|
|
3978
|
-
}
|
|
3979
|
-
];
|
|
3980
|
-
}
|
|
3981
|
-
var testsBase_default2 = createPluginTestsBaseConfig;
|
|
3982
|
-
|
|
3983
|
-
// src/configs/combined/javaScriptBase.ts
|
|
3984
|
-
function createCombinedJavaScriptBaseConfig(plugin) {
|
|
3985
|
-
return [...pluginBase_default(plugin), ...javaScriptBase_default];
|
|
3986
|
-
}
|
|
3987
|
-
var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
|
|
3988
|
-
|
|
3989
|
-
// src/configs/combined/reactBase.ts
|
|
3990
|
-
function createCombinedReactBaseConfig(plugin) {
|
|
3991
|
-
return [...pluginBase_default(plugin), ...reactBase_default];
|
|
3992
|
-
}
|
|
3993
|
-
var reactBase_default2 = createCombinedReactBaseConfig;
|
|
3994
|
-
|
|
3995
|
-
// src/configs/combined/testsBase.ts
|
|
3996
|
-
function createCombinedTestsBaseConfig(plugin) {
|
|
3997
|
-
return [...pluginBase_default(plugin), ...testsBase_default];
|
|
3998
|
-
}
|
|
3999
|
-
var testsBase_default3 = createCombinedTestsBaseConfig;
|
|
4000
|
-
|
|
4001
4014
|
// src/configs/combined/typeScriptBase.ts
|
|
4002
4015
|
function createCombinedTypeScriptBaseConfig(plugin) {
|
|
4003
4016
|
return [...pluginBase_default(plugin), ...typeScriptBase_default];
|
|
4004
4017
|
}
|
|
4005
4018
|
var typeScriptBase_default2 = createCombinedTypeScriptBaseConfig;
|
|
4006
4019
|
|
|
4020
|
+
// src/configs/combined/typeScriptReactBase.ts
|
|
4021
|
+
function createCombinedTypeScriptReactBaseConfig(plugin) {
|
|
4022
|
+
return [...pluginBase_default(plugin), ...typeScriptBase_default, ...reactBase_default];
|
|
4023
|
+
}
|
|
4024
|
+
var typeScriptReactBase_default = createCombinedTypeScriptReactBaseConfig;
|
|
4025
|
+
|
|
4026
|
+
// src/configs/combined/javaScriptReactBase.ts
|
|
4027
|
+
function createCombinedJavaScriptReactBaseConfig(plugin) {
|
|
4028
|
+
return [...pluginBase_default(plugin), ...javaScriptBase_default, ...reactBase_default];
|
|
4029
|
+
}
|
|
4030
|
+
var javaScriptReactBase_default = createCombinedJavaScriptReactBaseConfig;
|
|
4031
|
+
|
|
4007
4032
|
// src/rules/consistent-test-function.ts
|
|
4008
4033
|
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
4009
4034
|
import z from "zod";
|
|
@@ -4424,6 +4449,57 @@ var noSkippedTests = createRule_default({
|
|
|
4424
4449
|
});
|
|
4425
4450
|
var no_skipped_tests_default = noSkippedTests;
|
|
4426
4451
|
|
|
4452
|
+
// src/rules/use-normalized-imports.ts
|
|
4453
|
+
import path from "path";
|
|
4454
|
+
var useNormalizedImports = createRule_default({
|
|
4455
|
+
name: "use-normalized-imports",
|
|
4456
|
+
meta: {
|
|
4457
|
+
docs: {
|
|
4458
|
+
description: "Enforce the usage of normalised imports (i.e. import paths that you would only get from path.posix.normalize())"
|
|
4459
|
+
},
|
|
4460
|
+
messages: {
|
|
4461
|
+
pathNotNormalized: "Import path {{nonNormalized}} is not normalised. Please use {{normalized}} instead."
|
|
4462
|
+
},
|
|
4463
|
+
type: "suggestion",
|
|
4464
|
+
schema: [
|
|
4465
|
+
{
|
|
4466
|
+
type: "object",
|
|
4467
|
+
properties: {
|
|
4468
|
+
fixable: {
|
|
4469
|
+
type: "boolean"
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
4472
|
+
}
|
|
4473
|
+
],
|
|
4474
|
+
fixable: "code"
|
|
4475
|
+
},
|
|
4476
|
+
defaultOptions: [{ fixable: true }],
|
|
4477
|
+
create(context) {
|
|
4478
|
+
var _a, _b;
|
|
4479
|
+
const isFixable = (_b = (_a = context.options[0]) == null ? void 0 : _a.fixable) != null ? _b : true;
|
|
4480
|
+
return {
|
|
4481
|
+
ImportDeclaration(node) {
|
|
4482
|
+
const normalizedPath = path.posix.normalize(node.source.value);
|
|
4483
|
+
if (node.source.value !== normalizedPath) {
|
|
4484
|
+
return context.report({
|
|
4485
|
+
node,
|
|
4486
|
+
messageId: "pathNotNormalized",
|
|
4487
|
+
data: {
|
|
4488
|
+
nonNormalized: node.source.value,
|
|
4489
|
+
normalized: normalizedPath
|
|
4490
|
+
},
|
|
4491
|
+
fix: isFixable ? (fixer) => {
|
|
4492
|
+
const [quote] = node.source.raw;
|
|
4493
|
+
return fixer.replaceText(node.source, `${quote}${normalizedPath}${quote}`);
|
|
4494
|
+
} : void 0
|
|
4495
|
+
});
|
|
4496
|
+
}
|
|
4497
|
+
}
|
|
4498
|
+
};
|
|
4499
|
+
}
|
|
4500
|
+
});
|
|
4501
|
+
var use_normalized_imports_default = useNormalizedImports;
|
|
4502
|
+
|
|
4427
4503
|
// src/rules/use-object-shorthand.ts
|
|
4428
4504
|
import { AST_NODE_TYPES as AST_NODE_TYPES3 } from "@typescript-eslint/utils";
|
|
4429
4505
|
var useObjectShorthand = createRule_default({
|
|
@@ -4470,6 +4546,7 @@ var rules_default = {
|
|
|
4470
4546
|
"no-plugin-configs-access-from-src-configs": no_plugin_configs_access_from_src_configs_default,
|
|
4471
4547
|
"no-relative-imports": no_relative_imports_default,
|
|
4472
4548
|
"no-skipped-tests": no_skipped_tests_default,
|
|
4549
|
+
"use-normalized-imports": use_normalized_imports_default,
|
|
4473
4550
|
"use-object-shorthand": use_object_shorthand_default
|
|
4474
4551
|
};
|
|
4475
4552
|
|
|
@@ -4527,7 +4604,9 @@ alexPlugin.configs = createPluginConfigs_default({
|
|
|
4527
4604
|
javaScript: javaScriptBase_default2(alexPlugin),
|
|
4528
4605
|
typeScript: typeScriptBase_default2(alexPlugin),
|
|
4529
4606
|
react: reactBase_default2(alexPlugin),
|
|
4530
|
-
tests: testsBase_default3(alexPlugin)
|
|
4607
|
+
tests: testsBase_default3(alexPlugin),
|
|
4608
|
+
typeScriptReact: typeScriptReactBase_default(alexPlugin),
|
|
4609
|
+
javaScriptReact: javaScriptReactBase_default(alexPlugin)
|
|
4531
4610
|
}
|
|
4532
4611
|
});
|
|
4533
4612
|
var alexPlugin_default = alexPlugin;
|