Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions packages/oxlint-config/src/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,25 @@ import { testFiles } from './subconfigs/files.js'

export default {
overrides: [
{
// Tests live in `*.spec.*` files beside their code, never in `*.test.*` ones
files: ['**/*'],
plugins: ['vitest'],
rules: {
'vitest/consistent-test-filename': [
'error',
{
pattern: '.*\\.spec\\.[jt]sx?$'
}
]
}
},
{
files: testFiles,
env: {
vitest: true
},
plugins: ['typescript'],
plugins: ['typescript', 'vitest'],
jsPlugins: ['@trigen/oxlint-config/plugin'],
rules: {
'eslint/max-classes-per-file': 'off',
Expand All @@ -34,7 +47,34 @@ export default {
'eslint/no-useless-assignment': 'off',
'eslint/no-empty-function': 'off',
'trigen/naming-convention': 'off',
'trigen/func-style': 'off'
'trigen/func-style': 'off',
'vitest/consistent-test-it': [
'error',
{
fn: 'it',
withinDescribe: 'it'
}
],
'vitest/no-disabled-tests': 'error',
'vitest/no-focused-tests': 'error',
'vitest/no-identical-title': 'error',
'vitest/no-standalone-expect': 'error',
'vitest/prefer-importing-vitest-globals': 'error',
// The unit's address is a chain of describes, each with its own segment
'vitest/require-top-level-describe': 'error',
'vitest/valid-describe-callback': 'error',
'vitest/valid-expect': 'error',
'vitest/valid-title': [
'error',
{
mustMatch: {
it: '^should '
},
mustNotMatch: {
describe: '/'
}
}
]

// Unsupported by Oxlint
// 'eslint/camelcase': 'off',
Expand Down