@storm-software/eslint 0.68.1 → 0.68.3
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.mjs +15 -34
- 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.mjs
CHANGED
|
@@ -13343,7 +13343,7 @@ function excludeShebangs(comments) {
|
|
|
13343
13343
|
});
|
|
13344
13344
|
}
|
|
13345
13345
|
function getLeadingComments(context, node) {
|
|
13346
|
-
|
|
13346
|
+
const all = excludeShebangs(
|
|
13347
13347
|
context.getSourceCode().getAllComments(node.body.length ? node.body[0] : node)
|
|
13348
13348
|
);
|
|
13349
13349
|
if (all[0].type.toLowerCase() === "block") {
|
|
@@ -13351,7 +13351,7 @@ function getLeadingComments(context, node) {
|
|
|
13351
13351
|
}
|
|
13352
13352
|
let i = 1;
|
|
13353
13353
|
for (i = 1; i < all.length; ++i) {
|
|
13354
|
-
|
|
13354
|
+
const txt = context.getSourceCode().getText().slice(all[i - 1].range[1], all[i].range[0]);
|
|
13355
13355
|
if (!txt.match(/^(\r\n|\r|\n)$/)) {
|
|
13356
13356
|
break;
|
|
13357
13357
|
}
|
|
@@ -13359,7 +13359,7 @@ function getLeadingComments(context, node) {
|
|
|
13359
13359
|
return all.slice(0, i);
|
|
13360
13360
|
}
|
|
13361
13361
|
function genCommentBody(commentType, textArray, eol, numNewlines) {
|
|
13362
|
-
|
|
13362
|
+
const eols = eol.repeat(numNewlines);
|
|
13363
13363
|
if (commentType === "block") {
|
|
13364
13364
|
return "/*" + textArray.join(eol) + "*/" + eols;
|
|
13365
13365
|
} else {
|
|
@@ -13367,7 +13367,7 @@ function genCommentBody(commentType, textArray, eol, numNewlines) {
|
|
|
13367
13367
|
}
|
|
13368
13368
|
}
|
|
13369
13369
|
function genCommentsRange(context, comments, eol) {
|
|
13370
|
-
|
|
13370
|
+
const start = comments[0].range[0];
|
|
13371
13371
|
let end = comments.slice(-1)[0].range[1];
|
|
13372
13372
|
if (context.getSourceCode().text[end] === eol) {
|
|
13373
13373
|
end += eol.length;
|
|
@@ -13472,9 +13472,9 @@ const bannerRule = dist$3.ESLintUtils.RuleCreator(
|
|
|
13472
13472
|
if (!banner) {
|
|
13473
13473
|
banner = getFileBanner(repositoryName);
|
|
13474
13474
|
}
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13475
|
+
const options = context.options;
|
|
13476
|
+
const eol = getEOL(options);
|
|
13477
|
+
const bannerLines = banner.split(/\r?\n/);
|
|
13478
13478
|
let fixLines = bannerLines;
|
|
13479
13479
|
return {
|
|
13480
13480
|
Program: function(node) {
|
|
@@ -13485,7 +13485,7 @@ const bannerRule = dist$3.ESLintUtils.RuleCreator(
|
|
|
13485
13485
|
fix: genPrependFixer(commentType, node, fixLines, eol, numNewlines)
|
|
13486
13486
|
});
|
|
13487
13487
|
} else {
|
|
13488
|
-
|
|
13488
|
+
const leadingComments = getLeadingComments(context, node);
|
|
13489
13489
|
if (!leadingComments.length) {
|
|
13490
13490
|
context.report({
|
|
13491
13491
|
loc: node.loc,
|
|
@@ -13542,7 +13542,7 @@ const bannerRule = dist$3.ESLintUtils.RuleCreator(
|
|
|
13542
13542
|
return;
|
|
13543
13543
|
}
|
|
13544
13544
|
}
|
|
13545
|
-
|
|
13545
|
+
const postLineBanner = context.getSourceCode().text.substr(
|
|
13546
13546
|
leadingComments[bannerLines.length - 1].range[1],
|
|
13547
13547
|
(numNewlines ?? 1) * 2
|
|
13548
13548
|
);
|
|
@@ -13591,7 +13591,7 @@ const bannerRule = dist$3.ESLintUtils.RuleCreator(
|
|
|
13591
13591
|
)
|
|
13592
13592
|
});
|
|
13593
13593
|
} else {
|
|
13594
|
-
|
|
13594
|
+
const postBlockBanner = context.getSourceCode().text.substr(
|
|
13595
13595
|
leadingComments[0].range[1],
|
|
13596
13596
|
(numNewlines ?? 1) * 2
|
|
13597
13597
|
);
|
|
@@ -13646,8 +13646,8 @@ plugin.configs.recommended = [
|
|
|
13646
13646
|
];
|
|
13647
13647
|
|
|
13648
13648
|
const CODE_BLOCK = "**/*.md{,x}/*";
|
|
13649
|
+
const CODE_FILE = "**/*.{,c,m}{j,t}s{,x}";
|
|
13649
13650
|
const TS_FILE = "**/*.{,c,m}ts{,x}";
|
|
13650
|
-
const JS_FILE = "**/*.{,c}js{,x}";
|
|
13651
13651
|
|
|
13652
13652
|
const formatConfig = (name, config = []) => {
|
|
13653
13653
|
return config.map((config2, index) => {
|
|
@@ -13859,31 +13859,13 @@ function getStormConfig(options = {
|
|
|
13859
13859
|
}
|
|
13860
13860
|
};
|
|
13861
13861
|
}
|
|
13862
|
-
const
|
|
13863
|
-
files: [
|
|
13864
|
-
languageOptions: {
|
|
13865
|
-
globals: {
|
|
13866
|
-
...Object.fromEntries(
|
|
13867
|
-
Object.keys(globals).flatMap(
|
|
13868
|
-
(group) => Object.keys(globals[group]).map((key) => [
|
|
13869
|
-
key,
|
|
13870
|
-
"readonly"
|
|
13871
|
-
])
|
|
13872
|
-
)
|
|
13873
|
-
),
|
|
13874
|
-
...globals.browser,
|
|
13875
|
-
...globals.node,
|
|
13876
|
-
"window": "readonly",
|
|
13877
|
-
"Storm": "readonly"
|
|
13878
|
-
},
|
|
13879
|
-
ecmaVersion: "latest"
|
|
13880
|
-
},
|
|
13862
|
+
const codeConfig = {
|
|
13863
|
+
files: [CODE_FILE],
|
|
13881
13864
|
rules: {
|
|
13882
13865
|
// Prettier
|
|
13883
13866
|
...prettierConfig.rules,
|
|
13884
13867
|
// Banner
|
|
13885
13868
|
...plugin.configs["recommended"][1]?.rules,
|
|
13886
|
-
...config$1,
|
|
13887
13869
|
"banner/banner": [
|
|
13888
13870
|
"error",
|
|
13889
13871
|
{
|
|
@@ -13892,12 +13874,11 @@ function getStormConfig(options = {
|
|
|
13892
13874
|
commentType: "block",
|
|
13893
13875
|
numNewlines: 2
|
|
13894
13876
|
}
|
|
13895
|
-
]
|
|
13896
|
-
...options.rules ?? {}
|
|
13877
|
+
]
|
|
13897
13878
|
},
|
|
13898
13879
|
ignores: ["dist", "coverage", "tmp", ".nx", ...options.ignores || []]
|
|
13899
13880
|
};
|
|
13900
|
-
configs.push(
|
|
13881
|
+
configs.push(codeConfig);
|
|
13901
13882
|
if (options.markdown) {
|
|
13902
13883
|
configs.push(...markdown.configs.recommended);
|
|
13903
13884
|
configs.push({
|
package/package.json
CHANGED