@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 +1 -1
- package/dist/preset.d.mts +5 -0
- package/dist/preset.d.ts +5 -0
- package/dist/preset.mjs +36 -19
- package/dist/rules.d.ts +2 -0
- package/package.json +1 -1
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
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
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
|
-
|
|
12572
|
-
|
|
12573
|
-
padding += " ";
|
|
12570
|
+
const getFileBanner = (name = "") => {
|
|
12571
|
+
if (!name) {
|
|
12572
|
+
name = process.env.STORM_NAMESPACE || "";
|
|
12574
12573
|
}
|
|
12575
|
-
let
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
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
|
-
|
|
12736
|
+
repositoryName: "",
|
|
12731
12737
|
commentType: "block",
|
|
12732
12738
|
numNewlines: 2
|
|
12733
12739
|
}
|
|
12734
12740
|
],
|
|
12735
|
-
create(context, [{ banner =
|
|
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
package/package.json
CHANGED