Skip to content

Commit b731cec

Browse files
authored
Merge pull request #316 from lazercaveman/294-replace-eslint-with-oxlint-for-significantly-improved-performance
294 replace eslint with oxlint for significantly improved performance
2 parents 9c997f1 + 3350f64 commit b731cec

29 files changed

Lines changed: 771 additions & 1029 deletions

.husky/pre-push

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
# 1. Force Prettier Structure
2-
echo "🐶 Husky: 🌊 Enforcing TypeScript Types Check ..."
3-
yarn type-check || { echo "🐶 Husky: ❌ Enforcing Types Check. Aborting push."; exit 1; }
4-
echo "🐶 Husky: 🎉 TypeScript found no rule violations ..."
1+
# 1. TypeScript
2+
echo "🐶 Husky: 🌊 Enforcing TypeScript types check ..."
3+
yarn type-check || { echo "🐶 Husky: ❌ Enforcing types check failed. Aborting push."; exit 1; }
4+
echo "🐶 Husky: 🎉 TypeScript found no rule violations ..."
55

6-
# 2. Linting
7-
echo "🐶 Husky: 👮‍♂️ Executing EsLint ..."
8-
yarn lint:eslint || { echo "🐶 Husky: ❌ ESLint found issues. Aborting push."; exit 1; }
9-
echo "🐶 Husky: 🎉 Linter found no rule violations ..."
6+
# 2. Linting
7+
echo "🐶 Husky: 👮‍♂️ Executing Oxlint ..."
8+
yarn lint:fix || { echo "🐶 Husky: ❌ Oxlint found issues. Aborting push - you should install the Oxc extension!"; exit 1; }
9+
echo "🐶 Husky: 🎉 Linter found no rule violations ..."
1010

11-
# 4. Unit-Testing
12-
echo "🐶 Husky: 🧪 Executing test:coverage ..."
13-
yarn test:coverage || { echo "🐶 Husky: ❌ Tests failed. Aborting push."; exit 1; }
14-
echo "🐶 Husky: 🎉 All tests passed successfully!"
11+
# 3. Formatting
12+
echo "🐶 Husky: 🍰 Executing OxFmt ..."
13+
yarn format || { echo "🐶 Husky: ❌ OxFmt found issues. Aborting push - you should install the Oxc extension!"; exit 1; }
14+
echo "🐶 Husky: 🎉 Formatter found no rule violations ..."
1515

16-
# 6. Success
17-
echo "🐶 Husky: 🎉 Pushing to git successfully - thank you for contributing!"
18-
exit 0
16+
# 4. Unit-Testing
17+
echo "🐶 Husky: 🧪 Executing test:coverage ..."
18+
yarn test:coverage || { echo "🐶 Husky: ❌ Tests failed. Aborting push."; exit 1; }
19+
echo "🐶 Husky: 🎉 All unit-tests passed successfully!"
20+
21+
# 6. Success
22+
echo "🐶 Husky: 🎉 Pushing to git successfully - thank you for contributing!"
23+
exit 0

.oxfmtrc.jsonc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"singleQuote": true,
5+
"semi": true,
6+
"trailingComma": "all",
7+
"bracketSpacing": true,
8+
"singleAttributePerLine": true,
9+
"printWidth": 160,
10+
"bracketSameLine": false,
11+
"arrowParens": "always",
12+
"insertFinalNewline": true,
13+
"embeddedLanguageFormatting": "auto",
14+
"ignorePatterns": ["node_modules", "coverage", "dist", ".output", ".github", ".nuxt", ".yarn", "**/*.md", "**/*.mdx"],
15+
"sortTailwindcss": {
16+
"stylesheet": "./app/assets/style/tailwind.css",
17+
},
18+
}

