Skip to content

Commit 33c70d0

Browse files
committed
Load index.ts correctly
Add declaration/typings
1 parent 39f0777 commit 33c70d0

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"eslint": "^7.0.0 || ^8.0.0"
5454
},
5555
"main": "dist/index.js",
56+
"typings": "dist/index.d.ts",
5657
"scripts": {
5758
"build": "rimraf ./dist && tsc -p tsconfig.build.json",
5859
"typecheck": "tsc -p tsconfig.json --noEmit",

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import consistentThisRule, {
22
RULE_NAME as consistentThisRuleName,
33
} from "./lib/rules/eslint-plugin-angular-template-consistent-this";
44

5-
export default {
6-
rules: {
7-
[consistentThisRuleName]: consistentThisRule,
8-
},
5+
const rules = {
6+
[consistentThisRuleName]: consistentThisRule,
97
};
8+
9+
export { rules };

tests/rules/eslint-plugin-angular-template-consistent-this.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { MESSAGE_IDS } from "../../src/lib/message-ids";
22
import { RULE_NAME } from "../../src/lib/rules/eslint-plugin-angular-template-consistent-this";
33
import { RuleTester } from "../external/rule-tester";
44
import { convertAnnotatedSourceToFailureCase } from "../external/test-helpers";
5-
import rulesIndex from "../../src/index";
5+
import { rules } from "../../src/index";
66

77
// eslint-disable-next-line security/detect-object-injection
8-
const rule = rulesIndex.rules[RULE_NAME];
8+
const rule = rules[RULE_NAME];
99

1010
const ruleTester = new RuleTester({
1111
parser: "@angular-eslint/template-parser",

tsconfig.base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"allowSyntheticDefaultImports": true,
44
"allowUnreachableCode": false,
55
"allowUnusedLabels": false,
6-
"declaration": false,
7-
"declarationMap": false,
6+
"declaration": true,
7+
"declarationMap": true,
88
"esModuleInterop": true,
99
"module": "CommonJS",
1010
"moduleResolution": "node",

0 commit comments

Comments
 (0)