mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 14:41:28 -07:00
Initial commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# `@repo/oxlint-config`
|
||||
|
||||
Collection of internal oxlint configurations.
|
||||
|
||||
## Adding additional configs
|
||||
|
||||
You may want to add additional configs with overrides for different frameworks.
|
||||
|
||||
For example, you can add a TanStack Start config by adding `src/tanstack.config.ts`:
|
||||
|
||||
```ts
|
||||
// src/tanstack.config.ts
|
||||
import { getConfig } from '@repo/oxlint-config'
|
||||
|
||||
import type { OxlintConfig } from 'oxlint'
|
||||
|
||||
const config = getConfig()
|
||||
|
||||
export function getTanstackConfig() {
|
||||
return {
|
||||
...config,
|
||||
ignorePatterns: [...config.ignorePatterns, 'src/routeTree.gen.ts'],
|
||||
} as const satisfies OxlintConfig
|
||||
}
|
||||
```
|
||||
|
||||
And then updating [package.json](./package.json) exports:
|
||||
|
||||
```json
|
||||
"exports": {
|
||||
".": "./src/default.config.ts",
|
||||
"./tanstack": "./src/tanstack.config.ts"
|
||||
},
|
||||
```
|
||||
|
||||
Finally, import it to your TanStack Start app:
|
||||
|
||||
```ts
|
||||
// apps/my-tanstack-project/oxlint.config.ts
|
||||
import { defineConfig } from '@repo/oxlint-config'
|
||||
import { getTanstackConfig } from '@repo/oxlint-config/tanstack'
|
||||
|
||||
export default defineConfig(getTanstackConfig())
|
||||
```
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "@repo/oxlint-config",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./src/default.config.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"oxlint": "1.56.0",
|
||||
"oxlint-tsgolint": "0.17.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "25.5.0",
|
||||
"vitest": "4.1.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import { defineConfig } from 'oxlint'
|
||||
|
||||
import type { OxlintConfig } from 'oxlint'
|
||||
|
||||
export { defineConfig }
|
||||
|
||||
export function getConfig() {
|
||||
return {
|
||||
plugins: ['typescript', 'import', 'unicorn'],
|
||||
env: {
|
||||
builtin: true,
|
||||
es2018: true,
|
||||
},
|
||||
ignorePatterns: [
|
||||
'.astro/**',
|
||||
'.next/**',
|
||||
'.turbo/**',
|
||||
'.vercel/**',
|
||||
'.wrangler/**',
|
||||
'dist/**',
|
||||
'node_modules/**',
|
||||
'out/**',
|
||||
'worker-configuration.d.ts',
|
||||
],
|
||||
rules: {
|
||||
'@typescript-eslint/no-floating-promises': 'warn',
|
||||
'import/no-named-as-default': 'warn',
|
||||
'import/no-named-as-default-member': 'warn',
|
||||
'import/no-duplicates': 'warn',
|
||||
'no-var': 'error',
|
||||
'prefer-rest-params': 'error',
|
||||
'prefer-spread': 'error',
|
||||
'eslint/prefer-const': 'warn',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/no-empty-object-type': 'off',
|
||||
'typescript/await-thenable': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'no-unused-vars': [
|
||||
'warn',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/consistent-type-imports': [
|
||||
'warn',
|
||||
{
|
||||
prefer: 'type-imports',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/array-type': [
|
||||
'warn',
|
||||
{
|
||||
default: 'array-simple',
|
||||
},
|
||||
],
|
||||
'no-empty': 'warn',
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/dagger/*.ts', '**/dagger/**/*.ts'],
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['tailwind.config.ts', 'postcss.config.mjs'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
} as const satisfies OxlintConfig
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "@repo/typescript-config/lib.json",
|
||||
"include": ["*.ts", "src/**/*.ts"],
|
||||
"exclude": ["node_modules/"]
|
||||
}
|
||||
Reference in New Issue
Block a user