-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use depcheck to remove unused dependencies * Remove eslint-plugin-sort-destructure-keys * eslint packages minor version updates * typescript-eslint major version updates * eslint-plugin-unicorn major version updates * Fix js file lint * Update base tslint structure * Update to latest eslint major version * Revert usage of structuredClone * Restore missing react import * Remove all instances of structureClone * Update for compatibility with latest JBrowse
- Loading branch information
1 parent
1433542
commit aa3aab9
Showing
85 changed files
with
1,561 additions
and
1,022 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
import js from '@eslint/js' | ||
import pluginCypress from 'eslint-plugin-cypress/flat' | ||
import pluginImport from 'eslint-plugin-import' | ||
import pluginJSXA11y from 'eslint-plugin-jsx-a11y' | ||
import pluginReact from 'eslint-plugin-react' | ||
import pluginReactHooks from 'eslint-plugin-react-hooks' | ||
import pluginTSDoc from 'eslint-plugin-tsdoc' | ||
import pluginUnicorn from 'eslint-plugin-unicorn' | ||
import globals from 'globals' | ||
import tseslint from 'typescript-eslint' | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
{ | ||
ignores: [ | ||
'.pnp.*', | ||
'.yarn/', | ||
'**/bin/', | ||
'**/build/', | ||
'**/coverage/', | ||
'**/dist/', | ||
'packages/website/.docusaurus/', | ||
'packages/jbrowse-plugin-apollo/.jbrowse/', | ||
], | ||
}, | ||
js.configs.recommended, | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
pluginUnicorn.configs['flat/recommended'], | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
pluginImport.flatConfigs.typescript, | ||
...tseslint.configs.strictTypeChecked, | ||
...tseslint.configs.stylisticTypeChecked, | ||
pluginReact.configs.flat.recommended, | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
pluginJSXA11y.flatConfigs.recommended, | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
pluginCypress.configs.recommended, | ||
{ | ||
languageOptions: { | ||
globals: { ...globals.browser, ...globals.node }, | ||
parserOptions: { | ||
projectService: { | ||
allowDefaultProject: ['packages/jbrowse-plugin-apollo/*.js'], | ||
}, | ||
defaultProject: 'tsconfig.json', | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
settings: { react: { version: 'detect' } }, | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
plugins: { tsdoc: pluginTSDoc, import: pluginImport }, | ||
rules: { | ||
// eslint built-in rules (override recommended) | ||
curly: 'warn', | ||
'new-cap': [ | ||
'error', | ||
{ | ||
newIsCap: true, | ||
newIsCapExceptions: [], | ||
capIsNew: false, | ||
capIsNewExceptions: [ | ||
'Immutable.Map', | ||
'Immutable.Set', | ||
'Immutable.List', | ||
], | ||
}, | ||
], | ||
'no-console': ['warn', { allow: ['error', 'warn', 'debug'] }], | ||
'no-else-return': ['error', { allowElseIf: false }], | ||
'no-extra-semi': 'off', | ||
'object-shorthand': 'warn', | ||
'prefer-destructuring': 'warn', | ||
'prefer-template': 'warn', | ||
radix: 'error', | ||
// @typescript-eslint/eslint-plugin rules (override recommended) | ||
'@typescript-eslint/no-extraneous-class': [ | ||
'error', | ||
{ allowWithDecorator: true }, | ||
], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ argsIgnorePattern: '^_', ignoreRestSiblings: true }, | ||
], | ||
'@typescript-eslint/restrict-template-expressions': [ | ||
'warn', | ||
{ allowNumber: true }, | ||
], | ||
'@typescript-eslint/return-await': 'error', | ||
// eslint-plugin-import rules | ||
'import/export': 'error', | ||
'import/no-duplicates': 'warn', | ||
'import/no-extraneous-dependencies': 'error', | ||
'import/no-named-as-default': 'warn', | ||
// eslint-plugin-tsdoc rules | ||
'tsdoc/syntax': 'warn', | ||
// eslint-plugin-unicorn rules (override recommended) | ||
'unicorn/filename-case': 'off', // Doesn't match our file naming, maybe can be configured later | ||
'unicorn/no-empty-file': 'off', // False positives | ||
'unicorn/no-null': 'off', // A lot of null in React and other libraries | ||
'unicorn/prefer-module': 'off', // Cypress and apollo-collaboration-server need this | ||
'unicorn/prevent-abbreviations': 'off', // Doesn't guess a lot of abbreviations correctly | ||
}, | ||
}, | ||
{ | ||
name: 'eslint-plugin-react-hooks/recommended', | ||
files: [ | ||
'packages/jbrowse-plugin-apollo/src/**/*.{jsx,tsx}', | ||
'packages/website/src/**/*.{jsx,tsx}', | ||
], | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
plugins: { 'react-hooks': pluginReactHooks }, | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access | ||
rules: { ...pluginReactHooks.configs.recommended.rules }, | ||
}, | ||
// Don't enforce tsdoc syntax in JS files | ||
{ | ||
files: ['*.{c,m,}js', '**/*.{c,m,}js'], | ||
rules: { | ||
'tsdoc/syntax': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['packages/apollo-cli/src/**/*.ts'], | ||
rules: { '@typescript-eslint/no-deprecated': 'off' }, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.