Skip to content

Commit 1a9f20b

Browse files
Moved linter and formatter (#729)
1 parent 94151be commit 1a9f20b

50 files changed

Lines changed: 572 additions & 1488 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ jobs:
5151
- name: Lint
5252
run: pnpm lint
5353

54-
# Check formatting with Prettier
54+
# Check formatting with Oxfmt
5555
- name: Check formatting
56-
run: pnpm prettier
56+
run: pnpm fmt:check
5757

5858
# Check for type and other errors
5959
- name: Type and error check

.oxfmtrc.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"trailingComma": "es5",
3+
"semi": true,
4+
"singleQuote": true,
5+
"jsxSingleQuote": false,
6+
"tabWidth": 2,
7+
"printWidth": 80,
8+
"sortImports": {
9+
"customGroups": [
10+
{
11+
"groupName": "react",
12+
"elementNamePattern": [
13+
"react",
14+
"react-dom",
15+
"react-native",
16+
"next",
17+
"expo",
18+
"expo-*"
19+
]
20+
}
21+
],
22+
"groups": [
23+
"type-import",
24+
"react",
25+
["value-builtin", "value-external"],
26+
"type-internal",
27+
"value-internal",
28+
["type-parent", "type-sibling", "type-index"],
29+
["value-parent", "value-sibling", "value-index"],
30+
"unknown"
31+
],
32+
"newlinesBetween": false
33+
},
34+
"sortTailwindcss": {},
35+
"sortPackageJson": false,
36+
"ignorePatterns": [
37+
"pnpm-lock.yaml",
38+
"package-lock.json",
39+
"yarn.lock",
40+
"node_modules/",
41+
"dist/",
42+
"_site/",
43+
".astro/",
44+
".netlify/",
45+
".turbo/",
46+
"*.log",
47+
".DS_Store",
48+
".github/CODEOWNERS"
49+
]
50+
}

.oxlintrc.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["typescript", "react", "unicorn"],
4+
"jsPlugins": ["eslint-plugin-astro"],
5+
"env": {
6+
"builtin": true,
7+
"browser": true,
8+
"node": true,
9+
"es2024": true
10+
},
11+
"ignorePatterns": [
12+
"**/*.config.js",
13+
"**/*.config.cjs",
14+
"**/*.config.mjs",
15+
"eslint.config.mjs",
16+
"pnpm-lock.yaml",
17+
"**/*.d.ts",
18+
"dist/**",
19+
".astro/**",
20+
".netlify/**",
21+
".vercel/**",
22+
"_site/**",
23+
"node_modules/**",
24+
"scripts/**"
25+
],
26+
"rules": {
27+
"no-unused-vars": [
28+
"error",
29+
{
30+
"argsIgnorePattern": "^_",
31+
"varsIgnorePattern": "^_"
32+
}
33+
],
34+
"react/rules-of-hooks": "error",
35+
"react/exhaustive-deps": "warn",
36+
"typescript/explicit-function-return-type": "off",
37+
"typescript/no-explicit-any": "warn"
38+
},
39+
"overrides": [
40+
{
41+
"files": ["**/*.astro"],
42+
"env": {
43+
"astro": true,
44+
"browser": true,
45+
"node": true
46+
}
47+
},
48+
{
49+
"files": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
50+
"rules": {
51+
"no-var": "error",
52+
"prefer-const": "error",
53+
"prefer-rest-params": "error",
54+
"prefer-spread": "error"
55+
}
56+
}
57+
]
58+
}

.prettierignore

Lines changed: 0 additions & 25 deletions
This file was deleted.

.prettierrc.mjs

Lines changed: 0 additions & 38 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ All commands are run from the root of the project, from a terminal:
108108
| `pnpm preview` | Preview your build locally, before deploying |
109109
| `pnpm astro ...` | CLI commands like `astro add`, `astro check` |
110110
| `pnpm astro -- --help` | Get help using the Astro CLI |
111-
| `pnpm prettier-fix` | Format your code with Prettier |
112-
| `pnpm lint` | Lint your code with ESLint |
111+
| `pnpm fmt` | Format your code with Oxfmt |
112+
| `pnpm lint` | Lint your code with OXLint |
113113

