Skip to content
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
94 changes: 0 additions & 94 deletions .eslintrc.cjs

This file was deleted.

80 changes: 80 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import js from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import { defineConfig } from 'eslint/config';
import { importX, createNodeResolver } from 'eslint-plugin-import-x';
import lodash from 'eslint-plugin-lodash';
import reactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default defineConfig(
{ ignores: [ 'build/', 'dist/', 'out/', 'docs/', 'node_modules/' ] },

js.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.stylistic,

// Per-process globals. typescript-eslint turns `no-undef` off for TypeScript, so today these
// only bind for the two JavaScript config files; the blocks keep the process boundaries explicit.
{ files: [ 'src/main/**' ], languageOptions: { globals: globals.node } },
{ files: [ 'src/preload/**', 'src/preload-proofs/**' ], languageOptions: { globals: { ...globals.node, ...globals.browser } } },
{ files: [ 'src/app/**', 'src/index.tsx', 'src/registerServiceWorker.ts' ], languageOptions: { globals: globals.browser } },
{ files: [ 'src/**/*.test.{ts,tsx}', 'src/test/**' ], languageOptions: { globals: { ...globals.node, ...globals.browser } } },
{ files: [ 'electron.vite.config.js', 'vitest.config.mjs', 'eslint.config.js' ], languageOptions: { globals: globals.node } },

// The repo's own style, on every linted file.
{
plugins: { '@stylistic': stylistic, 'import-x': importX, lodash },
settings: {
// Without the TypeScript extensions `import-x/no-cycle` resolves nothing and passes silently.
...importX.flatConfigs.typescript.settings,
'import-x/resolver-next': [ createNodeResolver( { extensions: [ '.ts', '.tsx', '.js', '.mjs', '.json' ] } ) ],
},
rules: {
'lodash/import-scope': 'error',
'import-x/no-cycle': 'error',
'import-x/first': 'error',
'prefer-destructuring': [ 'error', { object: true, array: false } ],
'no-warning-comments': [ 'error', { terms: [ 'shortcut:' ], location: 'anywhere' } ],
eqeqeq: [ 'error', 'smart' ],
'array-callback-return': 'error',
'no-throw-literal': 'error',
'no-self-compare': 'error',
'no-template-curly-in-string': 'error',
'no-useless-rename': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'@stylistic/indent': [ 'error', 2, { SwitchCase: 1 } ],
'@stylistic/comma-dangle': [ 'error', 'always-multiline' ],
'@stylistic/space-in-parens': [ 'error', 'always' ],
'@stylistic/multiline-ternary': [ 'error', 'always' ],
'@stylistic/semi': [ 'error', 'always' ],
'@stylistic/quotes': [ 'error', 'single', { avoidEscape: true } ],
},
},

// Page: the hooks rules, including the React Compiler ones.
{ files: [ 'src/**/*.{ts,tsx}' ], ...reactHooks.configs.flat.recommended },

{
files: [ 'src/**/*.{ts,tsx}' ],
rules: {
// typescript-eslint turns this off for TypeScript.
'no-unreachable': 'error',
'@typescript-eslint/consistent-type-imports': [ 'error', { fixStyle: 'separate-type-imports', prefer: 'type-imports' } ],
'import-x/consistent-type-specifier-style': [ 'error', 'prefer-top-level' ],
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-unused-vars': [ 'error', {
vars: 'all',
args: 'after-used',
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
} ],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/class-literal-property-style': 'off',
},
},
);
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,31 +86,34 @@
},
"devDependencies": {
"@electron/notarize": "^3.1.2",
"@eslint/js": "^10.0.1",
"@sentry/bundler-plugins": "11.12.0",
"@sentry/cli": "^3.8.2",
"@stylistic/eslint-plugin": "^6.0.1",
"@types/d3-array": "^3.2.2",
"@types/lodash": "^4.17.27",
"@types/node": "^22.19.1",
"@types/prismjs": "^1.26.5",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8",
"@typescript-eslint/parser": "^8",
"@vitejs/plugin-react": "5.2.0",
"dotenv": "^17.4.2",
"download": "^8.0.0",
"electron": "^45.2.3",
"electron-builder": "^24.13.3",
"electron-download": "^4.1.1",
"electron-vite": "^6.0.0",
"eslint": "^8.57.0",
"eslint-config-react-app": "7.0.1",
"eslint": "^10",
"eslint-plugin-import-x": "^4.18.1",
"eslint-plugin-lodash": "^8.1.0",
"eslint-plugin-react-hooks": "^7.1.1",
"globals": "^17.14.0",
"jsdom": "^29.1.1",
"npm-run-all": "^4.1.5",
"playwright": "^1.65.0",
"prettier": "^3.9.10",
"typescript": "^5.9.3",
"typescript-eslint": "^8.73.0",
"vite": "^8.3.7",
"vitest": "^5.1.1"
},
Expand Down Expand Up @@ -209,9 +212,5 @@
"publish": {
"provider": "github"
}
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "^8.72.1",
"@typescript-eslint/parser": "^8.72.1"
}
}
12 changes: 6 additions & 6 deletions src/app/AlignmentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function AlignmentCard( { alignment }: AlignmentCardProps ): React.JSX.Element {
component="span"
sx={{ color: ( theme ) => theme.palette.primary.secondaryText }}
>
Parsing... {alignment.numSequencesParsed}{' '}
Parsing... {alignment.numSequencesParsed}{' '}
</Box>
);

