@alextheman/eslint-plugin 1.2.1 → 1.2.3
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 +33 -17
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -17
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3705,7 +3705,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
3705
3705
|
|
|
3706
3706
|
// package.json
|
|
3707
3707
|
var name = "@alextheman/eslint-plugin";
|
|
3708
|
-
var version = "1.2.
|
|
3708
|
+
var version = "1.2.3";
|
|
3709
3709
|
|
|
3710
3710
|
// src/create-rule.ts
|
|
3711
3711
|
var import_utils = require("@typescript-eslint/utils");
|
|
@@ -3872,16 +3872,10 @@ var eslint_config_default = [
|
|
|
3872
3872
|
rules: {
|
|
3873
3873
|
"import/no-unresolved": warnOnFixButErrorOnLint,
|
|
3874
3874
|
eqeqeq: warnOnFixButErrorOnLint,
|
|
3875
|
-
"no-console": "warn",
|
|
3875
|
+
"no-console": [warnOnFixButErrorOnLint, { allow: ["warn", "error"] }],
|
|
3876
3876
|
"no-restricted-imports": [
|
|
3877
3877
|
warnOnFixButErrorOnLint,
|
|
3878
3878
|
{
|
|
3879
|
-
paths: [
|
|
3880
|
-
{
|
|
3881
|
-
name: "@mui/material",
|
|
3882
|
-
message: 'Please use `import Component from "@mui/material/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.'
|
|
3883
|
-
}
|
|
3884
|
-
],
|
|
3885
3879
|
patterns: [
|
|
3886
3880
|
{
|
|
3887
3881
|
group: ["./", "../"],
|
|
@@ -3900,12 +3894,19 @@ var eslint_config_default = [
|
|
|
3900
3894
|
],
|
|
3901
3895
|
// Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
|
|
3902
3896
|
"no-unused-vars": "off",
|
|
3903
|
-
"func-style": [
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
"
|
|
3897
|
+
"func-style": [
|
|
3898
|
+
warnOnFixButErrorOnLint,
|
|
3899
|
+
"declaration",
|
|
3900
|
+
{ allowArrowFunctions: false }
|
|
3901
|
+
],
|
|
3902
|
+
"prefer-arrow-callback": [
|
|
3903
|
+
warnOnFixButErrorOnLint,
|
|
3904
|
+
{ allowNamedFunctions: false }
|
|
3905
|
+
],
|
|
3906
|
+
"no-param-reassign": warnOnFixButErrorOnLint,
|
|
3907
|
+
"no-useless-rename": warnOnFixButErrorOnLint,
|
|
3908
|
+
"sort-vars": warnOnFixButErrorOnLint,
|
|
3909
|
+
"no-cond-assign": warnOnFixButErrorOnLint,
|
|
3909
3910
|
"no-undef": warnOnFixButErrorOnLint
|
|
3910
3911
|
}
|
|
3911
3912
|
}
|
|
@@ -3933,8 +3934,12 @@ Object.assign(plugin.configs, {
|
|
|
3933
3934
|
"@alextheman": plugin
|
|
3934
3935
|
},
|
|
3935
3936
|
rules: {
|
|
3936
|
-
|
|
3937
|
-
|
|
3937
|
+
/* In this plugin's config, no-restricted-imports checks checks for relative imports and errors if they're found.
|
|
3938
|
+
In practice, though, this is something that would be caught by my custom linting rule, so no-restricted-imports can be disabled here
|
|
3939
|
+
in favour of @alextheman/no-relative-imports. */
|
|
3940
|
+
"no-restricted-imports": "off",
|
|
3941
|
+
"@alextheman/no-namespace-imports": warnOnFixButErrorOnLint,
|
|
3942
|
+
"@alextheman/no-relative-imports": warnOnFixButErrorOnLint
|
|
3938
3943
|
}
|
|
3939
3944
|
}
|
|
3940
3945
|
]
|
|
@@ -3957,7 +3962,18 @@ plugin.configs.alexTypeScriptReactBase = [
|
|
|
3957
3962
|
"warn",
|
|
3958
3963
|
{ allowConstantExport: true }
|
|
3959
3964
|
],
|
|
3960
|
-
"react-hooks/exhaustive-deps": "off"
|
|
3965
|
+
"react-hooks/exhaustive-deps": "off",
|
|
3966
|
+
"no-restricted-imports": [
|
|
3967
|
+
warnOnFixButErrorOnLint,
|
|
3968
|
+
{
|
|
3969
|
+
paths: [
|
|
3970
|
+
{
|
|
3971
|
+
name: "@mui/material",
|
|
3972
|
+
message: 'Please use `import Component from "@mui/material/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.'
|
|
3973
|
+
}
|
|
3974
|
+
]
|
|
3975
|
+
}
|
|
3976
|
+
]
|
|
3961
3977
|
})
|
|
3962
3978
|
}
|
|
3963
3979
|
];
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -3692,7 +3692,7 @@ var require_globals2 = __commonJS({
|
|
|
3692
3692
|
|
|
3693
3693
|
// package.json
|
|
3694
3694
|
var name = "@alextheman/eslint-plugin";
|
|
3695
|
-
var version = "1.2.
|
|
3695
|
+
var version = "1.2.3";
|
|
3696
3696
|
|
|
3697
3697
|
// src/create-rule.ts
|
|
3698
3698
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
@@ -3859,16 +3859,10 @@ var eslint_config_default = [
|
|
|
3859
3859
|
rules: {
|
|
3860
3860
|
"import/no-unresolved": warnOnFixButErrorOnLint,
|
|
3861
3861
|
eqeqeq: warnOnFixButErrorOnLint,
|
|
3862
|
-
"no-console": "warn",
|
|
3862
|
+
"no-console": [warnOnFixButErrorOnLint, { allow: ["warn", "error"] }],
|
|
3863
3863
|
"no-restricted-imports": [
|
|
3864
3864
|
warnOnFixButErrorOnLint,
|
|
3865
3865
|
{
|
|
3866
|
-
paths: [
|
|
3867
|
-
{
|
|
3868
|
-
name: "@mui/material",
|
|
3869
|
-
message: 'Please use `import Component from "@mui/material/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.'
|
|
3870
|
-
}
|
|
3871
|
-
],
|
|
3872
3866
|
patterns: [
|
|
3873
3867
|
{
|
|
3874
3868
|
group: ["./", "../"],
|
|
@@ -3887,12 +3881,19 @@ var eslint_config_default = [
|
|
|
3887
3881
|
],
|
|
3888
3882
|
// Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
|
|
3889
3883
|
"no-unused-vars": "off",
|
|
3890
|
-
"func-style": [
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
"
|
|
3884
|
+
"func-style": [
|
|
3885
|
+
warnOnFixButErrorOnLint,
|
|
3886
|
+
"declaration",
|
|
3887
|
+
{ allowArrowFunctions: false }
|
|
3888
|
+
],
|
|
3889
|
+
"prefer-arrow-callback": [
|
|
3890
|
+
warnOnFixButErrorOnLint,
|
|
3891
|
+
{ allowNamedFunctions: false }
|
|
3892
|
+
],
|
|
3893
|
+
"no-param-reassign": warnOnFixButErrorOnLint,
|
|
3894
|
+
"no-useless-rename": warnOnFixButErrorOnLint,
|
|
3895
|
+
"sort-vars": warnOnFixButErrorOnLint,
|
|
3896
|
+
"no-cond-assign": warnOnFixButErrorOnLint,
|
|
3896
3897
|
"no-undef": warnOnFixButErrorOnLint
|
|
3897
3898
|
}
|
|
3898
3899
|
}
|
|
@@ -3920,8 +3921,12 @@ Object.assign(plugin.configs, {
|
|
|
3920
3921
|
"@alextheman": plugin
|
|
3921
3922
|
},
|
|
3922
3923
|
rules: {
|
|
3923
|
-
|
|
3924
|
-
|
|
3924
|
+
/* In this plugin's config, no-restricted-imports checks checks for relative imports and errors if they're found.
|
|
3925
|
+
In practice, though, this is something that would be caught by my custom linting rule, so no-restricted-imports can be disabled here
|
|
3926
|
+
in favour of @alextheman/no-relative-imports. */
|
|
3927
|
+
"no-restricted-imports": "off",
|
|
3928
|
+
"@alextheman/no-namespace-imports": warnOnFixButErrorOnLint,
|
|
3929
|
+
"@alextheman/no-relative-imports": warnOnFixButErrorOnLint
|
|
3925
3930
|
}
|
|
3926
3931
|
}
|
|
3927
3932
|
]
|
|
@@ -3944,7 +3949,18 @@ plugin.configs.alexTypeScriptReactBase = [
|
|
|
3944
3949
|
"warn",
|
|
3945
3950
|
{ allowConstantExport: true }
|
|
3946
3951
|
],
|
|
3947
|
-
"react-hooks/exhaustive-deps": "off"
|
|
3952
|
+
"react-hooks/exhaustive-deps": "off",
|
|
3953
|
+
"no-restricted-imports": [
|
|
3954
|
+
warnOnFixButErrorOnLint,
|
|
3955
|
+
{
|
|
3956
|
+
paths: [
|
|
3957
|
+
{
|
|
3958
|
+
name: "@mui/material",
|
|
3959
|
+
message: 'Please use `import Component from "@mui/material/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.'
|
|
3960
|
+
}
|
|
3961
|
+
]
|
|
3962
|
+
}
|
|
3963
|
+
]
|
|
3948
3964
|
})
|
|
3949
3965
|
}
|
|
3950
3966
|
];
|