@progressive-victory/eslint-plugin-index-file 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/rules/enforce-index-usage.d.ts.map +1 -1
- package/dist/rules/enforce-index-usage.js +2 -3
- package/dist/rules/enforce-index-usage.js.map +1 -1
- package/package.json +1 -2
- package/vitest.config.ts +8 -0
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ declare const plugin: {
|
|
|
2
2
|
configs: {
|
|
3
3
|
readonly recommended: {
|
|
4
4
|
plugins: {
|
|
5
|
-
"eslint-index-file
|
|
5
|
+
"eslint-plugin-index-file": /*elided*/ any;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
rules: {
|
|
8
|
+
"enforce-index-usage": import("@typescript-eslint/utils/ts-eslint").RuleModule<"notExportedInIndex" | "noIndexPresent", [], import("./utils.js").IndexFileDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
9
11
|
};
|
|
10
12
|
};
|
|
11
13
|
};
|
|
@@ -15,7 +17,6 @@ declare const plugin: {
|
|
|
15
17
|
version: string;
|
|
16
18
|
description: string;
|
|
17
19
|
homepage: string;
|
|
18
|
-
private: boolean;
|
|
19
20
|
bugs: {
|
|
20
21
|
url: string;
|
|
21
22
|
};
|
|
@@ -62,7 +63,6 @@ declare const plugin: {
|
|
|
62
63
|
version: string;
|
|
63
64
|
description: string;
|
|
64
65
|
homepage: string;
|
|
65
|
-
private: boolean;
|
|
66
66
|
bugs: {
|
|
67
67
|
url: string;
|
|
68
68
|
};
|
|
@@ -105,8 +105,10 @@ declare const plugin: {
|
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
rules: {
|
|
109
|
+
"enforce-index-usage": import("@typescript-eslint/utils/ts-eslint").RuleModule<"notExportedInIndex" | "noIndexPresent", [], import("./utils.js").IndexFileDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
110
|
+
name: string;
|
|
111
|
+
};
|
|
110
112
|
};
|
|
111
113
|
};
|
|
112
114
|
export default plugin;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUX,CAAA;AAWD,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,13 +8,17 @@ const plugin = {
|
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
meta: { name, version },
|
|
11
|
-
|
|
11
|
+
rules: {
|
|
12
|
+
"enforce-index-usage": enforceIndexUsageRule
|
|
13
|
+
}
|
|
12
14
|
};
|
|
13
15
|
const recommended = {
|
|
14
16
|
plugins: {
|
|
15
|
-
"eslint-index-file
|
|
17
|
+
"eslint-plugin-index-file": plugin
|
|
16
18
|
},
|
|
17
|
-
|
|
19
|
+
rules: {
|
|
20
|
+
"enforce-index-usage": enforceIndexUsageRule
|
|
21
|
+
}
|
|
18
22
|
};
|
|
19
23
|
export default plugin;
|
|
20
24
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAA;AACtD,OAAO,IAAI,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACzD,OAAO,OAAO,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE5D,MAAM,MAAM,GAAG;IACX,OAAO,EAAE;QACL,IAAI,WAAW;YACX,OAAO,WAAW,CAAA;QACtB,CAAC;KACJ;IACD,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;IACvB,qBAAqB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAA;AACtD,OAAO,IAAI,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACzD,OAAO,OAAO,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE5D,MAAM,MAAM,GAAG;IACX,OAAO,EAAE;QACL,IAAI,WAAW;YACX,OAAO,WAAW,CAAA;QACtB,CAAC;KACJ;IACD,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;IACvB,KAAK,EAAE;QACH,qBAAqB,EAAE,qBAAqB;KAC/C;CACJ,CAAA;AAED,MAAM,WAAW,GAAG;IAChB,OAAO,EAAE;QACL,0BAA0B,EAAE,MAAM;KACrC;IACD,KAAK,EAAE;QACH,qBAAqB,EAAE,qBAAqB;KAC/C;CACJ,CAAA;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enforce-index-usage.d.ts","sourceRoot":"","sources":["../../src/rules/enforce-index-usage.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB;;
|
|
1
|
+
{"version":3,"file":"enforce-index-usage.d.ts","sourceRoot":"","sources":["../../src/rules/enforce-index-usage.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB;;CAuChC,CAAA"}
|
|
@@ -7,7 +7,6 @@ export const enforceIndexUsageRule = createRule({
|
|
|
7
7
|
//const services = ESLintUtils.getParserServices(context);
|
|
8
8
|
return {
|
|
9
9
|
ExportNamedDeclaration(node) {
|
|
10
|
-
console.log("doing shit");
|
|
11
10
|
const cwd = context.cwd;
|
|
12
11
|
const cwdFiles = fs.readdirSync(cwd);
|
|
13
12
|
const index = cwdFiles.find(x => x === "index.ts");
|
|
@@ -17,9 +16,9 @@ export const enforceIndexUsageRule = createRule({
|
|
|
17
16
|
node
|
|
18
17
|
});
|
|
19
18
|
const fileNameArr = context.filename.split('.');
|
|
20
|
-
const fileName = fileNameArr[
|
|
19
|
+
const fileName = fileNameArr[0];
|
|
21
20
|
const indexContent = fs.readFileSync(path.join(cwd, "index.ts")).toString();
|
|
22
|
-
if (!indexContent.includes(`export * from
|
|
21
|
+
if (!indexContent.includes(`export * from "./${fileName}.js"`))
|
|
23
22
|
context.report({
|
|
24
23
|
messageId: "notExportedInIndex",
|
|
25
24
|
node
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enforce-index-usage.js","sourceRoot":"","sources":["../../src/rules/enforce-index-usage.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;IAC5C,MAAM,CAAC,OAAO;QACV,0DAA0D;QAE1D,OAAO;YACH,sBAAsB,CAAC,IAAI;gBACvB,
|
|
1
|
+
{"version":3,"file":"enforce-index-usage.js","sourceRoot":"","sources":["../../src/rules/enforce-index-usage.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,IAAI,MAA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ACb;IACD,IAAI,EAAE,qBAAqB;IAC3B,cAAc,EAAE,EAAE;CACrB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progressive-victory/eslint-plugin-index-file",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Plugin that enforces the use of index files with eslint.",
|
|
5
5
|
"homepage": "https://github.com/Progressive-Victory/eslint-index-file-plugin#readme",
|
|
6
|
-
"private": false,
|
|
7
6
|
"bugs": {
|
|
8
7
|
"url": "https://github.com/Progressive-Victory/eslint-index-file-plugin/issues"
|
|
9
8
|
},
|