@storm-software/eslint 0.138.0 → 0.138.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/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.137.4-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.138.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFileBanner
3
- } from "./chunk-KDHZD7SF.js";
3
+ } from "./chunk-ZUIV57VZ.js";
4
4
  import {
5
5
  GLOB_SRC
6
6
  } from "./chunk-AIKLBIPC.js";
@@ -166,11 +166,11 @@ var bannerRule = ESLintUtils.RuleCreator(() => `https://docs.stormsoftware.com/e
166
166
  {
167
167
  repositoryName: "",
168
168
  commentType: "block",
169
- numNewlines: 1,
169
+ numNewlines: 2,
170
170
  lineEndings: "unix"
171
171
  }
172
172
  ],
173
- create(context, [{ banner, repositoryName = "", commentType = "block", numNewlines = 1, lineEndings = "unix" }]) {
173
+ create(context, [{ banner, repositoryName = "", commentType = "block", numNewlines = 2, lineEndings = "unix" }]) {
174
174
  if (!banner) {
175
175
  banner = getFileBanner(repositoryName);
176
176
  }
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-SHUYVCID.js";
7
7
 
8
8
  // src/utils/get-file-banner.ts
9
- var getFileBanner = /* @__PURE__ */ __name((name = "") => {
10
- if (!name) {
11
- name = process.env.STORM_NAME || "";
9
+ var getFileBanner = /* @__PURE__ */ __name((repositoryName = "") => {
10
+ if (!repositoryName) {
11
+ repositoryName = process.env.STORM_NAME || "";
12
12
  }
13
13
  let padding = " ";
14
- for (let i = 0; i < name.length + 2 && padding.length > 4; i++) {
14
+ for (let i = 0; i < repositoryName.length + 2 && padding.length > 4; i++) {
15
15
  padding = padding.slice(0, -1);
16
16
  }
17
- let titleName = name;
17
+ let titleName = repositoryName;
18
18
  if (titleName) {
19
19
  if (titleName?.startsWith("@")) {
20
20
  titleName = titleName.slice(1);
@@ -36,10 +36,10 @@ ${padding}\u26A1 Storm Software ${titleName ? `- ${titleName}` : ""}
36
36
  our licensing page.
37
37
 
38
38
  Website: ${process.env.STORM_HOMEPAGE ?? "https://stormsoftware.com"}
39
- Repository: ${process.env.STORM_REPOSITORY ?? `https://github.com/storm-software${name ? `/${name}` : ""}`}
40
- Documentation: ${process.env.STORM_DOCS ? process.env.STORM_DOCS : `https://stormsoftware.com/${name ? `projects/${name}/` : ""}docs`}
39
+ Repository: ${process.env.STORM_REPOSITORY ?? `https://github.com/storm-software${repositoryName ? `/${repositoryName}` : ""}`}
40
+ Documentation: ${process.env.STORM_DOCS ? process.env.STORM_DOCS : `https://stormsoftware.com/${repositoryName ? `projects/${repositoryName}/` : ""}docs`}
41
41
  Contact: ${process.env.STORM_HOMEPAGE ? process.env.STORM_HOMEPAGE.endsWith("/") ? process.env.STORM_HOMEPAGE.slice(-1) : process.env.STORM_HOMEPAGE : "https://stormsoftware.com"}/contact
42
- License: ${process.env.STORM_LICENSING ? process.env.STORM_LICENSING : `https://stormsoftware.com/${name ? `projects/${name}/` : ""}license`}
42
+ License: ${process.env.STORM_LICENSING ? process.env.STORM_LICENSING : `https://stormsoftware.com/${repositoryName ? `projects/${repositoryName}/` : ""}license`}
43
43
 
44
44
  ------------------------------------------------------------------- `;
45
45
  }, "getFileBanner");
package/dist/preset.d.ts CHANGED
@@ -27,6 +27,6 @@ declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsCon
27
27
  * @param options - The preset options.
28
28
  * @param userConfigs - Additional ESLint configurations.
29
29
  */
30
- declare function getStormConfig(options: OptionsConfig & Omit<TypedFlatConfigItem, "files">, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
30
+ declare function getStormConfig(options: OptionsConfig & Omit<TypedFlatConfigItem, "files">, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<object, string> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
31
31
 
32
32
  export { type ResolvedOptions, getStormConfig as default, defaultPluginRenaming, getOverrides, getStormConfig, resolveSubOptions };
package/dist/preset.js CHANGED
@@ -11,11 +11,11 @@ import {
11
11
  } from "./chunk-GXNMSXDL.js";
12
12
  import {
13
13
  banner_plugin_default
14
- } from "./chunk-BXVDD33Y.js";
14
+ } from "./chunk-VMGPCABA.js";
15
15
  import {
16
16
  joinPaths
17
17
  } from "./chunk-G7QVU75O.js";
18
- import "./chunk-KDHZD7SF.js";
18
+ import "./chunk-ZUIV57VZ.js";
19
19
  import {
20
20
  GLOB_ASTRO,
21
21
  GLOB_ASTRO_TS,
@@ -853,7 +853,7 @@ __name(imports, "imports");
853
853
  import defu2 from "defu";
854
854
  import globalsLib from "globals";
855
855
  async function javascript(options = {}) {
856
- const { lineEndings = "unix", overrides = {}, name = "", globals = {} } = options;
856
+ const { lineEndings = "unix", overrides = {}, repositoryName, globals = {} } = options;
857
857
  return [
858
858
  {
859
859
  name: "storm/javascript/setup",
@@ -890,8 +890,8 @@ async function javascript(options = {}) {
890
890
  "error",
891
891
  {
892
892
  commentType: "block",
893
- numNewlines: 1,
894
- repositoryName: name,
893
+ numNewlines: 2,
894
+ repositoryName,
895
895
  lineEndings
896
896
  }
897
897
  ]
@@ -2423,6 +2423,7 @@ async function markdown(options = {}) {
2423
2423
  name: "storm/markdown/disables",
2424
2424
  rules: {
2425
2425
  "import/newline-after-import": "off",
2426
+ "banner/banner": "off",
2426
2427
  "no-alert": "off",
2427
2428
  "no-console": "off",
2428
2429
  "no-labels": "off",
@@ -3412,7 +3413,7 @@ __name(toml, "toml");
3412
3413
 
3413
3414
  // src/configs/typescript.ts
3414
3415
  async function typescript(options = {}) {
3415
- const { componentExts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {}, type = "app" } = options;
3416
+ const { componentExts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {}, tsdoc = "warn", type = "app" } = options;
3416
3417
  let tsconfigRootDir = process.cwd();
3417
3418
  if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
3418
3419
  tsconfigRootDir = process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH;
@@ -3470,6 +3471,10 @@ async function typescript(options = {}) {
3470
3471
  interopDefault(import("@typescript-eslint/eslint-plugin")),
3471
3472
  interopDefault(import("@typescript-eslint/parser"))
3472
3473
  ]);
3474
+ let pluginTsdoc;
3475
+ if (tsdoc !== false && tsdoc !== "off") {
3476
+ pluginTsdoc = await interopDefault(import("eslint-plugin-tsdoc"));
3477
+ }
3473
3478
  function makeParser(typeAware, files2, ignores2) {
3474
3479
  return {
3475
3480
  files: files2,
@@ -3660,6 +3665,16 @@ async function typescript(options = {}) {
3660
3665
  ...overrides
3661
3666
  }
3662
3667
  },
3668
+ pluginTsdoc && {
3669
+ files,
3670
+ name: "storm/typescript/rules-tsdoc",
3671
+ plugins: {
3672
+ tsdoc: pluginTsdoc
3673
+ },
3674
+ rules: {
3675
+ "tsdoc/syntax": tsdoc
3676
+ }
3677
+ },
3663
3678
  ...isTypeAware ? [
3664
3679
  {
3665
3680
  files: filesTypeAware,
@@ -3671,7 +3686,7 @@ async function typescript(options = {}) {
3671
3686
  }
3672
3687
  }
3673
3688
  ] : []
3674
- ];
3689
+ ].filter(Boolean);
3675
3690
  }
3676
3691
  __name(typescript, "typescript");
3677
3692
 
@@ -3851,7 +3866,7 @@ function getOverrides(options, key) {
3851
3866
  }
3852
3867
  __name(getOverrides, "getOverrides");
3853
3868
  function getStormConfig(options, ...userConfigs) {
3854
- const { name = "", globals = {}, lineEndings = "unix", astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, jsx: enableJsx = true, cspell: enableCSpell = true, react: enableReact = false, "react-native": enableReactNative = false, regexp: enableRegexp = true, next: enableNext = false, graphql: enableGraphQL = false, storybook: enableStorybook = false, typescript: enableTypeScript = isPackageExists2("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false } = options;
3869
+ const { repositoryName, globals = {}, lineEndings = "unix", astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, jsx: enableJsx = true, cspell: enableCSpell = true, react: enableReact = false, "react-native": enableReactNative = false, regexp: enableRegexp = true, next: enableNext = false, graphql: enableGraphQL = false, storybook: enableStorybook = false, typescript: enableTypeScript = isPackageExists2("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false } = options;
3855
3870
  let isInEditor = options.isInEditor;
3856
3871
  if (isInEditor == null) {
3857
3872
  isInEditor = isInEditorEnv();
@@ -3884,7 +3899,7 @@ function getStormConfig(options, ...userConfigs) {
3884
3899
  tsconfigPath = getTsConfigPath();
3885
3900
  }
3886
3901
  configs2.push(ignores(options.ignores), javascript({
3887
- name,
3902
+ repositoryName,
3888
3903
  globals,
3889
3904
  lineEndings,
3890
3905
  isInEditor,
@@ -4007,7 +4022,9 @@ function getStormConfig(options, ...userConfigs) {
4007
4022
  throw new Error('[@storm-software/eslint] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');
4008
4023
  }
4009
4024
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
4010
- if (key in options) acc[key] = options[key];
4025
+ if (key in options) {
4026
+ acc[key] = options[key];
4027
+ }
4011
4028
  return acc;
4012
4029
  }, {});
4013
4030
  if (Object.keys(fusedConfig).length) configs2.push([
package/dist/types.d.ts CHANGED
@@ -6498,6 +6498,11 @@ Backward pagination arguments
6498
6498
  * @see https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable
6499
6499
  */
6500
6500
  'ts/use-unknown-in-catch-callback-variable'?: Linter.RuleEntry<[]>
6501
+ /**
6502
+ * Validates that TypeScript documentation comments conform to the TSDoc standard
6503
+ * @see https://tsdoc.org/pages/packages/eslint-plugin-tsdoc
6504
+ */
6505
+ 'tsdoc/syntax'?: Linter.RuleEntry<[]>
6501
6506
  /**
6502
6507
  * Require or disallow Unicode byte order mark (BOM)
6503
6508
  * @see https://eslint.org/docs/latest/rules/unicode-bom
@@ -16285,7 +16290,7 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
16285
16290
  onlyEquality?: boolean
16286
16291
  }]
16287
16292
  // Names of all the configs
16288
- type ConfigNames = 'storm/cspell/rules' | 'storm/astro/setup' | 'storm/astro/rules' | 'storm/formatter/setup' | 'storm/imports/rules' | 'storm/graphql/setup' | 'storm/graphql/rules' | 'storm/graphql/relay' | 'storm/javascript/setup' | 'storm/javascript/banner' | 'storm/javascript/rules' | 'storm/jsx/rules' | 'storm/jsdoc/rules' | 'storm/jsonc/setup' | 'storm/jsonc/rules' | 'storm/markdown/setup' | 'storm/markdown/processor' | 'storm/markdown/parser' | 'storm/markdown/disables' | 'storm/mdx/setup' | 'storm/node/rules' | 'storm/nx/setup' | 'storm/nx/schema' | 'storm/nx/dependency-check' | 'storm/nx/module-boundaries' | 'storm/next/rules' | 'storm/prettier/rules' | 'storm/perfectionist/rules' | 'storm/react/setup' | 'storm/react/rules' | 'storm/react-native/rules' | 'storm/sort/package-json' | 'storm/stylistic/rules' | 'storm/secrets/rules' | 'storm/storybook/setup' | 'storm/storybook/rules' | 'storm/storybook/main' | 'storm/test/setup' | 'storm/test/rules' | 'storm/toml/setup' | 'storm/toml/rules' | 'storm/regexp/rules' | 'storm/typescript/setup' | 'storm/typescript/parser' | 'storm/typescript/type-aware-parser' | 'storm/typescript/rules' | 'storm/typescript/rules-type-aware' | 'storm/unicorn/rules' | 'storm/unocss' | 'storm/yaml/setup' | 'storm/yaml/rules'
16293
+ type ConfigNames = 'storm/cspell/rules' | 'storm/astro/setup' | 'storm/astro/rules' | 'storm/formatter/setup' | 'storm/imports/rules' | 'storm/graphql/setup' | 'storm/graphql/rules' | 'storm/graphql/relay' | 'storm/javascript/setup' | 'storm/javascript/banner' | 'storm/javascript/rules' | 'storm/jsx/rules' | 'storm/jsdoc/rules' | 'storm/jsonc/setup' | 'storm/jsonc/rules' | 'storm/markdown/setup' | 'storm/markdown/processor' | 'storm/markdown/parser' | 'storm/markdown/disables' | 'storm/mdx/setup' | 'storm/node/rules' | 'storm/nx/setup' | 'storm/nx/schema' | 'storm/nx/dependency-check' | 'storm/nx/module-boundaries' | 'storm/next/rules' | 'storm/prettier/rules' | 'storm/perfectionist/rules' | 'storm/react/setup' | 'storm/react/rules' | 'storm/react-native/rules' | 'storm/sort/package-json' | 'storm/stylistic/rules' | 'storm/secrets/rules' | 'storm/storybook/setup' | 'storm/storybook/rules' | 'storm/storybook/main' | 'storm/test/setup' | 'storm/test/rules' | 'storm/toml/setup' | 'storm/toml/rules' | 'storm/regexp/rules' | 'storm/typescript/setup' | 'storm/typescript/parser' | 'storm/typescript/type-aware-parser' | 'storm/typescript/rules' | 'storm/typescript/rules-tsdoc' | 'storm/typescript/rules-type-aware' | 'storm/unicorn/rules' | 'storm/unocss' | 'storm/yaml/setup' | 'storm/yaml/rules'
16289
16294
 
16290
16295
  /**
16291
16296
  * Vendor types from Prettier so we don't rely on the dependency.
@@ -16523,6 +16528,14 @@ interface OptionsTypeScriptWithTypes {
16523
16528
  * Override type aware rules.
16524
16529
  */
16525
16530
  overridesTypeAware?: TypedFlatConfigItem["rules"];
16531
+ /**
16532
+ * The rule to use for eslint-plugin-tsdoc syntax checking. If set to `false`, it will disable the plugin.
16533
+ *
16534
+ * @see https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
16535
+ *
16536
+ * @defaultValue 'warn'
16537
+ */
16538
+ tsdoc?: "warn" | "error" | "off" | false;
16526
16539
  }
16527
16540
  interface OptionsHasTypeScript {
16528
16541
  typescript?: boolean;
@@ -16770,7 +16783,7 @@ interface OptionsJavascript {
16770
16783
  /**
16771
16784
  * The name of the repository used in adding the banner comments
16772
16785
  */
16773
- name: string;
16786
+ repositoryName?: string;
16774
16787
  /**
16775
16788
  * An object containing a list of extra global variables to include in the configuration.
16776
16789
  */
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  banner_plugin_default
3
- } from "../chunk-BXVDD33Y.js";
4
- import "../chunk-KDHZD7SF.js";
3
+ } from "../chunk-VMGPCABA.js";
4
+ import "../chunk-ZUIV57VZ.js";
5
5
  import "../chunk-AIKLBIPC.js";
6
6
  import "../chunk-SHUYVCID.js";
7
7
  export {
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Get a banner header to display at the top of a file
3
3
  *
4
- * @param name - The name to use in the display
4
+ * @param repositoryName - The name to use in the display
5
5
  * @returns The banner header
6
6
  */
7
- declare const getFileBanner: (name?: string) => string;
7
+ declare const getFileBanner: (repositoryName?: string) => string;
8
8
 
9
9
  export { getFileBanner };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFileBanner
3
- } from "../chunk-KDHZD7SF.js";
3
+ } from "../chunk-ZUIV57VZ.js";
4
4
  import "../chunk-AIKLBIPC.js";
5
5
  import "../chunk-SHUYVCID.js";
6
6
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/eslint",
3
- "version": "0.138.0",
3
+ "version": "0.138.1",
4
4
  "type": "module",
5
5
  "description": "⚡ A package containing the base ESLint configuration used by Storm Software across many projects.",
6
6
  "repository": {