Skip to content

Commit

Permalink
Use .jsx file extension for JS components (#1218)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
* Split from #1212

## Short description of the changes
This is to ease an eventual migration to Vite, since Vite by default
only supports JSX in files with the .jsx or .tsx extensions, and this is
surprisingly hard to override. Update the Prettier and ESLint
configurations accordingly.

Signed-off-by: Máté Szabó <[email protected]>
  • Loading branch information
mszabo-wikia authored Feb 27, 2023
1 parent 5cb39f9 commit ec3e089
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
settings: {
'import/resolver': {
node: {
extensions: ['.js', 'json', '.tsx'],
extensions: ['.js', '.jsx', 'json', '.tsx'],
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
"build": "lerna run build",
"check-license": "./scripts/check-license.sh",
"coverage": "lerna run coverage",
"eslint": "eslint --cache 'scripts/*.{js,ts,tsx}' 'packages/*/src/**/*.{js,ts,tsx}' 'packages/*/*.{js,ts,tsx}'",
"eslint": "eslint --cache 'scripts/*.{js,jsx,ts,tsx}' 'packages/*/src/**/*.{js,jsx,ts,tsx}' 'packages/*/*.{js,jsx,ts,tsx}'",
"fmt": "yarn prettier",
"lint": "npm-run-all -ln --parallel prettier-lint tsc-lint eslint check-license",
"prepare": "lerna run --stream --sort prepublishOnly",
"prettier": "prettier --write '{.,scripts}/*.{js,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,json,md,ts,tsx}' 'packages/*/*.{css,js,json,md,ts,tsx}'",
"prettier-lint": "prettier --list-different '{.,scripts}/*.{js,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,json,md,ts,tsx}' 'packages/*/*.{css,js,json,md,ts,tsx}'",
"prettier": "prettier --write '{.,scripts}/*.{js,jsx,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx}'",
"prettier-lint": "prettier --list-different '{.,scripts}/*.{js,jsx,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx}'",
"test": "lerna run test",
"tsc-lint": "tsc --build",
"tsc-lint-debug": "tsc --listFiles",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class SearchTracePageImpl extends Component {
</TabPane>
<TabPane tab="JSON File" key="fileLoader">
<FileLoader
loadJsonTraces={(fileList: FileList) => {
loadJsonTraces={fileList => {
loadJsonTraces(fileList);
}}
/>
Expand Down

0 comments on commit ec3e089

Please sign in to comment.