Skip to content
Closed
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
1 change: 1 addition & 0 deletions presto-ui/src/components/QueryPlanView.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions presto-ui/src/components/QuerySplitsView.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions presto-ui/src/components/SQLClient.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions presto-ui/src/components/SQLInput.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions presto-ui/src/components/Splits.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions presto-ui/src/d3utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
64 changes: 64 additions & 0 deletions presto-ui/src/eslint.config.mjs
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",
},
},
},
];
1 change: 1 addition & 0 deletions presto-ui/src/lazy.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
17 changes: 15 additions & 2 deletions presto-ui/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@
"@babel/preset-react": "^7.24.1",
"babel-loader": "9.1.3",
"css-loader": "^7.1.1",
"eslint": "^9.32.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-ft-flow": "^3.0.11",
"eslint-plugin-prettier": "^5.5.3",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"flow-bin": "^0.236.0",
"globals": "^16.3.0",
"hermes-eslint": "^0.31.0",
"html-inline-script-webpack-plugin": "^3.2.1",
"html-webpack-plugin": "^5.6.0",
"prettier": "^3.6.2",
"style-loader": "^4.0.0",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
Expand Down Expand Up @@ -44,9 +53,13 @@
"build:spa": "webpack --config webpack.config.js --env production --env config=spa",
"serve:spa": "webpack serve --config webpack.config.js --env config=spa",
"watch:spa": "webpack --config webpack.config.js --env config=spa --watch",
"analyze": "webpack --env=production --config webpack.config.js --profile --json > stats.json && mv stats.json ../target/webapp/ && npx webpack-bundle-analyzer ../target/webapp/stats.json"
"analyze": "webpack --env=production --config webpack.config.js --profile --json > stats.json && mv stats.json ../target/webapp/ && npx webpack-bundle-analyzer ../target/webapp/stats.json",
"lint": "eslint . --ext .js,.jsx",
"lint:fix": "eslint . --ext .js,.jsx --fix",
"format": "prettier .",
"format:fix": "prettier --write ."
Comment on lines +59 to +60
Copy link
Copy Markdown
Contributor

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.

Suggested change
"format": "prettier .",
"format:fix": "prettier --write ."
"format": "prettier \"**/*.{js,jsx,json,css,md}\"",
"format:fix": "prettier --write \"**/*.{js,jsx,json,css,md}\""

},
"resolutions": {
"d3-color": "3.1.0"
}
}
}
Loading
Loading