Expand Down Expand Up @@ -320,7 +320,7 @@ function AlignmentCard( { alignment }: AlignmentCardProps ): React.JSX.Element {
{alignment.modeltestLoading
? (
<MenuItem onClick={closeMenuAndRun( alignment.cancelModelTest )}>
Cancel modeltest
Cancel modeltest
</MenuItem>
)
: null}
Expand All @@ -345,14 +345,14 @@ function AlignmentCard( { alignment }: AlignmentCardProps ): React.JSX.Element {
? null
: (
<Typography variant="caption" color="primary">
Partition not complete, click{' '}
Partition not complete, click{' '}
<strong
style={{ cursor: 'pointer' }}
onClick={alignment.setShowPartition}
>
here
here
</strong>{' '}
to edit.
to edit.
</Typography>
)}
</CardActions>
Expand Down Expand Up @@ -399,7 +399,7 @@ function FinalAlignmentCard( {
component="span"
sx={{ color: ( theme ) => theme.palette.primary.secondaryText }}
>
Parsing... {alignment.numSequencesParsed}{' '}
Parsing... {alignment.numSequencesParsed}{' '}
</Box>
);

Expand Down
4 changes: 2 additions & 2 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const App = (): React.JSX.Element => {
message = `Converted your ${run.convertedAlignmentFrom} alignment into fasta!`;
}
if ( run.modified ) {
message = `Made a copy of your input file, because there were some issues!`;
message = 'Made a copy of your input file, because there were some issues!';
}
return (
<Snackbar
Expand Down Expand Up @@ -471,7 +471,7 @@ const App = (): React.JSX.Element => {
>
{run.exitCode === 0
? 'Calculation finished!'
: `Calculation cancelled!`}
: 'Calculation cancelled!'}
</Alert>
</Snackbar>
{fileModifiedSnack( run )}
Expand Down
2 changes: 1 addition & 1 deletion src/app/AstralTreeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function AstralTreeCard( {
backgroundColor: ( theme ) => theme.palette.input.main,
border: ( theme ) => `1px solid ${theme.palette.input.darker}`,
}}
label={"trees"}
label={'trees'}
color="secondary"
/>
}
Expand Down
16 changes: 8 additions & 8 deletions src/app/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const Input = ( { run }: InputProps ): React.JSX.Element => {
}}
onClick={run.loadAlignmentFiles}
>
Load alignment
Load alignment
</Button>
)
: null}
Expand Down Expand Up @@ -192,7 +192,7 @@ const Input = ( { run }: InputProps ): React.JSX.Element => {
}}
onClick={run.loadAstralTree}
>
Load input trees
Load input trees
</Button>
</Box>
)}
Expand Down Expand Up @@ -220,7 +220,7 @@ const Input = ( { run }: InputProps ): React.JSX.Element => {
onClick={run.loadAlignmentFiles}
title="Concatenate new alignments and create partition"
>
Add alignment
Add alignment
</Button>
</Box>
)}
Expand Down Expand Up @@ -258,7 +258,7 @@ const Input = ( { run }: InputProps ): React.JSX.Element => {
onClick={run.loadAlignmentFiles}
title="Concatenate new alignments and automatically generate a partition"
>
Add alignment
Add alignment
</Button>
</Box>
)}
Expand Down Expand Up @@ -286,7 +286,7 @@ const Input = ( { run }: InputProps ): React.JSX.Element => {
onClick={run.loadPartitionFile}
title="Load a partition file for the current alignment"
>
Load partition
Load partition
</Button>
</Box>
)}
Expand Down Expand Up @@ -340,7 +340,7 @@ const Input = ( { run }: InputProps ): React.JSX.Element => {
}}
onClick={run.loadTreeFile}
>
Add Tree
Add Tree
</Button>
</Box>
)}
Expand Down Expand Up @@ -390,7 +390,7 @@ const Input = ( { run }: InputProps ): React.JSX.Element => {
}}
onClick={run.loadBackboneConstraintFile}
>
Add Backbone Constraint
Add Backbone Constraint
</Button>
</Box>
)}
Expand Down Expand Up @@ -440,7 +440,7 @@ const Input = ( { run }: InputProps ): React.JSX.Element => {
}}
onClick={run.loadMultifurcatingConstraintFile}
>
Add Multifurcating Constraint
Add Multifurcating Constraint
</Button>
</Box>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/app/Output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const Output = ( { run }: OutputProps ): React.JSX.Element => {
? (
<Box component="form" my={1}>
<Button onClick={run.openOutputDir} variant="outlined">
Open folder
Open folder
</Button>
</Box>
)
Expand Down
2 changes: 1 addition & 1 deletion src/app/PartitionEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function PartitionEditor( {
title="Clear partition entries"
onClick={partition.reset}
>
Reset
Reset
</Button>
</Grid>
)}
Expand Down
Loading
Loading