Skip to content

Commit

Permalink
eslint9
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Aug 2, 2024
1 parent 6f643af commit c87c19e
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 341 deletions.
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

117 changes: 0 additions & 117 deletions .eslintrc.js

This file was deleted.

153 changes: 153 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import { fixupConfigRules } from '@eslint/compat'
import globals from 'globals'
import tsParser from '@typescript-eslint/parser'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'

const __filename = fileURLToPath(import.meta.url)

Check failure on line 9 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / Test and typecheck on node 20.x and ubuntu-latest

'__filename' is already defined as a built-in global variable
const __dirname = path.dirname(__filename)

Check failure on line 10 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / Test and typecheck on node 20.x and ubuntu-latest

'__dirname' is already defined as a built-in global variable
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

export default [
{
ignores: [
'**/coverage',
'**/node_modules/',
'**/dist/',
'**/bundle/',
'**/.eslintrc.js',
'lib/output-version.js',
],
},
...fixupConfigRules(
compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:unicorn/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
),
),
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: 'commonjs',

parserOptions: {
ecmaFeatures: {
jsx: true,
},

project: './tsconfig.json',
},
},

settings: {
react: {
version: 'detect',
},
},

rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'no-unexpected-multiline': 'error',
'unicorn/no-new-array': 'off',
'unicorn/prefer-type-error': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/no-unreadable-array-destructuring': 'off',
'unicorn/no-abusive-eslint-disable': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/number-literal-case': 'off',
'unicorn/prefer-add-event-listener': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-lonely-if': 'off',
'unicorn/consistent-destructuring': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-optional-catch-binding': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/no-null': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/filename-case': 'off',
'unicorn/catch-error-name': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-code-point': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/prefer-spread': 'off',
'unicorn/explicit-length-check': 'off',
'unicorn/prefer-regexp-test': 'off',
'unicorn/relative-url-style': 'off',
'unicorn/prefer-math-trunc': 'off',
'unicorn/prefer-query-selector': 'off',
'unicorn/switch-case-braces': 'off',
'unicorn/prefer-switch': 'off',
'unicorn/better-regex': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/escape-case': 'off',
'unicorn/prefer-number-properties': 'off',
curly: 'error',
'no-use-before-define': 'off',
'no-global-assign': 'warn',

'no-console': [
'warn',
{
allow: ['error', 'warn'],
},
],

'no-debugger': 'warn',
'no-undef': 'error',
'react/no-danger': 'warn',
'react/prop-types': 'off',
'react/destructuring-assignment': 'error',
'react/no-unused-prop-types': 'error',
'react/no-unused-state': 'error',
'react/prefer-stateless-function': 'error',

'spaced-comment': [
'error',
'always',
{
markers: ['/'],
},
],
},
},
]
1 change: 0 additions & 1 deletion lib/src/launchInterProScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ async function wait({
}) {
const url = `${base}/iprscan5/status/${jobId}`
try {
// eslint-disable-next-line no-constant-condition
while (true) {
for (let i = 0; i < 10; i++) {
await timeout(1000)
Expand Down
16 changes: 10 additions & 6 deletions lib/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -859,17 +859,21 @@ function stateModelFactory() {
* #action
*/
zoomIn() {
self.colWidth = Math.ceil(self.colWidth * 1.5)
self.rowHeight = Math.ceil(self.rowHeight * 1.5)
self.scrollX = clamp(self.maxScrollX, self.scrollX, 0)
transaction(() => {
self.colWidth = Math.ceil(self.colWidth * 1.5)
self.rowHeight = Math.ceil(self.rowHeight * 1.5)
self.scrollX = clamp(self.maxScrollX, self.scrollX, 0)
})
},
/**
* #action
*/
zoomOut() {
self.colWidth = Math.max(1, Math.floor(self.colWidth * 0.75))
self.rowHeight = Math.max(1.5, Math.floor(self.rowHeight * 0.75))
self.scrollX = clamp(self.maxScrollX, self.scrollX, 0)
transaction(() => {
self.colWidth = Math.max(1, Math.floor(self.colWidth * 0.75))
self.rowHeight = Math.max(1.5, Math.floor(self.rowHeight * 0.75))
self.scrollX = clamp(self.maxScrollX, self.scrollX, 0)
})
},
/**
* #action
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
"app"
],
"scripts": {
"lint": "eslint --report-unused-disable-directives --max-warnings 0 --ext .js,.ts,.jsx,.tsx ."
"lint": "eslint --report-unused-disable-directives --max-warnings 0 ."
},
"devDependencies": {
"@emotion/react": "^11.13.0",
"@eslint/compat": "^1.1.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@jbrowse/core": "^2.13.1",
"@mui/icons-material": "^5.16.6",
"@mui/material": "^5.16.6",
Expand All @@ -29,13 +32,13 @@
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@vitejs/plugin-react": "^4.0.0",
"eslint": "^8.39.0",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unicorn": "^55.0.0",
"globals": "^15.9.0",
"mobx": "^6.13.1",
"mobx-react": "^9.1.1",
"mobx-state-tree": "^5.0.1",
Expand Down
Loading

0 comments on commit c87c19e

Please sign in to comment.