eslint-plugin-package-json 0.10.3 → 0.10.4
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/lib/index.js +18 -28
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +9 -9
- package/lib/index.mjs.map +1 -1
- package/lib/rules/order-properties.d.mts +2 -2
- package/lib/rules/order-properties.d.ts +2 -2
- package/lib/rules/order-properties.js +6 -2
- package/lib/rules/order-properties.js.map +1 -1
- package/lib/rules/order-properties.mjs +2 -2
- package/lib/rules/order-properties.mjs.map +1 -1
- package/lib/rules/prefer-repository-shorthand.d.mts +2 -2
- package/lib/rules/prefer-repository-shorthand.d.ts +2 -2
- package/lib/rules/prefer-repository-shorthand.js +6 -2
- package/lib/rules/prefer-repository-shorthand.js.map +1 -1
- package/lib/rules/prefer-repository-shorthand.mjs +2 -2
- package/lib/rules/prefer-repository-shorthand.mjs.map +1 -1
- package/lib/rules/sort-collections.d.mts +2 -2
- package/lib/rules/sort-collections.d.ts +2 -2
- package/lib/rules/sort-collections.js +6 -2
- package/lib/rules/sort-collections.js.map +1 -1
- package/lib/rules/sort-collections.mjs +2 -2
- package/lib/rules/sort-collections.mjs.map +1 -1
- package/lib/rules/unique-dependencies.d.mts +2 -2
- package/lib/rules/unique-dependencies.d.ts +2 -2
- package/lib/rules/unique-dependencies.js +6 -2
- package/lib/rules/unique-dependencies.js.map +1 -1
- package/lib/rules/unique-dependencies.mjs +2 -2
- package/lib/rules/unique-dependencies.mjs.map +1 -1
- package/lib/rules/valid-local-dependency.d.mts +2 -2
- package/lib/rules/valid-local-dependency.d.ts +2 -2
- package/lib/rules/valid-local-dependency.js +6 -2
- package/lib/rules/valid-local-dependency.js.map +1 -1
- package/lib/rules/valid-local-dependency.mjs +2 -2
- package/lib/rules/valid-local-dependency.mjs.map +1 -1
- package/lib/rules/valid-name.d.mts +2 -2
- package/lib/rules/valid-name.d.ts +2 -2
- package/lib/rules/valid-name.js +6 -2
- package/lib/rules/valid-name.js.map +1 -1
- package/lib/rules/valid-name.mjs +2 -2
- package/lib/rules/valid-name.mjs.map +1 -1
- package/lib/rules/valid-package-def.d.mts +2 -2
- package/lib/rules/valid-package-def.d.ts +2 -2
- package/lib/rules/valid-package-def.js +6 -2
- package/lib/rules/valid-package-def.js.map +1 -1
- package/lib/rules/valid-package-def.mjs +2 -2
- package/lib/rules/valid-package-def.mjs.map +1 -1
- package/lib/rules/valid-repository-directory.d.mts +2 -2
- package/lib/rules/valid-repository-directory.d.ts +2 -2
- package/lib/rules/valid-repository-directory.js +6 -2
- package/lib/rules/valid-repository-directory.js.map +1 -1
- package/lib/rules/valid-repository-directory.mjs +2 -2
- package/lib/rules/valid-repository-directory.mjs.map +1 -1
- package/lib/rules/valid-version.d.mts +2 -2
- package/lib/rules/valid-version.d.ts +2 -2
- package/lib/rules/valid-version.js +6 -2
- package/lib/rules/valid-version.js.map +1 -1
- package/lib/rules/valid-version.mjs +2 -2
- package/lib/rules/valid-version.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,7 +117,7 @@ They can lint `package.json` files at project root and in any subfolder of the p
|
|
|
117
117
|
<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> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Akristjanesperanto" title="Bug reports">🐛</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=kristjanesperanto" title="Code">💻</a></td>
|
|
118
118
|
<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>
|
|
119
119
|
<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>
|
|
120
|
-
<td align="center" valign="top" width="14.28%"><a href="https://hyoban.cc"><img src="https://avatars.githubusercontent.com/u/38493346?v=4?s=100" width="100px;" alt="Stephen Zhou"/><br /><sub><b>Stephen Zhou</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Ahyoban" title="Bug reports">🐛</a></td>
|
|
120
|
+
<td align="center" valign="top" width="14.28%"><a href="https://hyoban.cc"><img src="https://avatars.githubusercontent.com/u/38493346?v=4?s=100" width="100px;" alt="Stephen Zhou"/><br /><sub><b>Stephen Zhou</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Ahyoban" title="Bug reports">🐛</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=hyoban" title="Code">💻</a></td>
|
|
121
121
|
<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>
|
|
122
122
|
<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>
|
|
123
123
|
</tr>
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var src_exports = {};
|
|
30
20
|
__export(src_exports, {
|
|
@@ -32,25 +22,25 @@ __export(src_exports, {
|
|
|
32
22
|
rules: () => rules
|
|
33
23
|
});
|
|
34
24
|
module.exports = __toCommonJS(src_exports);
|
|
35
|
-
var import_order_properties =
|
|
36
|
-
var import_prefer_repository_shorthand =
|
|
37
|
-
var import_sort_collections =
|
|
38
|
-
var import_unique_dependencies =
|
|
39
|
-
var import_valid_local_dependency =
|
|
40
|
-
var import_valid_name =
|
|
41
|
-
var import_valid_package_def =
|
|
42
|
-
var import_valid_repository_directory =
|
|
43
|
-
var import_valid_version =
|
|
25
|
+
var import_order_properties = require("./rules/order-properties.js");
|
|
26
|
+
var import_prefer_repository_shorthand = require("./rules/prefer-repository-shorthand.js");
|
|
27
|
+
var import_sort_collections = require("./rules/sort-collections.js");
|
|
28
|
+
var import_unique_dependencies = require("./rules/unique-dependencies.js");
|
|
29
|
+
var import_valid_local_dependency = require("./rules/valid-local-dependency.js");
|
|
30
|
+
var import_valid_name = require("./rules/valid-name.js");
|
|
31
|
+
var import_valid_package_def = require("./rules/valid-package-def.js");
|
|
32
|
+
var import_valid_repository_directory = require("./rules/valid-repository-directory.js");
|
|
33
|
+
var import_valid_version = require("./rules/valid-version.js");
|
|
44
34
|
const rules = {
|
|
45
|
-
"order-properties": import_order_properties.
|
|
46
|
-
"prefer-repository-shorthand": import_prefer_repository_shorthand.
|
|
47
|
-
"sort-collections": import_sort_collections.
|
|
48
|
-
"unique-dependencies": import_unique_dependencies.
|
|
49
|
-
"valid-local-dependency": import_valid_local_dependency.
|
|
50
|
-
"valid-name": import_valid_name.
|
|
51
|
-
"valid-package-def": import_valid_package_def.
|
|
52
|
-
"valid-repository-directory": import_valid_repository_directory.
|
|
53
|
-
"valid-version": import_valid_version.
|
|
35
|
+
"order-properties": import_order_properties.rule,
|
|
36
|
+
"prefer-repository-shorthand": import_prefer_repository_shorthand.rule,
|
|
37
|
+
"sort-collections": import_sort_collections.rule,
|
|
38
|
+
"unique-dependencies": import_unique_dependencies.rule,
|
|
39
|
+
"valid-local-dependency": import_valid_local_dependency.rule,
|
|
40
|
+
"valid-name": import_valid_name.rule,
|
|
41
|
+
"valid-package-def": import_valid_package_def.rule,
|
|
42
|
+
"valid-repository-directory": import_valid_repository_directory.rule,
|
|
43
|
+
"valid-version": import_valid_version.rule
|
|
54
44
|
};
|
|
55
45
|
const configs = {
|
|
56
46
|
recommended: {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 uniqueDependencies from \"./rules/unique-dependencies.js\";\nimport validLocalDependency from \"./rules/valid-local-dependency.js\";\nimport validName from \"./rules/valid-name.js\";\nimport validPackageDef from \"./rules/valid-package-def.js\";\nimport validRepositoryDirectory from \"./rules/valid-repository-directory.js\";\nimport validVersion from \"./rules/valid-version.js\";\n\nexport const rules = {\n\t\"order-properties\": orderProperties,\n\t\"prefer-repository-shorthand\": preferRepositoryShorthand,\n\t\"sort-collections\": sortCollections,\n\t\"unique-dependencies\": uniqueDependencies,\n\t\"valid-local-dependency\": validLocalDependency,\n\t\"valid-name\": validName,\n\t\"valid-package-def\": validPackageDef,\n\t\"valid-repository-directory\": validRepositoryDirectory,\n\t\"valid-version\": validVersion,\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":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { rule as orderProperties } from \"./rules/order-properties.js\";\nimport { rule as preferRepositoryShorthand } from \"./rules/prefer-repository-shorthand.js\";\nimport { rule as sortCollections } from \"./rules/sort-collections.js\";\nimport { rule as uniqueDependencies } from \"./rules/unique-dependencies.js\";\nimport { rule as validLocalDependency } from \"./rules/valid-local-dependency.js\";\nimport { rule as validName } from \"./rules/valid-name.js\";\nimport { rule as validPackageDef } from \"./rules/valid-package-def.js\";\nimport { rule as validRepositoryDirectory } from \"./rules/valid-repository-directory.js\";\nimport { rule as validVersion } from \"./rules/valid-version.js\";\n\nexport const rules = {\n\t\"order-properties\": orderProperties,\n\t\"prefer-repository-shorthand\": preferRepositoryShorthand,\n\t\"sort-collections\": sortCollections,\n\t\"unique-dependencies\": uniqueDependencies,\n\t\"valid-local-dependency\": validLocalDependency,\n\t\"valid-name\": validName,\n\t\"valid-package-def\": validPackageDef,\n\t\"valid-repository-directory\": validRepositoryDirectory,\n\t\"valid-version\": validVersion,\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,8BAAwC;AACxC,yCAAkD;AAClD,8BAAwC;AACxC,iCAA2C;AAC3C,oCAA6C;AAC7C,wBAAkC;AAClC,+BAAwC;AACxC,wCAAiD;AACjD,2BAAqC;AAE9B,MAAM,QAAQ;AAAA,EACpB,oBAAoB,wBAAAA;AAAA,EACpB,+BAA+B,mCAAAC;AAAA,EAC/B,oBAAoB,wBAAAC;AAAA,EACpB,uBAAuB,2BAAAC;AAAA,EACvB,0BAA0B,8BAAAC;AAAA,EAC1B,cAAc,kBAAAC;AAAA,EACd,qBAAqB,yBAAAC;AAAA,EACrB,8BAA8B,kCAAAC;AAAA,EAC9B,iBAAiB,qBAAAC;AAClB;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","uniqueDependencies","validLocalDependency","validName","validPackageDef","validRepositoryDirectory","validVersion"]}
|
package/lib/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import orderProperties from "./rules/order-properties.js";
|
|
2
|
-
import preferRepositoryShorthand from "./rules/prefer-repository-shorthand.js";
|
|
3
|
-
import sortCollections from "./rules/sort-collections.js";
|
|
4
|
-
import uniqueDependencies from "./rules/unique-dependencies.js";
|
|
5
|
-
import validLocalDependency from "./rules/valid-local-dependency.js";
|
|
6
|
-
import validName from "./rules/valid-name.js";
|
|
7
|
-
import validPackageDef from "./rules/valid-package-def.js";
|
|
8
|
-
import validRepositoryDirectory from "./rules/valid-repository-directory.js";
|
|
9
|
-
import validVersion from "./rules/valid-version.js";
|
|
1
|
+
import { rule as orderProperties } from "./rules/order-properties.js";
|
|
2
|
+
import { rule as preferRepositoryShorthand } from "./rules/prefer-repository-shorthand.js";
|
|
3
|
+
import { rule as sortCollections } from "./rules/sort-collections.js";
|
|
4
|
+
import { rule as uniqueDependencies } from "./rules/unique-dependencies.js";
|
|
5
|
+
import { rule as validLocalDependency } from "./rules/valid-local-dependency.js";
|
|
6
|
+
import { rule as validName } from "./rules/valid-name.js";
|
|
7
|
+
import { rule as validPackageDef } from "./rules/valid-package-def.js";
|
|
8
|
+
import { rule as validRepositoryDirectory } from "./rules/valid-repository-directory.js";
|
|
9
|
+
import { rule as validVersion } from "./rules/valid-version.js";
|
|
10
10
|
const rules = {
|
|
11
11
|
"order-properties": orderProperties,
|
|
12
12
|
"prefer-repository-shorthand": preferRepositoryShorthand,
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 uniqueDependencies from \"./rules/unique-dependencies.js\";\nimport validLocalDependency from \"./rules/valid-local-dependency.js\";\nimport validName from \"./rules/valid-name.js\";\nimport validPackageDef from \"./rules/valid-package-def.js\";\nimport validRepositoryDirectory from \"./rules/valid-repository-directory.js\";\nimport validVersion from \"./rules/valid-version.js\";\n\nexport const rules = {\n\t\"order-properties\": orderProperties,\n\t\"prefer-repository-shorthand\": preferRepositoryShorthand,\n\t\"sort-collections\": sortCollections,\n\t\"unique-dependencies\": uniqueDependencies,\n\t\"valid-local-dependency\": validLocalDependency,\n\t\"valid-name\": validName,\n\t\"valid-package-def\": validPackageDef,\n\t\"valid-repository-directory\": validRepositoryDirectory,\n\t\"valid-version\": validVersion,\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,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { rule as orderProperties } from \"./rules/order-properties.js\";\nimport { rule as preferRepositoryShorthand } from \"./rules/prefer-repository-shorthand.js\";\nimport { rule as sortCollections } from \"./rules/sort-collections.js\";\nimport { rule as uniqueDependencies } from \"./rules/unique-dependencies.js\";\nimport { rule as validLocalDependency } from \"./rules/valid-local-dependency.js\";\nimport { rule as validName } from \"./rules/valid-name.js\";\nimport { rule as validPackageDef } from \"./rules/valid-package-def.js\";\nimport { rule as validRepositoryDirectory } from \"./rules/valid-repository-directory.js\";\nimport { rule as validVersion } from \"./rules/valid-version.js\";\n\nexport const rules = {\n\t\"order-properties\": orderProperties,\n\t\"prefer-repository-shorthand\": preferRepositoryShorthand,\n\t\"sort-collections\": sortCollections,\n\t\"unique-dependencies\": uniqueDependencies,\n\t\"valid-local-dependency\": validLocalDependency,\n\t\"valid-name\": validName,\n\t\"valid-package-def\": validPackageDef,\n\t\"valid-repository-directory\": validRepositoryDirectory,\n\t\"valid-version\": validVersion,\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,SAAS,QAAQ,uBAAuB;AACxC,SAAS,QAAQ,iCAAiC;AAClD,SAAS,QAAQ,uBAAuB;AACxC,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,QAAQ,4BAA4B;AAC7C,SAAS,QAAQ,iBAAiB;AAClC,SAAS,QAAQ,uBAAuB;AACxC,SAAS,QAAQ,gCAAgC;AACjD,SAAS,QAAQ,oBAAoB;AAE9B,MAAM,QAAQ;AAAA,EACpB,oBAAoB;AAAA,EACpB,+BAA+B;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,8BAA8B;AAAA,EAC9B,iBAAiB;AAClB;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":[]}
|
|
@@ -7,9 +7,9 @@ type Order = "legacy" | "sort-package-json";
|
|
|
7
7
|
type Options = [{
|
|
8
8
|
order: Order;
|
|
9
9
|
}?];
|
|
10
|
-
declare const
|
|
10
|
+
declare const rule: {
|
|
11
11
|
create(context: PackageJsonRuleContext<Options>): jsonc_eslint_parser.RuleListener;
|
|
12
12
|
meta: eslint.Rule.RuleMetaData;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export {
|
|
15
|
+
export { rule };
|
|
@@ -7,9 +7,9 @@ type Order = "legacy" | "sort-package-json";
|
|
|
7
7
|
type Options = [{
|
|
8
8
|
order: Order;
|
|
9
9
|
}?];
|
|
10
|
-
declare const
|
|
10
|
+
declare const rule: {
|
|
11
11
|
create(context: PackageJsonRuleContext<Options>): jsonc_eslint_parser.RuleListener;
|
|
12
12
|
meta: eslint.Rule.RuleMetaData;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export {
|
|
15
|
+
export { rule };
|
|
@@ -28,7 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var order_properties_exports = {};
|
|
30
30
|
__export(order_properties_exports, {
|
|
31
|
-
|
|
31
|
+
rule: () => rule
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(order_properties_exports);
|
|
34
34
|
var import_sort_package_json = __toESM(require("sort-package-json"));
|
|
@@ -63,7 +63,7 @@ const standardOrderLegacy = [
|
|
|
63
63
|
"os",
|
|
64
64
|
"cpu"
|
|
65
65
|
];
|
|
66
|
-
|
|
66
|
+
const rule = (0, import_createRule.createRule)({
|
|
67
67
|
create(context) {
|
|
68
68
|
return {
|
|
69
69
|
"Program:exit"() {
|
|
@@ -130,4 +130,8 @@ var order_properties_default = (0, import_createRule.createRule)({
|
|
|
130
130
|
]
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
+
0 && (module.exports = {
|
|
135
|
+
rule
|
|
136
|
+
});
|
|
133
137
|
//# sourceMappingURL=order-properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rules/order-properties.ts"],"sourcesContent":["import type { AST as JsonAST } from \"jsonc-eslint-parser\";\n\nimport sortPackageJson from \"sort-package-json\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst standardOrderLegacy = [\n\t\"name\",\n\t\"version\",\n\t\"private\",\n\t\"publishConfig\",\n\t\"description\",\n\t\"main\",\n\t\"exports\",\n\t\"browser\",\n\t\"files\",\n\t\"bin\",\n\t\"directories\",\n\t\"man\",\n\t\"scripts\",\n\t\"repository\",\n\t\"keywords\",\n\t\"author\",\n\t\"license\",\n\t\"bugs\",\n\t\"homepage\",\n\t\"config\",\n\t\"dependencies\",\n\t\"devDependencies\",\n\t\"peerDependencies\",\n\t\"optionalDependencies\",\n\t\"bundledDependencies\",\n\t\"engines\",\n\t\"os\",\n\t\"cpu\",\n];\n\ntype Order = \"legacy\" | \"sort-package-json\";\n\ntype Options = [{ order: Order }?];\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/rules/order-properties.ts"],"sourcesContent":["import type { AST as JsonAST } from \"jsonc-eslint-parser\";\n\nimport sortPackageJson from \"sort-package-json\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst standardOrderLegacy = [\n\t\"name\",\n\t\"version\",\n\t\"private\",\n\t\"publishConfig\",\n\t\"description\",\n\t\"main\",\n\t\"exports\",\n\t\"browser\",\n\t\"files\",\n\t\"bin\",\n\t\"directories\",\n\t\"man\",\n\t\"scripts\",\n\t\"repository\",\n\t\"keywords\",\n\t\"author\",\n\t\"license\",\n\t\"bugs\",\n\t\"homepage\",\n\t\"config\",\n\t\"dependencies\",\n\t\"devDependencies\",\n\t\"peerDependencies\",\n\t\"optionalDependencies\",\n\t\"bundledDependencies\",\n\t\"engines\",\n\t\"os\",\n\t\"cpu\",\n];\n\ntype Order = \"legacy\" | \"sort-package-json\";\n\ntype Options = [{ order: Order }?];\n\nexport const rule = createRule<Options>({\n\tcreate(context) {\n\t\treturn {\n\t\t\t\"Program:exit\"() {\n\t\t\t\tconst { ast, text } = context.sourceCode;\n\n\t\t\t\tconst options = {\n\t\t\t\t\torder: \"sort-package-json\",\n\t\t\t\t\t...context.options[0],\n\t\t\t\t} satisfies Options[0];\n\n\t\t\t\tconst requiredOrder =\n\t\t\t\t\toptions.order === \"legacy\"\n\t\t\t\t\t\t? standardOrderLegacy\n\t\t\t\t\t\t: options.order;\n\t\t\t\tconst orderedSource = sortPackageJson(\n\t\t\t\t\tJSON.parse(text) as object,\n\t\t\t\t\trequiredOrder === \"sort-package-json\"\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tsortOrder: requiredOrder,\n\t\t\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tconst orderedKeys = Object.keys(orderedSource);\n\n\t\t\t\tconst { properties } = ast.body[0].expression;\n\n\t\t\t\tfor (let i = 0; i < properties.length; i += 1) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t(properties[i].key as JsonAST.JSONStringLiteral)\n\t\t\t\t\t\t\t.value !== orderedKeys[i]\n\t\t\t\t\t) {\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\tcontext.sourceCode.ast,\n\t\t\t\t\t\t\t\t\tJSON.stringify(orderedSource, null, 2) +\n\t\t\t\t\t\t\t\t\t\t`\\n`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\"Package top-level properties are not ordered in the npm standard way. Run the ESLint auto-fixer to correct.\",\n\t\t\t\t\t\t\tnode: context.sourceCode.ast,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\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:\n\t\t\t\t\"Package properties must be declared in standard order\",\n\t\t\trecommended: true,\n\t\t},\n\t\tfixable: \"code\",\n\t\tschema: [\n\t\t\t{\n\t\t\t\tproperties: {\n\t\t\t\t\torder: {\n\t\t\t\t\t\tanyOf: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tenum: [\"legacy\", \"sort-package-json\"],\n\t\t\t\t\t\t\t\ttype: [\"string\"],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titems: {\n\t\t\t\t\t\t\t\t\ttype: [\"string\"],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: [\"array\"],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttype: \"object\",\n\t\t\t},\n\t\t],\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,+BAA4B;AAE5B,wBAA2B;AAE3B,MAAM,sBAAsB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAMO,MAAM,WAAO,8BAAoB;AAAA,EACvC,OAAO,SAAS;AACf,WAAO;AAAA,MACN,iBAAiB;AAChB,cAAM,EAAE,KAAK,KAAK,IAAI,QAAQ;AAE9B,cAAM,UAAU;AAAA,UACf,OAAO;AAAA,UACP,GAAG,QAAQ,QAAQ,CAAC;AAAA,QACrB;AAEA,cAAM,gBACL,QAAQ,UAAU,WACf,sBACA,QAAQ;AACZ,cAAM,oBAAgB,yBAAAA;AAAA,UACrB,KAAK,MAAM,IAAI;AAAA,UACf,kBAAkB,sBACf,SACA;AAAA,YACA,WAAW;AAAA,UACZ;AAAA,QACH;AACA,cAAM,cAAc,OAAO,KAAK,aAAa;AAE7C,cAAM,EAAE,WAAW,IAAI,IAAI,KAAK,CAAC,EAAE;AAEnC,iBAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK,GAAG;AAC9C,cACE,WAAW,CAAC,EAAE,IACb,UAAU,YAAY,CAAC,GACxB;AACD,oBAAQ,OAAO;AAAA,cACd,IAAI,OAAO;AACV,uBAAO,MAAM;AAAA,kBACZ,QAAQ,WAAW;AAAA,kBACnB,KAAK,UAAU,eAAe,MAAM,CAAC,IACpC;AAAA;AAAA,gBACF;AAAA,cACD;AAAA,cACA,SACC;AAAA,cACD,MAAM,QAAQ,WAAW;AAAA,YAC1B,CAAC;AAAA,UACF;AAEA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM;AAAA,IACL,MAAM;AAAA,MACL,UAAU;AAAA,MACV,aACC;AAAA,MACD,aAAa;AAAA,IACd;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,MACP;AAAA,QACC,YAAY;AAAA,UACX,OAAO;AAAA,YACN,OAAO;AAAA,cACN;AAAA,gBACC,MAAM,CAAC,UAAU,mBAAmB;AAAA,gBACpC,MAAM,CAAC,QAAQ;AAAA,cAChB;AAAA,cACA;AAAA,gBACC,OAAO;AAAA,kBACN,MAAM,CAAC,QAAQ;AAAA,gBAChB;AAAA,gBACA,MAAM,CAAC,OAAO;AAAA,cACf;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,QACA,MAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD;AACD,CAAC;","names":["sortPackageJson"]}
|
|
@@ -30,7 +30,7 @@ const standardOrderLegacy = [
|
|
|
30
30
|
"os",
|
|
31
31
|
"cpu"
|
|
32
32
|
];
|
|
33
|
-
|
|
33
|
+
const rule = createRule({
|
|
34
34
|
create(context) {
|
|
35
35
|
return {
|
|
36
36
|
"Program:exit"() {
|
|
@@ -98,6 +98,6 @@ var order_properties_default = createRule({
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
export {
|
|
101
|
-
|
|
101
|
+
rule
|
|
102
102
|
};
|
|
103
103
|
//# sourceMappingURL=order-properties.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rules/order-properties.ts"],"sourcesContent":["import type { AST as JsonAST } from \"jsonc-eslint-parser\";\n\nimport sortPackageJson from \"sort-package-json\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst standardOrderLegacy = [\n\t\"name\",\n\t\"version\",\n\t\"private\",\n\t\"publishConfig\",\n\t\"description\",\n\t\"main\",\n\t\"exports\",\n\t\"browser\",\n\t\"files\",\n\t\"bin\",\n\t\"directories\",\n\t\"man\",\n\t\"scripts\",\n\t\"repository\",\n\t\"keywords\",\n\t\"author\",\n\t\"license\",\n\t\"bugs\",\n\t\"homepage\",\n\t\"config\",\n\t\"dependencies\",\n\t\"devDependencies\",\n\t\"peerDependencies\",\n\t\"optionalDependencies\",\n\t\"bundledDependencies\",\n\t\"engines\",\n\t\"os\",\n\t\"cpu\",\n];\n\ntype Order = \"legacy\" | \"sort-package-json\";\n\ntype Options = [{ order: Order }?];\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/rules/order-properties.ts"],"sourcesContent":["import type { AST as JsonAST } from \"jsonc-eslint-parser\";\n\nimport sortPackageJson from \"sort-package-json\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst standardOrderLegacy = [\n\t\"name\",\n\t\"version\",\n\t\"private\",\n\t\"publishConfig\",\n\t\"description\",\n\t\"main\",\n\t\"exports\",\n\t\"browser\",\n\t\"files\",\n\t\"bin\",\n\t\"directories\",\n\t\"man\",\n\t\"scripts\",\n\t\"repository\",\n\t\"keywords\",\n\t\"author\",\n\t\"license\",\n\t\"bugs\",\n\t\"homepage\",\n\t\"config\",\n\t\"dependencies\",\n\t\"devDependencies\",\n\t\"peerDependencies\",\n\t\"optionalDependencies\",\n\t\"bundledDependencies\",\n\t\"engines\",\n\t\"os\",\n\t\"cpu\",\n];\n\ntype Order = \"legacy\" | \"sort-package-json\";\n\ntype Options = [{ order: Order }?];\n\nexport const rule = createRule<Options>({\n\tcreate(context) {\n\t\treturn {\n\t\t\t\"Program:exit\"() {\n\t\t\t\tconst { ast, text } = context.sourceCode;\n\n\t\t\t\tconst options = {\n\t\t\t\t\torder: \"sort-package-json\",\n\t\t\t\t\t...context.options[0],\n\t\t\t\t} satisfies Options[0];\n\n\t\t\t\tconst requiredOrder =\n\t\t\t\t\toptions.order === \"legacy\"\n\t\t\t\t\t\t? standardOrderLegacy\n\t\t\t\t\t\t: options.order;\n\t\t\t\tconst orderedSource = sortPackageJson(\n\t\t\t\t\tJSON.parse(text) as object,\n\t\t\t\t\trequiredOrder === \"sort-package-json\"\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tsortOrder: requiredOrder,\n\t\t\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tconst orderedKeys = Object.keys(orderedSource);\n\n\t\t\t\tconst { properties } = ast.body[0].expression;\n\n\t\t\t\tfor (let i = 0; i < properties.length; i += 1) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t(properties[i].key as JsonAST.JSONStringLiteral)\n\t\t\t\t\t\t\t.value !== orderedKeys[i]\n\t\t\t\t\t) {\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\tcontext.sourceCode.ast,\n\t\t\t\t\t\t\t\t\tJSON.stringify(orderedSource, null, 2) +\n\t\t\t\t\t\t\t\t\t\t`\\n`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\"Package top-level properties are not ordered in the npm standard way. Run the ESLint auto-fixer to correct.\",\n\t\t\t\t\t\t\tnode: context.sourceCode.ast,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\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:\n\t\t\t\t\"Package properties must be declared in standard order\",\n\t\t\trecommended: true,\n\t\t},\n\t\tfixable: \"code\",\n\t\tschema: [\n\t\t\t{\n\t\t\t\tproperties: {\n\t\t\t\t\torder: {\n\t\t\t\t\t\tanyOf: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tenum: [\"legacy\", \"sort-package-json\"],\n\t\t\t\t\t\t\t\ttype: [\"string\"],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titems: {\n\t\t\t\t\t\t\t\t\ttype: [\"string\"],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: [\"array\"],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttype: \"object\",\n\t\t\t},\n\t\t],\n\t},\n});\n"],"mappings":"AAEA,OAAO,qBAAqB;AAE5B,SAAS,kBAAkB;AAE3B,MAAM,sBAAsB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAMO,MAAM,OAAO,WAAoB;AAAA,EACvC,OAAO,SAAS;AACf,WAAO;AAAA,MACN,iBAAiB;AAChB,cAAM,EAAE,KAAK,KAAK,IAAI,QAAQ;AAE9B,cAAM,UAAU;AAAA,UACf,OAAO;AAAA,UACP,GAAG,QAAQ,QAAQ,CAAC;AAAA,QACrB;AAEA,cAAM,gBACL,QAAQ,UAAU,WACf,sBACA,QAAQ;AACZ,cAAM,gBAAgB;AAAA,UACrB,KAAK,MAAM,IAAI;AAAA,UACf,kBAAkB,sBACf,SACA;AAAA,YACA,WAAW;AAAA,UACZ;AAAA,QACH;AACA,cAAM,cAAc,OAAO,KAAK,aAAa;AAE7C,cAAM,EAAE,WAAW,IAAI,IAAI,KAAK,CAAC,EAAE;AAEnC,iBAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK,GAAG;AAC9C,cACE,WAAW,CAAC,EAAE,IACb,UAAU,YAAY,CAAC,GACxB;AACD,oBAAQ,OAAO;AAAA,cACd,IAAI,OAAO;AACV,uBAAO,MAAM;AAAA,kBACZ,QAAQ,WAAW;AAAA,kBACnB,KAAK,UAAU,eAAe,MAAM,CAAC,IACpC;AAAA;AAAA,gBACF;AAAA,cACD;AAAA,cACA,SACC;AAAA,cACD,MAAM,QAAQ,WAAW;AAAA,YAC1B,CAAC;AAAA,UACF;AAEA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM;AAAA,IACL,MAAM;AAAA,MACL,UAAU;AAAA,MACV,aACC;AAAA,MACD,aAAa;AAAA,IACd;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,MACP;AAAA,QACC,YAAY;AAAA,UACX,OAAO;AAAA,YACN,OAAO;AAAA,cACN;AAAA,gBACC,MAAM,CAAC,UAAU,mBAAmB;AAAA,gBACpC,MAAM,CAAC,QAAQ;AAAA,cAChB;AAAA,cACA;AAAA,gBACC,OAAO;AAAA,kBACN,MAAM,CAAC,QAAQ;AAAA,gBAChB;AAAA,gBACA,MAAM,CAAC,OAAO;AAAA,cACf;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,QACA,MAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD;AACD,CAAC;","names":[]}
|
|
@@ -3,9 +3,9 @@ import * as jsonc_eslint_parser from 'jsonc-eslint-parser';
|
|
|
3
3
|
import { PackageJsonRuleContext } from '../createRule.mjs';
|
|
4
4
|
import 'estree';
|
|
5
5
|
|
|
6
|
-
declare const
|
|
6
|
+
declare const rule: {
|
|
7
7
|
create(context: PackageJsonRuleContext<unknown[]>): jsonc_eslint_parser.RuleListener;
|
|
8
8
|
meta: eslint.Rule.RuleMetaData;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { rule };
|
|
@@ -3,9 +3,9 @@ import * as jsonc_eslint_parser from 'jsonc-eslint-parser';
|
|
|
3
3
|
import { PackageJsonRuleContext } from '../createRule.js';
|
|
4
4
|
import 'estree';
|
|
5
5
|
|
|
6
|
-
declare const
|
|
6
|
+
declare const rule: {
|
|
7
7
|
create(context: PackageJsonRuleContext<unknown[]>): jsonc_eslint_parser.RuleListener;
|
|
8
8
|
meta: eslint.Rule.RuleMetaData;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { rule };
|
|
@@ -18,7 +18,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var prefer_repository_shorthand_exports = {};
|
|
20
20
|
__export(prefer_repository_shorthand_exports, {
|
|
21
|
-
|
|
21
|
+
rule: () => rule
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(prefer_repository_shorthand_exports);
|
|
24
24
|
var import_createRule = require("../createRule.js");
|
|
@@ -26,7 +26,7 @@ var import_findPropertyWithKeyValue = require("../utils/findPropertyWithKeyValue
|
|
|
26
26
|
const githubUrlRegex = /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?github\.com\//;
|
|
27
27
|
const isGitHubUrl = (url) => githubUrlRegex.test(url);
|
|
28
28
|
const cleanGitHubUrl = (url) => url.replace(githubUrlRegex, "").replace(/\.git$/, "");
|
|
29
|
-
|
|
29
|
+
const rule = (0, import_createRule.createRule)({
|
|
30
30
|
create(context) {
|
|
31
31
|
return {
|
|
32
32
|
JSONProperty(node) {
|
|
@@ -94,4 +94,8 @@ var prefer_repository_shorthand_default = (0, import_createRule.createRule)({
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
rule
|
|
100
|
+
});
|
|
97
101
|
//# sourceMappingURL=prefer-repository-shorthand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rules/prefer-repository-shorthand.ts"],"sourcesContent":["import type ESTree from \"estree\";\n\nimport { createRule } from \"../createRule.js\";\nimport { findPropertyWithKeyValue } from \"../utils/findPropertyWithKeyValue.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\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/rules/prefer-repository-shorthand.ts"],"sourcesContent":["import type ESTree from \"estree\";\n\nimport { createRule } from \"../createRule.js\";\nimport { findPropertyWithKeyValue } from \"../utils/findPropertyWithKeyValue.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\nexport const rule = 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 (findPropertyWithKeyValue(properties, \"directory\")) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst typeProperty = findPropertyWithKeyValue(\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 = findPropertyWithKeyValue(\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;AAEA,wBAA2B;AAC3B,sCAAyC;AAEzC,MAAM,iBACL;AAED,MAAM,cAAc,CAAC,QAAgB,eAAe,KAAK,GAAG;AAE5D,MAAM,iBAAiB,CAAC,QACvB,IAAI,QAAQ,gBAAgB,EAAE,EAAE,QAAQ,UAAU,EAAE;AAE9C,MAAM,WAAO,8BAAW;AAAA,EAC9B,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,kBAAI,0DAAyB,YAAY,WAAW,GAAG;AACtD;AAAA,UACD;AAEA,gBAAM,mBAAe;AAAA,YACpB;AAAA,YACA;AAAA,UACD;AACA,cACC,cAAc,MAAM,SAAS,iBAC7B,aAAa,MAAM,UAAU,OAC5B;AACD;AAAA,UACD;AAEA,gBAAM,kBAAc;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":[]}
|
|
@@ -3,7 +3,7 @@ import { findPropertyWithKeyValue } from "../utils/findPropertyWithKeyValue.js";
|
|
|
3
3
|
const githubUrlRegex = /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?github\.com\//;
|
|
4
4
|
const isGitHubUrl = (url) => githubUrlRegex.test(url);
|
|
5
5
|
const cleanGitHubUrl = (url) => url.replace(githubUrlRegex, "").replace(/\.git$/, "");
|
|
6
|
-
|
|
6
|
+
const rule = createRule({
|
|
7
7
|
create(context) {
|
|
8
8
|
return {
|
|
9
9
|
JSONProperty(node) {
|
|
@@ -72,6 +72,6 @@ var prefer_repository_shorthand_default = createRule({
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
export {
|
|
75
|
-
|
|
75
|
+
rule
|
|
76
76
|
};
|
|
77
77
|
//# sourceMappingURL=prefer-repository-shorthand.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rules/prefer-repository-shorthand.ts"],"sourcesContent":["import type ESTree from \"estree\";\n\nimport { createRule } from \"../createRule.js\";\nimport { findPropertyWithKeyValue } from \"../utils/findPropertyWithKeyValue.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\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/rules/prefer-repository-shorthand.ts"],"sourcesContent":["import type ESTree from \"estree\";\n\nimport { createRule } from \"../createRule.js\";\nimport { findPropertyWithKeyValue } from \"../utils/findPropertyWithKeyValue.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\nexport const rule = 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 (findPropertyWithKeyValue(properties, \"directory\")) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst typeProperty = findPropertyWithKeyValue(\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 = findPropertyWithKeyValue(\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":"AAEA,SAAS,kBAAkB;AAC3B,SAAS,gCAAgC;AAEzC,MAAM,iBACL;AAED,MAAM,cAAc,CAAC,QAAgB,eAAe,KAAK,GAAG;AAE5D,MAAM,iBAAiB,CAAC,QACvB,IAAI,QAAQ,gBAAgB,EAAE,EAAE,QAAQ,UAAU,EAAE;AAE9C,MAAM,OAAO,WAAW;AAAA,EAC9B,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":[]}
|
|
@@ -4,9 +4,9 @@ import { PackageJsonRuleContext } from '../createRule.mjs';
|
|
|
4
4
|
import 'estree';
|
|
5
5
|
|
|
6
6
|
type Options = string[];
|
|
7
|
-
declare const
|
|
7
|
+
declare const rule: {
|
|
8
8
|
create(context: PackageJsonRuleContext<Options>): jsonc_eslint_parser.RuleListener;
|
|
9
9
|
meta: eslint.Rule.RuleMetaData;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export {
|
|
12
|
+
export { rule };
|
|
@@ -4,9 +4,9 @@ import { PackageJsonRuleContext } from '../createRule.js';
|
|
|
4
4
|
import 'estree';
|
|
5
5
|
|
|
6
6
|
type Options = string[];
|
|
7
|
-
declare const
|
|
7
|
+
declare const rule: {
|
|
8
8
|
create(context: PackageJsonRuleContext<Options>): jsonc_eslint_parser.RuleListener;
|
|
9
9
|
meta: eslint.Rule.RuleMetaData;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export {
|
|
12
|
+
export { rule };
|
|
@@ -18,7 +18,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var sort_collections_exports = {};
|
|
20
20
|
__export(sort_collections_exports, {
|
|
21
|
-
|
|
21
|
+
rule: () => rule
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(sort_collections_exports);
|
|
24
24
|
var import_createRule = require("../createRule.js");
|
|
@@ -29,7 +29,7 @@ const defaultCollections = [
|
|
|
29
29
|
"peerDependencies",
|
|
30
30
|
"config"
|
|
31
31
|
];
|
|
32
|
-
|
|
32
|
+
const rule = (0, import_createRule.createRule)({
|
|
33
33
|
create(context) {
|
|
34
34
|
const toSort = context.options[0] || defaultCollections;
|
|
35
35
|
return {
|
|
@@ -92,4 +92,8 @@ var sort_collections_default = (0, import_createRule.createRule)({
|
|
|
92
92
|
]
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
+
0 && (module.exports = {
|
|
97
|
+
rule
|
|
98
|
+
});
|
|
95
99
|
//# sourceMappingURL=sort-collections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rules/sort-collections.ts"],"sourcesContent":["import * as ESTree from \"estree\";\nimport { AST } from \"jsonc-eslint-parser\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst defaultCollections = [\n\t\"scripts\",\n\t\"devDependencies\",\n\t\"dependencies\",\n\t\"peerDependencies\",\n\t\"config\",\n];\n\ntype Options = string[];\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/rules/sort-collections.ts"],"sourcesContent":["import * as ESTree from \"estree\";\nimport { AST } from \"jsonc-eslint-parser\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst defaultCollections = [\n\t\"scripts\",\n\t\"devDependencies\",\n\t\"dependencies\",\n\t\"peerDependencies\",\n\t\"config\",\n];\n\ntype Options = string[];\n\nexport const rule = createRule<Options>({\n\tcreate(context) {\n\t\tconst toSort = context.options[0] || defaultCollections;\n\t\treturn {\n\t\t\t\"JSONProperty:exit\"(node) {\n\t\t\t\tconst { key, value } = node as AST.JSONProperty & {\n\t\t\t\t\tkey: AST.JSONStringLiteral;\n\t\t\t\t};\n\n\t\t\t\tconst collection = value;\n\t\t\t\tif (\n\t\t\t\t\tcollection.type === \"JSONObjectExpression\" &&\n\t\t\t\t\ttoSort.includes(key.value)\n\t\t\t\t) {\n\t\t\t\t\tconst currentOrder = collection.properties;\n\t\t\t\t\tconst desiredOrder = currentOrder\n\t\t\t\t\t\t.slice()\n\t\t\t\t\t\t.sort((a, b) =>\n\t\t\t\t\t\t\t(a.key as AST.JSONStringLiteral).value >\n\t\t\t\t\t\t\t(b.key as AST.JSONStringLiteral).value\n\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t: -1,\n\t\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\tcurrentOrder.some(\n\t\t\t\t\t\t\t(property, i) => desiredOrder[i] !== property,\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\tkey: key.value,\n\t\t\t\t\t\t\t},\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\tcollection as unknown as ESTree.Node,\n\t\t\t\t\t\t\t\t\tJSON.stringify(\n\t\t\t\t\t\t\t\t\t\tdesiredOrder.reduce<\n\t\t\t\t\t\t\t\t\t\t\tRecord<string, unknown>\n\t\t\t\t\t\t\t\t\t\t>((out, property) => {\n\t\t\t\t\t\t\t\t\t\t\tout[\n\t\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t\tproperty.key as AST.JSONStringLiteral\n\t\t\t\t\t\t\t\t\t\t\t\t).value\n\t\t\t\t\t\t\t\t\t\t\t] = JSON.parse(\n\t\t\t\t\t\t\t\t\t\t\t\tcontext.sourceCode.getText(\n\t\t\t\t\t\t\t\t\t\t\t\t\tproperty.value as unknown as ESTree.Node,\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\treturn out;\n\t\t\t\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\t2,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t.split(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t.join(\"\\n \"), // nest indents\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tloc: collection.loc,\n\t\t\t\t\t\t\tmessage: \"Package {{ key }} are not alphabetized\",\n\t\t\t\t\t\t\tnode: node 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:\n\t\t\t\t\"Dependencies, scripts, and configuration values must be declared in alphabetical order.\",\n\t\t\trecommended: true,\n\t\t},\n\t\tfixable: \"code\",\n\t\tschema: [\n\t\t\t{\n\t\t\t\titems: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t},\n\t\t\t\ttype: \"array\",\n\t\t\t},\n\t\t],\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA2B;AAE3B,MAAM,qBAAqB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAIO,MAAM,WAAO,8BAAoB;AAAA,EACvC,OAAO,SAAS;AACf,UAAM,SAAS,QAAQ,QAAQ,CAAC,KAAK;AACrC,WAAO;AAAA,MACN,oBAAoB,MAAM;AACzB,cAAM,EAAE,KAAK,MAAM,IAAI;AAIvB,cAAM,aAAa;AACnB,YACC,WAAW,SAAS,0BACpB,OAAO,SAAS,IAAI,KAAK,GACxB;AACD,gBAAM,eAAe,WAAW;AAChC,gBAAM,eAAe,aACnB,MAAM,EACN;AAAA,YAAK,CAAC,GAAG,MACR,EAAE,IAA8B,QAChC,EAAE,IAA8B,QAC9B,IACA;AAAA,UACJ;AACD,cACC,aAAa;AAAA,YACZ,CAAC,UAAU,MAAM,aAAa,CAAC,MAAM;AAAA,UACtC,GACC;AACD,oBAAQ,OAAO;AAAA,cACd,MAAM;AAAA,gBACL,KAAK,IAAI;AAAA,cACV;AAAA,cACA,IAAI,OAAO;AACV,uBAAO,MAAM;AAAA,kBACZ;AAAA,kBACA,KAAK;AAAA,oBACJ,aAAa,OAEX,CAAC,KAAK,aAAa;AACpB,0BAEE,SAAS,IACR,KACH,IAAI,KAAK;AAAA,wBACR,QAAQ,WAAW;AAAA,0BAClB,SAAS;AAAA,wBACV;AAAA,sBACD;AACA,6BAAO;AAAA,oBACR,GAAG,CAAC,CAAC;AAAA,oBACL;AAAA,oBACA;AAAA,kBACD,EACE,MAAM,IAAI,EACV,KAAK,MAAM;AAAA;AAAA,gBACd;AAAA,cACD;AAAA,cACA,KAAK,WAAW;AAAA,cAChB,SAAS;AAAA,cACT;AAAA,YACD,CAAC;AAAA,UACF;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM;AAAA,IACL,MAAM;AAAA,MACL,UAAU;AAAA,MACV,aACC;AAAA,MACD,aAAa;AAAA,IACd;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,MACP;AAAA,QACC,OAAO;AAAA,UACN,MAAM;AAAA,QACP;AAAA,QACA,MAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD;AACD,CAAC;","names":[]}
|
|
@@ -6,7 +6,7 @@ const defaultCollections = [
|
|
|
6
6
|
"peerDependencies",
|
|
7
7
|
"config"
|
|
8
8
|
];
|
|
9
|
-
|
|
9
|
+
const rule = createRule({
|
|
10
10
|
create(context) {
|
|
11
11
|
const toSort = context.options[0] || defaultCollections;
|
|
12
12
|
return {
|
|
@@ -70,6 +70,6 @@ var sort_collections_default = createRule({
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
rule
|
|
74
74
|
};
|
|
75
75
|
//# sourceMappingURL=sort-collections.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rules/sort-collections.ts"],"sourcesContent":["import * as ESTree from \"estree\";\nimport { AST } from \"jsonc-eslint-parser\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst defaultCollections = [\n\t\"scripts\",\n\t\"devDependencies\",\n\t\"dependencies\",\n\t\"peerDependencies\",\n\t\"config\",\n];\n\ntype Options = string[];\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/rules/sort-collections.ts"],"sourcesContent":["import * as ESTree from \"estree\";\nimport { AST } from \"jsonc-eslint-parser\";\n\nimport { createRule } from \"../createRule.js\";\n\nconst defaultCollections = [\n\t\"scripts\",\n\t\"devDependencies\",\n\t\"dependencies\",\n\t\"peerDependencies\",\n\t\"config\",\n];\n\ntype Options = string[];\n\nexport const rule = createRule<Options>({\n\tcreate(context) {\n\t\tconst toSort = context.options[0] || defaultCollections;\n\t\treturn {\n\t\t\t\"JSONProperty:exit\"(node) {\n\t\t\t\tconst { key, value } = node as AST.JSONProperty & {\n\t\t\t\t\tkey: AST.JSONStringLiteral;\n\t\t\t\t};\n\n\t\t\t\tconst collection = value;\n\t\t\t\tif (\n\t\t\t\t\tcollection.type === \"JSONObjectExpression\" &&\n\t\t\t\t\ttoSort.includes(key.value)\n\t\t\t\t) {\n\t\t\t\t\tconst currentOrder = collection.properties;\n\t\t\t\t\tconst desiredOrder = currentOrder\n\t\t\t\t\t\t.slice()\n\t\t\t\t\t\t.sort((a, b) =>\n\t\t\t\t\t\t\t(a.key as AST.JSONStringLiteral).value >\n\t\t\t\t\t\t\t(b.key as AST.JSONStringLiteral).value\n\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t: -1,\n\t\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\tcurrentOrder.some(\n\t\t\t\t\t\t\t(property, i) => desiredOrder[i] !== property,\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\tkey: key.value,\n\t\t\t\t\t\t\t},\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\tcollection as unknown as ESTree.Node,\n\t\t\t\t\t\t\t\t\tJSON.stringify(\n\t\t\t\t\t\t\t\t\t\tdesiredOrder.reduce<\n\t\t\t\t\t\t\t\t\t\t\tRecord<string, unknown>\n\t\t\t\t\t\t\t\t\t\t>((out, property) => {\n\t\t\t\t\t\t\t\t\t\t\tout[\n\t\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t\tproperty.key as AST.JSONStringLiteral\n\t\t\t\t\t\t\t\t\t\t\t\t).value\n\t\t\t\t\t\t\t\t\t\t\t] = JSON.parse(\n\t\t\t\t\t\t\t\t\t\t\t\tcontext.sourceCode.getText(\n\t\t\t\t\t\t\t\t\t\t\t\t\tproperty.value as unknown as ESTree.Node,\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\treturn out;\n\t\t\t\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\t2,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t.split(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t.join(\"\\n \"), // nest indents\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tloc: collection.loc,\n\t\t\t\t\t\t\tmessage: \"Package {{ key }} are not alphabetized\",\n\t\t\t\t\t\t\tnode: node 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:\n\t\t\t\t\"Dependencies, scripts, and configuration values must be declared in alphabetical order.\",\n\t\t\trecommended: true,\n\t\t},\n\t\tfixable: \"code\",\n\t\tschema: [\n\t\t\t{\n\t\t\t\titems: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t},\n\t\t\t\ttype: \"array\",\n\t\t\t},\n\t\t],\n\t},\n});\n"],"mappings":"AAGA,SAAS,kBAAkB;AAE3B,MAAM,qBAAqB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAIO,MAAM,OAAO,WAAoB;AAAA,EACvC,OAAO,SAAS;AACf,UAAM,SAAS,QAAQ,QAAQ,CAAC,KAAK;AACrC,WAAO;AAAA,MACN,oBAAoB,MAAM;AACzB,cAAM,EAAE,KAAK,MAAM,IAAI;AAIvB,cAAM,aAAa;AACnB,YACC,WAAW,SAAS,0BACpB,OAAO,SAAS,IAAI,KAAK,GACxB;AACD,gBAAM,eAAe,WAAW;AAChC,gBAAM,eAAe,aACnB,MAAM,EACN;AAAA,YAAK,CAAC,GAAG,MACR,EAAE,IAA8B,QAChC,EAAE,IAA8B,QAC9B,IACA;AAAA,UACJ;AACD,cACC,aAAa;AAAA,YACZ,CAAC,UAAU,MAAM,aAAa,CAAC,MAAM;AAAA,UACtC,GACC;AACD,oBAAQ,OAAO;AAAA,cACd,MAAM;AAAA,gBACL,KAAK,IAAI;AAAA,cACV;AAAA,cACA,IAAI,OAAO;AACV,uBAAO,MAAM;AAAA,kBACZ;AAAA,kBACA,KAAK;AAAA,oBACJ,aAAa,OAEX,CAAC,KAAK,aAAa;AACpB,0BAEE,SAAS,IACR,KACH,IAAI,KAAK;AAAA,wBACR,QAAQ,WAAW;AAAA,0BAClB,SAAS;AAAA,wBACV;AAAA,sBACD;AACA,6BAAO;AAAA,oBACR,GAAG,CAAC,CAAC;AAAA,oBACL;AAAA,oBACA;AAAA,kBACD,EACE,MAAM,IAAI,EACV,KAAK,MAAM;AAAA;AAAA,gBACd;AAAA,cACD;AAAA,cACA,KAAK,WAAW;AAAA,cAChB,SAAS;AAAA,cACT;AAAA,YACD,CAAC;AAAA,UACF;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM;AAAA,IACL,MAAM;AAAA,MACL,UAAU;AAAA,MACV,aACC;AAAA,MACD,aAAa;AAAA,IACd;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,MACP;AAAA,QACC,OAAO;AAAA,UACN,MAAM;AAAA,QACP;AAAA,QACA,MAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD;AACD,CAAC;","names":[]}
|
|
@@ -3,9 +3,9 @@ import * as jsonc_eslint_parser from 'jsonc-eslint-parser';
|
|
|
3
3
|
import { PackageJsonRuleContext } from '../createRule.mjs';
|
|
4
4
|
import 'estree';
|
|
5
5
|
|
|
6
|
-
declare const
|
|
6
|
+
declare const rule: {
|
|
7
7
|
create(context: PackageJsonRuleContext<unknown[]>): jsonc_eslint_parser.RuleListener;
|
|
8
8
|
meta: eslint.Rule.RuleMetaData;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { rule };
|
|
@@ -3,9 +3,9 @@ import * as jsonc_eslint_parser from 'jsonc-eslint-parser';
|
|
|
3
3
|
import { PackageJsonRuleContext } from '../createRule.js';
|
|
4
4
|
import 'estree';
|
|
5
5
|
|
|
6
|
-
declare const
|
|
6
|
+
declare const rule: {
|
|
7
7
|
create(context: PackageJsonRuleContext<unknown[]>): jsonc_eslint_parser.RuleListener;
|
|
8
8
|
meta: eslint.Rule.RuleMetaData;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { rule };
|
|
@@ -18,7 +18,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var unique_dependencies_exports = {};
|
|
20
20
|
__export(unique_dependencies_exports, {
|
|
21
|
-
|
|
21
|
+
rule: () => rule
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(unique_dependencies_exports);
|
|
24
24
|
var import_createRule = require("../createRule.js");
|
|
@@ -32,7 +32,7 @@ const dependencyPropertyNames = /* @__PURE__ */ new Set([
|
|
|
32
32
|
"peerDependencies",
|
|
33
33
|
"overrides"
|
|
34
34
|
]);
|
|
35
|
-
|
|
35
|
+
const rule = (0, import_createRule.createRule)({
|
|
36
36
|
create(context) {
|
|
37
37
|
function check(elements, getNodeToRemove) {
|
|
38
38
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -106,4 +106,8 @@ var unique_dependencies_default = (0, import_createRule.createRule)({
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
+
0 && (module.exports = {
|
|
111
|
+
rule
|
|
112
|
+
});
|
|
109
113
|
//# sourceMappingURL=unique-dependencies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rules/unique-dependencies.ts"],"sourcesContent":["import type { AST as JsonAST } from \"jsonc-eslint-parser\";\n\nimport * as ESTree from \"estree\";\n\nimport { createRule } from \"../createRule.js\";\nimport { isJSONStringLiteral, isNotNullish } from \"../utils/predicates.js\";\n\nconst dependencyPropertyNames = new Set([\n\t\"bundleDependencies\",\n\t\"bundledDependencies\",\n\t\"dependencies\",\n\t\"devDependencies\",\n\t\"optionalDependencies\",\n\t\"peerDependencies\",\n\t\"overrides\",\n]);\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/rules/unique-dependencies.ts"],"sourcesContent":["import type { AST as JsonAST } from \"jsonc-eslint-parser\";\n\nimport * as ESTree from \"estree\";\n\nimport { createRule } from \"../createRule.js\";\nimport { isJSONStringLiteral, isNotNullish } from \"../utils/predicates.js\";\n\nconst dependencyPropertyNames = new Set([\n\t\"bundleDependencies\",\n\t\"bundledDependencies\",\n\t\"dependencies\",\n\t\"devDependencies\",\n\t\"optionalDependencies\",\n\t\"peerDependencies\",\n\t\"overrides\",\n]);\n\nexport const rule = createRule({\n\tcreate(context) {\n\t\tfunction check(\n\t\t\telements: (JsonAST.JSONNode | null)[],\n\t\t\tgetNodeToRemove: (element: JsonAST.JSONNode) => ESTree.Node,\n\t\t) {\n\t\t\tconst seen = new Set();\n\n\t\t\tfor (const element of elements\n\t\t\t\t.filter(isNotNullish)\n\t\t\t\t.filter(isJSONStringLiteral)\n\t\t\t\t.reverse()) {\n\t\t\t\tif (seen.has(element.value)) {\n\t\t\t\t\treport(element);\n\t\t\t\t} else {\n\t\t\t\t\tseen.add(element.value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction report(node: JsonAST.JSONNode) {\n\t\t\t\tcontext.report({\n\t\t\t\t\tmessageId: \"overridden\",\n\t\t\t\t\tnode: node as unknown as ESTree.Node,\n\t\t\t\t\tsuggest: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfix(fixer) {\n\t\t\t\t\t\t\t\tconst removal = getNodeToRemove(node);\n\t\t\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t\t\tfixer.remove(removal),\n\t\t\t\t\t\t\t\t\tfixer.remove(\n\t\t\t\t\t\t\t\t\t\t// A listing that's overridden can't be last,\n\t\t\t\t\t\t\t\t\t\t// so we're guaranteed there's a comma after.\n\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\t\t\t\t\tcontext.sourceCode.getTokenAfter(\n\t\t\t\t\t\t\t\t\t\t\tremoval,\n\t\t\t\t\t\t\t\t\t\t)!,\n\t\t\t\t\t\t\t\t\t),\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: \"remove\",\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\n\t\treturn {\n\t\t\t\"Program > JSONExpressionStatement > JSONObjectExpression > JSONProperty[key.type=JSONLiteral]\"(\n\t\t\t\tnode: JsonAST.JSONProperty & {\n\t\t\t\t\tkey: JsonAST.JSONStringLiteral;\n\t\t\t\t},\n\t\t\t) {\n\t\t\t\tif (!dependencyPropertyNames.has(node.key.value)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswitch (node.value.type) {\n\t\t\t\t\tcase \"JSONArrayExpression\":\n\t\t\t\t\t\tcheck(\n\t\t\t\t\t\t\tnode.value.elements,\n\t\t\t\t\t\t\t(element) => element as unknown as ESTree.Node,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"JSONObjectExpression\":\n\t\t\t\t\t\tcheck(\n\t\t\t\t\t\t\tnode.value.properties.map(\n\t\t\t\t\t\t\t\t(property) => property.key,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t(property) =>\n\t\t\t\t\t\t\t\tproperty.parent as unknown as ESTree.Node,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\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:\n\t\t\t\t\"Enforce that if repository directory is specified, it matches the path to the package.json file\",\n\t\t\trecommended: true,\n\t\t},\n\t\thasSuggestions: true,\n\t\tmessages: {\n\t\t\toverridden:\n\t\t\t\t\"Package name is overridden by a duplicate listing later on.\",\n\t\t\tremove: \"Remove this redundant dependency listing.\",\n\t\t},\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,wBAA2B;AAC3B,wBAAkD;AAElD,MAAM,0BAA0B,oBAAI,IAAI;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAEM,MAAM,WAAO,8BAAW;AAAA,EAC9B,OAAO,SAAS;AACf,aAAS,MACR,UACA,iBACC;AACD,YAAM,OAAO,oBAAI,IAAI;AAErB,iBAAW,WAAW,SACpB,OAAO,8BAAY,EACnB,OAAO,qCAAmB,EAC1B,QAAQ,GAAG;AACZ,YAAI,KAAK,IAAI,QAAQ,KAAK,GAAG;AAC5B,iBAAO,OAAO;AAAA,QACf,OAAO;AACN,eAAK,IAAI,QAAQ,KAAK;AAAA,QACvB;AAAA,MACD;AAEA,eAAS,OAAO,MAAwB;AACvC,gBAAQ,OAAO;AAAA,UACd,WAAW;AAAA,UACX;AAAA,UACA,SAAS;AAAA,YACR;AAAA,cACC,IAAI,OAAO;AACV,sBAAM,UAAU,gBAAgB,IAAI;AACpC,uBAAO;AAAA,kBACN,MAAM,OAAO,OAAO;AAAA,kBACpB,MAAM;AAAA;AAAA;AAAA;AAAA,oBAIL,QAAQ,WAAW;AAAA,sBAClB;AAAA,oBACD;AAAA,kBACD;AAAA,gBACD;AAAA,cACD;AAAA,cACA,WAAW;AAAA,YACZ;AAAA,UACD;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAEA,WAAO;AAAA,MACN,gGACC,MAGC;AACD,YAAI,CAAC,wBAAwB,IAAI,KAAK,IAAI,KAAK,GAAG;AACjD;AAAA,QACD;AAEA,gBAAQ,KAAK,MAAM,MAAM;AAAA,UACxB,KAAK;AACJ;AAAA,cACC,KAAK,MAAM;AAAA,cACX,CAAC,YAAY;AAAA,YACd;AACA;AAAA,UACD,KAAK;AACJ;AAAA,cACC,KAAK,MAAM,WAAW;AAAA,gBACrB,CAAC,aAAa,SAAS;AAAA,cACxB;AAAA,cACA,CAAC,aACA,SAAS;AAAA,YACX;AACA;AAAA,QACF;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM;AAAA,IACL,MAAM;AAAA,MACL,UAAU;AAAA,MACV,aACC;AAAA,MACD,aAAa;AAAA,IACd;AAAA,IACA,gBAAgB;AAAA,IAChB,UAAU;AAAA,MACT,YACC;AAAA,MACD,QAAQ;AAAA,IACT;AAAA,EACD;AACD,CAAC;","names":[]}
|
|
@@ -9,7 +9,7 @@ const dependencyPropertyNames = /* @__PURE__ */ new Set([
|
|
|
9
9
|
"peerDependencies",
|
|
10
10
|
"overrides"
|
|
11
11
|
]);
|
|
12
|
-
|
|
12
|
+
const rule = createRule({
|
|
13
13
|
create(context) {
|
|
14
14
|
function check(elements, getNodeToRemove) {
|
|
15
15
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -84,6 +84,6 @@ var unique_dependencies_default = createRule({
|
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
export {
|
|
87
|
-
|
|
87
|
+
rule
|
|
88
88
|
};
|
|
89
89
|
//# sourceMappingURL=unique-dependencies.mjs.map
|