mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
526c2b3fc4
## Summary - replace deprecated Vitest `toThrowError` assertions with `toThrow` - enable `typescript/no-deprecated` for `packages/codegen`
122 lines
3.2 KiB
JSON
122 lines
3.2 KiB
JSON
{
|
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
"plugins": [
|
|
"typescript",
|
|
"unicorn",
|
|
"react",
|
|
"react-perf",
|
|
"oxc",
|
|
"import",
|
|
"jsdoc",
|
|
"node",
|
|
"promise",
|
|
"vitest"
|
|
],
|
|
"categories": {
|
|
"correctness": "error",
|
|
"perf": "error"
|
|
},
|
|
"rules": {
|
|
"no-console": "error",
|
|
"curly": ["error", "multi-line"],
|
|
"prefer-const": ["error", { "destructuring": "all" }],
|
|
"prefer-destructuring": [
|
|
"error",
|
|
{
|
|
"VariableDeclarator": { "array": false, "object": true }
|
|
}
|
|
],
|
|
"unicode-bom": ["error", "never"],
|
|
"typescript/consistent-indexed-object-style": ["error", "record"],
|
|
"typescript/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
|
|
"vitest/require-mock-type-parameters": "off",
|
|
"vitest/prefer-snapshot-hint": "off"
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": ["packages/codegen/**"],
|
|
"rules": {
|
|
"typescript/no-deprecated": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": ["tasks/e2e/test/*.test.ts"],
|
|
"rules": {
|
|
"vitest/valid-describe-callback": ["off"],
|
|
"vitest/valid-title": ["off"]
|
|
}
|
|
},
|
|
{
|
|
// TODO: enable TS strict mode for these files and remove the override
|
|
"files": [
|
|
"napi/parser/test/**",
|
|
"napi/parser/test-browser/**",
|
|
"napi/parser/vitest.config.ts",
|
|
"napi/parser/vitest.config.browser.ts",
|
|
"tasks/e2e/**"
|
|
],
|
|
"rules": {
|
|
"typescript/no-useless-default-assignment": "off",
|
|
// TODO(camc314): there's some weird interaction between overrides
|
|
// and vitest/jest mappings happening here, these three lines shouldn't be necessary
|
|
"vitest/expect-expect": "error",
|
|
"vitest/no-standalone-expect": "error",
|
|
"vitest/no-conditional-expect": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": ["tasks/e2e/nestjs/test/*.ts"],
|
|
"rules": {
|
|
"vitest/expect-expect": [
|
|
"error",
|
|
{ "assertFunctionNames": ["expect", "request.**.expect"] }
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"files": ["apps/oxlint/test/fixtures/**"],
|
|
"rules": {
|
|
"no-restricted-imports": [
|
|
"error",
|
|
{
|
|
"patterns": [
|
|
{
|
|
"regex": ".*/dist/.*",
|
|
"message": "Use `#oxlint` subpath imports instead of relative paths to `dist` directory"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"ignorePatterns": [
|
|
"**/fixtures/**",
|
|
"**/generated/**",
|
|
"npm/runtime/**",
|
|
"tasks/coverage/**",
|
|
"crates/oxc_semantic/tests/**",
|
|
"napi/minify/**", // TODO
|
|
"apps/oxlint/src-js/package/config.generated.ts",
|
|
"!apps/oxlint/test/fixtures/**",
|
|
"apps/oxlint/test/fixtures/**/files/**",
|
|
"apps/oxlint/conformance/submodules/**",
|
|
// Files generated by NAPI-RS
|
|
"*.d.ts",
|
|
"*.d.cts",
|
|
"napi/*/*.wasi.cjs",
|
|
"napi/*/*.wasi-browser.js",
|
|
"napi/*/wasi-worker.mjs",
|
|
"napi/*/wasi-worker-browser.mjs",
|
|
"napi/*/src-js/*.wasi.cjs",
|
|
"napi/*/src-js/*.wasi-browser.js",
|
|
"napi/*/src-js/wasi-worker.mjs",
|
|
"napi/*/src-js/wasi-worker-browser.mjs",
|
|
"npm/oxlint-plugins/**"
|
|
],
|
|
"options": {
|
|
"typeAware": true,
|
|
"typeCheck": true
|
|
}
|
|
}
|