@osskit/eslint-config
Version:
The ESLint config used by osskit
94 lines (92 loc) • 3.63 kB
JavaScript
import typescriptEslint from 'typescript-eslint';
import vitest from '@vitest/eslint-plugin';
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.Config} */
export const testConfig = {
name: '@osskit/eslint-config/test.js',
files: ['tests/**', '**/*.spec.ts', '**/*.spec.js'],
plugins: {
vitest,
},
rules: {
'vitest/consistent-test-filename': 'off',
'vitest/consistent-test-it': ['error', { fn: 'it' }],
'vitest/prefer-lowercase-title': 'error',
'vitest/max-nested-describe': 'error',
'vitest/no-identical-title': 'error',
'vitest/no-focused-tests': 'error',
'vitest/no-conditional-tests': 'error',
'vitest/expect-expect': 'error',
'vitest/prefer-to-be': 'error',
'vitest/no-hooks': 'off',
'vitest/no-restricted-vi-methods': 'off',
'vitest/max-expects': 'off',
'vitest/no-alias-methods': 'off',
'vitest/no-commented-out-tests': 'error',
'vitest/no-conditional-expect': 'error',
'vitest/no-conditional-in-test': 'error',
'vitest/no-disabled-tests': 'error',
'vitest/no-duplicate-hooks': 'error',
'vitest/no-large-snapshots': 'off',
'vitest/no-interpolation-in-snapshots': 'error',
'vitest/no-mocks-import': 'off',
'vitest/no-restricted-matchers': 'off',
'vitest/no-standalone-expect': 'error',
'vitest/no-test-prefixes': 'error',
'vitest/no-test-return-statement': 'error',
'vitest/no-import-node-test': 'error',
'vitest/prefer-called-with': 'off',
'vitest/valid-title': 'off',
'vitest/valid-expect': 'error',
'vitest/prefer-to-be-falsy': 'off',
'vitest/prefer-to-be-object': 'error',
'vitest/prefer-to-be-truthy': 'off',
'vitest/prefer-to-have-length': 'error',
'vitest/prefer-equality-matcher': 'error',
'vitest/prefer-strict-equal': 'off',
'vitest/prefer-expect-resolves': 'error',
'vitest/prefer-each': 'error',
'vitest/prefer-hooks-on-top': 'error',
'vitest/prefer-hooks-in-order': 'error',
'vitest/require-local-test-context-for-concurrent-snapshots': 'error',
'vitest/prefer-mock-promise-shorthand': 'error',
'vitest/prefer-snapshot-hint': 'off',
'vitest/valid-describe-callback': 'error',
'vitest/require-top-level-describe': 'error',
'vitest/require-to-throw-message': 'off',
'vitest/require-hook': 'error',
'vitest/prefer-todo': 'error',
'vitest/prefer-spy-on': 'error',
'vitest/prefer-comparison-matcher': 'error',
'vitest/prefer-to-contain': 'error',
'vitest/prefer-expect-assertions': 'off',
'vitest/consistent-vitest-vi': 'error',
'vitest/prefer-vi-mocked': 'error',
'vitest/prefer-describe-function-title': 'off',
'vitest/padding-around-after-all-blocks': 'error',
'vitest/padding-around-after-each-blocks': 'error',
'vitest/padding-around-before-all-blocks': 'error',
'vitest/padding-around-before-each-blocks': 'error',
'vitest/padding-around-describe-blocks': 'error',
'vitest/padding-around-all': 'error',
'vitest/padding-around-expect-groups': 'error',
'vitest/padding-around-test-blocks': 'error',
'vitest/valid-expect-in-promise': 'error',
'vitest/prefer-strict-boolean-matchers': 'error',
'vitest/require-mock-type-parameters': 'error',
'vitest/warn-todo': 'off',
'vitest/prefer-called-times': 'off',
'vitest/prefer-called-once': 'error',
'vitest/no-importing-vitest-globals': 'off',
'vitest/prefer-importing-vitest-globals': 'error',
},
settings: {
vitest: {
typecheck: true,
},
},
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
},
};