@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 CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
8
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
9
  var __getProtoOf = Object.getPrototypeOf;
@@ -19,6 +21,7 @@ var __spreadValues = (a, b) => {
19
21
  }
20
22
  return a;
21
23
  };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
25
  var __commonJS = (cb, mod) => function __require() {
23
26
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
27
  };
@@ -3696,90 +3699,13 @@ var require_globals2 = __commonJS({
3696
3699
  // src/index.ts
3697
3700
  var index_exports = {};
3698
3701
  __export(index_exports, {
3699
- default: () => index_default,
3700
- eslintConfigTypeScriptBase: () => eslint_config_typescript_base_default,
3701
- meta: () => meta
3702
+ default: () => index_default
3702
3703
  });
3703
3704
  module.exports = __toCommonJS(index_exports);
3704
3705
 
3705
- // src/configs/eslint-config-typescript-base.ts
3706
- var import_js = __toESM(require_src(), 1);
3707
- var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
3708
- var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
3709
- var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
3710
- var import_globals = __toESM(require_globals2(), 1);
3711
- var warnOnFixButErrorOnLint = process.env.ESLINT_MODE === "fix" ? "warn" : "error";
3712
- var eslint_config_typescript_base_default = [
3713
- import_js.default.configs.recommended,
3714
- {
3715
- name: "@alextheman/eslint-config-typescript-base",
3716
- files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
3717
- languageOptions: {
3718
- parser: import_parser.default,
3719
- parserOptions: {
3720
- ecmaVersion: "latest",
3721
- sourceType: "module"
3722
- },
3723
- globals: __spreadValues(__spreadValues(__spreadValues({}, import_globals.default.jest), import_globals.default.node), import_globals.default.browser)
3724
- },
3725
- settings: {
3726
- "import/resolver": {
3727
- typescript: true,
3728
- node: true
3729
- }
3730
- },
3731
- ignores: ["dist"],
3732
- plugins: {
3733
- "@typescript-eslint": import_eslint_plugin.default,
3734
- import: import_eslint_plugin_import.default,
3735
- "@alextheman": index_default
3736
- },
3737
- rules: {
3738
- "import/no-unresolved": warnOnFixButErrorOnLint,
3739
- eqeqeq: warnOnFixButErrorOnLint,
3740
- "no-console": "warn",
3741
- "no-restricted-imports": [
3742
- warnOnFixButErrorOnLint,
3743
- {
3744
- paths: [
3745
- {
3746
- name: "@mui/material",
3747
- message: 'Please use `import Component from "@mui/material/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.'
3748
- }
3749
- ],
3750
- patterns: [
3751
- {
3752
- group: ["./", "../"],
3753
- message: "Relative imports are not allowed"
3754
- }
3755
- ]
3756
- }
3757
- ],
3758
- "@typescript-eslint/no-unused-vars": [
3759
- warnOnFixButErrorOnLint,
3760
- {
3761
- argsIgnorePattern: "^_",
3762
- varsIgnorePattern: "^_",
3763
- caughtErrorsIgnorePattern: "^_"
3764
- }
3765
- ],
3766
- // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3767
- "no-unused-vars": "off",
3768
- "func-style": ["error", "declaration", { allowArrowFunctions: false }],
3769
- "prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
3770
- "no-param-reassign": "error",
3771
- "no-useless-rename": "error",
3772
- "sort-vars": "error",
3773
- "no-cond-assign": "error",
3774
- "no-undef": warnOnFixButErrorOnLint,
3775
- "@alextheman/no-namespace-imports": "error"
3776
- }
3777
- }
3778
- ];
3779
-
3780
3706
  // package.json
3781
3707
  var name = "@alextheman/eslint-plugin";
3782
- var version = "1.1.2";
3708
+ var version = "1.2.0";
3783
3709
 
3784
3710
  // src/create-rule.ts
3785
3711
  var import_utils = require("@typescript-eslint/utils");
@@ -3909,15 +3835,132 @@ var rules_default = {
3909
3835
  "no-relative-imports": no_relative_imports_default
3910
3836
  };
3911
3837
 
3838
+ // eslint.config.ts
3839
+ var import_js = __toESM(require_src(), 1);
3840
+ var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
3841
+ var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
3842
+ var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
3843
+ var import_globals = __toESM(require_globals2(), 1);
3844
+ var warnOnFixButErrorOnLint = (
3845
+ // eslint-disable-next-line no-undef
3846
+ process.env.ESLINT_MODE === "fix" ? "warn" : "error"
3847
+ );
3848
+ var eslint_config_default = [
3849
+ import_js.default.configs.recommended,
3850
+ {
3851
+ name: "@alextheman/eslint-config-typescript-base",
3852
+ files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
3853
+ languageOptions: {
3854
+ parser: import_parser.default,
3855
+ parserOptions: {
3856
+ ecmaVersion: "latest",
3857
+ sourceType: "module"
3858
+ },
3859
+ globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser)
3860
+ },
3861
+ settings: {
3862
+ "import/resolver": {
3863
+ typescript: true,
3864
+ node: true
3865
+ }
3866
+ },
3867
+ ignores: ["dist"],
3868
+ plugins: {
3869
+ "@typescript-eslint": import_eslint_plugin.default,
3870
+ import: import_eslint_plugin_import.default
3871
+ },
3872
+ rules: {
3873
+ "import/no-unresolved": warnOnFixButErrorOnLint,
3874
+ eqeqeq: warnOnFixButErrorOnLint,
3875
+ "no-console": "warn",
3876
+ "no-restricted-imports": [
3877
+ warnOnFixButErrorOnLint,
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
+ patterns: [
3886
+ {
3887
+ group: ["./", "../"],
3888
+ message: "Relative imports are not allowed"
3889
+ }
3890
+ ]
3891
+ }
3892
+ ],
3893
+ "@typescript-eslint/no-unused-vars": [
3894
+ warnOnFixButErrorOnLint,
3895
+ {
3896
+ argsIgnorePattern: "^_",
3897
+ varsIgnorePattern: "^_",
3898
+ caughtErrorsIgnorePattern: "^_"
3899
+ }
3900
+ ],
3901
+ // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3902
+ "no-unused-vars": "off",
3903
+ "func-style": ["error", "declaration", { allowArrowFunctions: false }],
3904
+ "prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
3905
+ "no-param-reassign": "error",
3906
+ "no-useless-rename": "error",
3907
+ "sort-vars": "error",
3908
+ "no-cond-assign": "error",
3909
+ "no-undef": warnOnFixButErrorOnLint
3910
+ }
3911
+ }
3912
+ ];
3913
+
3912
3914
  // src/index.ts
