1- // @ts -check
1+ // @ts -nocheck
22
33import tseslint from "typescript-eslint" ;
44import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended" ;
55
6- import { TSESTree } from "@typescript-eslint/utils" ;
7- import { RuleContext } from "@typescript-eslint/utils/dist/ts-eslint" ;
8-
9- type Node = TSESTree . ImportDeclaration ;
10-
11- type CustomRuleOptions = {
12- locations : string [ ] ;
13- message ?: string ;
14- fixedLocation ?: string ;
15- ignoreTypeImports ?: boolean ;
16- } ;
17-
186export default tseslint . config (
197 // https://typescript-eslint.io/getting-started/typed-linting/
208 tseslint . configs . strictTypeChecked ,
@@ -39,7 +27,7 @@ export default tseslint.config(
3927 } ,
4028 ] ,
4129 } ,
42- create : function ( context : RuleContext < "bannedImport" , Node [ ] > ) {
30+ create : function ( context ) {
4331 const filePath = context . getFilename ( ) ;
4432 const options = context . options [ 0 ] || {
4533 "^/(.*)" : {
@@ -48,8 +36,8 @@ export default tseslint.config(
4836 } ;
4937
5038 return {
51- ImportDeclaration : ( node : Node ) => {
52- Object . entries ( options ) . forEach ( ( [ bannedImport , config ] : [ string , CustomRuleOptions ] ) => {
39+ ImportDeclaration : ( node ) => {
40+ Object . entries ( options ) . forEach ( ( [ bannedImport , config ] ) => {
5341 const importLocationRegex = new RegExp ( bannedImport ) ;
5442
5543 if ( config . ignoreTypeImports && node . importKind === "type" ) return ;
0 commit comments