@alextheman/eslint-plugin 1.13.8 → 1.14.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 CHANGED
@@ -3700,13 +3700,14 @@ var require_globals2 = __commonJS({
3700
3700
  var index_exports = {};
3701
3701
  __export(index_exports, {
3702
3702
  default: () => index_default,
3703
+ parseTestFunction: () => parseTestFunction,
3703
3704
  prettierRules: () => prettierRules_default
3704
3705
  });
3705
3706
  module.exports = __toCommonJS(index_exports);
3706
3707
 
3707
3708
  // package.json
3708
3709
  var name = "@alextheman/eslint-plugin";
3709
- var version = "1.13.8";
3710
+ var version = "1.14.1";
3710
3711
 
3711
3712
  // src/configs/alexPluginBase.ts
3712
3713
  function createAlexPluginBaseConfig(plugin) {
@@ -3735,7 +3736,6 @@ var alexPluginBase_default = createAlexPluginBaseConfig;
3735
3736
 
3736
3737
  // src/configs/typeScriptBase.ts
3737
3738
  var import_js = __toESM(require_src(), 1);
3738
- var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
3739
3739
  var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
3740
3740
  var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
3741
3741
  var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
@@ -3743,6 +3743,7 @@ var import_eslint_plugin_package_json = __toESM(require("eslint-plugin-package-j
3743
3743
  var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
3744
3744
  var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
3745
3745
  var import_globals = __toESM(require_globals2(), 1);
3746
+ var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
3746
3747
 
3747
3748
  // src/configs/prettierRules.ts
3748
3749
  var prettierRules = {
@@ -3752,6 +3753,7 @@ var prettierRules_default = prettierRules;
3752
3753
 
3753
3754
  // src/configs/typeScriptBase.ts
3754
3755
  var typeScriptBase = [
3756
+ ...import_typescript_eslint.default.configs.recommended,
3755
3757
  import_js.default.configs.recommended,
3756
3758
  import_eslint_config_prettier.default,
3757
3759
  import_eslint_plugin_package_json.default.configs.recommended,
@@ -3763,18 +3765,29 @@ var typeScriptBase = [
3763
3765
  parser: import_parser.default,
3764
3766
  parserOptions: {
3765
3767
  ecmaVersion: "latest",
3766
- sourceType: "module"
3768
+ projectService: true,
3769
+ sourceType: "module",
3770
+ tsconfigRootDir: process.cwd()
3767
3771
  }
3768
3772
  },
3769
3773
  name: "@alextheman/eslint-config-typescript-base",
3770
3774
  plugins: {
3771
- "@typescript-eslint": import_eslint_plugin.default,
3772
3775
  import: import_eslint_plugin_import.default,
3773
3776
  perfectionist: import_eslint_plugin_perfectionist.default,
3774
3777
  prettier: import_eslint_plugin_prettier.default
3775
3778
  },
3776
3779
  rules: {
3780
+ "@typescript-eslint/array-type": ["error", { default: "array" }],
3781
+ "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
3782
+ "@typescript-eslint/consistent-type-definitions": "error",
3783
+ "@typescript-eslint/consistent-type-exports": "error",
3777
3784
  "@typescript-eslint/consistent-type-imports": "error",
3785
+ "@typescript-eslint/dot-notation": "error",
3786
+ "@typescript-eslint/explicit-member-accessibility": "error",
3787
+ "@typescript-eslint/method-signature-style": ["error", "property"],
3788
+ "@typescript-eslint/no-deprecated": "error",
3789
+ // Explicit any can be helpful sometimes, so it's not worth erroring on every single one.
3790
+ "@typescript-eslint/no-explicit-any": "off",
3778
3791
  "@typescript-eslint/no-redeclare": ["error", { ignoreDeclarationMerge: true }],
3779
3792
  "@typescript-eslint/no-unused-vars": [
3780
3793
  "error",
@@ -3786,7 +3799,6 @@ var typeScriptBase = [
3786
3799
  ],
3787
3800
  "arrow-body-style": ["error", "always"],
3788
3801
  curly: ["error", "all"],
3789
- "dot-notation": "error",
3790
3802
  eqeqeq: "error",
3791
3803
  "func-style": ["error", "declaration", { allowArrowFunctions: false }],
3792
3804
  "import/no-unresolved": "error",
@@ -3966,6 +3978,9 @@ var getImportSpecifiersAfterRemoving_default = getImportSpecifiersAfterRemoving;
3966
3978
 
3967
3979
  // src/rules/consistent-test-function.ts
3968
3980
  var validTestFunctionsSchema = import_zod.default.enum(["test", "it"]);
3981
+ function parseTestFunction(data) {
3982
+ return validTestFunctionsSchema.parse(data);
3983
+ }
3969
3984
  var consistentTestFunction = createRule_default({
3970
3985
  name: "consistent-test-function",
3971
3986
  meta: {
@@ -4438,5 +4453,6 @@ var alexPlugin_default = alexPlugin;
4438
4453
  var index_default = alexPlugin_default;
4439
4454
  // Annotate the CommonJS export names for ESM import in node:
4440
4455
  0 && (module.exports = {
4456
+ parseTestFunction,
4441
4457
  prettierRules
4442
4458
  });
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@ import z from 'zod';
3
3
  import { Config } from 'prettier';
4
4
 
5
5
  var name = "@alextheman/eslint-plugin";
6
- var version = "1.13.8";
6
+ var version = "1.14.1";
7
7
 
8
8
  interface AlexPlugin {
9
9
  meta: {
@@ -28,6 +28,7 @@ declare const validTestFunctionsSchema: z.ZodEnum<{
28
28
  test: "test";
29
29
  it: "it";
30
30
  }>;
31
- type ValidTestFunctions = z.infer<typeof validTestFunctionsSchema>;
31
+ type TestFunction = z.infer<typeof validTestFunctionsSchema>;
32
+ declare function parseTestFunction(data: unknown): TestFunction;
32
33
 
33
- export { type AlexPlugin, type ValidTestFunctions, alexPlugin as default, prettierRules };
34
+ export { type AlexPlugin, type TestFunction, alexPlugin as default, parseTestFunction, prettierRules };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import z from 'zod';
3
3
  import { Config } from 'prettier';
4
4
 
5
5
  var name = "@alextheman/eslint-plugin";
6
- var version = "1.13.8";
6
+ var version = "1.14.1";
7
7
 
8
8
  interface AlexPlugin {
9
9
  meta: {
@@ -28,6 +28,7 @@ declare const validTestFunctionsSchema: z.ZodEnum<{
28
28
  test: "test";
29
29
  it: "it";
30
30
  }>;
31
- type ValidTestFunctions = z.infer<typeof validTestFunctionsSchema>;
31
+ type TestFunction = z.infer<typeof validTestFunctionsSchema>;
32
+ declare function parseTestFunction(data: unknown): TestFunction;
32
33
 
33
- export { type AlexPlugin, type ValidTestFunctions, alexPlugin as default, prettierRules };
34
+ export { type AlexPlugin, type TestFunction, alexPlugin as default, parseTestFunction, prettierRules };
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.13.8";
3695
+ var version = "1.14.1";
3696
3696
 
3697
3697
  // src/configs/alexPluginBase.ts
3698
3698
  function createAlexPluginBaseConfig(plugin) {
@@ -3722,13 +3722,13 @@ var alexPluginBase_default = createAlexPluginBaseConfig;
3722
3722
  // src/configs/typeScriptBase.ts
3723
3723
  var import_js = __toESM(require_src(), 1);
3724
3724
  var import_globals = __toESM(require_globals2(), 1);
3725
- import eslintPlugin from "@typescript-eslint/eslint-plugin";
3726
3725
  import tsparser from "@typescript-eslint/parser";
3727
3726
  import prettierConfig from "eslint-config-prettier";
3728
3727
  import importPlugin from "eslint-plugin-import";
3729
3728
  import packageJson from "eslint-plugin-package-json";
3730
3729
  import perfectionist from "eslint-plugin-perfectionist";
3731
3730
  import prettierPlugin from "eslint-plugin-prettier";
3731
+ import tseslint from "typescript-eslint";
3732
3732
 
3733
3733
  // src/configs/prettierRules.ts
3734
3734
  var prettierRules = {
@@ -3738,6 +3738,7 @@ var prettierRules_default = prettierRules;
3738
3738
 
3739
3739
  // src/configs/typeScriptBase.ts
3740
3740
  var typeScriptBase = [
3741
+ ...tseslint.configs.recommended,
3741
3742
  import_js.default.configs.recommended,
3742
3743
  prettierConfig,
3743
3744
  packageJson.configs.recommended,
@@ -3749,18 +3750,29 @@ var typeScriptBase = [
3749
3750
  parser: tsparser,
3750
3751
  parserOptions: {
3751
3752
  ecmaVersion: "latest",
3752
- sourceType: "module"
3753
+ projectService: true,
3754
+ sourceType: "module",
3755
+ tsconfigRootDir: process.cwd()
3753
3756
  }
3754
3757
  },
3755
3758
  name: "@alextheman/eslint-config-typescript-base",
3756
3759
  plugins: {
3757
- "@typescript-eslint": eslintPlugin,
3758
3760
  import: importPlugin,
3759
3761
  perfectionist,
3760
3762
  prettier: prettierPlugin
3761
3763
  },
3762
3764
  rules: {
3765
+ "@typescript-eslint/array-type": ["error", { default: "array" }],
3766
+ "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
3767
+ "@typescript-eslint/consistent-type-definitions": "error",
3768
+ "@typescript-eslint/consistent-type-exports": "error",
3763
3769
  "@typescript-eslint/consistent-type-imports": "error",
3770
+ "@typescript-eslint/dot-notation": "error",
3771
+ "@typescript-eslint/explicit-member-accessibility": "error",
3772
+ "@typescript-eslint/method-signature-style": ["error", "property"],
3773
+ "@typescript-eslint/no-deprecated": "error",
3774
+ // Explicit any can be helpful sometimes, so it's not worth erroring on every single one.
3775
+ "@typescript-eslint/no-explicit-any": "off",
3764
3776
  "@typescript-eslint/no-redeclare": ["error", { ignoreDeclarationMerge: true }],
3765
3777
  "@typescript-eslint/no-unused-vars": [
3766
3778
  "error",
@@ -3772,7 +3784,6 @@ var typeScriptBase = [
3772
3784
  ],
3773
3785
  "arrow-body-style": ["error", "always"],
3774
3786
  curly: ["error", "all"],
3775
- "dot-notation": "error",
3776
3787
  eqeqeq: "error",
3777
3788
  "func-style": ["error", "declaration", { allowArrowFunctions: false }],
3778
3789
  "import/no-unresolved": "error",
@@ -3952,6 +3963,9 @@ var getImportSpecifiersAfterRemoving_default = getImportSpecifiersAfterRemoving;
3952
3963
 
3953
3964
  // src/rules/consistent-test-function.ts
3954
3965
  var validTestFunctionsSchema = z.enum(["test", "it"]);
3966
+ function parseTestFunction(data) {
3967
+ return validTestFunctionsSchema.parse(data);
3968
+ }
3955
3969
  var consistentTestFunction = createRule_default({
3956
3970
  name: "consistent-test-function",
3957
3971
  meta: {
@@ -4424,5 +4438,6 @@ var alexPlugin_default = alexPlugin;
4424
4438
  var index_default = alexPlugin_default;
4425
4439
  export {
4426
4440
  index_default as default,
4441
+ parseTestFunction,
4427
4442
  prettierRules_default as prettierRules
4428
4443
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "1.13.8",
3
+ "version": "1.14.1",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "license": "ISC",
6
6
  "author": "alextheman",
@@ -55,6 +55,7 @@
55
55
  "eslint-plugin-prettier": "^5.5.3",
56
56
  "eslint-plugin-react": "^7.37.5",
57
57
  "eslint-plugin-react-hooks": "^5.2.0",
58
- "eslint-plugin-react-refresh": "^0.4.20"
58
+ "eslint-plugin-react-refresh": "^0.4.20",
59
+ "typescript-eslint": "^8.43.0"
59
60
  }
60
61
  }