@storm-software/eslint 0.48.0 → 0.48.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.47.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)
24
+ [![Version](https://img.shields.io/badge/version-0.48.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 -->
package/dist/preset.d.mts CHANGED
@@ -3877,6 +3877,8 @@ type BannerBanner = []|[{
3877
3877
 
3878
3878
  banner?: string
3879
3879
 
3880
+ repositoryName?: string
3881
+
3880
3882
  commentType?: string
3881
3883
 
3882
3884
  numNewlines?: number
@@ -4747,8 +4749,11 @@ type PresetModuleBoundary = {
4747
4749
  * The ESLint preset options.
4748
4750
  */
4749
4751
  interface PresetOptions {
4752
+ name?: string;
4753
+ banner?: string;
4750
4754
  rules?: RuleOptions;
4751
4755
  ignores?: string[];
4756
+ tsconfig?: string;
4752
4757
  parserOptions?: Linter.ParserOptions;
4753
4758
  markdown?: false | Linter.RulesRecord;
4754
4759
  react?: false | Linter.RulesRecord;
package/dist/preset.d.ts CHANGED
@@ -3877,6 +3877,8 @@ type BannerBanner = []|[{
3877
3877
 
3878
3878
  banner?: string
3879
3879
 
3880
+ repositoryName?: string
3881
+
3880
3882
  commentType?: string
3881
3883
 
3882
3884
  numNewlines?: number
@@ -4747,8 +4749,11 @@ type PresetModuleBoundary = {
4747
4749
  * The ESLint preset options.
4748
4750
  */
4749
4751
  interface PresetOptions {
4752
+ name?: string;
4753
+ banner?: string;
4750
4754
  rules?: RuleOptions;
4751
4755
  ignores?: string[];
4756
+ tsconfig?: string;
4752
4757
  parserOptions?: Linter.ParserOptions;
4753
4758
  markdown?: false | Linter.RulesRecord;
4754
4759
  react?: false | Linter.RulesRecord;
package/dist/preset.mjs CHANGED
@@ -12567,12 +12567,15 @@ isArray$1.isArray = isArray;
12567
12567
 
12568
12568
  } (dist$3));
12569
12569
 
12570
- const getFileBanner = (name) => {
12571
- let padding = "";
12572
- while (name.length + padding.length < 12) {
12573
- padding += " ";
12570
+ const getFileBanner = (name = "") => {
12571
+ if (!name) {
12572
+ name = process.env.STORM_NAMESPACE || "";
12574
12573
  }
12575
- let titleName = process.env.STORM_NAMESPACE ?? "";
12574
+ let padding = " ";
12575
+ for (let i = 0; i < name.length + 2 && padding.length > 4; i++) {
12576
+ padding = padding.slice(0, -1);
12577
+ }
12578
+ let titleName = name;
12576
12579
  if (titleName) {
12577
12580
  if (titleName?.startsWith("@")) {
12578
12581
  titleName = titleName.slice(1);
@@ -12581,19 +12584,18 @@ const getFileBanner = (name) => {
12581
12584
  }
12582
12585
  return `-------------------------------------------------------------------
12583
12586
 
12584
- ${padding}Storm Software
12585
- \u26A1 ${titleName ? name ? `${titleName} - ` : titleName : ""}${name && name.length > 0 ? name.charAt(0).toUpperCase() + name.slice(1) : name}
12587
+ ${padding}\u26A1 Storm Software ${titleName ? `- ${titleName}` : ""}
12586
12588
 
12587
- This code was released as part of the ${titleName ? `${titleName} ` : ""}project. ${titleName ? titleName : "This project"}
12589
+ This code was released as part of ${titleName ? `the ${titleName}` : "a Storm Software"} project. ${titleName ? titleName : "The project"}
12588
12590
  is maintained by Storm Software under the ${(process.env.STORM_LICENSE ?? "Apache-2.0")?.toLowerCase()?.includes("license") ? process.env.STORM_LICENSE ?? "Apache-2.0" : `${process.env.STORM_LICENSE ?? "Apache-2.0"} License`}, and is
12589
12591
  free for commercial and private use. For more information, please visit
12590
12592
  our licensing page.
12591
12593
 
12592
- Website: ${process.env.STORM_HOMEPAGE ?? "https://stormsoftware.com"}
12593
- Repository: ${process.env.STORM_REPOSITORY ?? "https://github.com/storm-software/storm-stack"}
12594
- Documentation: https://docs.stormsoftware.com${titleName?.startsWith("@") ? `/projects/${titleName.slice(1).trim().replaceAll(/\s+/g, "-").toLowerCase()}` : ""}
12595
- Contact: ${process.env.STORM_HOMEPAGE ? process.env.STORM_HOMEPAGE.endsWith("/") ? process.env.STORM_HOMEPAGE.slice(-1) : process.env.STORM_HOMEPAGE : "https://stormsoftware.com"}/contact
12596
- Licensing: ${process.env.STORM_HOMEPAGE ? process.env.STORM_HOMEPAGE.endsWith("/") ? process.env.STORM_HOMEPAGE.slice(-1) : process.env.STORM_HOMEPAGE : "https://stormsoftware.com"}/licensing
12594
+ Website: ${process.env.STORM_HOMEPAGE ?? "https://stormsoftware.com"}
12595
+ Repository: ${process.env.STORM_REPOSITORY ?? `https://github.com/storm-software${name ? `/${name}` : ""}`}
12596
+ Documentation: https://docs.stormsoftware.com${name ? `/projects/${name}` : ""}
12597
+ Contact: ${process.env.STORM_HOMEPAGE ? process.env.STORM_HOMEPAGE.endsWith("/") ? process.env.STORM_HOMEPAGE.slice(-1) : process.env.STORM_HOMEPAGE : "https://stormsoftware.com"}/contact
12598
+ Licensing: ${process.env.STORM_HOMEPAGE ? process.env.STORM_HOMEPAGE.endsWith("/") ? process.env.STORM_HOMEPAGE.slice(-1) : process.env.STORM_HOMEPAGE : "https://stormsoftware.com"}/licensing
12597
12599
 
12598
12600
  -------------------------------------------------------------------`;
12599
12601
  };
@@ -12704,6 +12706,10 @@ const bannerRule = dist$3.ESLintUtils.RuleCreator(
12704
12706
  type: "string",
12705
12707
  description: "The banner to enforce at the top of the file. If not provided, the banner will be read from the file specified in the commentStart option"
12706
12708
  },
12709
+ repositoryName: {
12710
+ type: "string",
12711
+ description: "The name of the repository to use when reading the banner from a file."
12712
+ },
12707
12713
  commentType: {
12708
12714
  type: "string",
12709
12715
  description: "The comment token to use for the banner. Defaults to block ('/* <banner> */')"
@@ -12727,12 +12733,15 @@ const bannerRule = dist$3.ESLintUtils.RuleCreator(
12727
12733
  },
12728
12734
  defaultOptions: [
12729
12735
  {
12730
- banner: getFileBanner(""),
12736
+ repositoryName: "",
12731
12737
  commentType: "block",
12732
12738
  numNewlines: 2
12733
12739
  }
12734
12740
  ],
12735
- create(context, [{ banner = getFileBanner(""), commentType = "block", numNewlines = 2 }]) {
12741
+ create(context, [{ banner, repositoryName = "", commentType = "block", numNewlines = 2 }]) {
12742
+ if (!banner) {
12743
+ banner = getFileBanner(repositoryName);
12744
+ }
12736
12745
  let options = context.options;
12737
12746
  let eol = getEOL(options);
12738
12747
  let bannerLines = banner.split(/\r?\n/);
@@ -12901,10 +12910,7 @@ plugin.configs.recommended = [
12901
12910
  "!.*/**/*"
12902
12911
  ],
12903
12912
  rules: {
12904
- "banner/banner": [
12905
- "error",
12906
- { banner: getFileBanner(""), commentType: "block", numNewlines: 2 }
12907
- ]
12913
+ "banner/banner": ["error", { commentType: "block", numNewlines: 2 }]
12908
12914
  }
12909
12915
  }
12910
12916
  ];
@@ -12931,6 +12937,7 @@ const formatConfig = (name, config = []) => {
12931
12937
  function getStormConfig(options = {
12932
12938
  rules: {},
12933
12939
  ignores: [],
12940
+ tsconfig: "./tsconfig.base.json",
12934
12941
  parserOptions: {},
12935
12942
  markdown: {},
12936
12943
  react: {}
@@ -13038,6 +13045,7 @@ function getStormConfig(options = {
13038
13045
  parserOptions: {
13039
13046
  emitDecoratorMetadata: true,
13040
13047
  experimentalDecorators: true,
13048
+ project: options.tsconfig ? options.tsconfig : "./tsconfig.base.json",
13041
13049
  projectService: true,
13042
13050
  sourceType: "module",
13043
13051
  projectFolderIgnoreList: [
@@ -13065,6 +13073,15 @@ function getStormConfig(options = {
13065
13073
  // Banner
13066
13074
  ...plugin.configs["recommended"][1].rules,
13067
13075
  ...config$1,
13076
+ "banner/banner": [
13077
+ "error",
13078
+ {
13079
+ repositoryName: options.name,
13080
+ banner: options.banner,
13081
+ commentType: "block",
13082
+ numNewlines: 2
13083
+ }
13084
+ ],
13068
13085
  ...options.rules ?? {}
13069
13086
  },
13070
13087
  ignores: ["dist", "coverage", "tmp", ".nx", ...options.ignores || []]
package/dist/rules.d.ts CHANGED
@@ -3875,6 +3875,8 @@ type BannerBanner = []|[{
3875
3875
 
3876
3876
  banner?: string
3877
3877
 
3878
+ repositoryName?: string
3879
+
3878
3880
  commentType?: string
3879
3881
 
3880
3882
  numNewlines?: number
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/eslint",
3
- "version": "0.48.0",
3
+ "version": "0.48.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": {