Skip to content

Commit

Permalink
feat: cleanup the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
veritem committed Apr 5, 2022
1 parent 387e6e5 commit 8d50455
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
29 changes: 12 additions & 17 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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,
}
}

0 comments on commit 8d50455

Please sign in to comment.