-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: abstract rule imports & use getters
\### Rationale In order to facilitate better testing of the correct imported rules, the rules imports need to be abstracted rather than using a global var which is not abstractable and controllable for invalid case checking. Also converted to getter functions to ensure imports are low computation during import but when accessed the computation occurs.
- Loading branch information
1 parent
c27c6c4
commit e3266da
Showing
2 changed files
with
45 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* @fileoverview easy import file to grab all rules in folder | ||
* @author codejedi365 | ||
*/ | ||
import type { | ||
RuleListener, | ||
RuleModule | ||
} from "@typescript-eslint/experimental-utils/dist/ts-eslint"; | ||
|
||
// Add Import for any new rules to this list with camelCase | ||
import noDebug from "./no-debug"; | ||
import noOnly from "./no-only"; | ||
import noSkip from "./no-skip"; | ||
import noIdenticalTitle from "./no-identical-title"; | ||
import expectExpect from "./expect-expect"; | ||
|
||
// Add export entry to this object for rule definition to be recognized | ||
export default { | ||
get rules(): { | ||
[key: string]: RuleModule<string, unknown[], RuleListener>; | ||
} { | ||
return { | ||
noDebug, | ||
noSkip, | ||
noOnly, | ||
noIdenticalTitle, | ||
expectExpect | ||
}; | ||
} | ||
}; |