@alextheman/eslint-plugin 2.3.0 → 2.4.1
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 +127 -118
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +127 -118
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3715,7 +3715,81 @@ 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.4.1";
|
|
3719
|
+
|
|
3720
|
+
// src/configs/plugin/pluginBase.ts
|
|
3721
|
+
function createPluginBaseConfig(plugin) {
|
|
3722
|
+
return [
|
|
3723
|
+
{
|
|
3724
|
+
plugins: {
|
|
3725
|
+
"@alextheman": plugin
|
|
3726
|
+
},
|
|
3727
|
+
rules: {
|
|
3728
|
+
"@alextheman/no-namespace-imports": "error",
|
|
3729
|
+
"@alextheman/use-normalized-imports": "error",
|
|
3730
|
+
"@alextheman/use-object-shorthand": "error"
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
];
|
|
3734
|
+
}
|
|
3735
|
+
var pluginBase_default = createPluginBaseConfig;
|
|
3736
|
+
|
|
3737
|
+
// src/configs/plugin/testsBase.ts
|
|
3738
|
+
function createPluginTestsBaseConfig(plugin) {
|
|
3739
|
+
return [
|
|
3740
|
+
{
|
|
3741
|
+
files: ["**/*.test.ts"],
|
|
3742
|
+
plugins: {
|
|
3743
|
+
"@alextheman": plugin
|
|
3744
|
+
},
|
|
3745
|
+
rules: {
|
|
3746
|
+
"@alextheman/consistent-test-function": ["error", { preference: "test" }],
|
|
3747
|
+
"@alextheman/no-isolated-tests": "error",
|
|
3748
|
+
"@alextheman/no-skipped-tests": "warn"
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
];
|
|
3752
|
+
}
|
|
3753
|
+
var testsBase_default = createPluginTestsBaseConfig;
|
|
3754
|
+
|
|
3755
|
+
// src/configs/combined/testsBase.ts
|
|
3756
|
+
function createCombinedTestsBaseConfig(plugin) {
|
|
3757
|
+
return [
|
|
3758
|
+
...testsBase_default(plugin),
|
|
3759
|
+
{
|
|
3760
|
+
files: ["**/*.test.{js,ts}"],
|
|
3761
|
+
rules: {
|
|
3762
|
+
"no-restricted-globals": [
|
|
3763
|
+
"error",
|
|
3764
|
+
{
|
|
3765
|
+
message: "Do not use global describe function. Import test functions from vitest instead.",
|
|
3766
|
+
name: "describe"
|
|
3767
|
+
},
|
|
3768
|
+
{
|
|
3769
|
+
message: "Do not use global test function. Import test functions from vitest instead.",
|
|
3770
|
+
name: "test"
|
|
3771
|
+
},
|
|
3772
|
+
{
|
|
3773
|
+
message: "Do not use global expect function. Import test functions from vitest instead.",
|
|
3774
|
+
name: "expect"
|
|
3775
|
+
}
|
|
3776
|
+
],
|
|
3777
|
+
"no-restricted-imports": [
|
|
3778
|
+
"error",
|
|
3779
|
+
{
|
|
3780
|
+
paths: [
|
|
3781
|
+
{
|
|
3782
|
+
message: "Use test functions from vitest instead.",
|
|
3783
|
+
name: "node:test"
|
|
3784
|
+
}
|
|
3785
|
+
]
|
|
3786
|
+
}
|
|
3787
|
+
]
|
|
3788
|
+
}
|
|
3789
|
+
}
|
|
3790
|
+
];
|
|
3791
|
+
}
|
|
3792
|
+
var testsBase_default2 = createCombinedTestsBaseConfig;
|
|
3719
3793
|
|
|
3720
3794
|
// src/configs/general/javaScriptBase.ts
|
|
3721
3795
|
var import_js = __toESM(require_src(), 1);
|
|
@@ -3725,50 +3799,6 @@ var import_eslint_plugin_package_json = __toESM(require("eslint-plugin-package-j
|
|
|
3725
3799
|
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
3726
3800
|
var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
3727
3801
|
var import_globals = __toESM(require_globals2(), 1);
|
|
3728
|
-
|
|
3729
|
-
// src/configs/general/prettierRules.ts
|
|
3730
|
-
var prettierRules = {
|
|
3731
|
-
printWidth: 100
|
|
3732
|
-
};
|
|
3733
|
-
var prettierRules_default = prettierRules;
|
|
3734
|
-
|
|
3735
|
-
// src/configs/general/testsBase.ts
|
|
3736
|
-
var testsBase = [
|
|
3737
|
-
{
|
|
3738
|
-
files: ["**/*.test.{js,ts}"],
|
|
3739
|
-
rules: {
|
|
3740
|
-
"no-restricted-globals": [
|
|
3741
|
-
"error",
|
|
3742
|
-
{
|
|
3743
|
-
message: "Do not use global describe function. Import test functions from vitest instead.",
|
|
3744
|
-
name: "describe"
|
|
3745
|
-
},
|
|
3746
|
-
{
|
|
3747
|
-
message: "Do not use global test function. Import test functions from vitest instead.",
|
|
3748
|
-
name: "test"
|
|
3749
|
-
},
|
|
3750
|
-
{
|
|
3751
|
-
message: "Do not use global expect function. Import test functions from vitest instead.",
|
|
3752
|
-
name: "expect"
|
|
3753
|
-
}
|
|
3754
|
-
],
|
|
3755
|
-
"no-restricted-imports": [
|
|
3756
|
-
"error",
|
|
3757
|
-
{
|
|
3758
|
-
paths: [
|
|
3759
|
-
{
|
|
3760
|
-
message: "Use test functions from vitest instead.",
|
|
3761
|
-
name: "node:test"
|
|
3762
|
-
}
|
|
3763
|
-
]
|
|
3764
|
-
}
|
|
3765
|
-
]
|
|
3766
|
-
}
|
|
3767
|
-
}
|
|
3768
|
-
];
|
|
3769
|
-
var testsBase_default = testsBase;
|
|
3770
|
-
|
|
3771
|
-
// src/configs/general/javaScriptBase.ts
|
|
3772
3802
|
var javaScriptBase = [
|
|
3773
3803
|
import_js.default.configs.recommended,
|
|
3774
3804
|
import_eslint_config_prettier.default,
|
|
@@ -3786,16 +3816,11 @@ var javaScriptBase = [
|
|
|
3786
3816
|
prettier: import_eslint_plugin_prettier.default
|
|
3787
3817
|
},
|
|
3788
3818
|
rules: {
|
|
3789
|
-
"arrow-body-style": ["error", "always"],
|
|
3790
|
-
curly: ["error", "all"],
|
|
3791
3819
|
eqeqeq: "error",
|
|
3792
|
-
"func-style": ["error", "declaration", { allowArrowFunctions: false }],
|
|
3793
3820
|
"import/no-unresolved": "error",
|
|
3794
3821
|
"no-cond-assign": "error",
|
|
3795
|
-
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
3796
|
-
"no-else-return": "error",
|
|
3822
|
+
"no-console": ["error", { allow: ["warn", "error", "info"] }],
|
|
3797
3823
|
"no-eval": "error",
|
|
3798
|
-
"no-implicit-coercion": ["error", { allow: ["!!"] }],
|
|
3799
3824
|
"no-lonely-if": "error",
|
|
3800
3825
|
"no-new-wrappers": "error",
|
|
3801
3826
|
"no-param-reassign": "error",
|
|
@@ -3821,7 +3846,6 @@ var javaScriptBase = [
|
|
|
3821
3846
|
],
|
|
3822
3847
|
"no-useless-rename": "error",
|
|
3823
3848
|
"no-useless-return": "error",
|
|
3824
|
-
"operator-assignment": ["error", "always"],
|
|
3825
3849
|
"perfectionist/sort-exports": [
|
|
3826
3850
|
"error",
|
|
3827
3851
|
{
|
|
@@ -3851,11 +3875,7 @@ var javaScriptBase = [
|
|
|
3851
3875
|
type: "alphabetical"
|
|
3852
3876
|
}
|
|
3853
3877
|
],
|
|
3854
|
-
"prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
|
|
3855
3878
|
"prefer-const": "error",
|
|
3856
|
-
"prefer-destructuring": "error",
|
|
3857
|
-
"prefer-template": "error",
|
|
3858
|
-
"prettier/prettier": ["warn", prettierRules_default],
|
|
3859
3879
|
"sort-vars": "error"
|
|
3860
3880
|
},
|
|
3861
3881
|
settings: {
|
|
@@ -3863,33 +3883,33 @@ var javaScriptBase = [
|
|
|
3863
3883
|
node: true
|
|
3864
3884
|
}
|
|
3865
3885
|
}
|
|
3866
|
-
}
|
|
3867
|
-
...testsBase_default
|
|
3886
|
+
}
|
|
3868
3887
|
];
|
|
3869
3888
|
var javaScriptBase_default = javaScriptBase;
|
|
3870
3889
|
|
|
3871
|
-
// src/configs/
|
|
3872
|
-
function
|
|
3890
|
+
// src/configs/combined/javaScriptBase.ts
|
|
3891
|
+
function createCombinedJavaScriptBaseConfig(plugin) {
|
|
3873
3892
|
return [
|
|
3893
|
+
...pluginBase_default(plugin),
|
|
3894
|
+
...javaScriptBase_default,
|
|
3874
3895
|
{
|
|
3875
|
-
plugins: {
|
|
3876
|
-
"@alextheman": plugin
|
|
3877
|
-
},
|
|
3878
3896
|
rules: {
|
|
3879
|
-
"@alextheman/no-namespace-imports": "error",
|
|
3880
3897
|
"@alextheman/no-relative-imports": "error",
|
|
3881
|
-
"
|
|
3882
|
-
|
|
3898
|
+
"arrow-body-style": ["error", "always"],
|
|
3899
|
+
curly: ["error", "all"],
|
|
3900
|
+
"func-style": ["error", "declaration", { allowArrowFunctions: false }],
|
|
3901
|
+
"no-else-return": "error",
|
|
3902
|
+
"no-implicit-coercion": ["error", { allow: ["!!"] }],
|
|
3903
|
+
"operator-assignment": ["error", "always"],
|
|
3904
|
+
"prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
|
|
3905
|
+
"prefer-destructuring": "error",
|
|
3906
|
+
"prefer-template": "error",
|
|
3907
|
+
"prettier/prettier": ["warn", prettierRules_default]
|
|
3883
3908
|
}
|
|
3884
|
-
}
|
|
3909
|
+
},
|
|
3910
|
+
...testsBase_default2(plugin)
|
|
3885
3911
|
];
|
|
3886
3912
|
}
|
|
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
3913
|
var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
|
|
3894
3914
|
|
|
3895
3915
|
// src/configs/general/reactBase.ts
|
|
@@ -3919,22 +3939,8 @@ var reactBase = [
|
|
|
3919
3939
|
"react-refresh": import_eslint_plugin_react_refresh.default
|
|
3920
3940
|
},
|
|
3921
3941
|
rules: __spreadProps(__spreadValues({}, import_eslint_plugin_react_hooks.default.configs.recommended.rules), {
|
|
3922
|
-
"no-restricted-imports": [
|
|
3923
|
-
"error",
|
|
3924
|
-
{
|
|
3925
|
-
patterns: [
|
|
3926
|
-
{
|
|
3927
|
-
message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.',
|
|
3928
|
-
regex: "^@mui/[^/]+$"
|
|
3929
|
-
}
|
|
3930
|
-
]
|
|
3931
|
-
}
|
|
3932
|
-
],
|
|
3933
|
-
"react-hooks/exhaustive-deps": "off",
|
|
3934
|
-
"react-refresh/only-export-components": "off",
|
|
3935
3942
|
"react/destructuring-assignment": ["error", "always", { destructureInSignature: "always" }],
|
|
3936
3943
|
"react/hook-use-state": "error",
|
|
3937
|
-
"react/jsx-boolean-value": "error",
|
|
3938
3944
|
"react/jsx-curly-brace-presence": [
|
|
3939
3945
|
"error",
|
|
3940
3946
|
{ children: "never", propElementValues: "always", props: "never" }
|
|
@@ -3954,33 +3960,36 @@ var reactBase_default = reactBase;
|
|
|
3954
3960
|
|
|
3955
3961
|
// src/configs/combined/reactBase.ts
|
|
3956
3962
|
function createCombinedReactBaseConfig(plugin) {
|
|
3957
|
-
return [...pluginBase_default(plugin), ...reactBase_default];
|
|
3958
|
-
}
|
|
3959
|
-
var reactBase_default2 = createCombinedReactBaseConfig;
|
|
3960
|
-
|
|
3961
|
-
// src/configs/plugin/testsBase.ts
|
|
3962
|
-
function createPluginTestsBaseConfig(plugin) {
|
|
3963
3963
|
return [
|
|
3964
|
+
...pluginBase_default(plugin),
|
|
3965
|
+
...reactBase_default,
|
|
3964
3966
|
{
|
|
3965
|
-
files: ["**/*.test.ts"],
|
|
3966
|
-
plugins: {
|
|
3967
|
-
"@alextheman": plugin
|
|
3968
|
-
},
|
|
3969
3967
|
rules: {
|
|
3970
|
-
"
|
|
3971
|
-
|
|
3972
|
-
|
|
3968
|
+
"no-restricted-imports": [
|
|
3969
|
+
"error",
|
|
3970
|
+
{
|
|
3971
|
+
patterns: [
|
|
3972
|
+
{
|
|
3973
|
+
message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.',
|
|
3974
|
+
regex: "^@mui/[^/]+$"
|
|
3975
|
+
}
|
|
3976
|
+
]
|
|
3977
|
+
}
|
|
3978
|
+
],
|
|
3979
|
+
"react-hooks/exhaustive-deps": "off",
|
|
3980
|
+
"react-refresh/only-export-components": "off",
|
|
3981
|
+
"react/jsx-boolean-value": "error"
|
|
3973
3982
|
}
|
|
3974
3983
|
}
|
|
3975
3984
|
];
|
|
3976
3985
|
}
|
|
3977
|
-
var
|
|
3986
|
+
var reactBase_default2 = createCombinedReactBaseConfig;
|
|
3978
3987
|
|
|
3979
|
-
// src/configs/
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
}
|
|
3983
|
-
var
|
|
3988
|
+
// src/configs/general/prettierRules.ts
|
|
3989
|
+
var prettierRules = {
|
|
3990
|
+
printWidth: 100
|
|
3991
|
+
};
|
|
3992
|
+
var prettierRules_default = prettierRules;
|
|
3984
3993
|
|
|
3985
3994
|
// src/configs/general/typeScriptBase.ts
|
|
3986
3995
|
var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
|
|
@@ -4001,14 +4010,9 @@ var typeScriptBase = [
|
|
|
4001
4010
|
},
|
|
4002
4011
|
name: "@alextheman/eslint-config-typescript-base",
|
|
4003
4012
|
rules: {
|
|
4004
|
-
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
|
4005
|
-
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
4006
|
-
"@typescript-eslint/consistent-type-definitions": "error",
|
|
4007
4013
|
"@typescript-eslint/consistent-type-exports": "error",
|
|
4008
4014
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
4009
|
-
"@typescript-eslint/dot-notation": "error",
|
|
4010
4015
|
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
4011
|
-
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
4012
4016
|
"@typescript-eslint/no-deprecated": "warn",
|
|
4013
4017
|
// Explicit any can be helpful sometimes, so it's not worth erroring on every single one.
|
|
4014
4018
|
"@typescript-eslint/no-explicit-any": "off",
|
|
@@ -4044,8 +4048,14 @@ function createCombinedTypeScriptBaseConfig(plugin) {
|
|
|
4044
4048
|
...pluginBase_default(plugin),
|
|
4045
4049
|
...typeScriptBase_default,
|
|
4046
4050
|
{
|
|
4051
|
+
files: ["**/*.ts", "**/*.tsx", "!package.json"],
|
|
4047
4052
|
rules: {
|
|
4048
|
-
"@alextheman/standardise-error-messages": "error"
|
|
4053
|
+
"@alextheman/standardise-error-messages": "error",
|
|
4054
|
+
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
|
4055
|
+
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
4056
|
+
"@typescript-eslint/consistent-type-definitions": "error",
|
|
4057
|
+
"@typescript-eslint/dot-notation": "error",
|
|
4058
|
+
"@typescript-eslint/method-signature-style": ["error", "property"]
|
|
4049
4059
|
}
|
|
4050
4060
|
}
|
|
4051
4061
|
];
|
|
@@ -4054,13 +4064,13 @@ var typeScriptBase_default2 = createCombinedTypeScriptBaseConfig;
|
|
|
4054
4064
|
|
|
4055
4065
|
// src/configs/combined/typeScriptReactBase.ts
|
|
4056
4066
|
function createCombinedTypeScriptReactBaseConfig(plugin) {
|
|
4057
|
-
return [...typeScriptBase_default2(plugin), ...
|
|
4067
|
+
return [...typeScriptBase_default2(plugin), ...reactBase_default2(plugin)];
|
|
4058
4068
|
}
|
|
4059
4069
|
var typeScriptReactBase_default = createCombinedTypeScriptReactBaseConfig;
|
|
4060
4070
|
|
|
4061
4071
|
// src/configs/combined/javaScriptReactBase.ts
|
|
4062
4072
|
function createCombinedJavaScriptReactBaseConfig(plugin) {
|
|
4063
|
-
return [...
|
|
4073
|
+
return [...javaScriptBase_default2(plugin), ...reactBase_default2(plugin)];
|
|
4064
4074
|
}
|
|
4065
4075
|
var javaScriptReactBase_default = createCombinedJavaScriptReactBaseConfig;
|
|
4066
4076
|
|
|
@@ -4684,18 +4694,17 @@ alexPlugin.configs = createPluginConfigs_default({
|
|
|
4684
4694
|
general: {
|
|
4685
4695
|
javaScript: javaScriptBase_default,
|
|
4686
4696
|
typeScript: typeScriptBase_default,
|
|
4687
|
-
react: reactBase_default
|
|
4688
|
-
tests: testsBase_default
|
|
4697
|
+
react: reactBase_default
|
|
4689
4698
|
},
|
|
4690
4699
|
plugin: {
|
|
4691
4700
|
base: pluginBase_default(alexPlugin),
|
|
4692
|
-
tests:
|
|
4701
|
+
tests: testsBase_default(alexPlugin)
|
|
4693
4702
|
},
|
|
4694
4703
|
combined: {
|
|
4695
4704
|
javaScript: javaScriptBase_default2(alexPlugin),
|
|
4696
4705
|
typeScript: typeScriptBase_default2(alexPlugin),
|
|
4697
4706
|
react: reactBase_default2(alexPlugin),
|
|
4698
|
-
tests:
|
|
4707
|
+
tests: testsBase_default2(alexPlugin),
|
|
4699
4708
|
typeScriptReact: typeScriptReactBase_default(alexPlugin),
|
|
4700
4709
|
javaScriptReact: javaScriptReactBase_default(alexPlugin)
|
|
4701
4710
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -3,14 +3,13 @@ import z from 'zod';
|
|
|
3
3
|
import { Config } from 'prettier';
|
|
4
4
|
|
|
5
5
|
var name = "@alextheman/eslint-plugin";
|
|
6
|
-
var version = "2.
|
|
6
|
+
var version = "2.4.1";
|
|
7
7
|
|
|
8
8
|
interface AlexPluginConfigs {
|
|
9
9
|
general: {
|
|
10
10
|
javaScript: Linter.Config[];
|
|
11
11
|
typeScript: Linter.Config[];
|
|
12
12
|
react: Linter.Config[];
|
|
13
|
-
tests: Linter.Config[];
|
|
14
13
|
};
|
|
15
14
|
plugin: {
|
|
16
15
|
base: Linter.Config[];
|
package/dist/index.d.ts
CHANGED
|
@@ -3,14 +3,13 @@ import z from 'zod';
|
|
|
3
3
|
import { Config } from 'prettier';
|
|
4
4
|
|
|
5
5
|
var name = "@alextheman/eslint-plugin";
|
|
6
|
-
var version = "2.
|
|
6
|
+
var version = "2.4.1";
|
|
7
7
|
|
|
8
8
|
interface AlexPluginConfigs {
|
|
9
9
|
general: {
|
|
10
10
|
javaScript: Linter.Config[];
|
|
11
11
|
typeScript: Linter.Config[];
|
|
12
12
|
react: Linter.Config[];
|
|
13
|
-
tests: Linter.Config[];
|
|
14
13
|
};
|
|
15
14
|
plugin: {
|
|
16
15
|
base: Linter.Config[];
|
package/dist/index.js
CHANGED
|
@@ -3700,7 +3700,81 @@ 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.4.1";
|
|
3704
|
+
|
|
3705
|
+
// src/configs/plugin/pluginBase.ts
|
|
3706
|
+
function createPluginBaseConfig(plugin) {
|
|
3707
|
+
return [
|
|
3708
|
+
{
|
|
3709
|
+
plugins: {
|
|
3710
|
+
"@alextheman": plugin
|
|
3711
|
+
},
|
|
3712
|
+
rules: {
|
|
3713
|
+
"@alextheman/no-namespace-imports": "error",
|
|
3714
|
+
"@alextheman/use-normalized-imports": "error",
|
|
3715
|
+
"@alextheman/use-object-shorthand": "error"
|
|
3716
|
+
}
|
|
3717
|
+
}
|
|
3718
|
+
];
|
|
3719
|
+
}
|
|
3720
|
+
var pluginBase_default = createPluginBaseConfig;
|
|
3721
|
+
|
|
3722
|
+
// src/configs/plugin/testsBase.ts
|
|
3723
|
+
function createPluginTestsBaseConfig(plugin) {
|
|
3724
|
+
return [
|
|
3725
|
+
{
|
|
3726
|
+
files: ["**/*.test.ts"],
|
|
3727
|
+
plugins: {
|
|
3728
|
+
"@alextheman": plugin
|
|
3729
|
+
},
|
|
3730
|
+
rules: {
|
|
3731
|
+
"@alextheman/consistent-test-function": ["error", { preference: "test" }],
|
|
3732
|
+
"@alextheman/no-isolated-tests": "error",
|
|
3733
|
+
"@alextheman/no-skipped-tests": "warn"
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
];
|
|
3737
|
+
}
|
|
3738
|
+
var testsBase_default = createPluginTestsBaseConfig;
|
|
3739
|
+
|
|
3740
|
+
// src/configs/combined/testsBase.ts
|
|
3741
|
+
function createCombinedTestsBaseConfig(plugin) {
|
|
3742
|
+
return [
|
|
3743
|
+
...testsBase_default(plugin),
|
|
3744
|
+
{
|
|
3745
|
+
files: ["**/*.test.{js,ts}"],
|
|
3746
|
+
rules: {
|
|
3747
|
+
"no-restricted-globals": [
|
|
3748
|
+
"error",
|
|
3749
|
+
{
|
|
3750
|
+
message: "Do not use global describe function. Import test functions from vitest instead.",
|
|
3751
|
+
name: "describe"
|
|
3752
|
+
},
|
|
3753
|
+
{
|
|
3754
|
+
message: "Do not use global test function. Import test functions from vitest instead.",
|
|
3755
|
+
name: "test"
|
|
3756
|
+
},
|
|
3757
|
+
{
|
|
3758
|
+
message: "Do not use global expect function. Import test functions from vitest instead.",
|
|
3759
|
+
name: "expect"
|
|
3760
|
+
}
|
|
3761
|
+
],
|
|
3762
|
+
"no-restricted-imports": [
|
|
3763
|
+
"error",
|
|
3764
|
+
{
|
|
3765
|
+
paths: [
|
|
3766
|
+
{
|
|
3767
|
+
message: "Use test functions from vitest instead.",
|
|
3768
|
+
name: "node:test"
|
|
3769
|
+
}
|
|
3770
|
+
]
|
|
3771
|
+
}
|
|
3772
|
+
]
|
|
3773
|
+
}
|
|
3774
|
+
}
|
|
3775
|
+
];
|
|
3776
|
+
}
|
|
3777
|
+
var testsBase_default2 = createCombinedTestsBaseConfig;
|
|
3704
3778
|
|
|
3705
3779
|
// src/configs/general/javaScriptBase.ts
|
|
3706
3780
|
var import_js = __toESM(require_src(), 1);
|
|
@@ -3710,50 +3784,6 @@ import importPlugin from "eslint-plugin-import";
|
|
|
3710
3784
|
import packageJson from "eslint-plugin-package-json";
|
|
3711
3785
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
3712
3786
|
import prettierPlugin from "eslint-plugin-prettier";
|
|
3713
|
-
|
|
3714
|
-
// src/configs/general/prettierRules.ts
|
|
3715
|
-
var prettierRules = {
|
|
3716
|
-
printWidth: 100
|
|
3717
|
-
};
|
|
3718
|
-
var prettierRules_default = prettierRules;
|
|
3719
|
-
|
|
3720
|
-
// src/configs/general/testsBase.ts
|
|
3721
|
-
var testsBase = [
|
|
3722
|
-
{
|
|
3723
|
-
files: ["**/*.test.{js,ts}"],
|
|
3724
|
-
rules: {
|
|
3725
|
-
"no-restricted-globals": [
|
|
3726
|
-
"error",
|
|
3727
|
-
{
|
|
3728
|
-
message: "Do not use global describe function. Import test functions from vitest instead.",
|
|
3729
|
-
name: "describe"
|
|
3730
|
-
},
|
|
3731
|
-
{
|
|
3732
|
-
message: "Do not use global test function. Import test functions from vitest instead.",
|
|
3733
|
-
name: "test"
|
|
3734
|
-
},
|
|
3735
|
-
{
|
|
3736
|
-
message: "Do not use global expect function. Import test functions from vitest instead.",
|
|
3737
|
-
name: "expect"
|
|
3738
|
-
}
|
|
3739
|
-
],
|
|
3740
|
-
"no-restricted-imports": [
|
|
3741
|
-
"error",
|
|
3742
|
-
{
|
|
3743
|
-
paths: [
|
|
3744
|
-
{
|
|
3745
|
-
message: "Use test functions from vitest instead.",
|
|
3746
|
-
name: "node:test"
|
|
3747
|
-
}
|
|
3748
|
-
]
|
|
3749
|
-
}
|
|
3750
|
-
]
|
|
3751
|
-
}
|
|
3752
|
-
}
|
|
3753
|
-
];
|
|
3754
|
-
var testsBase_default = testsBase;
|
|
3755
|
-
|
|
3756
|
-
// src/configs/general/javaScriptBase.ts
|
|
3757
3787
|
var javaScriptBase = [
|
|
3758
3788
|
import_js.default.configs.recommended,
|
|
3759
3789
|
prettierConfig,
|
|
@@ -3771,16 +3801,11 @@ var javaScriptBase = [
|
|
|
3771
3801
|
prettier: prettierPlugin
|
|
3772
3802
|
},
|
|
3773
3803
|
rules: {
|
|
3774
|
-
"arrow-body-style": ["error", "always"],
|
|
3775
|
-
curly: ["error", "all"],
|
|
3776
3804
|
eqeqeq: "error",
|
|
3777
|
-
"func-style": ["error", "declaration", { allowArrowFunctions: false }],
|
|
3778
3805
|
"import/no-unresolved": "error",
|
|
3779
3806
|
"no-cond-assign": "error",
|
|
3780
|
-
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
3781
|
-
"no-else-return": "error",
|
|
3807
|
+
"no-console": ["error", { allow: ["warn", "error", "info"] }],
|
|
3782
3808
|
"no-eval": "error",
|
|
3783
|
-
"no-implicit-coercion": ["error", { allow: ["!!"] }],
|
|
3784
3809
|
"no-lonely-if": "error",
|
|
3785
3810
|
"no-new-wrappers": "error",
|
|
3786
3811
|
"no-param-reassign": "error",
|
|
@@ -3806,7 +3831,6 @@ var javaScriptBase = [
|
|
|
3806
3831
|
],
|
|
3807
3832
|
"no-useless-rename": "error",
|
|
3808
3833
|
"no-useless-return": "error",
|
|
3809
|
-
"operator-assignment": ["error", "always"],
|
|
3810
3834
|
"perfectionist/sort-exports": [
|
|
3811
3835
|
"error",
|
|
3812
3836
|
{
|
|
@@ -3836,11 +3860,7 @@ var javaScriptBase = [
|
|
|
3836
3860
|
type: "alphabetical"
|
|
3837
3861
|
}
|
|
3838
3862
|
],
|
|
3839
|
-
"prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
|
|
3840
3863
|
"prefer-const": "error",
|
|
3841
|
-
"prefer-destructuring": "error",
|
|
3842
|
-
"prefer-template": "error",
|
|
3843
|
-
"prettier/prettier": ["warn", prettierRules_default],
|
|
3844
3864
|
"sort-vars": "error"
|
|
3845
3865
|
},
|
|
3846
3866
|
settings: {
|
|
@@ -3848,33 +3868,33 @@ var javaScriptBase = [
|
|
|
3848
3868
|
node: true
|
|
3849
3869
|
}
|
|
3850
3870
|
}
|
|
3851
|
-
}
|
|
3852
|
-
...testsBase_default
|
|
3871
|
+
}
|
|
3853
3872
|
];
|
|
3854
3873
|
var javaScriptBase_default = javaScriptBase;
|
|
3855
3874
|
|
|
3856
|
-
// src/configs/
|
|
3857
|
-
function
|
|
3875
|
+
// src/configs/combined/javaScriptBase.ts
|
|
3876
|
+
function createCombinedJavaScriptBaseConfig(plugin) {
|
|
3858
3877
|
return [
|
|
3878
|
+
...pluginBase_default(plugin),
|
|
3879
|
+
...javaScriptBase_default,
|
|
3859
3880
|
{
|
|
3860
|
-
plugins: {
|
|
3861
|
-
"@alextheman": plugin
|
|
3862
|
-
},
|
|
3863
3881
|
rules: {
|
|
3864
|
-
"@alextheman/no-namespace-imports": "error",
|
|
3865
3882
|
"@alextheman/no-relative-imports": "error",
|
|
3866
|
-
"
|
|
3867
|
-
|
|
3883
|
+
"arrow-body-style": ["error", "always"],
|
|
3884
|
+
curly: ["error", "all"],
|
|
3885
|
+
"func-style": ["error", "declaration", { allowArrowFunctions: false }],
|
|
3886
|
+
"no-else-return": "error",
|
|
3887
|
+
"no-implicit-coercion": ["error", { allow: ["!!"] }],
|
|
3888
|
+
"operator-assignment": ["error", "always"],
|
|
3889
|
+
"prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
|
|
3890
|
+
"prefer-destructuring": "error",
|
|
3891
|
+
"prefer-template": "error",
|
|
3892
|
+
"prettier/prettier": ["warn", prettierRules_default]
|
|
3868
3893
|
}
|
|
3869
|
-
}
|
|
3894
|
+
},
|
|
3895
|
+
...testsBase_default2(plugin)
|
|
3870
3896
|
];
|
|
3871
3897
|
}
|
|
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
3898
|
var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
|
|
3879
3899
|
|
|
3880
3900
|
// src/configs/general/reactBase.ts
|
|
@@ -3904,22 +3924,8 @@ var reactBase = [
|
|
|
3904
3924
|
"react-refresh": reactRefresh
|
|
3905
3925
|
},
|
|
3906
3926
|
rules: __spreadProps(__spreadValues({}, reactHooks.configs.recommended.rules), {
|
|
3907
|
-
"no-restricted-imports": [
|
|
3908
|
-
"error",
|
|
3909
|
-
{
|
|
3910
|
-
patterns: [
|
|
3911
|
-
{
|
|
3912
|
-
message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.',
|
|
3913
|
-
regex: "^@mui/[^/]+$"
|
|
3914
|
-
}
|
|
3915
|
-
]
|
|
3916
|
-
}
|
|
3917
|
-
],
|
|
3918
|
-
"react-hooks/exhaustive-deps": "off",
|
|
3919
|
-
"react-refresh/only-export-components": "off",
|
|
3920
3927
|
"react/destructuring-assignment": ["error", "always", { destructureInSignature: "always" }],
|
|
3921
3928
|
"react/hook-use-state": "error",
|
|
3922
|
-
"react/jsx-boolean-value": "error",
|
|
3923
3929
|
"react/jsx-curly-brace-presence": [
|
|
3924
3930
|
"error",
|
|
3925
3931
|
{ children: "never", propElementValues: "always", props: "never" }
|
|
@@ -3939,33 +3945,36 @@ var reactBase_default = reactBase;
|
|
|
3939
3945
|
|
|
3940
3946
|
// src/configs/combined/reactBase.ts
|
|
3941
3947
|
function createCombinedReactBaseConfig(plugin) {
|
|
3942
|
-
return [...pluginBase_default(plugin), ...reactBase_default];
|
|
3943
|
-
}
|
|
3944
|
-
var reactBase_default2 = createCombinedReactBaseConfig;
|
|
3945
|
-
|
|
3946
|
-
// src/configs/plugin/testsBase.ts
|
|
3947
|
-
function createPluginTestsBaseConfig(plugin) {
|
|
3948
3948
|
return [
|
|
3949
|
+
...pluginBase_default(plugin),
|
|
3950
|
+
...reactBase_default,
|
|
3949
3951
|
{
|
|
3950
|
-
files: ["**/*.test.ts"],
|
|
3951
|
-
plugins: {
|
|
3952
|
-
"@alextheman": plugin
|
|
3953
|
-
},
|
|
3954
3952
|
rules: {
|
|
3955
|
-
"
|
|
3956
|
-
|
|
3957
|
-
|
|
3953
|
+
"no-restricted-imports": [
|
|
3954
|
+
"error",
|
|
3955
|
+
{
|
|
3956
|
+
patterns: [
|
|
3957
|
+
{
|
|
3958
|
+
message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.',
|
|
3959
|
+
regex: "^@mui/[^/]+$"
|
|
3960
|
+
}
|
|
3961
|
+
]
|
|
3962
|
+
}
|
|
3963
|
+
],
|
|
3964
|
+
"react-hooks/exhaustive-deps": "off",
|
|
3965
|
+
"react-refresh/only-export-components": "off",
|
|
3966
|
+
"react/jsx-boolean-value": "error"
|
|
3958
3967
|
}
|
|
3959
3968
|
}
|
|
3960
3969
|
];
|
|
3961
3970
|
}
|
|
3962
|
-
var
|
|
3971
|
+
var reactBase_default2 = createCombinedReactBaseConfig;
|
|
3963
3972
|
|
|
3964
|
-
// src/configs/
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
}
|
|
3968
|
-
var
|
|
3973
|
+
// src/configs/general/prettierRules.ts
|
|
3974
|
+
var prettierRules = {
|
|
3975
|
+
printWidth: 100
|
|
3976
|
+
};
|
|
3977
|
+
var prettierRules_default = prettierRules;
|
|
3969
3978
|
|
|
3970
3979
|
// src/configs/general/typeScriptBase.ts
|
|
3971
3980
|
import tsparser from "@typescript-eslint/parser";
|
|
@@ -3986,14 +3995,9 @@ var typeScriptBase = [
|
|
|
3986
3995
|
},
|
|
3987
3996
|
name: "@alextheman/eslint-config-typescript-base",
|
|
3988
3997
|
rules: {
|
|
3989
|
-
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
|
3990
|
-
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
3991
|
-
"@typescript-eslint/consistent-type-definitions": "error",
|
|
3992
3998
|
"@typescript-eslint/consistent-type-exports": "error",
|
|
3993
3999
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
3994
|
-
"@typescript-eslint/dot-notation": "error",
|
|
3995
4000
|
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
3996
|
-
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
3997
4001
|
"@typescript-eslint/no-deprecated": "warn",
|
|
3998
4002
|
// Explicit any can be helpful sometimes, so it's not worth erroring on every single one.
|
|
3999
4003
|
"@typescript-eslint/no-explicit-any": "off",
|
|
@@ -4029,8 +4033,14 @@ function createCombinedTypeScriptBaseConfig(plugin) {
|
|
|
4029
4033
|
...pluginBase_default(plugin),
|
|
4030
4034
|
...typeScriptBase_default,
|
|
4031
4035
|
{
|
|
4036
|
+
files: ["**/*.ts", "**/*.tsx", "!package.json"],
|
|
4032
4037
|
rules: {
|
|
4033
|
-
"@alextheman/standardise-error-messages": "error"
|
|
4038
|
+
"@alextheman/standardise-error-messages": "error",
|
|
4039
|
+
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
|
4040
|
+
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
4041
|
+
"@typescript-eslint/consistent-type-definitions": "error",
|
|
4042
|
+
"@typescript-eslint/dot-notation": "error",
|
|
4043
|
+
"@typescript-eslint/method-signature-style": ["error", "property"]
|
|
4034
4044
|
}
|
|
4035
4045
|
}
|
|
4036
4046
|
];
|
|
@@ -4039,13 +4049,13 @@ var typeScriptBase_default2 = createCombinedTypeScriptBaseConfig;
|
|
|
4039
4049
|
|
|
4040
4050
|
// src/configs/combined/typeScriptReactBase.ts
|
|
4041
4051
|
function createCombinedTypeScriptReactBaseConfig(plugin) {
|
|
4042
|
-
return [...typeScriptBase_default2(plugin), ...
|
|
4052
|
+
return [...typeScriptBase_default2(plugin), ...reactBase_default2(plugin)];
|
|
4043
4053
|
}
|
|
4044
4054
|
var typeScriptReactBase_default = createCombinedTypeScriptReactBaseConfig;
|
|
4045
4055
|
|
|
4046
4056
|
// src/configs/combined/javaScriptReactBase.ts
|
|
4047
4057
|
function createCombinedJavaScriptReactBaseConfig(plugin) {
|
|
4048
|
-
return [...
|
|
4058
|
+
return [...javaScriptBase_default2(plugin), ...reactBase_default2(plugin)];
|
|
4049
4059
|
}
|
|
4050
4060
|
var javaScriptReactBase_default = createCombinedJavaScriptReactBaseConfig;
|
|
4051
4061
|
|
|
@@ -4669,18 +4679,17 @@ alexPlugin.configs = createPluginConfigs_default({
|
|
|
4669
4679
|
general: {
|
|
4670
4680
|
javaScript: javaScriptBase_default,
|
|
4671
4681
|
typeScript: typeScriptBase_default,
|
|
4672
|
-
react: reactBase_default
|
|
4673
|
-
tests: testsBase_default
|
|
4682
|
+
react: reactBase_default
|
|
4674
4683
|
},
|
|
4675
4684
|
plugin: {
|
|
4676
4685
|
base: pluginBase_default(alexPlugin),
|
|
4677
|
-
tests:
|
|
4686
|
+
tests: testsBase_default(alexPlugin)
|
|
4678
4687
|
},
|
|
4679
4688
|
combined: {
|
|
4680
4689
|
javaScript: javaScriptBase_default2(alexPlugin),
|
|
4681
4690
|
typeScript: typeScriptBase_default2(alexPlugin),
|
|
4682
4691
|
react: reactBase_default2(alexPlugin),
|
|
4683
|
-
tests:
|
|
4692
|
+
tests: testsBase_default2(alexPlugin),
|
|
4684
4693
|
typeScriptReact: typeScriptReactBase_default(alexPlugin),
|
|
4685
4694
|
javaScriptReact: javaScriptReactBase_default(alexPlugin)
|
|
4686
4695
|
}
|