Skip to content

Commit

Permalink
Remove ESLint configuration files and update package-lock.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Duckiduc committed Oct 21, 2024
1 parent aad2607 commit 4c3aa5b
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 75 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

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

This file was deleted.

65 changes: 65 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
const tsParser = require('@typescript-eslint/parser')
const tsPlugin = require('@typescript-eslint/eslint-plugin')
const reactPlugin = require('eslint-plugin-react')
const prettierPlugin = require('eslint-plugin-prettier')

module.exports = [
{
files: ['src/**/*.{js,ts,jsx,tsx}'],
ignores: ['node_modules/**', 'dist/**', 'out/**', 'build/**'],
languageOptions: {
sourceType: 'module', // `ecmaVersion` is no longer necessary
globals: {
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
console: 'readonly',
module: 'readonly',
require: 'readonly',
process: 'readonly',
__dirname: 'readonly',
Buffer: 'readonly',
setImmediate: 'readonly',
clearImmediate: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly'
},
parser: tsParser
},
plugins: {
'@typescript-eslint': tsPlugin,
react: reactPlugin,
prettier: prettierPlugin
},
rules: {
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-var-requires': 'off',
'prettier/prettier': 'error' // Prettier formatting rule
},
linterOptions: {
reportUnusedDisableDirectives: true
}
},
{
files: ['*.js'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off'
}
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser
},
rules: {
// TypeScript-specific rules can be added here if needed
}
}
]
39 changes: 16 additions & 23 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"homepage": "",
"scripts": {
"format": "prettier --write .",
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
"lint": "eslint src --fix",
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",
"typecheck": "npm run typecheck:node && npm run typecheck:web",
Expand All @@ -28,9 +28,9 @@
"devDependencies": {
"@electron-toolkit/tsconfig": "^1.0.1",
"@electron/notarize": "^2.4.0",
"@types/node": "^20.14.2",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.19",
"@types/node": "^22.7.5",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^8.9.0",
"@typescript-eslint/parser": "^8.9.0",
"@vitejs/plugin-react": "^4.2.1",
Expand All @@ -48,4 +48,4 @@
"vite": "^5.4.9",
"vite-plugin-static-copy": "^2.0.0"
}
}
}

0 comments on commit 4c3aa5b

Please sign in to comment.