-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat(ui): Add ESLint with plugins for react/hooks, prettier, flow #25716
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e99e46b
Implement eslint with prettier, react, react hooks, flow plugins
johallar 307f0d1
Remove prettier, restrict react linting to jsx files
johallar 1814ef2
Fix flow, move globals to own block
johallar c2fb5e5
Use recommended hooks config, restrict react to .jsx
johallar 29380ea
Add flow annotation to files that have them
johallar 31225d8
Split format command to run or run + fix
johallar 753f0fb
Revert "Add flow annotation to files that have them"
johallar bd4cfde
Add flow annotation to files that use flow syntax
johallar 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 contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,64 @@ | ||
| import ftFlow from "eslint-plugin-ft-flow"; | ||
| import js from "@eslint/js"; | ||
| import hermes from "hermes-eslint"; | ||
| import globals from "globals"; | ||
| import prettierEslint from "eslint-plugin-prettier/recommended"; | ||
| import react from "eslint-plugin-react"; | ||
| import reactHooks from "eslint-plugin-react-hooks"; | ||
|
|
||
| export default [ | ||
| js.configs.recommended, | ||
| prettierEslint, | ||
| reactHooks.configs["recommended-latest"], | ||
| { | ||
| ignores: [ | ||
| "**/vendor/**", | ||
| "**/node_modules/**", | ||
| "**/sql-parser/**", | ||
| "webpack.config.js", | ||
| ], | ||
| }, | ||
| { | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.jquery, | ||
| }, | ||
| }, | ||
| }, | ||
| // Flow | ||
| { | ||
| languageOptions: { | ||
| parser: hermes, | ||
| }, | ||
| plugins: { | ||
| "ft-flow": ftFlow, | ||
| }, | ||
| settings: { | ||
| flowtype: { | ||
| onlyFilesWithFlowAnnotation: true, | ||
| }, | ||
| }, | ||
| rules: { | ||
| ...ftFlow.configs.recommended.rules, | ||
| }, | ||
| }, | ||
| // React | ||
| { | ||
| files: ["**/*.jsx"], | ||
| plugins: { | ||
| react, | ||
| }, | ||
| rules: { | ||
| ...react.configs.recommended.rules, | ||
| ["react/prop-types"]: "warn", | ||
| ["react/no-deprecated"]: "warn", | ||
| ["no-prototype-builtins"]: "warn", | ||
| }, | ||
| settings: { | ||
| react: { | ||
| version: "detect", | ||
| }, | ||
| }, | ||
| }, | ||
| ]; |
This file contains hidden or 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 hidden or 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.
suggestion: Consider specifying file extensions for Prettier scripts to avoid formatting unintended files.
Using '.' as the target for Prettier may format files outside your intended scope. Limit formatting to specific extensions to avoid affecting non-source files.