Skip to content
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

upgrade eslint to v9 #1925

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

52 changes: 0 additions & 52 deletions .eslintrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions electron/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ const { appendLoading, removeLoading } = useLoading()
domReady().then(appendLoading)

window.onmessage = ev => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
ev.data.payload === 'removeLoading' && removeLoading()
}

Expand Down
2 changes: 1 addition & 1 deletion electron/utils/overwriteWitnetNodeConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const defaultConfig = {

// Replace witnet nodes urls in witnet configuration file
export function overwriteWitnetNodeConfiguration(
force: Boolean = false,
force: boolean = false,
config: NodeConfig = defaultConfig,
) {
const {
Expand Down
1 change: 0 additions & 1 deletion electron/walletManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export default async function sleep(t: number) {
}

interface GithubReleaseAsset {
// eslint-disable-next-line camelcase
browser_download_url: string
}

Expand Down
74 changes: 74 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import path from 'path'

import pluginVue from 'eslint-plugin-vue'
import vueTsEslintConfig from '@vue/eslint-config-typescript'
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
import eslintPluginImport from 'eslint-plugin-import'

export default [
{
name: 'app/files-to-lint',
files: ['**/*.{js,cjs,mjs,ts,mts,vue}'],
},
{
name: 'app/files-to-ignore',
ignores: [
'**/.witnet-rust-testnet-*-wallet',
'**/auto-imports.d.ts',
'**/build/**',
'**/coverage/**',
'**/dist-electron/',
'**/dist-ssr/**',
'**/dist/**',
'**/src/components.d.ts',
'**/src/locales/**',
'/dist_electron/',
],
},
...pluginVue.configs['flat/essential'],
...vueTsEslintConfig(),
skipFormatting,
{
plugins: {
import: eslintPluginImport,
},
rules: {
// Override import/extensions rule
'import/extensions': [
'error',
{
vue: 'always',
js: 'ignorePackages',
scss: 'always',
svg: 'always',
},
],
// Disable specific Vue rules
'vue/multi-word-component-names': 'off',
'vue/no-reserved-component-names': 'off',
'vue/require-explicit-emits': 'off',
'vue/block-lang': 'off',
// TODO: remove this rule
'@typescript-eslint/no-explicit-any': 'off',
'import/extensions': 'off',
},
settings: {
'import/resolver': {
alias: {
map: [['@', path.resolve('src')]],
extensions: ['.vue', '.js', '.ts', '.d.ts'],
},
},
'vue-i18n': {
localeDir: path.resolve('src', 'locales') + '/*.{json}',
messageSyntaxVersion: '^9.0.0',
},
},
},
{
files: ['**/*.cjs'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
]
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"electron:serve:wallet": "vue-cli-service electron:serve --wallet",
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|ts|vue)' --locales './src/locales/**/*.json'",
"lint:check": "pnpm lint:check:eslint && pnpm lint:check:prettier",
"lint:check:eslint": "pnpm lint:eslint --ext .js,.ts,.vue .",
"lint:check:eslint": "pnpm lint:eslint",
"lint:check:prettier": "pnpm lint:prettier --check \"**/*.{ts,js,json,css,scss,vue,html}\"",
"lint:eslint": "eslint",
"lint:fix:eslint": "pnpm lint:eslint --fix --ext .js,.ts,.vue .",
"lint:fix:eslint": "pnpm lint:eslint --fix",
"lint:fix:prettier": "pnpm lint:prettier --write \"**/*.{ts,js,json,css,scss,vue,html}\"",
"lint:prettier": "prettier --loglevel warn",
"postinstall": "electron-builder install-app-deps",
Expand Down Expand Up @@ -59,8 +59,8 @@
"@types/node": "^20.12.3",
"@typescript-eslint/parser": "^8.8.1",
"@vitejs/plugin-vue": "^5.1.4",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/eslint-config-prettier": "^10.0.0",
"@vue/eslint-config-typescript": "^14.0.0",
"@vue/test-utils": "^2.4.5",
"@vueuse/core": "^11.1.0",
"autoprefixer": "^10.4.19",
Expand All @@ -74,7 +74,7 @@
"electron-log": "^5.2.0",
"electron-updater": "^6.3.9",
"element-plus": "^2.7.3",
"eslint": "^8.57.0",
"eslint": "^9.12.0",
"eslint-import-resolver-alias": "1.1.2",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-node": "11.1.0",
Expand Down
Loading
Loading