.oxlintrc.jsonc

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["typescript", "vue"],
4+
"env": {
5+
"browser": true,
6+
},
7+
"ignorePatterns": ["node_modules", "coverage", "dist", ".output", ".nuxt", "clean-project.js"],
8+
/*
9+
I consider these rules essential for this project.
10+
Feel free to remove any that you find unnecessary
11+
and/or extend the ruleset with additional ones as needed.
12+
Documentation: https://oxc.rs/docs/guide/usage/linter/rules
13+
*/
14+
"rules": {
15+
"typescript/no-explicit-any": ["warn", { "fixToUnknown": true }],
16+
"typescript/no-non-null-assertion": "warn",
17+
"typescript/consistent-type-imports": "error",
18+
"vue/no-export-in-script-setup": "error",
19+
"vue/no-deprecated-destroyed-lifecycle": "error",
20+
"vue/prefer-import-from-vue": "error",
21+
"vue/define-props-declaration": ["error", "type-based"],
22+
"vue/require-typed-ref": "warn",
23+
"no-console": ["warn", { "allow": ["warn", "error"] }],
24+
"no-debugger": "error",
25+
"eqeqeq": "error",
26+
"prefer-const": "error",
27+
"no-unused-vars": [
28+
"error",
29+
{
30+
"args": "all",
31+
"argsIgnorePattern": "^(_|instance)",
32+
"caughtErrors": "none",
33+
"destructuredArrayIgnorePattern": "^_",
34+
"varsIgnorePattern": "^(prop|pending|key)$",
35+
"ignoreRestSiblings": true,
36+
},
37+
],
38+
},
39+
"overrides": [
40+
{
41+
"files": ["nuxt.config.ts"],
42+
"rules": {
43+
"typescript/no-unsafe-call": "off",
44+
},
45+
},
46+
],
47+
}

.vscode/extensions.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44

55
// List of extensions which should be recommended for users of this workspace.
66
"recommendations": [
7-
"dbaeumer.vscode-eslint",
7+
"oxc.oxc-vscode",
8+
"oxc.oxfmt",
89
"gruntfuggly.todo-tree",
910
"vue.volar",
1011
"bradlc.vscode-tailwindcss",
1112
"syler.sass-indented",
1213
"unifiedjs.vscode-mdx",
13-
"streetsidesoftware.code-spell-checker",
14+
"streetsidesoftware.code-spell-checker"
1415
],
1516
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
16-
"unwantedRecommendations": [
17-
"octref.vetur",
18-
"vue.vscode-typescript-vue-plugin",
19-
"esbenp.prettier-vscode",
20-
]
17+
"unwantedRecommendations": ["octref.vetur", "vue.vscode-typescript-vue-plugin", "esbenp.prettier-vscode"]
2118
}

.vscode/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"todo-tree.tree.showBadges": false,
3-
"editor.formatOnSave": false,
4-
// Due to eslint autoformatting, prettier formatting has to be disabled - ESLint will do the formatting related to rules setup (requires the official ESLint extension: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
5-
"prettier.enable": false,
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "oxc.oxfmt",
5+
"prettier.enable": false
66
}

CLAUDE.md

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ MIT-licensed, maintained by Ali Soueidan (@lazercaveman).
1111
- **Language:** TypeScript (strict mode)
1212
- **Build:** Vite (native Nuxt integration)
1313
- **Package Manager:** yarn (see version in `package.json`)
14-
- **Node:** v22.13.0 (pinned in `.nvmrc`)
14+
- **Node:** Version can be found in Package.json (enforced via `engines`)
1515
- **State:** Pinia (`@pinia/nuxt`)
1616
- **Styling:** Tailwind CSS v4 (`@tailwindcss/vite`) + SCSS (Sass)
17-
- **Linting:** ESLint v9 flat config (`eslint.config.ts`) — uses `eslint:recommended`, `typescript-eslint`, `eslint-plugin-vue`
17+
- **Linting:** Oxlint (`oxlint`) — configured in `.oxlintrc.jsonc` with `typescript` and `vue` plugins
18+
- **Formatting:** Oxfmt (`oxfmt`) — configured in `.oxfmtrc.jsonc`
1819
- **Testing:** Vitest + `@vitest/coverage-v8` + `@vitest/ui`
1920
- **Git Hooks:** Husky (pre-push: lint + test)
2021

