Skip to content

Commit c0cdd82

Browse files
committed
chore: oxlint oxfmt
1 parent d0f7929 commit c0cdd82

File tree

21 files changed

+631
-309
lines changed

21 files changed

+631
-309
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ jobs:
7474
- name: Run lint
7575
run: yarn lint
7676

77-
- name: Run prettier
78-
run: yarn prettier:check
77+
- name: Run formatter
78+
run: yarn format
7979

8080
unit_tests:
8181
name: 'unit tests'

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
. "$(dirname -- "$0")/_/husky.sh"
33

44
yarn lint
5-
yarn prettier:check
5+
yarn format

.oxfmtrc.jsonc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"semi": true,
4+
"trailingComma": "all",
5+
"singleQuote": true,
6+
"printWidth": 120,
7+
"tabWidth": 2
8+
}

.oxlintrc.jsonc

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": [
4+
"eslint",
5+
"typescript",
6+
"unicorn",
7+
"oxc",
8+
"react",
9+
"jsx-a11y",
10+
"import",
11+
"promise",
12+
"jest",
13+
"vitest"
14+
],
15+
"settings": {
16+
"react": {
17+
"version": "detect"
18+
}
19+
},
20+
"env": {
21+
"browser": true
22+
},
23+
"ignorePatterns": [
24+
"**/.next/**",
25+
"**/node_modules/**",
26+
"**/dist/**",
27+
"**/storybook-static/**",
28+
"**/*.mdx",
29+
"website"
30+
],
31+
"categories": {
32+
"correctness": "error",
33+
"suspicious": "warn",
34+
"style": "off",
35+
"pedantic": "off"
36+
},
37+
"rules": {
38+
"typescript/no-unused-vars": "error",
39+
"typescript/no-explicit-any": "warn",
40+
"react/display-name": "off"
41+
},
42+
"overrides": [
43+
{
44+
"files": [
45+
"packages/design-system/**/*.{ts,tsx,js,jsx}"
46+
],
47+
"rules": {
48+
"import/export": "off"
49+
}
50+
},
51+
{
52+
"files": [
53+
"**/*.{spec,test}.{ts,tsx,js,jsx}"
54+
],
55+
"env": {
56+
"jest": true
57+
}
58+
},
59+
{
60+
"files": [
61+
"docs/**/*.stories.tsx"
62+
],
63+
"rules": {
64+
"react-hooks/rules-of-hooks": "off",
65+
"import/no-default-export": "off",
66+
"no-console": "off",
67+
"no-restricted-syntax": [
68+
"error",
69+
{
70+
"selector": "ImportDeclaration[source.value='react'][specifiers.0.type='ImportDefaultSpecifier']",
71+
"message": "Default React import not allowed"
72+
}
73+
]
74+
}
75+
}
76+
]
77+
}

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"eslint.workingDirectories": [{ "mode": "auto" }]
2+
"eslint.workingDirectories": [{ "mode": "auto" }],
3+
"oxc.fmt.experimental": true,
4+
"editor.defaultFormatter": "oxc.oxc-vscode"
35
}

.yarn/releases/yarn-3.5.0.cjs renamed to .yarn/releases/yarn-3.6.4.cjs

Lines changed: 278 additions & 277 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ enableImmutableInstalls: false
66

77
nodeLinker: node-modules
88

9+
cacheFolder: .yarn/cache
10+
11+
enableGlobalCache: false
12+
913
plugins:
1014
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
1115
spec: '@yarnpkg/plugin-interactive-tools'
1216

1317
preferInteractive: true
1418

15-
yarnPath: .yarn/releases/yarn-3.5.0.cjs
19+
yarnPath: .yarn/releases/yarn-3.6.4.cjs

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ if we're already in pre-release mode, this is fine and you should continue.
152152
- `yarn clean` Clean the project (remove dist & node_modules).
153153
- `yarn build` Build the project.
154154
- `yarn lint` Check the codebase for lint errors.
155-
- `yarn format` Automatically fix lint errors.
156-
- `yarn prettier:check` Check the codebase for pretty-ness.
157-
- `yarn prettier:write` Fix any prettier issues.
155+
- `yarn format` Automatically format.
158156
- `yarn test:ts`: Run the TypeScript tests.
159157
- `yarn test:unit` Run the design system tests.
160158

docs/.oxfmtrc.jsonc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "../node_modules/oxfmt/configuration_schema.json",
3+
"semi": true,
4+
"trailingComma": "all",
5+
"singleQuote": true,
6+
"printWidth": 120,
7+
"tabWidth": 2,
8+
"proseWrap": "always"
9+
}

docs/.storybook/preview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const useLocalStorageDarkMode = () => {
8383
export const useSafeDarkMode = () => {
8484
try {
8585
return useDarkMode();
86+
// oxlint-disable-next-line no-unused-vars
8687
} catch (error) {
8788
return useLocalStorageDarkMode();
8889
}

0 commit comments

Comments
 (0)