Skip to content

Commit

Permalink
fix: enable react rules for ts/js files (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
egilsster authored Nov 27, 2024
1 parent 3d24b83 commit 4bb6fc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-humans-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@qlik/eslint-config": patch
---

fix: enable react rules for ts/js files. fixes an issue where rules of hooks were not enable for files containing only hooks.
4 changes: 2 additions & 2 deletions packages/eslint-config/src/configs/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const reactConfig = {
*/
const reactJS = mergeConfigs(reactConfig, {
name: "react-js",
files: ["**/*.jsx"],
files: ["**/*.js", "**/*.jsx"],
rules: {
// turn on/off or modify js rules necessary for react
"react/jsx-filename-extension": [2, { extensions: [".js", ".jsx"] }],
Expand All @@ -64,7 +64,7 @@ const reactJS = mergeConfigs(reactConfig, {
*/
const reactTS = mergeConfigs(reactConfig, {
name: "react-ts",
files: ["**/*.tsx"],
files: ["**/*.ts", "**/*.tsx"],
rules: {
// turn on/off or modify js/ts rules necessary for react
"react/jsx-filename-extension": [2, { extensions: [".js", ".jsx", ".ts", ".tsx"] }],
Expand Down

0 comments on commit 4bb6fc1

Please sign in to comment.