@so1ve/eslint-plugin 3.9.0 → 3.9.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/dist/index.js +3 -6
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -55,12 +55,10 @@ var function_style_default = createEslintRule({
|
|
|
55
55
|
});
|
|
56
56
|
function generateArrowFunction(name, info, returnValue, asVariable = true) {
|
|
57
57
|
const asyncKeyword = info.async ? "async " : "";
|
|
58
|
-
|
|
59
|
-
return `${variableDeclaration}${asyncKeyword}${info.generics}(${info.params})${info.returnType} => ${returnValue};`;
|
|
58
|
+
return `${asVariable && name ? `const ${name} = ` : ""}${asyncKeyword}${info.generics}(${info.params})${info.returnType} => ${returnValue};`;
|
|
60
59
|
}
|
|
61
60
|
function generateFunctionDeclaration(name, info) {
|
|
62
|
-
|
|
63
|
-
return `${asyncKeyword}function ${name}${info.generics}(${info.params})${info.returnType} ${info.body}`;
|
|
61
|
+
return `${info.async ? "async " : ""}function ${name}${info.generics}(${info.params})${info.returnType} ${info.body}`;
|
|
64
62
|
}
|
|
65
63
|
function setupScope(node) {
|
|
66
64
|
scopeStack.push(sourceCode.getScope(node));
|
|
@@ -214,8 +212,7 @@ var no_import_promises_as_default = createEslintRule({
|
|
|
214
212
|
},
|
|
215
213
|
defaultOptions: [],
|
|
216
214
|
create: (context) => {
|
|
217
|
-
const
|
|
218
|
-
const { text } = sourceCode;
|
|
215
|
+
const { text } = context.sourceCode;
|
|
219
216
|
return { ImportDeclaration(node) {
|
|
220
217
|
if (!POSSIBLE_IMPORT_SOURCES.includes(node.source.value)) return;
|
|
221
218
|
const promisesSpecifier = node.specifiers.find((s) => s.type === "ImportSpecifier" && s.imported.type === "Identifier" && s.imported.name === "promises" && s.local.name !== "promises");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@so1ve/eslint-plugin",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.1",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@typescript-eslint/types": "^8.
|
|
37
|
-
"@typescript-eslint/utils": "^8.
|
|
36
|
+
"@typescript-eslint/types": "^8.44.0",
|
|
37
|
+
"@typescript-eslint/utils": "^8.44.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"vue-eslint-parser": "^10.2.0"
|