Skip to content

Commit 7075b03

Browse files
committed
fix: fixed typo in rule script preventing it from running abd refactored the index.ts
1 parent ec8b7f6 commit 7075b03

13 files changed

+34
-81
lines changed

lib/index.d.ts

+2-62
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,3 @@
1-
declare const _default: {
2-
rules: {
3-
'no-aliased-imports': {
4-
meta: {
5-
type: string;
6-
fixable: string;
7-
hasSuggestions: boolean;
8-
schema: {
9-
type: string;
10-
properties: {
11-
aliases: {
12-
type: string;
13-
items: {
14-
type: string;
15-
properties: {
16-
prefix: {
17-
type: string;
18-
};
19-
target: {
20-
type: string;
21-
};
22-
};
23-
required: string[];
24-
};
25-
default: {
26-
prefix: string;
27-
target: string;
28-
}[];
29-
};
30-
includeFolders: {
31-
type: string;
32-
items: {
33-
type: string;
34-
};
35-
default: string[];
36-
};
37-
autoFix: {
38-
type: string;
39-
};
40-
};
41-
additionalProperties: boolean;
42-
}[];
43-
messages: {
44-
noAlias: string;
45-
noAliasNoAutofix: string;
46-
};
47-
};
48-
defaultOptions: {
49-
aliases: {
50-
prefix: string;
51-
target: string;
52-
}[];
53-
includeFolders: string[];
54-
autoFix: boolean;
55-
}[];
56-
create(context: any): {
57-
importDeclaration(node: any): void;
58-
};
59-
};
60-
};
61-
};
62-
export default _default;
1+
import { noAliasedImportsRule } from './rules/no-aliased-imports.js';
2+
export { noAliasedImportsRule, };
633
//# sourceMappingURL=index.d.ts.map

lib/index.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

lib/index.js

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/rules/no-aliased-imports.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export declare const noAliasedImportsRule: {
5252
autoFix: boolean;
5353
}[];
5454
create(context: any): {
55-
importDeclaration(node: any): void;
55+
ImportDeclaration(node: any): void;
5656
};
5757
};
5858
//# sourceMappingURL=no-aliased-imports.d.ts.map

lib/rules/no-aliased-imports.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

lib/rules/no-aliased-imports.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/rules/no-aliased-imports.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tsbuildinfo

+1-1
Large diffs are not rendered by default.

package.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@matrixai/matrix-eslint",
2+
"name": "@matrixai/js-eslint",
33
"version": "0.0.1",
44
"author": "Roger Qiu",
55
"description": "Org wide custom eslint rules",
@@ -29,6 +29,8 @@
2929
"docs": "shx rm -rf ./docs && typedoc --gitRevision master --tsconfig ./tsconfig.build.json --out ./docs src",
3030
"bench": "tsc -p ./tsconfig.build.json && shx rm -rf ./benches/results && tsx ./benches/index.ts"
3131
},
32+
33+
3234
"devDependencies": {
3335
"@swc/core": "1.3.82",
3436
"@types/node": "^20.5.7",
@@ -44,5 +46,11 @@
4446
"tsx": "^3.12.7",
4547
"typedoc": "^0.24.8",
4648
"typescript": "^5.1.6"
49+
},
50+
51+
"peerDependencies": {
52+
"eslint": ">=9.0.0"
4753
}
54+
55+
4856
}

src/configs/recommended.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
rules: {
3+
'@matrixai/js-eslint/no-aliased-imports': 'error',
4+
}
5+
6+
7+
}

src/index.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { noAliasedImportsRule } from './rules/no-aliased-imports.js';
22

3-
export default {
4-
rules: {
5-
'no-aliased-imports': noAliasedImportsRule,
6-
},
3+
export {
4+
noAliasedImportsRule,
75
};

src/rules/no-aliased-imports.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@ export const noAliasedImportsRule = {
5353
],
5454
create(context) {
5555
const options = context.options[0] || {};
56-
const { aliases, includeFolders, autoFix } = options;
56+
const {
57+
aliases ,
58+
includeFolders,
59+
autoFix
60+
} = options;
5761
return {
58-
importDeclaration(node) {
62+
ImportDeclaration(node) {
5963
const importPath = node.source.value;
6064

6165
// The absolute path of the current file being linted

0 commit comments

Comments
 (0)