Skip to content

Instantly share code, notes, and snippets.

@yano3nora
Last active February 16, 2026 02:35
Show Gist options
  • Select an option

  • Save yano3nora/6c46a7cd1de69042a4333c1b8c58277d to your computer and use it in GitHub Desktop.

Select an option

Save yano3nora/6c46a7cd1de69042a4333c1b8c58277d to your computer and use it in GitHub Desktop.
linter & formatter / oxlint + dprint

oxlint

$ npm i -D oxlint
$ npx oxlint --init
// package.json
{
  "scripts": {
    "check:lint": "oxlint",
    "fix:lint": "oxlint --fix"
  }
}
{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "categories": {},
  "env": {
    "browser": true,
    "builtin": true,
    "es2021": true,
    "node": true
  },
  "ignorePatterns": [
    "dist/**",
    "husky/**",
    "amplify/**",
    "node_modules/**",
    ".*",
    ".*/**"
  ],
  "plugins": [
    "react",
    "react-perf",
    "typescript",
    "unicorn",
    "oxc",
    "import"
  ],
  "rules": {
    "eslint/array-callback-return": "off",
    "eslint/no-unused-expressions": [
      "error",
      {
        "allowShortCircuit": true
      }
    ],
    "eslint/prefer-template": "off",
    "import/default": "off",
    "no-unused-vars": "off",
    "react-perf/no-array-index-key": "off",
    "react/exhaustive-deps": "off",
    "react/jsx-no-useless-fragment": "off",
    "typescript/ban-ts-comment": "off",
    "typescript/consistent-type-imports": "off",
    "typescript/no-explicit-any": "off",
    "unicorn/no-useless-fallback-in-spread": "off"
  }
}

dprint

$ npm i -D dprint
$ npx dprint init
// package.json
{
  "scripts": {
    "check:format": "dprint check",
    "fix:format": "dprint fmt"
  }
}
// dprint.json
{
  "typescript": {
    "lineWidth": 80,
    "indentWidth": 2,
    "useTabs": false,
    "semiColons": "asi",
    "quoteStyle": "alwaysSingle",
    "operatorPosition": "maintain"
  },
  "excludes": [
    "**/node_modules",
    "dist"
  ],
  "plugins": [
    "https://plugins.dprint.dev/typescript-0.95.15.wasm"
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment