From 8d5045576cc2126a0ba8961fd6e2cf38d949877c Mon Sep 17 00:00:00 2001 From: Makuza Mugabo Verite Date: Tue, 5 Apr 2022 06:59:52 +0200 Subject: [PATCH] feat: cleanup the repo --- README.md | 5 ++++- src/index.ts | 29 ++++++++++++----------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 90d0057..8aef7a5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ ## eslint-plugin-vitest -> Disclaimer: This package is very experimental ![npm](https://img.shields.io/npm/v/eslint-plugin-vitest) +[![ci](https://github.com/veritem/eslint-plugin-vitest/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/veritem/eslint-plugin-vitest/actions/workflows/ci.yml) + + +> Disclaimer: This package is very experimental Eslint plugin for vitest diff --git a/src/index.ts b/src/index.ts index 4863e68..677c836 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,17 +1,12 @@ -import { readdirSync } from "fs"; -import { dirname, join, parse } from "path"; -import { fileURLToPath } from "url"; - -const rulesDir = dirname(fileURLToPath(import.meta.url)); - -console.log({ rulesDir }) - -const values = readdirSync(rulesDir) - .map(rule => parse(rule).name) - .reduce((allRules, ruleName) => ({ - ...allRules, - [ruleName]: import(join(rulesDir, ruleName)), - }), {}) - - -console.log({ values }) +import assertionType from "./rules/assertion-type" +import lowerCaseTitle from "./rules/lower-case-title" +import noSkippedTests from "./rules/no-skipped-tests" + + +export default { + rules: { + 'no-skip-test': noSkippedTests, + 'lower-case-title': lowerCaseTitle, + 'assertion-type': assertionType, + } +}