eslint-plugin-kirklin 3.1.1 → 4.0.0
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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +8 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const version = "3.1.1";
|
|
1
|
+
const version = "4.0.0";
|
|
4
2
|
|
|
5
3
|
const hasDocs = [
|
|
6
4
|
"consistent-chaining",
|
|
@@ -39,7 +37,7 @@ function createRule({
|
|
|
39
37
|
create: ((context) => {
|
|
40
38
|
const optionsWithDefault = context.options.map((options, index) => {
|
|
41
39
|
return {
|
|
42
|
-
...defaultOptions[index] || {},
|
|
40
|
+
...defaultOptions?.[index] || {},
|
|
43
41
|
...options || {}
|
|
44
42
|
};
|
|
45
43
|
});
|
|
@@ -184,6 +182,9 @@ const consistentChaining = createEslintRule({
|
|
|
184
182
|
});
|
|
185
183
|
|
|
186
184
|
const RULE_NAME$7 = "consistent-list-newline";
|
|
185
|
+
function isCommaToken(token) {
|
|
186
|
+
return token.type === "Punctuator" && token.value === ",";
|
|
187
|
+
}
|
|
187
188
|
const consistentListNewline = createEslintRule({
|
|
188
189
|
name: RULE_NAME$7,
|
|
189
190
|
meta: {
|
|
@@ -544,7 +545,7 @@ const importDedupe = createEslintRule({
|
|
|
544
545
|
fix(fixer) {
|
|
545
546
|
const s = n.range[0];
|
|
546
547
|
let e = n.range[1];
|
|
547
|
-
if (context.
|
|
548
|
+
if (context.sourceCode.text[e] === ",") {
|
|
548
549
|
e += 1;
|
|
549
550
|
}
|
|
550
551
|
return fixer.removeRange([s, e]);
|
|
@@ -751,7 +752,7 @@ const noTsExportEqual = createEslintRule({
|
|
|
751
752
|
},
|
|
752
753
|
defaultOptions: [],
|
|
753
754
|
create: (context) => {
|
|
754
|
-
const extension = context.
|
|
755
|
+
const extension = context.filename.split(".").pop();
|
|
755
756
|
if (!extension) {
|
|
756
757
|
return {};
|
|
757
758
|
}
|
|
@@ -823,7 +824,7 @@ const topLevelFunction = createEslintRule({
|
|
|
823
824
|
},
|
|
824
825
|
messageId: "topLevelFunctionDeclaration",
|
|
825
826
|
fix(fixer) {
|
|
826
|
-
const code = context.
|
|
827
|
+
const code = context.sourceCode.text;
|
|
827
828
|
const textName = code.slice(id.range[0], id.range[1]);
|
|
828
829
|
const textArgs = fnExpression.params.length ? code.slice(fnExpression.params[0].range[0], fnExpression.params[fnExpression.params.length - 1].range[1]) : "";
|
|
829
830
|
const textBody = body.type === "BlockStatement" ? code.slice(body.range[0], body.range[1]) : `{
|