@@ -32,7 +33,8 @@ MIT-licensed, maintained by Ali Soueidan (@lazercaveman).
3233
├── server/ # Nitro server routes & API
3334
│ └── api/
3435
├── public/ # Static assets
35-
├── eslint.config.ts # ESLint v9 flat config — DO NOT create .eslintrc files
36+
├── .oxlintrc.jsonc # Oxlint config — DO NOT create .eslintrc files
37+
├── .oxfmtrc.jsonc # Oxfmt formatter config
3638
├── vitest.config.ts # Vitest configuration
3739
├── nuxt.config.ts # Nuxt configuration
3840
├── tsconfig.json # TypeScript config
@@ -45,19 +47,26 @@ MIT-licensed, maintained by Ali Soueidan (@lazercaveman).
4547
yarn install # Install dependencies
4648
yarn dev # Start dev server
4749
yarn build # Production build
48-
yarn lint # Run ESLint
49-
yarn lint:fix # Run ESLint with auto-fix
50-
yarn test # Run Vitest
50+
yarn generate # Static site generation
51+
yarn preview # Preview production build
52+
yarn start # Start production server
53+
yarn type-check # Run vue-tsc type checking
54+
yarn lint # Run oxlint
55+
yarn lint:fix # Run oxlint with auto-fix
56+
yarn format # Format with oxfmt
57+
yarn format:check # Check formatting (used in CI/pre-push)
58+
yarn test # Run Vitest (watch mode)
5159
yarn test:ui # Run Vitest with browser UI
52-
yarn test:coverage # Run Vitest with v8 coverage
60+
yarn test:coverage # Run Vitest with v8 coverage (used in pre-push)
61+
yarn analyze # Bundle analysis via nuxi analyze
5362
yarn script:cleanup # Remove demo content (one-time, self-deleting)
5463
```
5564

56-
Run `yarn lint` and `yarn test` to verify changes before committing — Husky enforces this on pre-push.
65+
Run `yarn type-check`, `yarn lint`, and `yarn test:coverage` before pushing — Husky enforces all three on pre-push.
5766

5867
## Critical Rules
5968

60-
1. **ESLint v9 flat config only.** All lint config goes in `eslint.config.ts` as an array export. Never create `.eslintrc.*` files or use legacy config format.
69+
1. **Oxlint** All lint config goes in `.oxlintrc.jsonc`. All formatter config goes in `.oxfmtrc.jsonc`.
6170
2. **No `@apply` in SCSS.** Tailwind v4 + Sass have compatibility issues with `@apply`. Use SCSS only for things Tailwind can't do (complex animations, keyframes, third-party overrides). Use utility classes directly in templates for everything else.
6271
3. **`app/` directory structure.** Components, pages, composables, stores, and tests live under `app/`. Do not place them in the project root.
6372
4. **TypeScript strict.** All new code must be typed. No `any` unless explicitly justified with a comment.
@@ -73,6 +82,13 @@ Run `yarn lint` and `yarn test` to verify changes before committing — Husky en
7382
- Tailwind v4 config is CSS-based (not `tailwind.config.js`). Check existing CSS for theme customizations.
7483
- Never mix `@apply` with SCSS. If you need a reusable utility, create a Vue component instead.
7584

85+
## Formatting Conventions
86+
87+
- Oxfmt is the sole formatter — never use Prettier or Biome alongside it.
88+
- Config is in `.oxfmtrc.jsonc`: `printWidth: 100`, single quotes, semicolons, 2-space indent.
89+
- Run `yarn format` to format in place, `yarn format:check` to verify without writing (used in pre-push).
90+
- VS Code auto-formats on save via the `oxc.oxfmt` extension (`editor.defaultFormatter`).
91+
7692
## Testing Conventions
7793

7894
- Vitest config is in `vitest.config.ts` — check there for aliases and setup.
@@ -82,6 +98,19 @@ Run `yarn lint` and `yarn test` to verify changes before committing — Husky en
8298
## Gotchas
8399

84100
- `clean-project.js` deletes `.git/` — it's meant for first-time setup only. Never run it on an active project.
85-
- The Husky pre-push hook runs lint + tests. If either fails, the push is rejected.
101+
- The Husky pre-push hook runs: type-check (`vue-tsc`) → lint (oxlint) → format check (oxfmt) → `test:coverage`. If any step fails, the push is rejected.
86102
- `tsconfig.tsbuildinfo` is committed — don't delete it, TypeScript incremental builds depend on it.
87103
- Nuxt auto-imports Vue APIs and composables. Don't manually import `ref`, `computed`, `useRoute`, etc. unless the auto-import fails.
104+
105+
106+
## Boundaries
107+
108+
### Do not modify or index
109+
110+
`.nuxt/`, `.output/`, `dist/`, `coverage/`, `.yarn/`, `node_modules/`, `localcerts/`
111+
112+
### Do not propose
113+
114+
- Alternative frameworks, build tools, or package managers.
115+
- Removing or bypassing Husky hooks.
116+
- New dependencies unless there is a clear, justified need that existing tools (`@vueuse/core`, Pinia, etc.) cannot cover.

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![Screenshot](./app/assets/img/screenshot.png)
77

88
## 🥸 Why this template?
9-
Get ready to supercharge your development with this fully configured Nuxt 4 Starter Kit! Built on Vue 3 and powered by TypeScript and many other technologies (for more information see down-below or checkout package.json for even more), this setup comes preloaded with tools and libraries designed to enhance your workflow, streamline development, and maintain high-quality code. 🙌 No more wrestling with configurations—jump straight into building amazing projects!
9+
Get ready to supercharge your development with this fully configured Nuxt 4 Starter Kit! Built on Vue 3, AI ready (including configured CLAUDE.md), powered by TypeScript and many other technologies (for more information see down-below or checkout package.json for even more), this setup comes preloaded with tools and libraries designed to enhance your workflow, streamline development, and maintain high-quality code. 🙌 No more wrestling with configurations—jump straight into building amazing projects!
1010

1111
- **Clean up project in seconds:** Using the `yarn script:cleanup` command in your terminal, will clean up the project, remove demo contents - the Starter Kit is designed so that developers can start working immediately without having to spend time setting up basic structures and configurations.
1212
- **Up to date:** Using up to date dependencies and tools to ensure a smooth development experience. (at least I try ^^)
@@ -38,9 +38,13 @@ This starter kit is packed with carefully chosen dependencies to handle real-wor
3838
Why? Because it’s blazing fast. Vite ensures instant builds and on-demand compilation, making both development and production smoother and quicker.
3939
[learn more](https://vitejs.dev/).
4040

41-
### 🏗️ ESLint
42-
ESLint V9 with a "Flat Config setup" tailored for TypeScript and Vue 3 or Nuxt 4 - it is configured to use best practices integrating some plugins (eslint:recommended, typescript-eslint, and eslint-plugin-vue) - wanna change them!? just add some custom rules to meet your team's needs to ensure clean, maintainable, and standard-compliant code quality.
43-
[learn more](https://eslint.org/blog/2024/04/eslint-v9.0.0-released/).
41+
### 🏗️ Oxlint
42+
Blazing-fast Rust-based linter for JavaScript and TypeScript (including Vue `<script>` blocks), with 695+ built-in rules. Ships pre-configured in `.oxlintrc.json` with the `typescript` and `vue` plugins enabled — just add your own rules on top.
43+
[learn more](https://oxc.rs/docs/guide/usage/linter).
44+
45+
### 💎 Oxfmt
46+
High-performance code formatter from the OXC project, matching Prettier's output for JS, TS, Vue, CSS, JSON, YAML, and more. Configured in `.oxfmtrc.json`. Format-on-save is enabled out of the box via the VS Code extension (`oxc.oxfmt`).
47+
[learn more](https://oxc.rs/docs/guide/usage/formatter).
4448

4549
### 🧪 Vitest
4650
To test smarter and faster. Vitest is a lightweight, Jest-compatible testing framework that ensures code reliability and helps you catching bugs early.
@@ -66,6 +70,10 @@ To manage app state easily. Pinia is modern, simple, and works perfectly with Vu
6670
TypeScript enhances the JavaScript language by adding optional static typing and other features, for safer, smarter code - helping avoiding errors and catching bugs early in development.
6771
[learn more](https://www.typescriptlang.org/).
6872

73+
### 🤖 Claude Code
74+
This starter ships with a pre-configured `CLAUDE.md` file — the instruction file read by [Claude Code](https://claude.ai/code) (Anthropic's AI coding assistant). It documents the full project setup: tech stack, directory layout, commands, critical rules, and gotchas. Any Claude Code session in this repo will pick it up automatically, so the AI already knows the conventions, the correct tools (`oxlint`, `oxfmt`, Vitest, yarn), and what not to do — no manual briefing required.
75+
[learn more](https://docs.anthropic.com/en/docs/claude-code/memory).
76+
6977
## 🤝 Contributing
7078
Feel free to fork this project and submit pull requests — contributions are very welcome!
7179

app/assets/style/animations.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use "sass:math";
1+
@use 'sass:math';
22

33
// Mixin which can be used to generate keyframes for a background-gradient animation
44
@mixin animate-gradient-frames($name, $animationSteps) {
@@ -16,7 +16,6 @@
1616
}
1717
}
1818

19-
2019
// In this example we're generating 1000 frames for the background-gradient animation to be smooth, this cant be done in a convenient way using TailwindCSS
2120
@include animate-gradient-frames(thousandGeneratedFramesAnimation, 1000);
2221

@@ -35,4 +34,3 @@
3534
text-shadow: none;
3635
}
3736
}
38-

app/assets/style/tailwind.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
@import "tailwindcss";
1+
@import 'tailwindcss';
22
/*
33
// Tailwind 4 should not be used with SASS, therefor SASS definitions should not use @apply: https://tailwindcss.com/docs/compatibility#sass-less-and-stylus
44
// However SCSS can be use full in addition in some cases (or of course instead of tailwind if this is what you prefer)
55
*/
66

77
@theme {
88
/* You can overwrite exiting tailwind utility classes */
9-
--color-gray-900: hsla(235, 90%, 7%, .5);
9+
--color-gray-900: hsla(235, 90%, 7%, 0.5);
1010
/* Or add new ones */
1111
--color-nuxt-green: hsla(152, 100%, 43%, 1);
1212
--drop-shadow-2xl: 0 0 48px rgba(0, 0, 0, 1);
@@ -24,7 +24,7 @@
2424

2525
.state-update-animation {
2626
animation-name: stateUpdateAnimation;
27-
animation-duration: .4s;
27+
animation-duration: 0.4s;
2828
}
2929
}
3030

app/components/nuxt-starter/NuxtStarter.vue

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
2-
<div class="flex flex-col items-center drop-shadow-2xl w-3xl">
3-
<span class="text-8xl mb-8">🙌</span>
4-
<div class="flex justify-center items-end mb-6">
2+
<div class="flex w-3xl flex-col items-center drop-shadow-2xl">
3+
<span class="mb-8 text-8xl">🙌</span>
4+
<div class="mb-6 flex items-end justify-center">
55
<svg
66
width="256"
77
height="64"
@@ -30,13 +30,9 @@
3030
fill="white"
3131
/>
3232
</svg>
33-
<h1 class="text-white text-6xl font-bold leading-[0.75]">
34-
-Starter
35-
</h1>
33+
<h1 class="text-6xl leading-[0.75] font-bold text-white">-Starter</h1>
3634
</div>
37-
<p class="mb-6 max-w-xl text-center text-2xl text-white ">
38-
Get ready to supercharge your development with this fully configured Nuxt 4 Starter Kit!
39-
</p>
35+
<p class="mb-6 max-w-xl text-center text-2xl text-white">Get ready to supercharge your development with this fully configured Nuxt 4 Starter Kit!</p>
4036
<p :class="`mb-6 max-w-md text-center text-2xl text-white ${Store.stateUpdatedAnimation}`">
4137
{{ Store.sampleData }}
4238
</p>
@@ -46,7 +42,6 @@
4642
</div>
4743
</template>
4844

49-
5045
<script setup>
5146
import { useSampleStore } from '@/store/sample';
5247

0 commit comments

Comments
 (0)