-
Notifications
You must be signed in to change notification settings - Fork 41
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
Linting refactor and enable GitHub actions #3179
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
d5c0338
lint: Upgrade to eslint 9 and refactor to enable simpler linting config
nellh 79389b9
fix(server): Use Object.hasOwn over hasOwnProperty
nellh e6b3060
fix(app): Disable linting for react.d.ts type helper in tests
nellh 58eb99b
fix(server): Prefix unreferenced validateUrl vars with _
nellh 7d996c7
chore(server): Use mongoose types as a type import
nellh 0928d94
chore(lint): Fix object prototype hasOwnProperty usage
nellh a0e36c9
chore(lint): Use object over any for model definitions
nellh 00b718e
feat(graphql-client): Only warn once on mismatched versions
nellh 7fbda3e
chore(lint): Don't suppress console from the CLI upload steps
nellh 7e1eda7
chore(lint): Remove cjs import for node-mailjet
nellh feb1eaa
chore(lint): Indexer should print console messages
nellh 27af188
chore(lint): Document issues with Readable interface types
nellh 97d130e
chore(lint): Enable checking for schema.ts
nellh 81240a6
chore(lint): Fix linter configuration for console and unused vars
nellh beada40
chore(lint): Fix types imported as values
nellh ccf90e1
fix(app): Error handling for FlaggedFileContainer query errors
nellh f0ab199
chore(lint): Cleanup unused variables
nellh 9097564
refactor(app): Drop deprecated updateRef
nellh 34a07ca
chore(lint): React type import fixes
nellh 508a1dc
chore(lint): Linting and error handling fixes
nellh cf5956d
fix(app): Remove no-op value mutation TwoHandleRange change handlers
nellh eabf4dc
chore(lint): Remaining eslint refactor fixes
nellh dc70912
ci: Add ESLint step
nellh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: ESLint | ||
|
||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
|
||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
- run: yarn install | ||
- run: yarn run lint |
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,53 @@ | ||||||||
// @ts-check | ||||||||
import eslint from "@eslint/js" | ||||||||
import tseslint from "typescript-eslint" | ||||||||
import reactCompiler from "eslint-plugin-react-compiler" | ||||||||
|
||||||||
export default tseslint.config({ | ||||||||
ignores: [ | ||||||||
"**/build/**", | ||||||||
"**/dist/**", | ||||||||
"**/node_modules/**", | ||||||||
".yarn/*", | ||||||||
".pnp.cjs", | ||||||||
".pnp.loader.mjs", | ||||||||
"**/coverage/**", | ||||||||
"packages/openneuro-app/pluralize-esm.js", | ||||||||
"packages/openneuro-app/src/scripts/utils/schema-validator.js", | ||||||||
], | ||||||||
}, { | ||||||||
files: [ | ||||||||
"packages/**/*.ts", | ||||||||
"packages/**/*.tsx", | ||||||||
"packages/**/*.jsx", | ||||||||
"packages/**/*.js", | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it reasonable for this thing to lint itself?
Suggested change
|
||||||||
], | ||||||||
extends: [ | ||||||||
eslint.configs.recommended, | ||||||||
...tseslint.configs.recommended, | ||||||||
], | ||||||||
rules: { | ||||||||
"@typescript-eslint/array-type": "error", | ||||||||
"@typescript-eslint/consistent-type-imports": "error", | ||||||||
"no-console": "error", | ||||||||
"@typescript-eslint/no-unused-vars": [ | ||||||||
"error", | ||||||||
{ | ||||||||
"argsIgnorePattern": "^_", | ||||||||
"varsIgnorePattern": "^_", | ||||||||
"caughtErrorsIgnorePattern": "^_", | ||||||||
}, | ||||||||
], | ||||||||
}, | ||||||||
}, { | ||||||||
files: ["packages/**/*.tsx", "packages/**/*.jsx"], | ||||||||
plugins: { | ||||||||
"react-compiler": reactCompiler, | ||||||||
}, | ||||||||
rules: { | ||||||||
"react-compiler/react-compiler": "error", | ||||||||
}, | ||||||||
}, { | ||||||||
files: ["packages/**/*.js"], | ||||||||
...tseslint.configs.disableTypeChecked, | ||||||||
}) |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable */ | ||
import React from "react" | ||
|
||
/** | ||
|
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
1 change: 0 additions & 1 deletion
1
packages/openneuro-app/src/scripts/authentication/withProfile.jsx
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
3 changes: 2 additions & 1 deletion
3
packages/openneuro-app/src/scripts/common/containers/footer.tsx
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
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
39 changes: 0 additions & 39 deletions
39
packages/openneuro-app/src/scripts/datalad/mutations/update-ref.jsx
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be helpful to future readers to know why we're ignoring these. I think this is the reason?