-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove source codes and tests from the same place (#218)
* feat: orgnize tests * chore: manage generate command
- Loading branch information
Showing
79 changed files
with
3,407 additions
and
3,316 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"plugin:vitest/all" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
import { describe, it, expect } from 'vitest' | ||
|
||
describe('foo', () => { | ||
it.todo('mdmdms') | ||
|
||
it('foo', () => { | ||
expect(true).toBeTruthy() | ||
}) | ||
}) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,40 @@ | ||
import fs from 'node:fs' | ||
import url from 'node:url' | ||
import path from 'node:path' | ||
|
||
async function generate() { | ||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) | ||
const rules = fs.readdirSync(path.resolve(__dirname, '../src/rules')) | ||
|
||
const allRules = [] | ||
const recommendedRules = [] | ||
|
||
rules.forEach(async (rule) => { | ||
const ruleName = rule.replace(/\.ts$/, '') | ||
const content = await import(path.resolve(__dirname, `../src/rules/${ruleName}.ts`)) | ||
|
||
if (content.default.meta.docs.recommended) { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
recommendedRules.push({ | ||
name: ruleName, | ||
rule: content.default | ||
}) | ||
} else { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
allRules.push({ | ||
name: ruleName, | ||
rule: content.default | ||
}) | ||
} | ||
}) | ||
|
||
console.log(recommendedRules) | ||
} | ||
|
||
generate() | ||
.catch((e) => { | ||
console.error(e) | ||
process.exit(1) | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.