3913
- var meta = {
3914
- name,
3915
- version,
3916
- namespace: "alextheman"
3915
+ var import_globals2 = __toESM(require_globals2(), 1);
3916
+ var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
3917
+ var import_eslint_plugin_react_refresh = __toESM(require("eslint-plugin-react-refresh"), 1);
3918
+ var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
3919
+ var plugin = {
3920
+ meta: {
3921
+ name,
3922
+ version,
3923
+ namespace: "alextheman"
3924
+ },
3925
+ configs: { alexTypeScriptBase: [] },
3926
+ rules: rules_default
3917
3927
  };
3918
- var index_default = { rules: rules_default };
3919
- // Annotate the CommonJS export names for ESM import in node:
3920
- 0 && (module.exports = {
3921
- eslintConfigTypeScriptBase,
3922
- meta
3928
+ Object.assign(plugin.configs, {
3929
+ alexTypeScriptBase: [
3930
+ ...eslint_config_default,
3931
+ {
3932
+ plugins: {
3933
+ "@alextheman": plugin
3934
+ },
3935
+ rules: {
3936
+ "@alextheman/no-namespace-imports": "error",
3937
+ "@alextheman/no-relative-imports": "error"
3938
+ }
3939
+ }
3940
+ ]
3941
+ });
3942
+ Object.assign(plugin.configs, {
3943
+ alexTypescriptReactBase: [
3944
+ ...plugin.configs.alexTypeScriptBase,
3945
+ {
3946
+ name: "@alextheman/eslint-config-typescript-react-base",
3947
+ languageOptions: {
3948
+ ecmaVersion: 2020,
3949
+ globals: import_globals2.default.browser
3950
+ },
3951
+ plugins: {
3952
+ "react-hooks": import_eslint_plugin_react_hooks.default,
3953
+ "react-refresh": import_eslint_plugin_react_refresh.default,
3954
+ react: import_eslint_plugin_react.default
3955
+ },
3956
+ rules: __spreadProps(__spreadValues({}, import_eslint_plugin_react_hooks.default.configs.recommended.rules), {
3957
+ "react-refresh/only-export-components": [
3958
+ "warn",
3959
+ { allowConstantExport: true }
3960
+ ],
3961
+ "react-hooks/exhaustive-deps": "off"
3962
+ })
3963
+ }
3964
+ ]
3923
3965
  });
3966
+ var index_default = plugin;