114114
## 👀 Want to learn more about Astro?
115115

eslint.config.mjs

Lines changed: 0 additions & 98 deletions
This file was deleted.

knip.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const config: KnipConfig = {
1515
'@radix-ui/react-scroll-area',
1616
'framer-motion',
1717
'posthog-js',
18+
'eslint-plugin-astro',
19+
'globals',
1820
],
1921

2022
// Icon and UI components re-export named + default — this is intentional

netlify.toml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
[build]
2-
command = "pnpm run build"
3-
publish = "dist"
2+
command = "pnpm run build"
3+
publish = "dist"
44

55
[build.environment]
6-
NODE_VERSION = "24"
6+
NODE_VERSION = "24"
77

88
[build.processing.html]
9-
pretty_urls = false
9+
pretty_urls = false
1010

1111
# Cache static assets for 1 year
1212
[[headers]]
13-
for = "/_astro/*"
14-
[headers.values]
15-
Cache-Control = "public, max-age=31536000, immutable"
13+
for = "/_astro/*"
14+
[headers.values]
15+
Cache-Control = "public, max-age=31536000, immutable"
1616

1717
[[headers]]
18-
for = "/*.png"
19-
[headers.values]
20-
Cache-Control = "public, max-age=31536000, immutable"
18+
for = "/*.png"
19+
[headers.values]
20+
Cache-Control = "public, max-age=31536000, immutable"
2121

2222
[[headers]]
23-
for = "/*.svg"
24-
[headers.values]
25-
Cache-Control = "public, max-age=31536000, immutable"
23+
for = "/*.svg"
24+
[headers.values]
25+
Cache-Control = "public, max-age=31536000, immutable"
2626

2727
[[headers]]
28-
for = "/*.woff2"
29-
[headers.values]
30-
Cache-Control = "public, max-age=31536000, immutable"
28+
for = "/*.woff2"
29+
[headers.values]
30+
Cache-Control = "public, max-age=31536000, immutable"

package.json

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"preview": "astro preview",
1515
"astro": "astro",
1616
"sync": "astro sync",
17-
"lint": "eslint .",
18-
"lint-fix": "eslint --fix .",
19-
"prettier": "prettier --check .",
20-
"prettier-fix": "prettier --write .",
17+
"lint": "oxlint",
18+
"lint:fix": "oxlint --fix",
19+
"fmt": "oxfmt",
20+
"fmt:check": "oxfmt --check",
2121
"check-links": "node scripts/check-tool-links.mjs",
2222
"depcheck": "knip",
2323
"test": "vitest run"
@@ -56,27 +56,18 @@
5656
"tw-animate-css": "^1.3.0"
5757
},
5858
"devDependencies": {
59-
"@eslint/js": "^10.0.1",
60-
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
6159
"@tailwindcss/typography": "^0.5.19",
6260
"@tailwindcss/vite": "^4.2.2",
6361
"@types/react": "^19.2.14",
6462
"@types/react-dom": "^19.2.0",
65-
"eslint": "^10.1.0",
66-
"eslint-config-prettier": "^10.1.0",
6763
"eslint-plugin-astro": "^1.6.0",
68-
"eslint-plugin-jsx-a11y": "^6.10.2",
69-
"eslint-plugin-react": "^7.37.5",
70-
"eslint-plugin-react-hooks": "^7.0.0",
7164
"globals": "^17.4.0",
7265
"knip": "^6.0.1",
7366
"open-graph-scraper": "^6.11.0",
74-
"prettier": "^3.8.1",
75-
"prettier-plugin-astro": "^0.14.1",
76-
"prettier-plugin-tailwindcss": "^0.7.0",
67+
"oxfmt": "^0.43.0",
68+
"oxlint": "^1.58.0",
7769
"tailwindcss": "^4.2.2",
7870
"typescript": "5.9.3",
79-
"typescript-eslint": "^8.57.1",
8071
"vitest": "^4.1.0"
8172
}
8273
}

0 commit comments

Comments
 (0)