@alextheman/eslint-plugin 1.1.2 → 1.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 +131 -88
- package/dist/index.d.cts +8 -1287
- package/dist/index.d.ts +8 -1287
- package/dist/index.js +132 -84
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
7
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -18,6 +20,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
20
|
}
|
|
19
21
|
return a;
|
|
20
22
|
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
24
|
var __commonJS = (cb, mod) => function __require() {
|
|
22
25
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
23
26
|
};
|
|
@@ -3687,84 +3690,9 @@ var require_globals2 = __commonJS({
|
|
|
3687
3690
|
}
|
|
3688
3691
|
});
|
|
3689
3692
|
|
|
3690
|
-
// src/configs/eslint-config-typescript-base.ts
|
|
3691
|
-
var import_js = __toESM(require_src(), 1);
|
|
3692
|
-
var import_globals = __toESM(require_globals2(), 1);
|
|
3693
|
-
import eslintPlugin from "@typescript-eslint/eslint-plugin";
|
|
3694
|
-
import tsparser from "@typescript-eslint/parser";
|
|
3695
|
-
import importPlugin from "eslint-plugin-import";
|
|
3696
|
-
var warnOnFixButErrorOnLint = process.env.ESLINT_MODE === "fix" ? "warn" : "error";
|
|
3697
|
-
var eslint_config_typescript_base_default = [
|
|
3698
|
-
import_js.default.configs.recommended,
|
|
3699
|
-
{
|
|
3700
|
-
name: "@alextheman/eslint-config-typescript-base",
|
|
3701
|
-
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
|
3702
|
-
languageOptions: {
|
|
3703
|
-
parser: tsparser,
|
|
3704
|
-
parserOptions: {
|
|
3705
|
-
ecmaVersion: "latest",
|
|
3706
|
-
sourceType: "module"
|
|
3707
|
-
},
|
|
3708
|
-
globals: __spreadValues(__spreadValues(__spreadValues({}, import_globals.default.jest), import_globals.default.node), import_globals.default.browser)
|
|
3709
|
-
},
|
|
3710
|
-
settings: {
|
|
3711
|
-
"import/resolver": {
|
|
3712
|
-
typescript: true,
|
|
3713
|
-
node: true
|
|
3714
|
-
}
|
|
3715
|
-
},
|
|
3716
|
-
ignores: ["dist"],
|
|
3717
|
-
plugins: {
|
|
3718
|
-
"@typescript-eslint": eslintPlugin,
|
|
3719
|
-
import: importPlugin,
|
|
3720
|
-
"@alextheman": index_default
|
|
3721
|
-
},
|
|
3722
|
-
rules: {
|
|
3723
|
-
"import/no-unresolved": warnOnFixButErrorOnLint,
|
|
3724
|
-
eqeqeq: warnOnFixButErrorOnLint,
|
|
3725
|
-
"no-console": "warn",
|
|
3726
|
-
"no-restricted-imports": [
|
|
3727
|
-
warnOnFixButErrorOnLint,
|
|
3728
|
-
{
|
|
3729
|
-
paths: [
|
|
3730
|
-
{
|
|
3731
|
-
name: "@mui/material",
|
|
3732
|
-
message: 'Please use `import Component from "@mui/material/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.'
|
|
3733
|
-
}
|
|
3734
|
-
],
|
|
3735
|
-
patterns: [
|
|
3736
|
-
{
|
|
3737
|
-
group: ["./", "../"],
|
|
3738
|
-
message: "Relative imports are not allowed"
|
|
3739
|
-
}
|
|
3740
|
-
]
|
|
3741
|
-
}
|
|
3742
|
-
],
|
|
3743
|
-
"@typescript-eslint/no-unused-vars": [
|
|
3744
|
-
warnOnFixButErrorOnLint,
|
|
3745
|
-
{
|
|
3746
|
-
argsIgnorePattern: "^_",
|
|
3747
|
-
varsIgnorePattern: "^_",
|
|
3748
|
-
caughtErrorsIgnorePattern: "^_"
|
|
3749
|
-
}
|
|
3750
|
-
],
|
|
3751
|
-
// Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
|
|
3752
|
-
"no-unused-vars": "off",
|
|
3753
|
-
"func-style": ["error", "declaration", { allowArrowFunctions: false }],
|
|
3754
|
-
"prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
|
|
3755
|
-
"no-param-reassign": "error",
|
|
3756
|
-
"no-useless-rename": "error",
|
|
3757
|
-
"sort-vars": "error",
|
|
3758
|
-
"no-cond-assign": "error",
|
|
3759
|
-
"no-undef": warnOnFixButErrorOnLint,
|
|
3760
|
-
"@alextheman/no-namespace-imports": "error"
|
|
3761
|
-
}
|
|
3762
|
-
}
|
|
3763
|
-
];
|
|
3764
|
-
|
|
3765
3693
|
// package.json
|
|
3766
3694
|
var name = "@alextheman/eslint-plugin";
|
|
3767
|
-
var version = "1.
|
|
3695
|
+
var version = "1.2.0";
|
|
3768
3696
|
|
|
3769
3697
|
// src/create-rule.ts
|
|
3770
3698
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
@@ -3894,15 +3822,135 @@ var rules_default = {
|
|
|
3894
3822
|
"no-relative-imports": no_relative_imports_default
|
|
3895
3823
|
};
|
|
3896
3824
|
|
|
3825
|
+
// eslint.config.ts
|
|
3826
|
+
var import_js = __toESM(require_src(), 1);
|
|
3827
|
+
var import_globals = __toESM(require_globals2(), 1);
|
|
3828
|
+
import eslintPlugin from "@typescript-eslint/eslint-plugin";
|
|
3829
|
+
import tsparser from "@typescript-eslint/parser";
|
|
3830
|
+
import importPlugin from "eslint-plugin-import";
|
|
3831
|
+
var warnOnFixButErrorOnLint = (
|
|
3832
|
+
// eslint-disable-next-line no-undef
|
|
3833
|
+
process.env.ESLINT_MODE === "fix" ? "warn" : "error"
|
|
3834
|
+
);
|
|
3835
|
+
var eslint_config_default = [
|
|
3836
|
+
import_js.default.configs.recommended,
|
|
3837
|
+
{
|
|
3838
|
+
name: "@alextheman/eslint-config-typescript-base",
|
|
3839
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
|
3840
|
+
languageOptions: {
|
|
3841
|
+
parser: tsparser,
|
|
3842
|
+
parserOptions: {
|
|
3843
|
+
ecmaVersion: "latest",
|
|
3844
|
+
sourceType: "module"
|
|
3845
|
+
},
|
|
3846
|
+
globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser)
|
|
3847
|
+
},
|
|
3848
|
+
settings: {
|
|
3849
|
+
"import/resolver": {
|
|
3850
|
+
typescript: true,
|
|
3851
|
+
node: true
|
|
3852
|
+
}
|
|
3853
|
+
},
|
|
3854
|
+
ignores: ["dist"],
|
|
3855
|
+
plugins: {
|
|
3856
|
+
"@typescript-eslint": eslintPlugin,
|
|
3857
|
+
import: importPlugin
|
|
3858
|
+
},
|
|
3859
|
+
rules: {
|
|
3860
|
+
"import/no-unresolved": warnOnFixButErrorOnLint,
|
|
3861
|
+
eqeqeq: warnOnFixButErrorOnLint,
|
|
3862
|
+
"no-console": "warn",
|
|
3863
|
+
"no-restricted-imports": [
|
|
3864
|
+
warnOnFixButErrorOnLint,
|
|
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
|
+
patterns: [
|
|
3873
|
+
{
|
|
3874
|
+
group: ["./", "../"],
|
|
3875
|
+
message: "Relative imports are not allowed"
|
|
3876
|
+
}
|
|
3877
|
+
]
|
|
3878
|
+
}
|
|
3879
|
+
],
|
|
3880
|
+
"@typescript-eslint/no-unused-vars": [
|
|
3881
|
+
warnOnFixButErrorOnLint,
|
|
3882
|
+
{
|
|
3883
|
+
argsIgnorePattern: "^_",
|
|
3884
|
+
varsIgnorePattern: "^_",
|
|
3885
|
+
caughtErrorsIgnorePattern: "^_"
|
|
3886
|
+
}
|
|
3887
|
+
],
|
|
3888
|
+
// Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
|
|
3889
|
+
"no-unused-vars": "off",
|
|
3890
|
+
"func-style": ["error", "declaration", { allowArrowFunctions: false }],
|
|
3891
|
+
"prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
|
|
3892
|
+
"no-param-reassign": "error",
|
|
3893
|
+
"no-useless-rename": "error",
|
|
3894
|
+
"sort-vars": "error",
|
|
3895
|
+
"no-cond-assign": "error",
|
|
3896
|
+
"no-undef": warnOnFixButErrorOnLint
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
];
|
|
3900
|
+
|
|
3897
3901
|
// src/index.ts
|
|
3898
|
-
var
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
+
var import_globals2 = __toESM(require_globals2(), 1);
|
|
3903
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
3904
|
+
import reactRefresh from "eslint-plugin-react-refresh";
|
|
3905
|
+
import reactPlugin from "eslint-plugin-react";
|
|
3906
|
+
var plugin = {
|
|
3907
|
+
meta: {
|
|
3908
|
+
name,
|
|
3909
|
+
version,
|
|
3910
|
+
namespace: "alextheman"
|
|
3911
|
+
},
|
|
3912
|
+
configs: { alexTypeScriptBase: [] },
|
|
3913
|
+
rules: rules_default
|
|
3902
3914
|
};
|
|
3903
|
-
|
|
3915
|
+
Object.assign(plugin.configs, {
|
|
3916
|
+
alexTypeScriptBase: [
|
|
3917
|
+
...eslint_config_default,
|
|
3918
|
+
{
|
|
3919
|
+
plugins: {
|
|
3920
|
+
"@alextheman": plugin
|
|
3921
|
+
},
|
|
3922
|
+
rules: {
|
|
3923
|
+
"@alextheman/no-namespace-imports": "error",
|
|
3924
|
+
"@alextheman/no-relative-imports": "error"
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
]
|
|
3928
|
+
});
|
|
3929
|
+
Object.assign(plugin.configs, {
|
|
3930
|
+
alexTypescriptReactBase: [
|
|
3931
|
+
...plugin.configs.alexTypeScriptBase,
|
|
3932
|
+
{
|
|
3933
|
+
name: "@alextheman/eslint-config-typescript-react-base",
|
|
3934
|
+
languageOptions: {
|
|
3935
|
+
ecmaVersion: 2020,
|
|
3936
|
+
globals: import_globals2.default.browser
|
|
3937
|
+
},
|
|
3938
|
+
plugins: {
|
|
3939
|
+
"react-hooks": reactHooks,
|
|
3940
|
+
"react-refresh": reactRefresh,
|
|
3941
|
+
react: reactPlugin
|
|
3942
|
+
},
|
|
3943
|
+
rules: __spreadProps(__spreadValues({}, reactHooks.configs.recommended.rules), {
|
|
3944
|
+
"react-refresh/only-export-components": [
|
|
3945
|
+
"warn",
|
|
3946
|
+
{ allowConstantExport: true }
|
|
3947
|
+
],
|
|
3948
|
+
"react-hooks/exhaustive-deps": "off"
|
|
3949
|
+
})
|
|
3950
|
+
}
|
|
3951
|
+
]
|
|
3952
|
+
});
|
|
3953
|
+
var index_default = plugin;
|
|
3904
3954
|
export {
|
|
3905
|
-
index_default as default
|
|
3906
|
-
eslint_config_typescript_base_default as eslintConfigTypeScriptBase,
|
|
3907
|
-
meta
|
|
3955
|
+
index_default as default
|
|
3908
3956
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "vitest run",
|
|
12
12
|
"test-watch": "vitest",
|
|
13
|
-
"format": "prettier --write --parser typescript 'src/**/*.ts' 'tests/**/*.ts' && ESLINT_MODE=fix
|
|
14
|
-
"lint": "ESLINT_MODE=lint
|
|
13
|
+
"format": "prettier --write --parser typescript 'src/**/*.ts' 'tests/**/*.ts' && ESLINT_MODE=fix eslint --fix 'src/**/*.ts' 'tests/**/*.ts'",
|
|
14
|
+
"lint": "ESLINT_MODE=lint eslint 'src/**/*.ts' 'tests/**/*.ts' && prettier --check --parser typescript 'src/**/*.ts' 'tests/**/*.ts'",
|
|
15
15
|
"update-dependencies": "npx npm-check-updates -u && npm install",
|
|
16
16
|
"prepare": "husky",
|
|
17
17
|
"build": "tsup",
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
"@typescript-eslint/parser": "^8.37.0",
|
|
29
29
|
"eslint": "^9.31.0",
|
|
30
30
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
31
|
-
"eslint-plugin-import": "^2.32.0"
|
|
31
|
+
"eslint-plugin-import": "^2.32.0",
|
|
32
|
+
"eslint-plugin-react": "^7.37.5",
|
|
33
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
34
|
+
"eslint-plugin-react-refresh": "^0.4.20"
|
|
32
35
|
},
|
|
33
36
|
"devDependencies": {
|
|
34
37
|
"@types/eslint": "^9.6.1",
|
|
@@ -41,8 +44,6 @@
|
|
|
41
44
|
"husky": "^9.1.7",
|
|
42
45
|
"jiti": "^2.4.2",
|
|
43
46
|
"prettier": "^3.6.2",
|
|
44
|
-
"ts-node": "^10.9.2",
|
|
45
|
-
"tsconfig-paths": "^4.2.0",
|
|
46
47
|
"tsup": "^8.5.0",
|
|
47
48
|
"typescript": "^5.8.3",
|
|
48
49
|
"vite-tsconfig-paths": "^5.1.4",
|