@progressive-victory/eslint-plugin-index-file 0.0.12 → 0.0.13
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
CHANGED
|
@@ -15,7 +15,6 @@ declare const plugin: {
|
|
|
15
15
|
version: string;
|
|
16
16
|
description: string;
|
|
17
17
|
homepage: string;
|
|
18
|
-
private: boolean;
|
|
19
18
|
bugs: {
|
|
20
19
|
url: string;
|
|
21
20
|
};
|
|
@@ -62,7 +61,6 @@ declare const plugin: {
|
|
|
62
61
|
version: string;
|
|
63
62
|
description: string;
|
|
64
63
|
homepage: string;
|
|
65
|
-
private: boolean;
|
|
66
64
|
bugs: {
|
|
67
65
|
url: string;
|
|
68
66
|
};
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQX,CAAA;AASD,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,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;IAC5C,MAAM,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
|
1
1
|
{
|
|
2
2
|
"name": "@progressive-victory/eslint-plugin-index-file",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
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
|
},
|