mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
chore: replace eslint and prettier with oxlint and oxfmt
Migrate from ESLint/Prettier to oxlint/oxfmt for 50-100x faster linting and 35x faster formatting.
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ['react-app'],
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'warn'
|
||||
},
|
||||
ignorePatterns: ['android/**', 'build/**', 'node_modules/**', 'public/**', 'electron/**']
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"printWidth": 170,
|
||||
"bracketSpacing": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "all",
|
||||
"jsxSingleQuote": true,
|
||||
"arrowParens": "always",
|
||||
"useTabs": false,
|
||||
"ignorePatterns": []
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"rules": {
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "warn"
|
||||
},
|
||||
"ignore": [
|
||||
"android/**",
|
||||
"build/**",
|
||||
"node_modules/**",
|
||||
"public/**",
|
||||
"electron/**"
|
||||
]
|
||||
}
|
||||
|
||||
+5
-11
@@ -33,7 +33,6 @@
|
||||
"json-stringify-pretty-compact": "4.0.0",
|
||||
"lodash": "4.17.21",
|
||||
"memoizee": "0.4.15",
|
||||
"prettier": "3.0.3",
|
||||
"react": "19.1.2",
|
||||
"react-dom": "19.1.2",
|
||||
"react-i18next": "13.2.2",
|
||||
@@ -72,7 +71,8 @@
|
||||
"electron:before:download-ipfs": "node electron/download-ipfs",
|
||||
"electron:before:delete-data": "rimraf .plebbit",
|
||||
"android:build:icons": "cordova-res android --skip-config --copy --resources /tmp/plebbit-react-android-icons --icon-source ./android/icons/icon.png --splash-source ./android/icons/splash.png --icon-foreground-source ./android/icons/icon-foreground.png --icon-background-source '#ffffee'",
|
||||
"prettier": "prettier {src,electron}/**/*.{js,ts,tsx} --write",
|
||||
"lint": "oxlint --react-plugin {src,electron}/**/*.{js,ts,tsx}",
|
||||
"prettier": "oxfmt {src,electron}/**/*.{js,ts,tsx}",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
||||
"android:build": "yarn build && npx cap sync android && npx cap run android",
|
||||
"i18n:update": "node scripts/update-translations.js",
|
||||
@@ -99,8 +99,6 @@
|
||||
"@electron/rebuild": "4.0.0",
|
||||
"@react-scan/vite-plugin-react-scan": "0.1.8",
|
||||
"@types/memoizee": "0.4.9",
|
||||
"@typescript-eslint/eslint-plugin": "8.29.0",
|
||||
"@typescript-eslint/parser": "8.29.0",
|
||||
"@vitejs/plugin-react": "4.3.4",
|
||||
"assert": "2.1.0",
|
||||
"babel-plugin-react-compiler": "1.0.0",
|
||||
@@ -114,20 +112,16 @@
|
||||
"decompress": "4.2.1",
|
||||
"electron": "36.9.5",
|
||||
"electron-builder": "24.13.2",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-config-react-app": "7.0.1",
|
||||
"eslint-plugin-react": "7.37.4",
|
||||
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
||||
"eslint-plugin-react-hooks": "5.2.0",
|
||||
"husky": "4.3.8",
|
||||
"isomorphic-fetch": "3.0.0",
|
||||
"jsdom": "27.3.0",
|
||||
"lint-staged": "12.3.8",
|
||||
"oxfmt": "^0.20.0",
|
||||
"oxlint": "^1.35.0",
|
||||
"progress": "2.0.3",
|
||||
"react-scan": "0.4.3",
|
||||
"stream-browserify": "3.0.0",
|
||||
"vite": "6.4.1",
|
||||
"vite-plugin-eslint": "1.8.1",
|
||||
"vite-plugin-node-polyfills": "0.23.0",
|
||||
"vite-plugin-pwa": "0.21.1",
|
||||
"vitest": "4.0.15",
|
||||
@@ -177,7 +171,7 @@
|
||||
},
|
||||
"lint-staged": {
|
||||
"{src,electron}/**/*.{js,ts,tsx}": [
|
||||
"prettier --write"
|
||||
"oxfmt --write"
|
||||
]
|
||||
},
|
||||
"husky": {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
module.exports = {
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
printWidth: 170,
|
||||
bracketSpacing: true,
|
||||
tabWidth: 2,
|
||||
trailingComma: 'all',
|
||||
jsxSingleQuote: true,
|
||||
arrowParens: 'always',
|
||||
useTabs: false,
|
||||
}
|
||||
@@ -2,7 +2,6 @@ import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { resolve } from 'path';
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
import eslint from 'vite-plugin-eslint';
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
import reactScan from '@react-scan/vite-plugin-react-scan';
|
||||
|
||||
@@ -25,14 +24,6 @@ export default defineConfig({
|
||||
showToolbar: true,
|
||||
playSound: true,
|
||||
}),
|
||||
!isProduction && eslint({
|
||||
lintOnStart: true,
|
||||
overrideConfigFile: './.eslintrc.cjs',
|
||||
failOnError: false,
|
||||
failOnWarning: false,
|
||||
cache: true,
|
||||
include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.js', 'src/**/*.jsx'],
|
||||
}),
|
||||
nodePolyfills({
|
||||
globals: {
|
||||
Buffer: true,
|
||||
|
||||
Reference in New Issue
Block a user