-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(lint): migrate from ESLint + Prettier to oxlint + oxfmt #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "$schema": "./node_modules/oxfmt/configuration_schema.json", | ||
| "sortImports": {}, | ||
| "sortTailwindcss": {}, | ||
| "trailingComma": "es5", | ||
| "tabWidth": 2, | ||
| "semi": false, | ||
| "singleQuote": true, | ||
| "printWidth": 80, | ||
| "sortPackageJson": false, | ||
| "ignorePatterns": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json", | ||
| "plugins": ["react", "typescript", "nextjs", "import", "jsx-a11y"], | ||
| "categories": { | ||
| "correctness": "error", | ||
| "suspicious": "warn", | ||
| "pedantic": "off", | ||
| "style": "off", | ||
| "perf": "warn" | ||
| }, | ||
| "rules": { | ||
| "@typescript-eslint/no-explicit-any": "off", | ||
| "@typescript-eslint/no-unused-vars": "warn", | ||
| "@typescript-eslint/no-non-null-assertion": "off", | ||
| "react/react-in-jsx-scope": "off", | ||
| "react/no-unescaped-entities": "off", | ||
| "react-hooks/exhaustive-deps": "off", | ||
| "@next/next/no-img-element": "off", | ||
| "@next/next/no-html-link-for-pages": "off", | ||
| "prefer-template": "warn", | ||
| "no-useless-escape": "warn", | ||
| "import/no-unassigned-import": "off", | ||
| "import/no-named-as-default": "off", | ||
| "import/no-named-as-default-member": "off", | ||
| "no-shadow": "off", | ||
| "react/no-array-index-key": "off", | ||
| "jsx-a11y/no-static-element-interactions": "off", | ||
| "jsx-a11y/click-events-have-key-events": "off", | ||
| "no-await-in-loop": "off" | ||
| }, | ||
| "settings": { | ||
| "react": { "version": "19.0.0" }, | ||
| "next": { "rootDir": "./" } | ||
| }, | ||
| "ignorePatterns": [ | ||
| "tailwind.config.js", | ||
| "src/gql/**/*.ts", | ||
| "src/**/*.mdx", | ||
| "src/types.g.ts", | ||
| "src/schema/generated.tsx", | ||
| "node_modules", | ||
| ".next", | ||
| "coverage", | ||
| "build", | ||
| "dist" | ||
| ] | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,9 +15,9 @@ | |
| pre-commit: | ||
| parallel: true | ||
| commands: | ||
| eslint: | ||
| oxlint: | ||
| glob: "*.{js,ts,jsx,tsx}" | ||
| run: npm run lint -- --fix {staged_files} | ||
| run: pnpm run lint:fix {staged_files} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current command run: pnpm oxlint --fix {staged_files} |
||
| # rubocop: | ||
| # tags: backend style | ||
| # glob: "*.rb" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,9 +7,10 @@ | |
| "dev": "next dev --turbo --port 3101", | ||
| "build": "npm run codegen && next build --turbo", | ||
| "start": "next start -p $PORT", | ||
| "lint": "eslint src/", | ||
| "lint:fix": "eslint --fix src/", | ||
| "format": "prettier --write src/", | ||
| "lint": "oxlint src/", | ||
| "lint:fix": "oxlint --fix src/", | ||
| "format": "oxfmt src/", | ||
| "format:check": "oxfmt --check src/", | ||
| "test": "jest", | ||
| "test:update": "npm test -- --updateSnapshot", | ||
| "coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls", | ||
|
|
@@ -57,19 +58,16 @@ | |
| "autoprefixer": "^10.4.27", | ||
| "coveralls": "^3.1.1", | ||
| "cross-fetch": "^4.1.0", | ||
| "eslint": "^10.1.0", | ||
| "eslint-config-next": "^16.2.1", | ||
| "graphql": "^16.13.1", | ||
| "graphql-tag": "^2.12.6", | ||
| "jest": "^30.3.0", | ||
| "jest-environment-jsdom": "^30.3.0", | ||
| "lefthook": "^2.1.4", | ||
| "lint-staged": "^16.4.0", | ||
| "oxfmt": "^0.41.0", | ||
| "oxlint": "^1.56.0", | ||
| "postcss": "^8.5.8", | ||
| "postcss-simple-vars": "^7.0.1", | ||
| "prettier": "^3.8.1", | ||
| "prettier-plugin-organize-imports": "^4.3.0", | ||
| "prettier-plugin-tailwindcss": "^0.7.2", | ||
| "redux-mock-store": "^1.5.5", | ||
| "ts-jest": "^29.4.6", | ||
| "tw-animate-css": "^1.4.0", | ||
|
|
@@ -193,12 +191,12 @@ | |
| }, | ||
| "lint-staged": { | ||
| "*.{js,ts,tsx}": [ | ||
| "eslint --fix", | ||
| "prettier --write", | ||
| "oxlint --fix", | ||
| "oxfmt", | ||
| "git add" | ||
| ], | ||
| "*.{css,md,json}": [ | ||
| "prettier --write", | ||
| "oxfmt", | ||
| "git add" | ||
| ] | ||
| }, | ||
|
Comment on lines
192
to
202
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling important linting rules like
react-hooks/exhaustive-depsand accessibility rules (jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events) can introduce subtle bugs and accessibility issues. While these might have been disabled before, this migration is a good opportunity to enable them (at least as warnings) and address the violations. This would significantly improve the application's correctness and accessibility. For cases where a rule is too noisy, you can disable it for a specific line with an explanatory comment.