@agoric/eslint-plugin 0.1.1-other-dev-d15096d.0.d15096d → 0.1.1-other-dev-ecf44df.0.ecf44df
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/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/eslint-plugin",
|
|
3
|
-
"version": "0.1.1-other-dev-
|
|
3
|
+
"version": "0.1.1-other-dev-ecf44df.0.ecf44df",
|
|
4
4
|
"description": "ESLint plugin for Agoric best practices",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Agoric/agoric-sdk.git"
|
|
8
|
+
},
|
|
5
9
|
"main": "src/index.js",
|
|
6
10
|
"type": "commonjs",
|
|
7
11
|
"files": [
|
|
@@ -15,7 +19,7 @@
|
|
|
15
19
|
"scripts": {
|
|
16
20
|
"build": "exit 0",
|
|
17
21
|
"lint": "yarn run -T run-s --continue-on-error 'lint:*'",
|
|
18
|
-
"lint:types": "yarn run -T
|
|
22
|
+
"lint:types": "yarn run -T tsgo --tsBuildInfoFile tsconfig.tsgo.tsbuildinfo",
|
|
19
23
|
"test": "node --test **/*.test.*",
|
|
20
24
|
"test:xs": "exit 0"
|
|
21
25
|
},
|
|
@@ -24,11 +28,11 @@
|
|
|
24
28
|
},
|
|
25
29
|
"devDependencies": {
|
|
26
30
|
"eslint": "^9.0.0",
|
|
27
|
-
"eslint-plugin-eslint-plugin": "^7.2
|
|
31
|
+
"eslint-plugin-eslint-plugin": "^7.3.2"
|
|
28
32
|
},
|
|
29
33
|
"license": "Apache-2.0",
|
|
30
34
|
"engines": {
|
|
31
|
-
"node": "^
|
|
35
|
+
"node": "^22.11 || ^24.14"
|
|
32
36
|
},
|
|
33
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "ecf44df5eadcc7a1d68745f056fca19155fb5231"
|
|
34
38
|
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {Rule} from 'eslint';
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* ESLint rule: group-jsdoc-imports
|
|
3
7
|
*
|
|
4
|
-
* Moves inline JSDoc type imports (e.g. \@type {
|
|
8
|
+
* Moves inline JSDoc type imports (e.g. \@type {Bar})
|
|
5
9
|
* into a top-level JSDoc block with \@import lines, then references the
|
|
6
10
|
* import by name (e.g. \@type {Bar}).
|
|
7
11
|
*
|
|
@@ -14,7 +18,7 @@
|
|
|
14
18
|
* }
|
|
15
19
|
* }
|
|
16
20
|
*
|
|
17
|
-
* @type {
|
|
21
|
+
* @type {Rule.RuleModule}
|
|
18
22
|
*/
|
|
19
23
|
/**
|
|
20
24
|
* ESLint rule: group-jsdoc-imports (one-fix-per-inline-import version)
|
|
@@ -270,26 +274,24 @@ module.exports = {
|
|
|
270
274
|
`${buildNewBlock(importTypeName, importPath)}\n`,
|
|
271
275
|
),
|
|
272
276
|
);
|
|
273
|
-
} else
|
|
277
|
+
} else if (
|
|
274
278
|
// If we do have a block, ensure it includes `@import {typeName} from 'importPath'`
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
importPath,
|
|
289
|
-
),
|
|
279
|
+
!alreadyHasImport(
|
|
280
|
+
topBlockComment.value,
|
|
281
|
+
importTypeName,
|
|
282
|
+
importPath,
|
|
283
|
+
)
|
|
284
|
+
) {
|
|
285
|
+
fixOps.push(
|
|
286
|
+
fixer.replaceTextRange(
|
|
287
|
+
topBlockComment.range,
|
|
288
|
+
appendImportToComment(
|
|
289
|
+
topBlockComment,
|
|
290
|
+
importTypeName,
|
|
291
|
+
importPath,
|
|
290
292
|
),
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
+
),
|
|
294
|
+
);
|
|
293
295
|
}
|
|
294
296
|
|
|
295
297
|
// (b) Remove the inline usage from *this* comment
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
* @see https://github.com/microsoft/typescript/issues/60831
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @import {Rule} from 'eslint';
|
|
16
|
+
*/
|
|
17
|
+
|
|
14
18
|
const LINE_REGEX =
|
|
15
19
|
/^(\s*\*?\s*)@typedef\s+\{\s*import\((['"])([^'"]+)\2\)\.([A-Za-z0-9_$]+)([^}]*)\}\s+([A-Za-z0-9_$]+)(.*)$/;
|
|
16
20
|
|
|
@@ -76,7 +80,7 @@ const transformCommentValue = value => {
|
|
|
76
80
|
return lines.join('\n');
|
|
77
81
|
};
|
|
78
82
|
|
|
79
|
-
/** @type {
|
|
83
|
+
/** @type {Rule.RuleModule} */
|
|
80
84
|
module.exports = {
|
|
81
85
|
meta: {
|
|
82
86
|
type: 'problem',
|