Skip to content
Grok

Introduction

  • oxlint คือ linter ที่เร็ว เขียนด้วย rust
  • รวม oxc.rs faviconrules ต่างๆไว้ในที่เดียว

Usage

json
{
	"scripts": {
		"lint": "oxlint", // ตรวจสอบแต่ละไฟล์
		"lint:fix": "oxlint --fix" // แก้ไขไฟล์ที่มี error
	}
}
bash
npx oxlint@latest
bash
yarn dlx oxlint@latest
bash
pnpm dlx oxlint@latest
bash
bunx oxlint@latest

Configuration

กำหนดที่ .oxlintrc.json

json
{
	"$schema": "./node_modules/oxlint/configuration_schema.json",
	"plugins": ["import", "typescript", "unicorn"],
	"env": {
		"browser": true
	},
	"globals": {
		"foo": "readonly"
	},
	"settings": {},
	"rules": {
		"eqeqeq": "warn",
		"import/no-cycle": "error"
	},
	"overrides": [
		{
			"files": ["*.test.ts", "*.spec.ts"],
			"rules": {
				"@typescript-eslint/no-explicit-any": "off"
			}
		}
	]
}