eslint-plugin-package-json 0.4.0 โ 0.5.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/README.md +18 -10
- package/lib/index.d.mts +4 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +2 -0
- package/lib/index.mjs.map +1 -1
- package/lib/rules/prefer-repository-shorthand.d.mts +11 -0
- package/lib/rules/prefer-repository-shorthand.d.ts +11 -0
- package/lib/rules/prefer-repository-shorthand.js +101 -0
- package/lib/rules/prefer-repository-shorthand.js.map +1 -0
- package/lib/rules/prefer-repository-shorthand.mjs +81 -0
- package/lib/rules/prefer-repository-shorthand.mjs.map +1 -0
- package/package.json +4 -7
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<a href="#contributors" target="_blank">
|
|
7
7
|
<!-- prettier-ignore-start -->
|
|
8
8
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
9
|
-
<img alt="All Contributors:
|
|
9
|
+
<img alt="All Contributors: 13 ๐ช" src="https://img.shields.io/badge/all_contributors-13_๐ช-21bb42.svg" />
|
|
10
10
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
11
11
|
<!-- prettier-ignore-end -->
|
|
12
12
|
</a>
|
|
@@ -73,14 +73,17 @@ module.exports = {
|
|
|
73
73
|
<!-- prettier-ignore-start -->
|
|
74
74
|
<!-- begin auto-generated rules list -->
|
|
75
75
|
|
|
76
|
+
๐ผ Configurations enabled in.\
|
|
77
|
+
โ
Set in the `recommended` configuration.\
|
|
76
78
|
๐ง Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).
|
|
77
79
|
|
|
78
|
-
| Name
|
|
79
|
-
|
|
|
80
|
-
| [order-properties](docs/rules/order-properties.md)
|
|
81
|
-
| [
|
|
82
|
-
| [
|
|
83
|
-
| [valid-
|
|
80
|
+
| Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย | Description | ๐ผ | ๐ง |
|
|
81
|
+
| :----------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :- | :- |
|
|
82
|
+
| [order-properties](docs/rules/order-properties.md) | Package properties must be declared in standard order | โ
| ๐ง |
|
|
83
|
+
| [prefer-repository-shorthand](docs/rules/prefer-repository-shorthand.md) | Enforce shorthand declaration for GitHub repository. | โ
| ๐ง |
|
|
84
|
+
| [sort-collections](docs/rules/sort-collections.md) | Dependencies, scripts, and configuration values must be declared in alphabetical order. | โ
| ๐ง |
|
|
85
|
+
| [valid-local-dependency](docs/rules/valid-local-dependency.md) | Checks existence of local dependencies in the package.json | โ
| |
|
|
86
|
+
| [valid-package-def](docs/rules/valid-package-def.md) | Enforce that package.json has all properties required by NPM spec | โ
| |
|
|
84
87
|
|
|
85
88
|
<!-- end auto-generated rules list -->
|
|
86
89
|
<!-- prettier-ignore-end -->
|
|
@@ -96,15 +99,20 @@ These rules only run on `package.json` files; they will ignore all other files b
|
|
|
96
99
|
<table>
|
|
97
100
|
<tbody>
|
|
98
101
|
<tr>
|
|
102
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/AndreasLindbergPAF"><img src="https://avatars.githubusercontent.com/u/59874563?v=4?s=100" width="100px;" alt="Andreas Lindberg"/><br /><sub><b>Andreas Lindberg</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Aandreaslindbergpaf" title="Bug reports">๐</a></td>
|
|
103
|
+
<td align="center" valign="top" width="14.28%"><a href="http://technotes.khitrenovich.com/"><img src="https://avatars.githubusercontent.com/u/3424762?v=4?s=100" width="100px;" alt="Anton Khitrenovich"/><br /><sub><b>Anton Khitrenovich</b></sub></a><br /><a href="#ideas-khitrenovich" title="Ideas, Planning, & Feedback">๐ค</a></td>
|
|
104
|
+
<td align="center" valign="top" width="14.28%"><a href="https://azat.io"><img src="https://avatars.githubusercontent.com/u/5698350?v=4?s=100" width="100px;" alt="Azat S."/><br /><sub><b>Azat S.</b></sub></a><br /><a href="#ideas-azat-io" title="Ideas, Planning, & Feedback">๐ค</a></td>
|
|
99
105
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Zamiell"><img src="https://avatars.githubusercontent.com/u/5511220?v=4?s=100" width="100px;" alt="James"/><br /><sub><b>James</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=Zamiell" title="Code">๐ป</a></td>
|
|
100
106
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zetlen"><img src="https://avatars.githubusercontent.com/u/1643758?v=4?s=100" width="100px;" alt="James Zetlen"/><br /><sub><b>James Zetlen</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=zetlen" title="Code">๐ป</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Azetlen" title="Bug reports">๐</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=zetlen" title="Documentation">๐</a> <a href="#infra-zetlen" title="Infrastructure (Hosting, Build-Tools, etc)">๐</a> <a href="#maintenance-zetlen" title="Maintenance">๐ง</a> <a href="#tool-zetlen" title="Tools">๐ง</a></td>
|
|
101
107
|
<td align="center" valign="top" width="14.28%"><a href="https://piranna.github.io/"><img src="https://avatars.githubusercontent.com/u/532414?v=4?s=100" width="100px;" alt="Jesรบs Leganรฉs-Combarro"/><br /><sub><b>Jesรบs Leganรฉs-Combarro</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=piranna" title="Code">๐ป</a></td>
|
|
102
|
-
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com/"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg โจ"/><br /><sub><b>Josh Goldberg โจ</b></sub></a><br /><a href="#tool-JoshuaKGoldberg" title="Tools">๐ง</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3AJoshuaKGoldberg" title="Bug reports">๐</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=JoshuaKGoldberg" title="Code">๐ป</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">๐</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=JoshuaKGoldberg" title="Documentation">๐</a> <a href="#maintenance-JoshuaKGoldberg" title="Maintenance">๐ง</a></td>
|
|
108
|
+
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com/"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg โจ"/><br /><sub><b>Josh Goldberg โจ</b></sub></a><br /><a href="#tool-JoshuaKGoldberg" title="Tools">๐ง</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3AJoshuaKGoldberg" title="Bug reports">๐</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=JoshuaKGoldberg" title="Code">๐ป</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">๐</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=JoshuaKGoldberg" title="Documentation">๐</a> <a href="#maintenance-JoshuaKGoldberg" title="Maintenance">๐ง</a> <a href="#ideas-JoshuaKGoldberg" title="Ideas, Planning, & Feedback">๐ค</a></td>
|
|
109
|
+
</tr>
|
|
110
|
+
<tr>
|
|
103
111
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kendallgassner"><img src="https://avatars.githubusercontent.com/u/15275462?v=4?s=100" width="100px;" alt="Kendall Gassner"/><br /><sub><b>Kendall Gassner</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=kendallgassner" title="Code">๐ป</a> <a href="#maintenance-kendallgassner" title="Maintenance">๐ง</a></td>
|
|
112
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/KristjanESPERANTO"><img src="https://avatars.githubusercontent.com/u/35647502?v=4?s=100" width="100px;" alt="Kristjan ESPERANTO"/><br /><sub><b>Kristjan ESPERANTO</b></sub></a><br /><a href="#ideas-kristjanesperanto" title="Ideas, Planning, & Feedback">๐ค</a></td>
|
|
104
113
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nschonni"><img src="https://avatars.githubusercontent.com/u/1297909?v=4?s=100" width="100px;" alt="Nick Schonning"/><br /><sub><b>Nick Schonning</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=nschonni" title="Code">๐ป</a></td>
|
|
105
114
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sirugh"><img src="https://avatars.githubusercontent.com/u/1278869?v=4?s=100" width="100px;" alt="Stephen"/><br /><sub><b>Stephen</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=sirugh" title="Code">๐ป</a></td>
|
|
106
|
-
|
|
107
|
-
<tr>
|
|
115
|
+
<td align="center" valign="top" width="14.28%"><a href="https://ota-meshi.github.io/"><img src="https://avatars.githubusercontent.com/u/16508807?v=4?s=100" width="100px;" alt="Yosuke Ota"/><br /><sub><b>Yosuke Ota</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Aota-meshi" title="Bug reports">๐</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=ota-meshi" title="Code">๐ป</a></td>
|
|
108
116
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/b3rnhard"><img src="https://avatars.githubusercontent.com/u/10774404?v=4?s=100" width="100px;" alt="b3rnhard"/><br /><sub><b>b3rnhard</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Ab3rnhard" title="Bug reports">๐</a></td>
|
|
109
117
|
</tr>
|
|
110
118
|
</tbody>
|
package/lib/index.d.mts
CHANGED
|
@@ -10,6 +10,10 @@ declare const rules: {
|
|
|
10
10
|
} | undefined)?]>): jsonc_eslint_parser.RuleListener;
|
|
11
11
|
meta: eslint.Rule.RuleMetaData;
|
|
12
12
|
};
|
|
13
|
+
"prefer-repository-shorthand": {
|
|
14
|
+
create(context: PackageJsonRuleContext<unknown[]>): jsonc_eslint_parser.RuleListener;
|
|
15
|
+
meta: eslint.Rule.RuleMetaData;
|
|
16
|
+
};
|
|
13
17
|
"sort-collections": {
|
|
14
18
|
create(context: PackageJsonRuleContext<string[]>): jsonc_eslint_parser.RuleListener;
|
|
15
19
|
meta: eslint.Rule.RuleMetaData;
|
package/lib/index.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ declare const rules: {
|
|
|
10
10
|
} | undefined)?]>): jsonc_eslint_parser.RuleListener;
|
|
11
11
|
meta: eslint.Rule.RuleMetaData;
|
|
12
12
|
};
|
|
13
|
+
"prefer-repository-shorthand": {
|
|
14
|
+
create(context: PackageJsonRuleContext<unknown[]>): jsonc_eslint_parser.RuleListener;
|
|
15
|
+
meta: eslint.Rule.RuleMetaData;
|
|
16
|
+
};
|
|
13
17
|
"sort-collections": {
|
|
14
18
|
create(context: PackageJsonRuleContext<string[]>): jsonc_eslint_parser.RuleListener;
|
|
15
19
|
meta: eslint.Rule.RuleMetaData;
|
package/lib/index.js
CHANGED
|
@@ -33,11 +33,13 @@ __export(src_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(src_exports);
|
|
35
35
|
var import_order_properties = __toESM(require("./rules/order-properties.js"));
|
|
36
|
+
var import_prefer_repository_shorthand = __toESM(require("./rules/prefer-repository-shorthand.js"));
|
|
36
37
|
var import_sort_collections = __toESM(require("./rules/sort-collections.js"));
|
|
37
38
|
var import_valid_local_dependency = __toESM(require("./rules/valid-local-dependency.js"));
|
|
38
39
|
var import_valid_package_def = __toESM(require("./rules/valid-package-def.js"));
|
|
39
40
|
const rules = {
|
|
40
41
|
"order-properties": import_order_properties.default,
|
|
42
|
+
"prefer-repository-shorthand": import_prefer_repository_shorthand.default,
|
|
41
43
|
"sort-collections": import_sort_collections.default,
|
|
42
44
|
"valid-local-dependency": import_valid_local_dependency.default,
|
|
43
45
|
"valid-package-def": import_valid_package_def.default
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import orderProperties from \"./rules/order-properties.js\";\nimport sortCollections from \"./rules/sort-collections.js\";\nimport validLocalDependency from \"./rules/valid-local-dependency.js\";\nimport validPackageDef from \"./rules/valid-package-def.js\";\n\nexport const rules = {\n\t\"order-properties\": orderProperties,\n\t\"sort-collections\": sortCollections,\n\t\"valid-local-dependency\": validLocalDependency,\n\t\"valid-package-def\": validPackageDef,\n};\n\nexport const configs = {\n\trecommended: {\n\t\trules: Object.fromEntries(\n\t\t\tObject.entries(rules)\n\t\t\t\t.filter(([, rule]) => rule.meta.docs?.recommended)\n\t\t\t\t.map(([name]) => [\"package-json/\" + name, \"error\" as const]),\n\t\t),\n\t},\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA4B;AAC5B,8BAA4B;AAC5B,oCAAiC;AACjC,+BAA4B;AAErB,MAAM,QAAQ;AAAA,EACpB,oBAAoB,wBAAAA;AAAA,EACpB,oBAAoB,wBAAAC;AAAA,EACpB,0BAA0B,8BAAAC;AAAA,EAC1B,qBAAqB,yBAAAC;AACtB;AAEO,MAAM,UAAU;AAAA,EACtB,aAAa;AAAA,IACZ,OAAO,OAAO;AAAA,MACb,OAAO,QAAQ,KAAK,EAClB,OAAO,CAAC,CAAC,EAAE,IAAI,MAAM,KAAK,KAAK,MAAM,WAAW,EAChD,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,kBAAkB,MAAM,OAAgB,CAAC;AAAA,IAC7D;AAAA,EACD;AACD;","names":["orderProperties","sortCollections","validLocalDependency","validPackageDef"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import orderProperties from \"./rules/order-properties.js\";\nimport preferRepositoryShorthand from \"./rules/prefer-repository-shorthand.js\";\nimport sortCollections from \"./rules/sort-collections.js\";\nimport validLocalDependency from \"./rules/valid-local-dependency.js\";\nimport validPackageDef from \"./rules/valid-package-def.js\";\n\nexport const rules = {\n\t\"order-properties\": orderProperties,\n\t\"prefer-repository-shorthand\": preferRepositoryShorthand,\n\t\"sort-collections\": sortCollections,\n\t\"valid-local-dependency\": validLocalDependency,\n\t\"valid-package-def\": validPackageDef,\n};\n\nexport const configs = {\n\trecommended: {\n\t\trules: Object.fromEntries(\n\t\t\tObject.entries(rules)\n\t\t\t\t.filter(([, rule]) => rule.meta.docs?.recommended)\n\t\t\t\t.map(([name]) => [\"package-json/\" + name, \"error\" as const]),\n\t\t),\n\t},\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA4B;AAC5B,yCAAsC;AACtC,8BAA4B;AAC5B,oCAAiC;AACjC,+BAA4B;AAErB,MAAM,QAAQ;AAAA,EACpB,oBAAoB,wBAAAA;AAAA,EACpB,+BAA+B,mCAAAC;AAAA,EAC/B,oBAAoB,wBAAAC;AAAA,EACpB,0BAA0B,8BAAAC;AAAA,EAC1B,qBAAqB,yBAAAC;AACtB;AAEO,MAAM,UAAU;AAAA,EACtB,aAAa;AAAA,IACZ,OAAO,OAAO;AAAA,MACb,OAAO,QAAQ,KAAK,EAClB,OAAO,CAAC,CAAC,EAAE,IAAI,MAAM,KAAK,KAAK,MAAM,WAAW,EAChD,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,kBAAkB,MAAM,OAAgB,CAAC;AAAA,IAC7D;AAAA,EACD;AACD;","names":["orderProperties","preferRepositoryShorthand","sortCollections","validLocalDependency","validPackageDef"]}
|
package/lib/index.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import orderProperties from "./rules/order-properties.js";
|
|
2
|
+
import preferRepositoryShorthand from "./rules/prefer-repository-shorthand.js";
|
|
2
3
|
import sortCollections from "./rules/sort-collections.js";
|
|
3
4
|
import validLocalDependency from "./rules/valid-local-dependency.js";
|
|
4
5
|
import validPackageDef from "./rules/valid-package-def.js";
|
|
5
6
|
const rules = {
|
|
6
7
|
"order-properties": orderProperties,
|
|
8
|
+
"prefer-repository-shorthand": preferRepositoryShorthand,
|
|
7
9
|
"sort-collections": sortCollections,
|
|
8
10
|
"valid-local-dependency": validLocalDependency,
|
|
9
11
|
"valid-package-def": validPackageDef
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import orderProperties from \"./rules/order-properties.js\";\nimport sortCollections from \"./rules/sort-collections.js\";\nimport validLocalDependency from \"./rules/valid-local-dependency.js\";\nimport validPackageDef from \"./rules/valid-package-def.js\";\n\nexport const rules = {\n\t\"order-properties\": orderProperties,\n\t\"sort-collections\": sortCollections,\n\t\"valid-local-dependency\": validLocalDependency,\n\t\"valid-package-def\": validPackageDef,\n};\n\nexport const configs = {\n\trecommended: {\n\t\trules: Object.fromEntries(\n\t\t\tObject.entries(rules)\n\t\t\t\t.filter(([, rule]) => rule.meta.docs?.recommended)\n\t\t\t\t.map(([name]) => [\"package-json/\" + name, \"error\" as const]),\n\t\t),\n\t},\n};\n"],"mappings":"AAAA,OAAO,qBAAqB;AAC5B,OAAO,qBAAqB;AAC5B,OAAO,0BAA0B;AACjC,OAAO,qBAAqB;AAErB,MAAM,QAAQ;AAAA,EACpB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,0BAA0B;AAAA,EAC1B,qBAAqB;AACtB;AAEO,MAAM,UAAU;AAAA,EACtB,aAAa;AAAA,IACZ,OAAO,OAAO;AAAA,MACb,OAAO,QAAQ,KAAK,EAClB,OAAO,CAAC,CAAC,EAAE,IAAI,MAAM,KAAK,KAAK,MAAM,WAAW,EAChD,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,kBAAkB,MAAM,OAAgB,CAAC;AAAA,IAC7D;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import orderProperties from \"./rules/order-properties.js\";\nimport preferRepositoryShorthand from \"./rules/prefer-repository-shorthand.js\";\nimport sortCollections from \"./rules/sort-collections.js\";\nimport validLocalDependency from \"./rules/valid-local-dependency.js\";\nimport validPackageDef from \"./rules/valid-package-def.js\";\n\nexport const rules = {\n\t\"order-properties\": orderProperties,\n\t\"prefer-repository-shorthand\": preferRepositoryShorthand,\n\t\"sort-collections\": sortCollections,\n\t\"valid-local-dependency\": validLocalDependency,\n\t\"valid-package-def\": validPackageDef,\n};\n\nexport const configs = {\n\trecommended: {\n\t\trules: Object.fromEntries(\n\t\t\tObject.entries(rules)\n\t\t\t\t.filter(([, rule]) => rule.meta.docs?.recommended)\n\t\t\t\t.map(([name]) => [\"package-json/\" + name, \"error\" as const]),\n\t\t),\n\t},\n};\n"],"mappings":"AAAA,OAAO,qBAAqB;AAC5B,OAAO,+BAA+B;AACtC,OAAO,qBAAqB;AAC5B,OAAO,0BAA0B;AACjC,OAAO,qBAAqB;AAErB,MAAM,QAAQ;AAAA,EACpB,oBAAoB;AAAA,EACpB,+BAA+B;AAAA,EAC/B,oBAAoB;AAAA,EACpB,0BAA0B;AAAA,EAC1B,qBAAqB;AACtB;AAEO,MAAM,UAAU;AAAA,EACtB,aAAa;AAAA,IACZ,OAAO,OAAO;AAAA,MACb,OAAO,QAAQ,KAAK,EAClB,OAAO,CAAC,CAAC,EAAE,IAAI,MAAM,KAAK,KAAK,MAAM,WAAW,EAChD,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,kBAAkB,MAAM,OAAgB,CAAC;AAAA,IAC7D;AAAA,EACD;AACD;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as eslint from 'eslint';
|
|
2
|
+
import * as jsonc_eslint_parser from 'jsonc-eslint-parser';
|
|
3
|
+
import { PackageJsonRuleContext } from '../createRule.mjs';
|
|
4
|
+
import 'estree';
|
|
5
|
+
|
|
6
|
+
declare const _default: {
|
|
7
|
+
create(context: PackageJsonRuleContext<unknown[]>): jsonc_eslint_parser.RuleListener;
|
|
8
|
+
meta: eslint.Rule.RuleMetaData;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { _default as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as eslint from 'eslint';
|
|
2
|
+
import * as jsonc_eslint_parser from 'jsonc-eslint-parser';
|
|
3
|
+
import { PackageJsonRuleContext } from '../createRule.js';
|
|
4
|
+
import 'estree';
|
|
5
|
+
|
|
6
|
+
declare const _default: {
|
|
7
|
+
create(context: PackageJsonRuleContext<unknown[]>): jsonc_eslint_parser.RuleListener;
|
|
8
|
+
meta: eslint.Rule.RuleMetaData;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { _default as default };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var prefer_repository_shorthand_exports = {};
|
|
20
|
+
__export(prefer_repository_shorthand_exports, {
|
|
21
|
+
default: () => prefer_repository_shorthand_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(prefer_repository_shorthand_exports);
|
|
24
|
+
var import_createRule = require("../createRule.js");
|
|
25
|
+
const githubUrlRegex = /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?github\.com\//;
|
|
26
|
+
const isGitHubUrl = (url) => githubUrlRegex.test(url);
|
|
27
|
+
const cleanGitHubUrl = (url) => url.replace(githubUrlRegex, "").replace(/\.git$/, "");
|
|
28
|
+
function findJSONLiteralWithValue(properties, value) {
|
|
29
|
+
return properties.find(
|
|
30
|
+
(property) => property.key.type === "JSONLiteral" && property.key.value === value
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
var prefer_repository_shorthand_default = (0, import_createRule.createRule)({
|
|
34
|
+
create(context) {
|
|
35
|
+
return {
|
|
36
|
+
JSONProperty(node) {
|
|
37
|
+
if (node.key.type !== "JSONLiteral" || node.key.value !== "repository" || node.parent.parent.parent.type !== "Program") {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (node.value.type === "JSONObjectExpression") {
|
|
41
|
+
const { properties } = node.value;
|
|
42
|
+
if (findJSONLiteralWithValue(properties, "directory")) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const typeProperty = findJSONLiteralWithValue(
|
|
46
|
+
properties,
|
|
47
|
+
"type"
|
|
48
|
+
);
|
|
49
|
+
if (typeProperty?.value.type !== "JSONLiteral" || typeProperty.value.value !== "git") {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const urlProperty = findJSONLiteralWithValue(
|
|
53
|
+
properties,
|
|
54
|
+
"url"
|
|
55
|
+
);
|
|
56
|
+
if (urlProperty?.value.type !== "JSONLiteral" || typeof urlProperty.value.value !== "string" || !isGitHubUrl(urlProperty.value.value)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const url = urlProperty.value.value;
|
|
60
|
+
context.report({
|
|
61
|
+
fix(fixer) {
|
|
62
|
+
return fixer.replaceText(
|
|
63
|
+
node.value,
|
|
64
|
+
JSON.stringify(cleanGitHubUrl(url))
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
messageId: "preferShorthand",
|
|
68
|
+
node: node.value
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (node.value.type === "JSONLiteral") {
|
|
72
|
+
const { value } = node.value;
|
|
73
|
+
if (typeof value === "string" && isGitHubUrl(value)) {
|
|
74
|
+
context.report({
|
|
75
|
+
fix(fixer) {
|
|
76
|
+
return fixer.replaceText(
|
|
77
|
+
node.value,
|
|
78
|
+
JSON.stringify(cleanGitHubUrl(value))
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
messageId: "preferShorthand",
|
|
82
|
+
node: node.value
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
meta: {
|
|
90
|
+
docs: {
|
|
91
|
+
category: "Best Practices",
|
|
92
|
+
description: "Enforce shorthand declaration for GitHub repository.",
|
|
93
|
+
recommended: true
|
|
94
|
+
},
|
|
95
|
+
fixable: "code",
|
|
96
|
+
messages: {
|
|
97
|
+
preferShorthand: "Prefer a shorthand locator for a GitHub repository."
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=prefer-repository-shorthand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/rules/prefer-repository-shorthand.ts"],"sourcesContent":["import type ESTree from \"estree\";\nimport type { AST as JsonAST } from \"jsonc-eslint-parser\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst githubUrlRegex =\n\t/^(?:git\\+)?(?:ssh:\\/\\/git@|http?s:\\/\\/)?(?:www\\.)?github\\.com\\//;\n\nconst isGitHubUrl = (url: string) => githubUrlRegex.test(url);\n\nconst cleanGitHubUrl = (url: string) =>\n\turl.replace(githubUrlRegex, \"\").replace(/\\.git$/, \"\");\n\ntype JSONPropertyWithKeyAndValue<Value extends string> =\n\tJsonAST.JSONProperty & {\n\t\tkey: JsonAST.JSONStringLiteral;\n\t\tvalue: Value;\n\t};\n\nfunction findJSONLiteralWithValue<Value extends string>(\n\tproperties: JsonAST.JSONProperty[],\n\tvalue: Value,\n) {\n\treturn properties.find(\n\t\t(property): property is JSONPropertyWithKeyAndValue<Value> =>\n\t\t\tproperty.key.type === \"JSONLiteral\" && property.key.value === value,\n\t);\n}\n\nexport default createRule({\n\tcreate(context) {\n\t\treturn {\n\t\t\tJSONProperty(node) {\n\t\t\t\tif (\n\t\t\t\t\tnode.key.type !== \"JSONLiteral\" ||\n\t\t\t\t\tnode.key.value !== \"repository\" ||\n\t\t\t\t\tnode.parent.parent.parent.type !== \"Program\"\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (node.value.type === \"JSONObjectExpression\") {\n\t\t\t\t\tconst { properties } = node.value;\n\n\t\t\t\t\tif (findJSONLiteralWithValue(properties, \"directory\")) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst typeProperty = findJSONLiteralWithValue(\n\t\t\t\t\t\tproperties,\n\t\t\t\t\t\t\"type\",\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeProperty?.value.type !== \"JSONLiteral\" ||\n\t\t\t\t\t\ttypeProperty.value.value !== \"git\"\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst urlProperty = findJSONLiteralWithValue(\n\t\t\t\t\t\tproperties,\n\t\t\t\t\t\t\"url\",\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\turlProperty?.value.type !== \"JSONLiteral\" ||\n\t\t\t\t\t\ttypeof urlProperty.value.value !== \"string\" ||\n\t\t\t\t\t\t!isGitHubUrl(urlProperty.value.value)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst url = urlProperty.value.value;\n\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tfix(fixer) {\n\t\t\t\t\t\t\treturn fixer.replaceText(\n\t\t\t\t\t\t\t\tnode.value as unknown as ESTree.Node,\n\t\t\t\t\t\t\t\tJSON.stringify(cleanGitHubUrl(url)),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmessageId: \"preferShorthand\",\n\t\t\t\t\t\tnode: node.value as unknown as ESTree.Node,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (node.value.type === \"JSONLiteral\") {\n\t\t\t\t\tconst { value } = node.value;\n\t\t\t\t\tif (typeof value === \"string\" && isGitHubUrl(value)) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tfix(fixer) {\n\t\t\t\t\t\t\t\treturn fixer.replaceText(\n\t\t\t\t\t\t\t\t\tnode.value as unknown as ESTree.Node,\n\t\t\t\t\t\t\t\t\tJSON.stringify(cleanGitHubUrl(value)),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tmessageId: \"preferShorthand\",\n\t\t\t\t\t\t\tnode: node.value as unknown as ESTree.Node,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n\n\tmeta: {\n\t\tdocs: {\n\t\t\tcategory: \"Best Practices\",\n\t\t\tdescription: \"Enforce shorthand declaration for GitHub repository.\",\n\t\t\trecommended: true,\n\t\t},\n\t\tfixable: \"code\",\n\t\tmessages: {\n\t\t\tpreferShorthand:\n\t\t\t\t\"Prefer a shorthand locator for a GitHub repository.\",\n\t\t},\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA2B;AAE3B,MAAM,iBACL;AAED,MAAM,cAAc,CAAC,QAAgB,eAAe,KAAK,GAAG;AAE5D,MAAM,iBAAiB,CAAC,QACvB,IAAI,QAAQ,gBAAgB,EAAE,EAAE,QAAQ,UAAU,EAAE;AAQrD,SAAS,yBACR,YACA,OACC;AACD,SAAO,WAAW;AAAA,IACjB,CAAC,aACA,SAAS,IAAI,SAAS,iBAAiB,SAAS,IAAI,UAAU;AAAA,EAChE;AACD;AAEA,IAAO,0CAAQ,8BAAW;AAAA,EACzB,OAAO,SAAS;AACf,WAAO;AAAA,MACN,aAAa,MAAM;AAClB,YACC,KAAK,IAAI,SAAS,iBAClB,KAAK,IAAI,UAAU,gBACnB,KAAK,OAAO,OAAO,OAAO,SAAS,WAClC;AACD;AAAA,QACD;AAEA,YAAI,KAAK,MAAM,SAAS,wBAAwB;AAC/C,gBAAM,EAAE,WAAW,IAAI,KAAK;AAE5B,cAAI,yBAAyB,YAAY,WAAW,GAAG;AACtD;AAAA,UACD;AAEA,gBAAM,eAAe;AAAA,YACpB;AAAA,YACA;AAAA,UACD;AACA,cACC,cAAc,MAAM,SAAS,iBAC7B,aAAa,MAAM,UAAU,OAC5B;AACD;AAAA,UACD;AAEA,gBAAM,cAAc;AAAA,YACnB;AAAA,YACA;AAAA,UACD;AACA,cACC,aAAa,MAAM,SAAS,iBAC5B,OAAO,YAAY,MAAM,UAAU,YACnC,CAAC,YAAY,YAAY,MAAM,KAAK,GACnC;AACD;AAAA,UACD;AAEA,gBAAM,MAAM,YAAY,MAAM;AAE9B,kBAAQ,OAAO;AAAA,YACd,IAAI,OAAO;AACV,qBAAO,MAAM;AAAA,gBACZ,KAAK;AAAA,gBACL,KAAK,UAAU,eAAe,GAAG,CAAC;AAAA,cACnC;AAAA,YACD;AAAA,YACA,WAAW;AAAA,YACX,MAAM,KAAK;AAAA,UACZ,CAAC;AAAA,QACF;AAEA,YAAI,KAAK,MAAM,SAAS,eAAe;AACtC,gBAAM,EAAE,MAAM,IAAI,KAAK;AACvB,cAAI,OAAO,UAAU,YAAY,YAAY,KAAK,GAAG;AACpD,oBAAQ,OAAO;AAAA,cACd,IAAI,OAAO;AACV,uBAAO,MAAM;AAAA,kBACZ,KAAK;AAAA,kBACL,KAAK,UAAU,eAAe,KAAK,CAAC;AAAA,gBACrC;AAAA,cACD;AAAA,cACA,WAAW;AAAA,cACX,MAAM,KAAK;AAAA,YACZ,CAAC;AAAA,UACF;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM;AAAA,IACL,MAAM;AAAA,MACL,UAAU;AAAA,MACV,aAAa;AAAA,MACb,aAAa;AAAA,IACd;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,MACT,iBACC;AAAA,IACF;AAAA,EACD;AACD,CAAC;","names":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { createRule } from "../createRule.js";
|
|
2
|
+
const githubUrlRegex = /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?github\.com\//;
|
|
3
|
+
const isGitHubUrl = (url) => githubUrlRegex.test(url);
|
|
4
|
+
const cleanGitHubUrl = (url) => url.replace(githubUrlRegex, "").replace(/\.git$/, "");
|
|
5
|
+
function findJSONLiteralWithValue(properties, value) {
|
|
6
|
+
return properties.find(
|
|
7
|
+
(property) => property.key.type === "JSONLiteral" && property.key.value === value
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
var prefer_repository_shorthand_default = createRule({
|
|
11
|
+
create(context) {
|
|
12
|
+
return {
|
|
13
|
+
JSONProperty(node) {
|
|
14
|
+
if (node.key.type !== "JSONLiteral" || node.key.value !== "repository" || node.parent.parent.parent.type !== "Program") {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (node.value.type === "JSONObjectExpression") {
|
|
18
|
+
const { properties } = node.value;
|
|
19
|
+
if (findJSONLiteralWithValue(properties, "directory")) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const typeProperty = findJSONLiteralWithValue(
|
|
23
|
+
properties,
|
|
24
|
+
"type"
|
|
25
|
+
);
|
|
26
|
+
if (typeProperty?.value.type !== "JSONLiteral" || typeProperty.value.value !== "git") {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const urlProperty = findJSONLiteralWithValue(
|
|
30
|
+
properties,
|
|
31
|
+
"url"
|
|
32
|
+
);
|
|
33
|
+
if (urlProperty?.value.type !== "JSONLiteral" || typeof urlProperty.value.value !== "string" || !isGitHubUrl(urlProperty.value.value)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const url = urlProperty.value.value;
|
|
37
|
+
context.report({
|
|
38
|
+
fix(fixer) {
|
|
39
|
+
return fixer.replaceText(
|
|
40
|
+
node.value,
|
|
41
|
+
JSON.stringify(cleanGitHubUrl(url))
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
messageId: "preferShorthand",
|
|
45
|
+
node: node.value
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (node.value.type === "JSONLiteral") {
|
|
49
|
+
const { value } = node.value;
|
|
50
|
+
if (typeof value === "string" && isGitHubUrl(value)) {
|
|
51
|
+
context.report({
|
|
52
|
+
fix(fixer) {
|
|
53
|
+
return fixer.replaceText(
|
|
54
|
+
node.value,
|
|
55
|
+
JSON.stringify(cleanGitHubUrl(value))
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
messageId: "preferShorthand",
|
|
59
|
+
node: node.value
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
meta: {
|
|
67
|
+
docs: {
|
|
68
|
+
category: "Best Practices",
|
|
69
|
+
description: "Enforce shorthand declaration for GitHub repository.",
|
|
70
|
+
recommended: true
|
|
71
|
+
},
|
|
72
|
+
fixable: "code",
|
|
73
|
+
messages: {
|
|
74
|
+
preferShorthand: "Prefer a shorthand locator for a GitHub repository."
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
prefer_repository_shorthand_default as default
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=prefer-repository-shorthand.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/rules/prefer-repository-shorthand.ts"],"sourcesContent":["import type ESTree from \"estree\";\nimport type { AST as JsonAST } from \"jsonc-eslint-parser\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst githubUrlRegex =\n\t/^(?:git\\+)?(?:ssh:\\/\\/git@|http?s:\\/\\/)?(?:www\\.)?github\\.com\\//;\n\nconst isGitHubUrl = (url: string) => githubUrlRegex.test(url);\n\nconst cleanGitHubUrl = (url: string) =>\n\turl.replace(githubUrlRegex, \"\").replace(/\\.git$/, \"\");\n\ntype JSONPropertyWithKeyAndValue<Value extends string> =\n\tJsonAST.JSONProperty & {\n\t\tkey: JsonAST.JSONStringLiteral;\n\t\tvalue: Value;\n\t};\n\nfunction findJSONLiteralWithValue<Value extends string>(\n\tproperties: JsonAST.JSONProperty[],\n\tvalue: Value,\n) {\n\treturn properties.find(\n\t\t(property): property is JSONPropertyWithKeyAndValue<Value> =>\n\t\t\tproperty.key.type === \"JSONLiteral\" && property.key.value === value,\n\t);\n}\n\nexport default createRule({\n\tcreate(context) {\n\t\treturn {\n\t\t\tJSONProperty(node) {\n\t\t\t\tif (\n\t\t\t\t\tnode.key.type !== \"JSONLiteral\" ||\n\t\t\t\t\tnode.key.value !== \"repository\" ||\n\t\t\t\t\tnode.parent.parent.parent.type !== \"Program\"\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (node.value.type === \"JSONObjectExpression\") {\n\t\t\t\t\tconst { properties } = node.value;\n\n\t\t\t\t\tif (findJSONLiteralWithValue(properties, \"directory\")) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst typeProperty = findJSONLiteralWithValue(\n\t\t\t\t\t\tproperties,\n\t\t\t\t\t\t\"type\",\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeProperty?.value.type !== \"JSONLiteral\" ||\n\t\t\t\t\t\ttypeProperty.value.value !== \"git\"\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst urlProperty = findJSONLiteralWithValue(\n\t\t\t\t\t\tproperties,\n\t\t\t\t\t\t\"url\",\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\turlProperty?.value.type !== \"JSONLiteral\" ||\n\t\t\t\t\t\ttypeof urlProperty.value.value !== \"string\" ||\n\t\t\t\t\t\t!isGitHubUrl(urlProperty.value.value)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst url = urlProperty.value.value;\n\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tfix(fixer) {\n\t\t\t\t\t\t\treturn fixer.replaceText(\n\t\t\t\t\t\t\t\tnode.value as unknown as ESTree.Node,\n\t\t\t\t\t\t\t\tJSON.stringify(cleanGitHubUrl(url)),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmessageId: \"preferShorthand\",\n\t\t\t\t\t\tnode: node.value as unknown as ESTree.Node,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (node.value.type === \"JSONLiteral\") {\n\t\t\t\t\tconst { value } = node.value;\n\t\t\t\t\tif (typeof value === \"string\" && isGitHubUrl(value)) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tfix(fixer) {\n\t\t\t\t\t\t\t\treturn fixer.replaceText(\n\t\t\t\t\t\t\t\t\tnode.value as unknown as ESTree.Node,\n\t\t\t\t\t\t\t\t\tJSON.stringify(cleanGitHubUrl(value)),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tmessageId: \"preferShorthand\",\n\t\t\t\t\t\t\tnode: node.value as unknown as ESTree.Node,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n\n\tmeta: {\n\t\tdocs: {\n\t\t\tcategory: \"Best Practices\",\n\t\t\tdescription: \"Enforce shorthand declaration for GitHub repository.\",\n\t\t\trecommended: true,\n\t\t},\n\t\tfixable: \"code\",\n\t\tmessages: {\n\t\t\tpreferShorthand:\n\t\t\t\t\"Prefer a shorthand locator for a GitHub repository.\",\n\t\t},\n\t},\n});\n"],"mappings":"AAGA,SAAS,kBAAkB;AAE3B,MAAM,iBACL;AAED,MAAM,cAAc,CAAC,QAAgB,eAAe,KAAK,GAAG;AAE5D,MAAM,iBAAiB,CAAC,QACvB,IAAI,QAAQ,gBAAgB,EAAE,EAAE,QAAQ,UAAU,EAAE;AAQrD,SAAS,yBACR,YACA,OACC;AACD,SAAO,WAAW;AAAA,IACjB,CAAC,aACA,SAAS,IAAI,SAAS,iBAAiB,SAAS,IAAI,UAAU;AAAA,EAChE;AACD;AAEA,IAAO,sCAAQ,WAAW;AAAA,EACzB,OAAO,SAAS;AACf,WAAO;AAAA,MACN,aAAa,MAAM;AAClB,YACC,KAAK,IAAI,SAAS,iBAClB,KAAK,IAAI,UAAU,gBACnB,KAAK,OAAO,OAAO,OAAO,SAAS,WAClC;AACD;AAAA,QACD;AAEA,YAAI,KAAK,MAAM,SAAS,wBAAwB;AAC/C,gBAAM,EAAE,WAAW,IAAI,KAAK;AAE5B,cAAI,yBAAyB,YAAY,WAAW,GAAG;AACtD;AAAA,UACD;AAEA,gBAAM,eAAe;AAAA,YACpB;AAAA,YACA;AAAA,UACD;AACA,cACC,cAAc,MAAM,SAAS,iBAC7B,aAAa,MAAM,UAAU,OAC5B;AACD;AAAA,UACD;AAEA,gBAAM,cAAc;AAAA,YACnB;AAAA,YACA;AAAA,UACD;AACA,cACC,aAAa,MAAM,SAAS,iBAC5B,OAAO,YAAY,MAAM,UAAU,YACnC,CAAC,YAAY,YAAY,MAAM,KAAK,GACnC;AACD;AAAA,UACD;AAEA,gBAAM,MAAM,YAAY,MAAM;AAE9B,kBAAQ,OAAO;AAAA,YACd,IAAI,OAAO;AACV,qBAAO,MAAM;AAAA,gBACZ,KAAK;AAAA,gBACL,KAAK,UAAU,eAAe,GAAG,CAAC;AAAA,cACnC;AAAA,YACD;AAAA,YACA,WAAW;AAAA,YACX,MAAM,KAAK;AAAA,UACZ,CAAC;AAAA,QACF;AAEA,YAAI,KAAK,MAAM,SAAS,eAAe;AACtC,gBAAM,EAAE,MAAM,IAAI,KAAK;AACvB,cAAI,OAAO,UAAU,YAAY,YAAY,KAAK,GAAG;AACpD,oBAAQ,OAAO;AAAA,cACd,IAAI,OAAO;AACV,uBAAO,MAAM;AAAA,kBACZ,KAAK;AAAA,kBACL,KAAK,UAAU,eAAe,KAAK,CAAC;AAAA,gBACrC;AAAA,cACD;AAAA,cACA,WAAW;AAAA,cACX,MAAM,KAAK;AAAA,YACZ,CAAC;AAAA,UACF;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM;AAAA,IACL,MAAM;AAAA,MACL,UAAU;AAAA,MACV,aAAa;AAAA,MACb,aAAa;AAAA,IACd;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,MACT,iBACC;AAAA,IACF;AAAA,EACD;AACD,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-package-json",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Rules for consistent, readable, and valid package.json files. ๐๏ธ",
|
|
5
|
-
"homepage": "https://github.com/
|
|
5
|
+
"homepage": "https://github.com/JoshuaKGoldberg/eslint-plugin-package-json#readme",
|
|
6
6
|
"bugs": {
|
|
7
|
-
"url": "https://github.com/
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "https://github.com/JoshuaKGoldberg/eslint-plugin-package-json"
|
|
7
|
+
"url": "https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues"
|
|
12
8
|
},
|
|
9
|
+
"repository": "JoshuaKGoldberg/eslint-plugin-package-json",
|
|
13
10
|
"license": "MIT",
|
|
14
11
|
"author": {
|
|
15
12
|
"name": "James Zetlan",
|