chore: init project
This commit is contained in:
44
internal/lint-configs/eslint-config/src/configs/test.ts
Normal file
44
internal/lint-configs/eslint-config/src/configs/test.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function test(): Promise<Linter.FlatConfig[]> {
|
||||
const [pluginTest, pluginNoOnlyTests] = await Promise.all([
|
||||
import('eslint-plugin-vitest'),
|
||||
// @ts-expect-error - no types
|
||||
import('eslint-plugin-no-only-tests'),
|
||||
] as const);
|
||||
|
||||
return [
|
||||
{
|
||||
files: [
|
||||
`**/__tests__/**/*.?([cm])[jt]s?(x)`,
|
||||
`**/*.spec.?([cm])[jt]s?(x)`,
|
||||
`**/*.test.?([cm])[jt]s?(x)`,
|
||||
`**/*.bench.?([cm])[jt]s?(x)`,
|
||||
`**/*.benchmark.?([cm])[jt]s?(x)`,
|
||||
],
|
||||
plugins: {
|
||||
test: {
|
||||
...pluginTest,
|
||||
rules: {
|
||||
// @ts-expect-error - no types
|
||||
...pluginTest.rules,
|
||||
...pluginNoOnlyTests.rules,
|
||||
},
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
'node/prefer-global/process': 'off',
|
||||
'test/consistent-test-it': [
|
||||
'error',
|
||||
{ fn: 'it', withinDescribe: 'it' },
|
||||
],
|
||||
'test/no-identical-title': 'error',
|
||||
'test/no-import-node-test': 'error',
|
||||
'test/no-only-tests': 'error',
|
||||
'test/prefer-hooks-in-order': 'error',
|
||||
'test/prefer-lowercase-title': 'error',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user