Skip to content

Commit

Permalink
chore: add oxlint plugin (#2532)
Browse files Browse the repository at this point in the history
<!--
☝️ PR title should follow conventional commits
(https://conventionalcommits.org).
In particular, the title should start with one of the following types:

- docs: 📖 Documentation (updates to the documentation or readme)
- fix: 🐞 Bug fix (a non-breaking change that fixes an issue)
- feat: ✨ New feature/enhancement (a non-breaking change that adds
functionality or improves existing one)
- feat!/fix!: ⚠️ Breaking change (fix or feature that would cause
existing functionality to change)
- chore: 🧹 Chore (updates to the build process or auxiliary tools and
libraries)
-->

### 🔗 Linked issue

<!-- If it resolves an open issue, please link the issue here. For
example "Resolves #123" -->

### 📚 Description

Doesn't support super many rules yet, but is amazingly fast (and easier
to config). We can investigate to remove eslint once typescript, vue and
graphql rules are supported. Refs
oxc-project/oxc#481

<!-- Describe your changes in detail -->
<!-- Why is this change required? What problem does it solve? -->
  • Loading branch information
tobiasdiez authored Oct 2, 2024

Verified

This commit was signed with the committer’s verified signature.
mattgodbolt Matt Godbolt
1 parent 8d5c485 commit 5e645fc
Showing 5 changed files with 101 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ module.exports = {
'plugin:nuxt/recommended',
// Turns off all rules that are unnecessary or might conflict with Prettier (needs to be last)
'prettier',
// Disable rules covered by oxlint
'plugin:oxlint/recommended',
],
plugins: ['unused-imports'],
rules: {
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
"journaltitle",
"Nuxt",
"nuxtjs",
"oxlint",
"scimago",
"transpiled",
"tsyringe",
2 changes: 1 addition & 1 deletion middleware/authenticated.global.ts
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
) {
return redirectToLogin()
}
} catch (error) {
} catch {
return redirectToLogin()
}
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -30,7 +30,8 @@
"graphql:generate:watch": "graphql-codegen-esm --watch",
"graphql:validate": "graphql-inspector validate --apollo '{pages,components}/**/*.vue' 'server/**/*.graphql'",
"docker:redis": "docker run -d --rm --name JabRefRedis -p 6380:6379 redis --requirepass jabref",
"lint": "pnpm lint:eslint && pnpm lint:prettier",
"lint": "pnpm lint:oxlint && pnpm lint:eslint && pnpm lint:prettier",
"lint:oxlint": "oxlint",
"lint:eslint": "eslint --ext .ts,.js,.vue,.graphql --ignore-path .gitignore --report-unused-disable-directives .",
"lint:prettier": "prettier --check .",
"postinstall": "nuxi prepare && pnpm generate",
@@ -133,6 +134,7 @@
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-nuxt": "4.0.0",
"eslint-plugin-oxlint": "^0.9.9",
"eslint-plugin-unused-imports": "3.2.0",
"eslint-plugin-vitest": "0.5.4",
"eslint-plugin-vue": "9.27.0",
@@ -143,6 +145,7 @@
"nuxt": "3.12.4",
"nuxt-graphql-server": "3.1.4",
"nuxt-icon": "0.6.10",
"oxlint": "^0.9.9",
"postinstall-postinstall": "2.1.0",
"prettier": "3.3.3",
"prettier-plugin-organize-imports": "4.1.0",
93 changes: 93 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5e645fc

Please sign in to comment.